From 34de0aa01a7ab43a6633fda85e92c83430c0c90f Mon Sep 17 00:00:00 2001 From: Andy Jenkinson Date: Sun, 8 Jun 2014 09:07:16 +0100 Subject: [PATCH] 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);