Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.7.0
-
None
-
GTK+ 3.x
-
b2799062f365fb1d4c9820d33fd38cf5510d2ade
Description
ColorDialog:
- QGtk3ColorDialogHelper::currentColorChanged() is NOT emitted while selecting colors
- QColorDialog::colorSelected() emitted TWICE on accept
- QML ColorDialog.color is not updated on accept
FontDialog:
- QGtk3FontDialogHelper::currentFontChanged() is NOT emitted while selecting fonts
- QFontDialog::fontSelected() emitted TWICE on accept
- QML FontDialog.font follows currentFont (should be updated on accept instead)
FileDialog:
- QFileDialog::file(s)Selected() emitted TWICE on accept
- QML FileDialog.filterSelected() only emitted on accept
Side-note:
- A missing null check in QGtk3Dialog::show() causes QObject::connect: invalid null parameter -warnings with the widget-based test case below.
A test case with QtWidgets dialogs:
#include <QtWidgets> //#define DONT_USE_NATIVE_DIALOGS int main(int argc, char *argv[]) { QApplication app(argc, argv); QColorDialog colorDialog; #ifdef DONT_USE_NATIVE_DIALOGS colorDialog.setOption(QColorDialog::DontUseNativeDialog); #endif QObject::connect(&colorDialog, &QColorDialog::colorSelected, [](const QColor &c) { qDebug() << "QColorDialog::colorSelected" << c; }); QObject::connect(&colorDialog, &QColorDialog::currentColorChanged, [](const QColor &c) { qDebug() << "QColorDialog::currentColorChanged" << c; }); colorDialog.show(); QFontDialog fontDialog; #ifdef DONT_USE_NATIVE_DIALOGS fontDialog.setOption(QFontDialog::DontUseNativeDialog); #endif QObject::connect(&fontDialog, &QFontDialog::fontSelected, [](const QFont &f) { qDebug() << "QFontDialog::fontSelected" << f; }); QObject::connect(&fontDialog, &QFontDialog::currentFontChanged, [](const QFont &f) { qDebug() << "QFontDialog::currentFontChanged" << f; }); fontDialog.show(); QFileDialog fileDialog; #ifdef DONT_USE_NATIVE_DIALOGS fileDialog.setOption(QFileDialog::DontUseNativeDialog); #endif QObject::connect(&fileDialog, &QFileDialog::fileSelected, [](const QString &f) { qDebug() << "QFileDialog::fileSelected" << f; }); QObject::connect(&fileDialog, &QFileDialog::currentChanged, [](const QString &f) { qDebug() << "QFileDialog::currentChanged" << f; }); QObject::connect(&fileDialog, &QFileDialog::directoryEntered, [](const QString &f) { qDebug() << "QFileDialog::directoryEntered" << f; }); fileDialog.show(); return app.exec(); }
When DONT_USE_NATIVE_DIALOGS is defined, it uses QWidget based dialogs instead, and then the behavior is correct.
A test case with QtQuick Dialogs:
import QtQuick 2.5 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 Window { width: 640 height: 480 visible: false ColorDialog { visible: true onColorChanged: console.log("onColorChanged:", color) onCurrentColorChanged: console.log("onCurrentColorChanged:", currentColor) } FontDialog { visible: true onFontChanged: console.log("onFontChanged:", font) onCurrentFontChanged: console.log("onCurrentFontChanged:", currentFont) } FileDialog { visible: true onFileUrlChanged: console.log("onFileUrlChanged:", fileUrl) onFileUrlsChanged: console.log("onFileUrlsChanged:", fileUrls) } }
QtQuick Dialogs don't suffer from the duplicate "selected" signals, because they are wired to a property, but the "currentChanged" notifiers are missing just like with QtWidgets.
Attachments
Issue Links
- resulted from
-
QTBUG-54951 FontDialog: fontSelected() signal not emitted on OS X
-
- Closed
-
For Gerrit Dashboard: QTBUG-55298 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
167907,4 | Fix ColorDialog.color and FontDialog.font update on accept | 5.7 | qt/qtquickcontrols | Status: MERGED | +2 | 0 |
167908,2 | QGtk3Dialog::show(): add missing null-check to avoid warnings | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |
167909,3 | GTK+ dialogs: do not emit duplicate selected signals | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |
167910,2 | QGtk3FontDialogHelper: provide proper currentFontChanged() | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |
167911,3 | Fix QGtk3ColorDialogHelper::currentColorChanged() emission | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |
168645,2 | QGtk3FileDialogHelper: provide proper filterSelected() | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |