[Qt-interest] Style sheet mistakes
David Walthall
walthall at wavefun.com
Fri Sep 25 19:00:50 CEST 2009
william.crocker at analog.com wrote:
> 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
I agree that would be useful. Until then, if you want to check your
sytlesheet, you can do so in Designer. Open designer, create a QWidget.
In the property editor, click on styleSheet, then click the "..."
button to bring up the Edit Style Sheet dialog. While it does not give
an indication of why the style sheet is wrong, it will at least tell you
if it is valid.
David
More information about the Qt-interest-old
mailing list