Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.2
-
None
-
Qt 4.6.2. Mac OS 10.5.8.
-
-
0ffd973b76470e3636577f6335186b36b96e0b9b e083aede62a23af8330bb572366e79e2f42e0cec
Description
The following code demonstrates the problem. Run the main window code in a new project; then click the button. The first time the native Mac OS color dialog will appear. The 2nd time it won't.
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QtGui/QMainWindow> class QColorDialog; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = 0); ~MainWindow(); private Q_SLOTS: void openColor(); void colorDialogFinished(int result); private: QColorDialog *color_dialog; }; #endif // MAINWINDOW_H
#include "MainWindow.h" #include <QPushButton> #include <QVBoxLayout> #include <QColorDialog> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { QWidget *widget = new QWidget(); QVBoxLayout *layout = new QVBoxLayout(widget); QPushButton *button = new QPushButton("Push Me"); layout->addWidget(button); setCentralWidget(widget); connect(button, SIGNAL(clicked()), this, SLOT(openColor())); } MainWindow::~MainWindow() { } void MainWindow::openColor() { color_dialog = new QColorDialog(); color_dialog->setOption(QColorDialog::NoButtons, true); connect(color_dialog, SIGNAL(finished(int)), this, SLOT(colorDialogFinished(int))); color_dialog->show(); } void MainWindow::colorDialogFinished(int result) { color_dialog->deleteLater(); }
Attachments
For Gerrit Dashboard: QTBUG-11188 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
59335,1 | can show the Cocoa color panel repeatedly | 4.8 | qt/qt | Status: MERGED | +2 | 0 |