QTextEditor is a lightweight, custom-built text editor implemented in C++ using Qt. It features a core gap buffer data structure for efficient text manipulation and a custom GUI built with Qt Widgets for responsive rendering.
This project serves as a foundational step toward building a modern, extensible text editor with accurate cursor handling, clean rendering, and a responsive user interface.
- Custom gap buffer implementation for efficient insertions and deletions
- Basic keyboard navigation (left, right, insert, delete)
- Smooth cursor rendering with blinking support
- Multi-line text rendering using
QPainter - Minimal UI built on
QWidgetandQPainter - Designed for extensibility and clean architecture
TextEditor: Core logic implementing the gap buffer, cursor movement, and text operationsEditorWidget: GUI layer handling painting, keyboard input, and rendering logicmain.cpp: Initializes the application window and launches the editor
QTextEditor/
├── Editor.h # Gap buffer interface
├── Editor.cpp # Core logic implementation
├── EditorUI.h # Qt Widget interface
├── EditorUI.cpp # UI logic and rendering
├── main.cpp # Application entry point
Ensure you have Qt 6 and a C++ compiler installed.
- Qt Core
- Qt GUI
- Qt Widgets
- C++17 or higher (recommended)