[Qt-interest] Style sheet mistakes

william.crocker at analog.com william.crocker at analog.com
Fri Sep 25 18:31:40 CEST 2009


Hello:

I find style sheets to be very powerful,
but difficult to use. They are difficulty
to use because they can be complicated
and when I make mistakes Qt does not comment.

For example, the mistake in the following
spec causes it to fail silently.
Qt does not catch my mistake so I assume that
my understanding of the system is incorrect
and move on to try something else.

    padding-left: 0px; padding-right: 10px  padding-top: 5px;
         Missing semi-colon after 10px ---^

    I set the style with: QWidget::setStyleSheet()

I don't think there is any other way to
interpret the above other than user error.
Silently ignoring incorrect specifications is not helpful.

With a debug build there are plenty of other
places within the Qt lib where a mistake
(like accessing an QList out of bounds) generates
a runtime comment form a Q_ASSERT macro.
This is great.

Why doesn't a debug Qt build report
obvious mistakes in my style sheets?

Bill



More information about the Qt-interest-old mailing list