Developing a Beautiful and Performant Block Editor in Qt C++ and QML
4 months ago
- #Qt
- #Performance
- #BlockEditor
- The author developed Daino Notes, a cross-platform block editor using Qt C++ and QML, aiming for performance and native-like behavior.
- Native apps are expected to be visually appealing, behave consistently, and perform well. Qt applications can achieve 'native-like' qualities.
- Daino Notes evolved from a simple Markdown editor to a WYSIWYG block editor inspired by Notion, focusing on simplicity and flexibility.
- The block editor architecture uses Qt's MVC pattern: Data (plain text in SQLite), Model (BlockModel in C++), and View (QML ListView).
- Advanced features include undo/redo stacks, Markdown syntax visibility under cursor, and handling complex blocks like Kanban boards.
- Drag and drop functionality was implemented with replicas to overcome ListView virtualization challenges.
- External drag and drop support for images was added, though with some limitations due to Qt's QML constraints.