From 73f2e99d7d836722ba424a89f9446fd9f3552bae Mon Sep 17 00:00:00 2001 From: Andy Jenkinson Date: Sun, 8 Jun 2014 00:22:27 +0100 Subject: [PATCH 1/4] Radio buttons in the wizard were too close together --- companion/src/wizarddialog.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/companion/src/wizarddialog.cpp b/companion/src/wizarddialog.cpp index 33dd45b5b..0fc1a627d 100644 --- a/companion/src/wizarddialog.cpp +++ b/companion/src/wizarddialog.cpp @@ -264,6 +264,9 @@ ModelSelectionPage::ModelSelectionPage(WizardDialog *dlg, QString image, QString multirotorRB = new QRadioButton(tr("Multirotor")); helicopterRB = new QRadioButton(tr("Helicopter")); helicopterRB->setDisabled(true); //TODO REMOVE TO ENABLE HELICOPTERS + planeRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + multirotorRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + helicopterRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); registerField("evaluate.name*", nameLineEdit); @@ -310,7 +313,9 @@ WingtypeSelectionPage::WingtypeSelectionPage(WizardDialog *dlg, QString image, Q { standardWingRB = new QRadioButton(tr("Standard Wing")); standardWingRB->setChecked(true); + standardWingRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); deltaWingRB = new QRadioButton(tr("Flying Wing / Deltawing")); + deltaWingRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(standardWingRB); @@ -330,8 +335,11 @@ TailSelectionPage::TailSelectionPage(WizardDialog *dlg, QString image, QString t { standardTailRB = new QRadioButton(tr("Elevator and Rudder")); standardTailRB->setChecked(true); + standardTailRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); simpleTailRB = new QRadioButton(tr("Only Elevator")); + simpleTailRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); vTailRB = new QRadioButton(tr("V-tail")); + vTailRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(new QLabel(tr("Tail Type:"))); @@ -355,7 +363,9 @@ FlybarSelectionPage::FlybarSelectionPage(WizardDialog *dlg, QString image, QStri { flybarRB = new QRadioButton(tr("Has Flybar")); flybarRB->setChecked(true); + flybarRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); noFlybarRB = new QRadioButton(tr("Flybarless")); + noFlybarRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(new QLabel(tr("Flybar:"))); @@ -377,6 +387,8 @@ ThrottlePage::ThrottlePage(WizardDialog *dlg, QString image, QString title, QStr motorRB = new QRadioButton(tr("Yes")); noMotorRB = new QRadioButton(tr("No")); motorRB->setChecked(true); + motorRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + noMotorRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); throttleCB = new QComboBox(); QLayout *l = layout(); @@ -415,6 +427,9 @@ AileronsPage::AileronsPage(WizardDialog *dlg, QString image, QString title, QStr oneAileronRB = new QRadioButton(tr("Yes, controlled by a single channel")); twoAileronsRB = new QRadioButton(tr("Yes, controlled by two channels")); noAileronsRB->setChecked(true); + noAileronsRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + oneAileronRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + twoAileronsRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); aileron1CB = new QComboBox(); aileron2CB = new QComboBox(); @@ -480,6 +495,9 @@ FlapsPage::FlapsPage(WizardDialog *dlg, QString image, QString title, QString te oneFlapRB = new QRadioButton(tr("Yes, controlled by a single channel")); twoFlapsRB = new QRadioButton(tr("Yes, controlled by two channels")); noFlapsRB->setChecked(true); + noFlapsRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + oneFlapRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + twoFlapsRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); flap1CB = new QComboBox(); flap2CB = new QComboBox(); @@ -544,6 +562,9 @@ AirbrakesPage::AirbrakesPage(WizardDialog *dlg, QString image, QString title, QS oneAirbrakeRB = new QRadioButton(tr("Yes, controlled by a single channel")); twoAirbrakesRB = new QRadioButton(tr("Yes, controlled by two channels")); noAirbrakesRB->setChecked(true); + noAirbrakesRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + oneAirbrakeRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + twoAirbrakesRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); airbrake1CB = new QComboBox(); airbrake2CB = new QComboBox(); @@ -635,6 +656,8 @@ RudderPage::RudderPage(WizardDialog *dlg, QString image, QString title, QString noRudderRB = new QRadioButton(tr("No")); hasRudderRB = new QRadioButton(tr("Yes")); noRudderRB->setChecked(true); + noRudderRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + hasRudderRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); rudderCB = new QComboBox(); rudderCB->setEnabled(false); @@ -756,6 +779,10 @@ CyclicPage::CyclicPage(WizardDialog *dlg, QString image, QString title, QString cyclic120RB = new QRadioButton(tr("120")); cyclic120XRB = new QRadioButton(tr("120x")); cyclic140RB = new QRadioButton(tr("140")); + cyclic90RB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + cyclic120RB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + cyclic120XRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + cyclic140RB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(cyclic90RB); @@ -782,6 +809,9 @@ GyroPage::GyroPage(WizardDialog *dlg, QString image, QString title, QString text noGyroRB->setChecked(true); switchGyroRB = new QRadioButton(tr("Yes, controled by a switch")); potGyroRB = new QRadioButton(tr("Yes, controlled by a pot")); + noGyroRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + switchGyroRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + potGyroRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(noGyroRB); @@ -916,6 +946,9 @@ OptionsPage::OptionsPage(WizardDialog *dlg, QString image, QString title, QStrin throttleCutRB = new QCheckBox(tr("Throttle Cut")); throttleTimerRB = new QCheckBox(tr("Throttle Timer")); flightTimerRB = new QCheckBox(tr("Flight Timer")); + throttleCutRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + throttleTimerRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); + flightTimerRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(throttleCutRB); From f482b895fb933a46785e03cc68a83ea20a7914eb Mon Sep 17 00:00:00 2001 From: Andy Jenkinson Date: Sun, 8 Jun 2014 01:26:19 +0100 Subject: [PATCH 2/4] Enabled Phonon for Mac (sounds) --- companion/src/CMakeLists.txt | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 527aee913..f1ab87ddf 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -42,18 +42,14 @@ SET( QT_USE_QTNETWORK True ) SET( QT_USE_QTXML True ) INCLUDE( ${QT_USE_FILE} ) -IF ( APPLE ) - MESSAGE( STATUS "Phonon still not supported on APPLE " ) +MESSAGE( STATUS "Looking for PHONON " ) +FIND_PACKAGE(Phonon) +IF ( PHONON_FOUND ) + INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} ) + MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} ) + ADD_DEFINITIONS( -DPHONON ) ELSE() - MESSAGE( STATUS "Looking for PHONON " ) - FIND_PACKAGE(Phonon) - IF ( PHONON_FOUND ) - INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} ) - MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} ) - ADD_DEFINITIONS( -DPHONON ) - ELSE() - MESSAGE( "PHONON not found!" ) - ENDIF() + MESSAGE( "PHONON not found!" ) ENDIF() ADD_CUSTOM_COMMAND( From 34de0aa01a7ab43a6633fda85e92c83430c0c90f Mon Sep 17 00:00:00 2001 From: Andy Jenkinson Date: Sun, 8 Jun 2014 09:07:16 +0100 Subject: [PATCH 3/4] Revert "Radio buttons in the wizard were too close together" and do this another way via Q_FOREACH This reverts commit 73f2e99d7d836722ba424a89f9446fd9f3552bae. --- companion/src/wizarddialog.cpp | 38 +++++----------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/companion/src/wizarddialog.cpp b/companion/src/wizarddialog.cpp index 0fc1a627d..7c4eeb02d 100644 --- a/companion/src/wizarddialog.cpp +++ b/companion/src/wizarddialog.cpp @@ -51,6 +51,11 @@ WizardDialog::WizardDialog(const GeneralSettings & settings, unsigned int modelI "Please note that continuing removes all old model settings!"), -1)); setStartId(Page_Models); + // Workaround for Qt radio button rendering issue on Mac + Q_FOREACH(QAbstractButton * rb, findChildren()) { + rb->setAttribute(Qt::WA_LayoutUsesWidgetRect); + } + setWizardStyle(ModernStyle); setOption(HaveHelpButton, true); connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp())); @@ -264,9 +269,6 @@ ModelSelectionPage::ModelSelectionPage(WizardDialog *dlg, QString image, QString multirotorRB = new QRadioButton(tr("Multirotor")); helicopterRB = new QRadioButton(tr("Helicopter")); helicopterRB->setDisabled(true); //TODO REMOVE TO ENABLE HELICOPTERS - planeRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - multirotorRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - helicopterRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); registerField("evaluate.name*", nameLineEdit); @@ -313,9 +315,7 @@ WingtypeSelectionPage::WingtypeSelectionPage(WizardDialog *dlg, QString image, Q { standardWingRB = new QRadioButton(tr("Standard Wing")); standardWingRB->setChecked(true); - standardWingRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); deltaWingRB = new QRadioButton(tr("Flying Wing / Deltawing")); - deltaWingRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(standardWingRB); @@ -335,11 +335,8 @@ TailSelectionPage::TailSelectionPage(WizardDialog *dlg, QString image, QString t { standardTailRB = new QRadioButton(tr("Elevator and Rudder")); standardTailRB->setChecked(true); - standardTailRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); simpleTailRB = new QRadioButton(tr("Only Elevator")); - simpleTailRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); vTailRB = new QRadioButton(tr("V-tail")); - vTailRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(new QLabel(tr("Tail Type:"))); @@ -363,9 +360,7 @@ FlybarSelectionPage::FlybarSelectionPage(WizardDialog *dlg, QString image, QStri { flybarRB = new QRadioButton(tr("Has Flybar")); flybarRB->setChecked(true); - flybarRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); noFlybarRB = new QRadioButton(tr("Flybarless")); - noFlybarRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(new QLabel(tr("Flybar:"))); @@ -387,8 +382,6 @@ ThrottlePage::ThrottlePage(WizardDialog *dlg, QString image, QString title, QStr motorRB = new QRadioButton(tr("Yes")); noMotorRB = new QRadioButton(tr("No")); motorRB->setChecked(true); - motorRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - noMotorRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); throttleCB = new QComboBox(); QLayout *l = layout(); @@ -427,9 +420,6 @@ AileronsPage::AileronsPage(WizardDialog *dlg, QString image, QString title, QStr oneAileronRB = new QRadioButton(tr("Yes, controlled by a single channel")); twoAileronsRB = new QRadioButton(tr("Yes, controlled by two channels")); noAileronsRB->setChecked(true); - noAileronsRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - oneAileronRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - twoAileronsRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); aileron1CB = new QComboBox(); aileron2CB = new QComboBox(); @@ -495,9 +485,6 @@ FlapsPage::FlapsPage(WizardDialog *dlg, QString image, QString title, QString te oneFlapRB = new QRadioButton(tr("Yes, controlled by a single channel")); twoFlapsRB = new QRadioButton(tr("Yes, controlled by two channels")); noFlapsRB->setChecked(true); - noFlapsRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - oneFlapRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - twoFlapsRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); flap1CB = new QComboBox(); flap2CB = new QComboBox(); @@ -562,9 +549,6 @@ AirbrakesPage::AirbrakesPage(WizardDialog *dlg, QString image, QString title, QS oneAirbrakeRB = new QRadioButton(tr("Yes, controlled by a single channel")); twoAirbrakesRB = new QRadioButton(tr("Yes, controlled by two channels")); noAirbrakesRB->setChecked(true); - noAirbrakesRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - oneAirbrakeRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - twoAirbrakesRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); airbrake1CB = new QComboBox(); airbrake2CB = new QComboBox(); @@ -656,8 +640,6 @@ RudderPage::RudderPage(WizardDialog *dlg, QString image, QString title, QString noRudderRB = new QRadioButton(tr("No")); hasRudderRB = new QRadioButton(tr("Yes")); noRudderRB->setChecked(true); - noRudderRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - hasRudderRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); rudderCB = new QComboBox(); rudderCB->setEnabled(false); @@ -779,10 +761,6 @@ CyclicPage::CyclicPage(WizardDialog *dlg, QString image, QString title, QString cyclic120RB = new QRadioButton(tr("120")); cyclic120XRB = new QRadioButton(tr("120x")); cyclic140RB = new QRadioButton(tr("140")); - cyclic90RB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - cyclic120RB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - cyclic120XRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - cyclic140RB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(cyclic90RB); @@ -809,9 +787,6 @@ GyroPage::GyroPage(WizardDialog *dlg, QString image, QString title, QString text noGyroRB->setChecked(true); switchGyroRB = new QRadioButton(tr("Yes, controled by a switch")); potGyroRB = new QRadioButton(tr("Yes, controlled by a pot")); - noGyroRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - switchGyroRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - potGyroRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(noGyroRB); @@ -946,9 +921,6 @@ OptionsPage::OptionsPage(WizardDialog *dlg, QString image, QString title, QStrin throttleCutRB = new QCheckBox(tr("Throttle Cut")); throttleTimerRB = new QCheckBox(tr("Throttle Timer")); flightTimerRB = new QCheckBox(tr("Flight Timer")); - throttleCutRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - throttleTimerRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); - flightTimerRB->setAttribute(Qt::WA_LayoutUsesWidgetRect); QLayout *l = layout(); l->addWidget(throttleCutRB); From 6bfc4f79867fdc83dd03d307d1a7404f1076324d Mon Sep 17 00:00:00 2001 From: Andy Jenkinson Date: Sun, 8 Jun 2014 09:10:25 +0100 Subject: [PATCH 4/4] Fixes #1216 --- companion/src/wizarddialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/companion/src/wizarddialog.cpp b/companion/src/wizarddialog.cpp index 7c4eeb02d..d59537ab5 100644 --- a/companion/src/wizarddialog.cpp +++ b/companion/src/wizarddialog.cpp @@ -57,6 +57,7 @@ WizardDialog::WizardDialog(const GeneralSettings & settings, unsigned int modelI } setWizardStyle(ModernStyle); + setOption(QWizard::NoCancelButton, false); setOption(HaveHelpButton, true); connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));