Hi
I checked the "flat" property on a QPushButton containing a Icon.
Whe i press the button the original rectangular shape shows again?
How do i disable this?
Thanks
Hi
I checked the "flat" property on a QPushButton containing a Icon.
Whe i press the button the original rectangular shape shows again?
How do i disable this?
Thanks
I don't think this is possible, as the user needs some response that "something" is happening when he presses the flat button.
Otherwise the button could be a QLabel which normally never changes its shape. But of course a label has no clicked() signal.
I'm using 2 diferent Pixmaps for that.
One for pressed and one for released.
That's why i want the original sape to go away.
Then subclass QPushButton and write your own print() method. It's not that difficult.
Don't want to sound lazzy but ... is there any example for me to look in for how to write that print method ... a place to start
Qt source code . There are billions of paint methods implemented. Start at QPushButton:: paint().
graciano (19th September 2009)
Ah, I'm going crazy. I cant keep that in mind! It's not print and neither it's paint: It's QWidget::paintEvent(QPaintEvent *event)!
Qt Code:
{ //... protected: private: QImage m_normal;//... }; { // do your painting here }To copy to clipboard, switch view to plain text mode
graciano (19th September 2009)
I see ... thanks for the tips.
I will try this way.
It should be possible to obtain the same effect purely by using stylesheets too.
graciano (19th September 2009)
Yess ... that's what i did for not making the solution "too complex" for the moment.
this did the job:
Qt Code:
w.setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}");To copy to clipboard, switch view to plain text mode
Thanks all
Bookmarks