QColorDialog window blank on Linux
-
Hi,
You should try with 5.9.1 to see if it's still misbehaving otherwise please post a sample code that reproduces the error you get.
-
Sorry for coming late.
I have checked against Qt 5.9.1 and I could observe the same problem.The code used which leads to wrong result is like this (this is from QtPropertyBrowser):
bool ok = false; ... QRgb newRgba = QColorDialog::getRgba(oldRgba, &ok, this);
The code which works as expected:
... QColor newColor = QColorDialog::getColor(m_color, this, QString(), QColorDialog::DontUseNativeDialog);
EDIT: hmmm...it seems that the problem occurs only for this particular case when called from QtPropertyBrowser...I'll try to investigate it further
-
Hi,
So I have built Qt 5.9.1 from sources on my Ubuntu box to be able to debug Qt code. It seems the dialog is presented correctly when using my developers Qt :/
However, the dialog shown is exactly the same as one with stock Qt and QColorDialog::DontUseNativeDialog option enabled.I wonder if it can have something to do with configuration of my Qt source build.
-
Do you have the same behaviour with your distribution provided Qt ?
-
Just as a note,
QRgb newRgba = QColorDialog::getRgba(oldRgba, &ok, this);works as expected on Mint 18 64bit xfce , Qt5.9 downloaded.
-
Hey all,
Ok I have found the cause of the problem. It seems that in this particular case, problem with rendering on QColorDialog was caused by my QOpenGLWidget based object where in its paintGL method I was calling update(). This somehow messed up the composition of QColorDialog which popped up on top of QOpenGLWidget.
I am not sure why the rendering problem does not occur when QColorDialog::DontUseNativeDialog is used though. Since depending on the flag presence, 2 completely different QColorDialogs can popup, I can only assume that one of them is somehow influenced by composition with OpenGL-enabled widget. -
Thanks for the feedback !
One is the native dialog of the system and the other one is Qt's own implementation of the dialog.
-
Indeed, it looks like that form the flag name. Apparently, in this case, native dialog has some 'feature' causing composition to fail. At least we know it now, though I suppose this is very OS based or even window manager based.
For future reference, I am using Unity.
Thanks again for all your time!
-
I am experiencing this problem on 5.11.2 running Linux Mint. So it is still there.
Using the following formulation:
QColorDialog dlg(colored->getColor());
dlg.setOption(QColorDialog::DontUseNativeDialog);
dlg.setOption(QColorDialog::ShowAlphaChannel);
dlg.open(this,SLOT(slot_colorChanged(QColor)));
dlg.exec();First problem: the dialog initializes with color black, not the given color. When pressing OK, the slot is triggered
but the color is always color white, whatever is selected in the dialg. So essentially it does not work at all.using the formulation
QColor newColor = QColorDialog::getColor(m_color, this, QString(), QColorDialog::DontUseNativeDialog);
does work as was mentioned before