🐛 fix: should work well with qt6.4
This commit is contained in:
@@ -17,7 +17,7 @@ It might not be that worthy to build a Qt application from ground for such a sma
|
|||||||
on Debian-based systems:
|
on Debian-based systems:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt install --no-install-recommends qt6-base-dev qt6-declarative-dev cmake g++
|
sudo apt install --no-install-recommends qt6-base-dev qt6-declarative-dev qml6-module-qtquick qml6-module-qtquick-controls2 qml6-module-qtquick-layouts qml6-module-qtquick-templates qml6-qtqml-workerscript cmake g++
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Clone the repository:
|
2. Clone the repository:
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ Item {
|
|||||||
|
|
||||||
displayedText: "Restore"
|
displayedText: "Restore"
|
||||||
onClicked: root.restoreClicked()
|
onClicked: root.restoreClicked()
|
||||||
foregroundColor: "#fab387"
|
foregroundColor: "#D28A25"
|
||||||
|
|
||||||
Binding {
|
Binding {
|
||||||
target: restoreButton
|
target: restoreButton
|
||||||
@@ -71,7 +71,7 @@ Item {
|
|||||||
|
|
||||||
displayedText: "Confirm"
|
displayedText: "Confirm"
|
||||||
onClicked: root.confirmClicked()
|
onClicked: root.confirmClicked()
|
||||||
foregroundColor: "#a6e3a1"
|
foregroundColor: "#459A4E"
|
||||||
|
|
||||||
Binding {
|
Binding {
|
||||||
target: confirmButton
|
target: confirmButton
|
||||||
@@ -84,7 +84,7 @@ Item {
|
|||||||
WRTextButton {
|
WRTextButton {
|
||||||
displayedText: "Cancel"
|
displayedText: "Cancel"
|
||||||
onClicked: root.cancelClicked()
|
onClicked: root.cancelClicked()
|
||||||
foregroundColor: "#f38ba8"
|
foregroundColor: "#D65555"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Item {
|
|||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
paletteCombo.currentIndex = selectedPalette ? availablePalettes.findIndex((p) => {
|
paletteCombo.currentIndex = selectedPalette ? availablePalettes.findIndex((p) => {
|
||||||
return p.name === selectedPalette.name;
|
return p.name === selectedPalette.name;
|
||||||
}) : -1;
|
}) + 1 : 0;
|
||||||
colorCombo.currentIndex = selectedColor ? availableColors.findIndex((c) => {
|
colorCombo.currentIndex = selectedColor ? availableColors.findIndex((c) => {
|
||||||
return c.name === selectedColor.name;
|
return c.name === selectedColor.name;
|
||||||
}) + 1 : 0;
|
}) + 1 : 0;
|
||||||
|
|||||||
+16
-2
@@ -25,7 +25,12 @@ int main(int argc, char* argv[]) {
|
|||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
a.setApplicationName(APP_NAME);
|
a.setApplicationName(APP_NAME);
|
||||||
a.setApplicationVersion(APP_VERSION);
|
a.setApplicationVersion(APP_VERSION);
|
||||||
a.setWindowIcon(QIcon(QString(":/%1.svg").arg(APP_NAME)));
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
a.setWindowIcon(QIcon(u":/%1.svg"_s.arg(APP_NAME)));
|
||||||
|
#else
|
||||||
|
a.setWindowIcon(QIcon(u":/%1.svg"_qs.arg(APP_NAME)));
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
Logger::init();
|
Logger::init();
|
||||||
@@ -60,7 +65,16 @@ int main(int argc, char* argv[]) {
|
|||||||
&a,
|
&a,
|
||||||
[]() { QCoreApplication::exit(-1); },
|
[]() { QCoreApplication::exit(-1); },
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
engine.loadFromModule(UIMODULE_URI, "Main");
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
engine.loadFromModule(UIMODULE_URI, u"Main"_s);
|
||||||
|
#elif QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||||
|
engine.loadFromModule(UIMODULE_URI, u"Main"_qs);
|
||||||
|
#else
|
||||||
|
engine.addImportPath(u"qrc:/"_qs));
|
||||||
|
engine.load(QUrl(u"qrc:/WallReel/UI/Main.qml"_qs));
|
||||||
|
#endif
|
||||||
|
|
||||||
bootstrap.start();
|
bootstrap.start();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user