I propose the following plan to convert this project into Qt6 completely and remove the dependency on Gtkmm. This opens up the Mac OS/X platform as presently this app only runs under Linux and Windows. This summary was written by anthropic.claude-sonnet-4-6:1m.
I will employ AI to do the conversion and help with the debugging.
TurnWatcher → Qt6 Conversion Plan
Project Overview
This is a D&D initiative tracker ("Turn Watcher") written in C++ originally built against GTK+/GTKMM. There is already a partial Qt5 port in progress — the src/gui/ui/ directory, the src/gui/base/ layer, and the src/gui/transactions/ layer already use Qt/sigc++ but many UI windows still live in src/gui/ui-gtk/ and use pure GTK classes. The motk library (a thin GTK helper wrapper) is also GTK-heavy.
The entry point TurnWatcher.cpp still calls Gtk::Main, and many windows still inherit from Gtk::Dialog, Gtk::Window, Gtk::TreeView, etc.
Key Layers to Convert
| Layer |
Location |
Status |
Work Needed |
| Entry point |
TurnWatcher.cpp |
GTK Gtk::Main |
Replace with QApplication |
| motk library |
src/motk/ |
GTK (Gtk::ActionGroup, Gtk::UIManager, Gtk::AccelGroup) |
Replace with Qt6 equivalents or eliminate |
| Base/model layer |
src/gui/base/ |
Already Qt5-ish (QString, Qt signal patterns) but uses sigc::signal |
Replace sigc::signal with Qt signals/slots |
| CharacterModel |
src/gui/base/CharacterModel.h |
Uses Gtk::TreeStore, Gdk::Pixbuf |
Replace with QAbstractItemModel / QStandardItemModel |
| CharacterColumns |
src/gui/base/CharacterColumns.h |
GTK TreeView columns |
Replace with Qt model column definitions |
| GTK UI windows |
src/gui/ui-gtk/ |
All GTK |
Full Qt6 rewrite |
| Qt stub UI |
src/gui/ui/ |
Already Qt5 .ui + stub .cpp/.h |
Upgrade to Qt6, wire up logic |
| CMakeLists |
All CMakeLists.txt |
Qt5 find_package |
Upgrade to Qt6 |
Detailed Plan
Phase 1 — CMake Build System (Qt5 → Qt6)
- Update
src/gui/CMakeLists.txt and src/motk/CMakeLists.txt
- Change
find_package(Qt5...) → find_package(Qt6...)
- Set
CMAKE_PREFIX_PATH to /Users/doug-personal/Qt
- Change
Qt5::Core, Qt5::Widgets, etc. → Qt6::Core, Qt6::Widgets, etc.
- Use
qt_wrap_ui() / qt_add_resources() (Qt6 macros)
- Remove the
motk GTK dependency (include(gtkmm)) entirely
Phase 2 — Drop motk GTK library
The motk library provides:
ActionManager — wraps Gtk::ActionGroup / Gtk::UIManager / icon factories
UiBase — wraps Gtk::UIManager for XML-based menus
LabelTable / LabelTableScroller — GTK form layout helpers
MenuManager, HtmlWidget, Chooser
Strategy: Replace motk entirely — Qt6 provides direct equivalents:
QAction, QMenu, QMenuBar, QToolBar → replace ActionManager / UIBase
QFormLayout → replace LabelTable
QTextBrowser → replace HtmlWidget
The new motk CMakeLists will become a minimal shim or be eliminated — all its functionality gets absorbed directly into the Qt UI layer.
Phase 3 — Base Layer: Replace sigc::signal with Qt Signals
Several classes in src/gui/base/ use sigc::signal:
AppSettings, CharacterManager, InitiativeManager, TransactionManager, StatManager
Strategy: Convert each singleton manager class to a QObject subclass with proper signals: blocks. Replace all sigc::signal<void> with void signal_xxx(), and all .connect(sigc::mem_fun(...)) call sites with QObject::connect(...).
Phase 4 — CharacterModel: GTK TreeStore → Qt Item Model
CharacterModel currently inherits from nothing but manages a Glib::RefPtr<Gtk::TreeStore>.
Strategy: Rewrite as QStandardItemModel (or QAbstractItemModel subclass). Character rows become QStandardItem rows with custom data roles. The sort model will be QSortFilterProxyModel.
Phase 5 — Rewrite All GTK UI Windows as Qt6 Dialogs/Widgets
Each GTK window in src/gui/ui-gtk/ gets a Qt6 replacement in src/gui/ui/:
| GTK Class |
Qt6 Replacement |
MainWindow (Gtk::Window) |
QMainWindow (already stubbed — flesh out) |
AboutWindow (Gtk::AboutDialog) |
QDialog (already stubbed as AboutDialog) |
EditWindow (Gtk::Dialog) |
New EditDialog (QDialog with QFormLayout) |
DamageWindow (Gtk::Dialog) |
New DamageDialog (QDialog with QSpinBox) |
InitWindow (Gtk::Dialog) |
New InitDialog (QDialog with QTableWidget) |
SettingsWindow (Gtk::Dialog) |
New SettingsDialog (QDialog with QFormLayout) |
StatWindow (Gtk::Dialog) |
New StatDialog (QDialog) |
CharacterView (Gtk::TreeView) |
QTreeView + new Qt item model |
HUDWindow (Gtk::Window) |
QWidget floating window with QTreeView |
RoundsHelper |
Keep the logic, replace Gtk:: references with Qt |
StatusBox |
QStatusBar |
Splash |
QSplashScreen |
EffectsBook, EffectsEditor, EffectsList, EffectEditor |
New Qt tabs/dialogs |
DuplicateWindow |
New QDialog with QSpinBox |
JumpInWindow, InputWindow |
New simple QDialog variants |
ExpiredEffectsWindow |
New QDialog |
Phase 6 — Wire Up MainWindow
The existing src/gui/ui/MainWindow.cpp is just a stub with setupUi(this). The real logic is in the GTK version. Strategy:
- Uncomment and implement all the action slots
- Connect
QAction signals to slots for all menu/toolbar actions
- Integrate
CharacterView (Qt TreeView) as central widget
- Implement
Load(), Save(), UpdateUI(), UpdateMenus() using the base managers
- Add
QTimer for periodic save
- Restore window geometry from
AppSettings
Phase 7 — Update TurnWatcher.cpp Entry Point
- Remove
#include <gtkmm.h>, Gtk::Main, g_log_set_default_handler
- Add
QApplication, QCoreApplication::setApplicationName/Version
- Replace
moApplication integration where it applies to path management
- Keep
molib usage for file I/O (it's pure C++ and doesn't need GTK)
Phase 8 — Remove GTK cmake modules
- Remove
src/motk/CMakeLists.txt inclusion of include(gtkmm)
- Remove
cmake/gtkmm.cmake dependency from build
- Clean up unused
sigc references in CMakeLists (sigc++ is no longer needed once signals are converted to Qt)
Directory Strategy
- Keep
src/gui/ui-gtk/ as-is for reference (do not delete, just stop compiling them)
- All new Qt6 UI code goes into
src/gui/ui/ (already exists)
- New
.ui files created with Qt Designer for any dialog that benefits from it
- The existing
src/gui/ui/MainWindow.ui and AboutDialog.ui are already Qt5 compatible and need only minor Qt6 updates
What stays the same (no GTK dependency)
src/molib/ — pure C++ library for prop bags, XML I/O, name management
src/gui/base/character.cpp/.h, effect.cpp/.h, stat.cpp/.h — pure data models
src/gui/transactions/ — transaction pattern, pure C++
- All
.ui Qt Designer files and src/gui/ui/res/ resources
Estimated Scope
This is a large but structured conversion. The logical business layer (transactions, characters, effects, stats, initiative management) is already mostly decoupled from GTK. The GTK dependency is concentrated in:
- The
motk library (~8 files)
- The
ui-gtk/ windows (~18 files)
CharacterModel.h and ActionsManager.h (GTK includes)
TurnWatcher.cpp entry point
I propose the following plan to convert this project into Qt6 completely and remove the dependency on Gtkmm. This opens up the Mac OS/X platform as presently this app only runs under Linux and Windows. This summary was written by
anthropic.claude-sonnet-4-6:1m.I will employ AI to do the conversion and help with the debugging.
TurnWatcher → Qt6 Conversion Plan
Project Overview
This is a D&D initiative tracker ("Turn Watcher") written in C++ originally built against GTK+/GTKMM. There is already a partial Qt5 port in progress — the
src/gui/ui/directory, thesrc/gui/base/layer, and thesrc/gui/transactions/layer already use Qt/sigc++ but many UI windows still live insrc/gui/ui-gtk/and use pure GTK classes. Themotklibrary (a thin GTK helper wrapper) is also GTK-heavy.The entry point
TurnWatcher.cppstill callsGtk::Main, and many windows still inherit fromGtk::Dialog,Gtk::Window,Gtk::TreeView, etc.Key Layers to Convert
TurnWatcher.cppGtk::MainQApplicationsrc/motk/Gtk::ActionGroup,Gtk::UIManager,Gtk::AccelGroup)src/gui/base/QString, Qt signal patterns) but usessigc::signalsigc::signalwith Qt signals/slotssrc/gui/base/CharacterModel.hGtk::TreeStore,Gdk::PixbufQAbstractItemModel/QStandardItemModelsrc/gui/base/CharacterColumns.hsrc/gui/ui-gtk/src/gui/ui/.ui+ stub.cpp/.hCMakeLists.txtfind_packageDetailed Plan
Phase 1 — CMake Build System (Qt5 → Qt6)
src/gui/CMakeLists.txtandsrc/motk/CMakeLists.txtfind_package(Qt5...)→find_package(Qt6...)CMAKE_PREFIX_PATHto/Users/doug-personal/QtQt5::Core,Qt5::Widgets, etc. →Qt6::Core,Qt6::Widgets, etc.qt_wrap_ui()/qt_add_resources()(Qt6 macros)motkGTK dependency (include(gtkmm)) entirelyPhase 2 — Drop
motkGTK libraryThe
motklibrary provides:ActionManager— wrapsGtk::ActionGroup/Gtk::UIManager/ icon factoriesUiBase— wrapsGtk::UIManagerfor XML-based menusLabelTable/LabelTableScroller— GTK form layout helpersMenuManager,HtmlWidget,ChooserStrategy: Replace
motkentirely — Qt6 provides direct equivalents:QAction,QMenu,QMenuBar,QToolBar→ replaceActionManager/UIBaseQFormLayout→ replaceLabelTableQTextBrowser→ replaceHtmlWidgetThe new
motkCMakeLists will become a minimal shim or be eliminated — all its functionality gets absorbed directly into the Qt UI layer.Phase 3 — Base Layer: Replace
sigc::signalwith Qt SignalsSeveral classes in
src/gui/base/usesigc::signal:AppSettings,CharacterManager,InitiativeManager,TransactionManager,StatManagerStrategy: Convert each singleton manager class to a
QObjectsubclass with propersignals:blocks. Replace allsigc::signal<void>withvoid signal_xxx(), and all.connect(sigc::mem_fun(...))call sites withQObject::connect(...).Phase 4 — CharacterModel: GTK TreeStore → Qt Item Model
CharacterModelcurrently inherits from nothing but manages aGlib::RefPtr<Gtk::TreeStore>.Strategy: Rewrite as
QStandardItemModel(orQAbstractItemModelsubclass). Character rows becomeQStandardItemrows with custom data roles. The sort model will beQSortFilterProxyModel.Phase 5 — Rewrite All GTK UI Windows as Qt6 Dialogs/Widgets
Each GTK window in
src/gui/ui-gtk/gets a Qt6 replacement insrc/gui/ui/:MainWindow(Gtk::Window)QMainWindow(already stubbed — flesh out)AboutWindow(Gtk::AboutDialog)QDialog(already stubbed asAboutDialog)EditWindow(Gtk::Dialog)EditDialog(QDialog with QFormLayout)DamageWindow(Gtk::Dialog)DamageDialog(QDialog with QSpinBox)InitWindow(Gtk::Dialog)InitDialog(QDialog with QTableWidget)SettingsWindow(Gtk::Dialog)SettingsDialog(QDialog with QFormLayout)StatWindow(Gtk::Dialog)StatDialog(QDialog)CharacterView(Gtk::TreeView)QTreeView+ new Qt item modelHUDWindow(Gtk::Window)QWidgetfloating window withQTreeViewRoundsHelperStatusBoxQStatusBarSplashQSplashScreenEffectsBook,EffectsEditor,EffectsList,EffectEditorDuplicateWindowQDialogwithQSpinBoxJumpInWindow,InputWindowQDialogvariantsExpiredEffectsWindowQDialogPhase 6 — Wire Up MainWindow
The existing
src/gui/ui/MainWindow.cppis just a stub withsetupUi(this). The real logic is in the GTK version. Strategy:QActionsignals to slots for all menu/toolbar actionsCharacterView(Qt TreeView) as central widgetLoad(),Save(),UpdateUI(),UpdateMenus()using the base managersQTimerfor periodic saveAppSettingsPhase 7 — Update
TurnWatcher.cppEntry Point#include <gtkmm.h>,Gtk::Main,g_log_set_default_handlerQApplication,QCoreApplication::setApplicationName/VersionmoApplicationintegration where it applies to path managementmolibusage for file I/O (it's pure C++ and doesn't need GTK)Phase 8 — Remove GTK cmake modules
src/motk/CMakeLists.txtinclusion ofinclude(gtkmm)cmake/gtkmm.cmakedependency from buildsigcreferences in CMakeLists (sigc++ is no longer needed once signals are converted to Qt)Directory Strategy
src/gui/ui-gtk/as-is for reference (do not delete, just stop compiling them)src/gui/ui/(already exists).uifiles created with Qt Designer for any dialog that benefits from itsrc/gui/ui/MainWindow.uiandAboutDialog.uiare already Qt5 compatible and need only minor Qt6 updatesWhat stays the same (no GTK dependency)
src/molib/— pure C++ library for prop bags, XML I/O, name managementsrc/gui/base/character.cpp/.h,effect.cpp/.h,stat.cpp/.h— pure data modelssrc/gui/transactions/— transaction pattern, pure C++.uiQt Designer files andsrc/gui/ui/res/resourcesEstimated Scope
This is a large but structured conversion. The logical business layer (transactions, characters, effects, stats, initiative management) is already mostly decoupled from GTK. The GTK dependency is concentrated in:
motklibrary (~8 files)ui-gtk/windows (~18 files)CharacterModel.handActionsManager.h(GTK includes)TurnWatcher.cppentry point