Drop Qt Quick Controls and Qt Widgets
The binary now links Core, Gui, Quick and QuickShapes, nothing else. Qt Widgets was there for one reason, QSystemTrayIcon, so the tray icon is gone and QApplication is back to QGuiApplication. The cat itself is the whole interface: right-click or long-press opens the settings window, which carries the tricks and a quit button. Ctrl+C in the terminal works as well. The settings window is rebuilt from Qt Quick primitives. AppButton, AppSlider, AppToggle and SettingsGroup replace the Controls types, keyboard handling and accessible roles included, and a Flickable with plain positioners replaces QtQuick.Layouts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f6ecf0ddbf
commit
1581a760be
10 files changed
+540
-294
No files matched your search
+5
-4
@@ -8,13 +8,13 @@ project(TNCat
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(Qt6 6.5 REQUIRED COMPONENTS Core Gui Quick QuickControls2 Widgets)
|
||||
# No Qt Quick Controls and no Qt Widgets: the whole interface is plain Qt Quick.
|
||||
find_package(Qt6 6.5 REQUIRED COMPONENTS Core Gui Quick QuickShapes)
|
||||
qt_standard_project_setup(REQUIRES 6.5)
|
||||
|
||||
qt_add_executable(tncat
|
||||
src/main.cpp
|
||||
src/catcontroller.h src/catcontroller.cpp
|
||||
src/traycontroller.h src/traycontroller.cpp
|
||||
src/appsettings.h src/appsettings.cpp
|
||||
src/platforminfo.h src/platforminfo.cpp
|
||||
)
|
||||
@@ -22,7 +22,8 @@ qt_add_executable(tncat
|
||||
target_include_directories(tncat PRIVATE src)
|
||||
|
||||
# QML files live in qml/ but register at the module root (TNCat.Main etc.)
|
||||
set(TNCAT_QML Main Cat Chip Cup CatWindow ChipWindow CupWindow OverlayWindow SettingsWindow CatDefs)
|
||||
set(TNCAT_QML Main Cat Chip Cup CatWindow ChipWindow CupWindow OverlayWindow
|
||||
SettingsWindow AppButton AppSlider AppToggle SettingsGroup CatDefs)
|
||||
foreach(qmlfile IN LISTS TNCAT_QML)
|
||||
set_source_files_properties(qml/${qmlfile}.qml PROPERTIES QT_RESOURCE_ALIAS ${qmlfile}.qml)
|
||||
list(APPEND TNCAT_QML_FILES qml/${qmlfile}.qml)
|
||||
@@ -37,7 +38,7 @@ qt_add_qml_module(tncat
|
||||
)
|
||||
|
||||
target_link_libraries(tncat PRIVATE
|
||||
Qt6::Core Qt6::Gui Qt6::Quick Qt6::QuickControls2 Qt6::Widgets)
|
||||
Qt6::Core Qt6::Gui Qt6::Quick Qt6::QuickShapes)
|
||||
|
||||
set_target_properties(tncat PROPERTIES
|
||||
MACOSX_BUNDLE TRUE
|
||||
|
||||
Reference in new issue
Block a user