While working with Qt buttons I've came across a very nasty behaviour - when you disable a button, it's label receives a pretty ugly shadow that makes the font rather unreadable. This effect is called 'etching'. There is a reminant of a CSS property that controls that behaviour called etch-disabled-text, but it's undocumented and actually doesn't work at all.
There is NO documented way of removing that shadow. Pretty crappy, especially for a very configurable toolkit like Qt.
Anyways, here's a workaround. It'll set the proper global palette rules that will apply this fix to all the buttons.
The first line sets the color of the disabled text, the second - removes the etching.
Showing posts with label qt. Show all posts
Showing posts with label qt. Show all posts
2012/05/28
2012/01/03
SCons and Qt Resource files
Today I've stumbled upon a bug/problem with SCons' support for Qt resource files (the ones with QRC extension).
Usually, to add a QRC to your project you add a line like this:
But - probably due to a bug somewhere in qt4.py module, the files that are referenced from inside the QRC (the actual images and stylesheets) are not added as a dependency to the build process, so when you change a CSS file, the QRC will not be rebuilt.
The snippet below parses the QRC manually, fetches the list of files inside and adds the to deps list; Python rocks.
Usually, to add a QRC to your project you add a line like this:
qrcobj = programEnv.Qrc("SomeFile.qrc", QT4_QRCFLAGS="-name SomeFile")and all is well.
But - probably due to a bug somewhere in qt4.py module, the files that are referenced from inside the QRC (the actual images and stylesheets) are not added as a dependency to the build process, so when you change a CSS file, the QRC will not be rebuilt.
The snippet below parses the QRC manually, fetches the list of files inside and adds the to deps list; Python rocks.
2011/03/10
Making QT behave properly on Mac.
Couple of things I found out that helped porting a QT application to Mac:
The QMainWindow you create does not look like a native Cocoa window. The status bar is there, no matter what you request, the menu doesn't port and the icon is yucky.
Here's what you can do:
Remove status bar/resize grip:
Don't show unneeded icon in the title bar and move a QAction to Mac's main menu:
The QMainWindow you create does not look like a native Cocoa window. The status bar is there, no matter what you request, the menu doesn't port and the icon is yucky.
Here's what you can do:
Remove status bar/resize grip:
Don't show unneeded icon in the title bar and move a QAction to Mac's main menu:
Subscribe to:
Posts (Atom)