[PyKDE] Problem with QMessageBox.question

Baz Walter bazwal at ftml.net
Sat Oct 15 15:25:38 BST 2005


On Friday 14 Oct 2005 22:29, Douglas Soares de Andrade wrote:
> Hi !

Hello Douglas

> I did a QMessageBox.question and the icon is missing.
> Is it a problem with the way im making the dialog ?

No, it's a problem with the gui style your app is using:

>>> from qt import *
>>> a = QApplication([])
>>> def icontest():
...     f = QStyleFactory.keys()
...     print 'Available gui styles =', len(f)
...     for k in f:
...         s = qApp.setStyle(k)
...         if not QMessageBox.standardIcon(
...             QMessageBox.Question).isNull():
...             QMessageBox.question(None,'',k)
...             print '"%s" has question icon' % k
...
>>> icontest()
Available gui styles = 21
"Compact" has question icon
"MotifPlus" has question icon
"Platinum" has question icon
"Light, 2nd revision" has question icon
"Motif" has question icon
"SGI" has question icon
"CDE" has question icon
"Light, 3rd revision" has question icon
"Windows" has question icon
>>>

I'm currently using the "HighColor" style on my Linux box, so I don't get the 
question icon, either :(

The Qt docs state that QMessageBox "...defines the Question, Information, 
Warning, and Critical icons for each GUI style", so I suppose there must be a 
bug somewhere in Qt or PyQt.

-- 
Baz Walter




More information about the PyQt mailing list