2012/05/28

Pesky Etching

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.


2012/01/22

OATMEAL2PDF

As a continuation to my wildly popular XKCD2PDF post, here's a script I whipped out to get me some sweet PDFs of a great comic called The Oatmeal.


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:
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.