Просмотр исходного кода

BUG: Fix ctkColorDialog crash on Mac with Qt5

Fix crash when constructing ctkColorDialog on Mac when using Qt5. Force
using Qt's standard color dialog instead of the native dialog so that
the expected layouts are available for adding widgets.
Max Smolens лет назад: 8
Родитель
Сommit
192d81e2ec
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      Libs/Widgets/ctkColorDialog.cpp

+ 4 - 0
Libs/Widgets/ctkColorDialog.cpp

@@ -85,6 +85,8 @@ ctkColorDialog::ctkColorDialog(QWidget* parent)
   , d_ptr(new ctkColorDialogPrivate(*this))
   , d_ptr(new ctkColorDialogPrivate(*this))
 {
 {
   Q_D(ctkColorDialog);
   Q_D(ctkColorDialog);
+  // Force using Qt's standard color dialog to support adding new widgets
+  setOption(QColorDialog::DontUseNativeDialog);
   d->init();
   d->init();
 }
 }
 
 
@@ -94,6 +96,8 @@ ctkColorDialog::ctkColorDialog(const QColor& initial, QWidget* parent)
   , d_ptr(new ctkColorDialogPrivate(*this))
   , d_ptr(new ctkColorDialogPrivate(*this))
 {
 {
   Q_D(ctkColorDialog);
   Q_D(ctkColorDialog);
+  // Force using Qt's standard color dialog to support adding new widgets
+  setOption(QColorDialog::DontUseNativeDialog);
   d->init();
   d->init();
 }
 }