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

Merge pull request #516 from SINTEFMedisinskTeknologi/master

Fixed crashing line in ctkFileDialog for Mac/Qt5
Jean-Christophe Fillion-Robin лет назад: 10
Родитель
Сommit
396c4c42bb
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      Libs/Widgets/ctkFileDialog.cpp

+ 8 - 0
Libs/Widgets/ctkFileDialog.cpp

@@ -115,6 +115,14 @@ ctkFileDialog::ctkFileDialog(QWidget *parentWidget,
   , d_ptr(new ctkFileDialogPrivate(*this))
 {
   Q_D(ctkFileDialog);
+
+// The findChild<QDialogButtonBox*>() call fails on Mac/Qt5 because native
+// dialogs don't publish any internals. No problems on other OS.
+// Can be applied to Qt4 as well, if problems arise there.
+#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
+  this->setOptions(DontUseNativeDialog);
+#endif
+
   d->init();
 }