Two independent QColorDialogs
Hello, I'm a little confused on a program I'm writing
I created a widget that has a QColorDialog pointer, when the widget starts the QColorDialog is initiated, then it is controlled by simply using the show() and hide() functions to make it appear and desappear as the user needs it, it is modaless . The problem is when I have 2 instances of that widget, when one instance opens it's QColorDialog then the other opens it's QColorDialog, it makes the first one disappear, it is as if they were both controlling the same dialog, I have read the documentation for QColorDialog and searched for this issue with no results.
Any help appreciated, thanks in advance
Re: Two independent QColorDialogs
This works just fine for me:
Code:
#include <QtWidgets>
int main(int argc, char **argv) {
d1->show();
d1->move(0,0);
d2->show();
d2->move(d1->width(), 0);
return app.exec();
}
Re: Two independent QColorDialogs
This code only gives me one color dialog
Re: Two independent QColorDialogs
Which version of Qt and which platform are you using? Also did you try dragging the dialog around the screen?
Re: Two independent QColorDialogs
Quote:
Originally Posted by
wysota
Which version of Qt and which platform are you using? Also did you try dragging the dialog around the screen?
I'm using Qt 5.2 on a macOSX (10.9.2) and yes I tried dragging.
Re: Two independent QColorDialogs
I don't have OSX so I can't try it myself but it works for me on Linux with both Qt4 and Qt5. Maybe you should try setting the option to not use the native color dialog?
Re: Two independent QColorDialogs
I tried to set the QColorDialog flag DontUseNativeDialog, then I opened the first dialog and clicked the close button, it closes,
then I opened again which was a good sign, but it didn't work the third time...and there is no flag or bool I have setter to control
this behavior, is all based in the isVisible() method.
Then I setted an old PC I have to test it on linux... Guess what?
It worked just fine, exactly as it was suppose to in the beginning...I also found this bug report:
https://bugreports.qt-project.org/br...ream-issue-tab
So I was left with a few options on how to proceed:
1 - if the program is to run on linux and maybe windows, it is fine the way I described in the thread
2 - on the mac the color dialog will probably be modal until I find another way :(
Thanks a lot for your atention and support :)