{"id":18743676,"url":"https://github.com/mjlee111/qt_example","last_synced_at":"2026-01-05T18:40:39.868Z","repository":{"id":261601508,"uuid":"848556456","full_name":"mjlee111/qt_example","owner":"mjlee111","description":"Simple QT based GUI examples.","archived":false,"fork":false,"pushed_at":"2024-09-23T05:32:04.000Z","size":33503,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T15:54:15.905Z","etag":null,"topics":["cpp","gui","qt","qt-examples"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjlee111.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T01:26:36.000Z","updated_at":"2024-10-14T13:42:37.000Z","dependencies_parsed_at":"2024-11-07T12:49:46.917Z","dependency_job_id":"15ed55aa-3656-4f14-b79b-d5c56a32b34e","html_url":"https://github.com/mjlee111/qt_example","commit_stats":null,"previous_names":["mjlee111/qt_example"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjlee111%2Fqt_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjlee111%2Fqt_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjlee111%2Fqt_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjlee111%2Fqt_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjlee111","download_url":"https://codeload.github.com/mjlee111/qt_example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248636039,"owners_count":21137360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","gui","qt","qt-examples"],"created_at":"2024-11-07T16:12:07.697Z","updated_at":"2026-01-05T18:40:39.825Z","avatar_url":"https://github.com/mjlee111.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qt_example\n\n`qt_example` a simple application developed using the Qt framework. This project implements a application with various functionalities.\n\n\n\u003cdiv align=center\u003e\n\u003cimg src=\"https://img.shields.io/badge/C++-00599C?style=flat\u0026logo=cplusplus\u0026logoColor=white\"/\u003e \n\u003cimg src=\"https://img.shields.io/badge/Qt-41CD52?\u0026style=flat\u0026logo=qt\u0026logoColor=white\"/\u003e \n\u003c/div\u003e\n\n## Table of Contents\n- [Keyboard](#️-keyboard)\n- [Serial](#-serial)\n- [Astar](#-a-pathfinding)\n- [IMU](#-imu-inertial-measurement-unit)\n- [3DOF_robot_arm](#-3dof-robot-arm)\n- [TextEditor](#-texteditor)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n\n## ⌨️ Keyboard\n### Features\n\n- **Keyboard Layout**: Supports qwerty and Korean keyboard layouts.\n- **Caps Lock and Shift Keys**: Toggles between uppercase and lowercase.\n- **Text Input**: Displays input text in a `QLabel`.\n- **Keypress Capture**: Captures key press event and display.\n- **Special Functions**: Handles Backspace, Tab, Enter, Windows key, and other special functions.\n\n### Installation and Running\n\n#### Prerequisites\n\n- CMake\n- Qt 5 or Qt 6 -\u003e [Qt Docs][qtlink]\n- X11 \u0026 XTest (required only for Linux)\n    ```bash\n    $ sudo apt-get install libx11-dev libxtst-dev\n    ```\n\n#### Build and Run\n\n1. **Clone the Source Code**\n    ```bash\n    $ git clone https://github.com/mjlee111/qt_example.git\n    ```\n\n2. **Build**\n   \n    - Linux\n    ```bash\n    $ cd qt_example/Keyboard\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake ..\n    $ make\n    ```\n    - Windows\n    ```bash\n    $ cd qt_example/Keyboard\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake -G \"Visual Studio 16 2019\" ..\n    $ cmake --build . --config Release\n    ```\n\n3. **Run**\n    - Linux\n    ```bash\n    ./keyboard\n    ```\n    - Windows\n\n    Double-click the executable generated after building, or run it from the Command Prompt.\n\n\u003cdiv align=center\u003e\n\n![keyboard-run-image](https://github.com/mjlee111/qt_example/blob/master/keyboard/docs/run.png)\n\u003c/div\u003e\n\n#### Usage\n- **Text Input**: Click on the buttons to input text. Special keys like Backspace, Tab, and Enter perform their respective functions.\n- **Language Switching**: Use the \"Kor\" or \"영어\" button to switch between Korean and English keyboard layouts.\n- **Caps Lock**: Toggle Caps Lock to switch between uppercase and lowercase text.\n\n## 🔌 Serial\n### Features\n- **Serial Port Communication**: Establishes communication with serial devices using various baud rates.\n- **Data Reception**: Reads and displays incoming serial data in a `QTextEdit`.\n- **Data Transmission**: Allows sending data to the serial device via the `writeToDevice()` methods.\n- **Device Management**: Lists available serial ports and allows opening or closing the connection.\n- **Automatic Scroll**: Ensures the `QTextEdit` view automatically scrolls to the latest received data.\n- **Status Indication**: Changes the background color of a status label based on serial activity.\n\n### Installation and Running\n#### Prerequisites\n\n- CMake\n- Qt 5 or Qt 6 -\u003e [Qt Docs][qtlink]\n- For Windows: Ensure the Qt installation includes the Qt Serial Port module.\n- For Linux: Install the libqt5serialport5 package (or 6).\n\n#### Build and Run\n\n1. **Clone the Source Code**\n    ```bash\n    $ git clone https://github.com/mjlee111/qt_example.git\n    ```\n\n2. **Build**\n   \n    - Linux\n    ```bash\n    $ cd qt_example/Serial\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake ..\n    $ make\n    ```\n    - Windows\n    ```bash\n    $ cd qt_example/Serial\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake -G \"Visual Studio 16 2019\" ..\n    $ cmake --build . --config Release\n    ```\n\n3. **Run**\n    - Linux\n    ```bash\n    ./serial\n    ```\n    - Windows\n\n    Double-click the executable generated after building, or run it from the Command Prompt.\n\n    - Simple test with arduino. (returns NONE when no data to read, READ: ${DATA} when data available per 1 seconds.)\n\u003cdiv align=center\u003e\n\n![Serial-run-image](https://github.com/mjlee111/qt_example/blob/master/Serial/docs/run.gif)\n\u003c/div\u003e\n\n\n#### Usage\n\n- **Connect to Serial Device:**\n    * Select a serial port from the dropdown menu.\n    * Set the desired baud rate.\n    * Click \"OPEN\" to establish the connection.\n\n- **Data Reception:**\n    * Incoming data will be displayed in the QTextEdit widget.\n    * The widget scrolls automatically to show the latest data.\n\n- **Data Transmission:**\n    * Use the `writeToDevice()` methods to send data to the connected serial device.\n\n- **Device Status:**\n    * The status label will turn green when data is received.\n    * The status label will return to its default color when no data is present.\n\n- **Clear Display:**\n    * Click the \"CLEAR\" button to clear the data from the display\n\n## 🧭 A* Pathfinding\n### Features\n- **Grid-Based Pathfinding**: Implements the A* pathfinding algorithm to find the shortest path on a grid.\n- **Dynamic Grid Visualization**: Displays a dynamic grid in the GUI where users can set obstacles, start, and end points.\n- **Interactive Controls**: Allows users to interactively set the start and end points and obstacles through the UI.\n- **Path Display**: Visualizes the calculated shortest path in the grid using color-coding.\n- **Error Handling**: Provides feedback when a valid path cannot be found or if the start and end points are not set.\n\n### Installation and Running\n#### Prerequisites\n\n- CMake\n- Qt 5 or Qt 6 -\u003e [Qt Docs][qtlink]\n- For Windows: Ensure the Qt installation includes the necessary Qt modules.\n- For Linux: Install the relevant Qt packages.\n\n#### Build and Run\n\n1. **Clone the Source Code**\n    ```bash\n    git clone https://github.com/mjlee111/qt_example.git\n    ```\n\n2. **Build**\n   \n    - **Linux**\n    ```bash\n    cd qt_example/Astar\n    mkdir build \u0026\u0026 cd build\n    cmake ..\n    make\n    ```\n    - **Windows**\n    ```bash\n    cd qt_example/Astar\n    mkdir build \u0026\u0026 cd build\n    cmake -G \"Visual Studio 16 2019\" ..\n    cmake --build . --config Release\n    ```\n\n3. **Run**\n    - **Linux**\n    ```bash\n    ./astar\n    ```\n    - **Windows**  \n      Double-click the executable generated after building, or run it from the Command Prompt.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/mjlee111/qt_example/blob/master/Astar/docs/run.gif\" alt=\"Astar-run-image\"\u003e\n\u003c/div\u003e\n\n### Usage\n\n- **Initialize Grid:**\n  - Set the number of rows and columns using the provided input fields.\n  - Click \"Generate\" to create the grid.\n\n- **Set Start and End Points:**\n  - Click \"Set Start\" and select a cell to define the starting point (marked in green).\n  - Click \"Set End\" and select a cell to define the ending point (marked in red).\n\n- **Place Obstacles:**\n  - Click on any cell to toggle obstacles (marked in black).\n\n- **Find Path:**\n  - Click \"Start A*\" to execute the A* algorithm and display the shortest path (highlighted in blue).\n\n- **Clear Grid:**\n  - Click the \"Reset\" button to clear all points, obstacles, and reset the grid.\n\n- **Error Feedback:**\n  - If no valid path is found or if the start/end points are not set, a message will be displayed.\n\n## 📐 IMU (Inertial Measurement Unit)\n### Features\n- **Serial Port Communication**: Extends the functionality of the Serial project to communicate with [EBIMU][ebimu] sensors. Allows communication over various baud rates, with support for up to 115200.\n- **Data Reception \u0026 Packet Analysis**: Reads incoming data from EBIMU sensors via serial communication, decodes sensor packets, and displays the values of parameters like acceleration, gyroscope, and magnetometer.\n- **Real-time Data Visualization**: Utilizes OpenGL to render a 3D cube that reacts in real-time to changes in roll, pitch, and yaw values, providing visual feedback on the sensor's orientation.\n- **Device Management**: Lists available serial ports and allows opening or closing the connection with EBIMU sensors. Automatically handles packet structure and parsing for seamless communication.\n- **Automatic Scroll**: Ensures that the `QTextEdit` view, used for displaying raw data, automatically scrolls to the latest received data from the sensor.\n- **Status Indication**: Provides visual feedback on sensor data reception by changing the background color of the status label.\n- **Roll, Pitch, and Yaw Calculation**: Automatically computes roll, pitch, and yaw values from IMU sensor data, translating raw measurements into meaningful orientation angles.\n  \n### Installation and Running\n#### Prerequisites\n\n- CMake\n- Qt 5 or Qt 6 -\u003e [Qt Docs][qtlink]\n- OpenGL for 3D visualization of IMU data\n- EBIMU sensor (or any 9DOF sensor with compatible communication protocols)\n- For Windows: Ensure the Qt installation includes the Qt Serial Port and OpenGL modules.\n- For Linux: Install the libqt5serialport5 (or 6) and OpenGL libraries.\n\n#### Build and Run\n\n1. **Clone the Source Code**\n    ```bash\n    $ git clone https://github.com/mjlee111/qt_example.git\n    ```\n\n2. **Build**\n   \n    - Linux\n    ```bash\n    $ cd qt_example/IMU\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake ..\n    $ make\n    ```\n    - Windows\n    ```bash\n    $ cd qt_example/IMU\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake -G \"Visual Studio 16 2019\" ..\n    $ cmake --build . --config Release\n    ```\n\n3. **Run**\n    - Linux\n    ```bash\n    ./IMU\n    ```\n    - Windows\n\n    Double-click the executable generated after building, or run it from the Command Prompt.\n\n    - Test the real-time visualization with an EBIMU sensor to see live changes in the orientation of the 3D cube.\n\n\u003cdiv align=center\u003e\n    \u003cimg src=\"https://github.com/mjlee111/qt_example/blob/master/IMU/docs/run.gif\" alt=\"IMU-run-image\"\u003e\n\u003c/div\u003e\n\n#### Usage\n\n- **Connect to IMU Sensor:**\n    * Select the EBIMU sensor's serial port from the dropdown menu.\n    * Set the desired baud rate and communication parameters.\n    * Click \"OPEN\" to establish the connection.\n\n- **Data Reception:**\n    * Incoming IMU data, including acceleration, gyroscope, and magnetometer values, will be displayed in the `QTextEdit` widget.\n    * The widget automatically scrolls to the latest data.\n\n- **3D Visualization:**\n    * As the sensor's orientation changes, the 3D cube rendered using OpenGL will react in real-time, rotating to reflect the changes in roll, pitch, and yaw.\n  \n- **Device Status:**\n    * The status label will turn green when data is received from the IMU.\n    * It will return to its default color when no data is present.\n\n- **Clear Display:**\n    * Click the \"CLEAR\" button to clear the data from the display.\n\n## 🤖 3DOF Robot Arm\n### Features\n\n- **Robot Arm Control**: Control the angles of a 3DOF robotic arm using QSlider.\n- **Link Length Customization**: Adjust the length of each arm link using QSpinBox.\n- **Real-Time Visualization**: Displays the robotic arm in a `QGraphicsView` with real-time updates.\n- **Joint and End Effector Visualization**: Each joint is marked with a blue circle, and the end effector is marked with a red circle.\n- **Reset Functionality**: Reset the arm's position and link lengths to default values.\n\n### Installation and Running\n\n#### Prerequisites\n\n- CMake\n- Qt 5 or Qt 6 -\u003e [Qt Docs][qtlink]\n\n#### Build and Run\n\n1. **Clone the Source Code**\n    ```bash\n    $ git clone https://github.com/mjlee111/qt_example.git\n    ```\n\n2. **Build**\n\n    - Linux\n    ```bash\n    $ cd qt_example/3DOF_robot_arm\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake ..\n    $ make\n    ```\n    - Windows\n    ```bash\n    $ cd qt_example/3DOF_robot_arm\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake -G \"Visual Studio 16 2019\" ..\n    $ cmake --build . --config Release\n    ```\n\n3. **Run**\n\n    - Linux\n    ```bash\n    ./3DOF_robot_arm\n    ```\n    - Windows\n\n    Double-click the executable generated after building, or run it from the Command Prompt.\n\n\u003cdiv align=center\u003e\n\n![robot-arm-run-image](https://github.com/mjlee111/qt_example/blob/master/3DOF_robot_arm/docs/run.gif)\n\u003c/div\u003e\n\n#### Usage\n\n- **Joint Angle Control**: Use the sliders to adjust the angles of the three joints. The corresponding angle value is displayed in real-time next to each slider.\n- **Link Length Customization**: Adjust the length of each link using the spin boxes labeled `link1`, `link2`, and `link3`. The arm will update dynamically based on the entered values.\n- **Generate Arm**: Click the \"Generate Arm\" button after setting the link lengths to visualize the updated robotic arm.\n- **Reset Arm**: Click the \"Reset\" button to reset the arm's position and link lengths to their default values.\n\n## 📝 TextEditor\n\n### Features\n\n- **File Open**: Opens `.txt`, `.c`, and `.cpp` files using a file dialog.\n- **File Save**: Saves the opened file or saves it under a new name.\n- **File Editing**: Displays file content in a `QTextEdit` widget, allowing for easy text editing.\n- **Read-Only Mode**: Files can be opened in read-only mode or edited based on the user's actions.\n- **Folder Selection**: Allows folder selection through a folder dialog.\n- **GUI Components**: Uses a clean and simple GUI with `QMainWindow`, `QTextEdit`, `QPushButton`, and `QLabel`.\n\n### Installation and Running\n\n#### Prerequisites\n\n- CMake\n- Qt 5 or Qt 6 -\u003e [Qt Docs][qtlink]\n- X11 \u0026 XTest (required only for Linux)\n\n    ```bash\n    $ sudo apt-get install libx11-dev libxtst-dev\n    ```\n\n#### Build and Run\n\n1. **Clone the Source Code**\n\n    ```bash\n    $ git clone https://github.com/mjlee111/qt_example.git\n    ```\n\n2. **Build**\n\n    - **Linux**\n    ```bash\n    $ cd qt_example/TextEditor\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake ..\n    $ make\n    ```\n\n    - **Windows**\n    ```bash\n    $ cd qt_example/TextEditor\n    $ mkdir build \u0026\u0026 cd build\n    $ cmake -G \"Visual Studio 16 2019\" ..\n    $ cmake --build . --config Release\n    ```\n\n3. **Run**\n\n    - **Linux**\n    ```bash\n    ./texteditor\n    ```\n\n    - **Windows**\n\n    Double-click the executable generated after building, or run it from the Command Prompt.\n\n\u003cdiv align=center\u003e\n\n![robot-arm-run-image](https://github.com/mjlee111/qt_example/blob/master/TextEditor/docs/run.gif)\n\u003c/div\u003e\n\n#### Usage\n\n- **Opening a File**: Use the \"Open\" button to browse for `.txt`, `.c`, or `.cpp` files and display their content in the editor.\n- **Editing a File**: Once a file is opened, its content can be modified in the text editor. The \"Save\" button is enabled to allow saving changes.\n- **Save As**: Use the \"Save As\" button to save the current file under a new name or location.\n- **Close File**: Clears the text editor and disables saving functionality if no file is open.\n- **Folder Selection**: Click the \"Open Folder\" button to select a folder and retrieve its path.\n\n## Contributing\nFeel free to submit issues, feature requests, and pull requests to improve the package.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE][LICENSE] file for details.\n\n## Contact\nFor any questions or feedback, please contact [menggu1234@naver.com][email].\n\n[qtlink]: https://doc.qt.io/\n[ebimu]: https://www.e2box.co.kr/\n[LICENSE]: https://github.com/mjlee111/qt_example/blob/master/LICENSE\n[email]: mailto:menggu1234@naver.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjlee111%2Fqt_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjlee111%2Fqt_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjlee111%2Fqt_example/lists"}