and if I set the add this code:
Qt Code:
colorButton->setFlat(true);To copy to clipboard, switch view to plain text mode
the button's background wiil be set.
but I don't want to set the flat true!![]()
and if I set the add this code:
Qt Code:
colorButton->setFlat(true);To copy to clipboard, switch view to plain text mode
the button's background wiil be set.
but I don't want to set the flat true!![]()
btw, I tested on Qt 4.5.0, which version of Qt do you use?
PS. also read this, maybe you already know this.![]()
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
QMake version 2.01a
Using Qt version 4.3.2 in D:\Qt\4.3.2\lib
yup, I don't remember the task number, but it was on the tracker.![]()
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
I followed the exact code to update the QPalette to change the QPushButton's color but it never showed the color. I compiled my code for Qt 4.5.3 on *both* Unix/X11 and Qt-Embedded, none workedI tried Qt Designer as well, color's not shown either. It works with style sheet, but what I'm trying to have a blinking button that changes colors ever 0.5s, and just that eats up 95% CPU consumption! Admittedly we don't have a very powerful one
so I was hoping using QPalette would help the performance.
Anyhow, do you guys have any more ideas? I do have a style sheet applied at the top level Form, but it should be overwritten when I update palette for a particular button, right?
Thanks in advance.
can you show us you code?
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
In my example,I use the setStyleSheet,it works well.But in my application,it will be crashed!
I have no idea
the crash infomation is:
In my application,I have a framework,it will be load some QLibrary,in theQt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.
Lib,it wil create some widget,like QPushButton,like the listColorBtn.
and now when I setStyleSheet in listColorBtn,it crashed!
Bookmarks