That doesn't look like something that would compile.
"pb" is of type QPushButton* but the method return value is of type QToolButton*, so either of the two needs to be changed.
Adding the button to the layout in there should be OK
Cheers,
_
That doesn't look like something that would compile.
"pb" is of type QPushButton* but the method return value is of type QToolButton*, so either of the two needs to be changed.
Adding the button to the layout in there should be OK
Cheers,
_
rawfool (7th March 2014)
Oh sorry for the typo. I meant QToolButton there.
Thank you.
To your code from the first post: You don't pass a QPushButton by reference. You pass "a pointer to QPushButton by value". That's why btn1/2/3/4 doesn't change after calling addButtons - just a copy of that pointer changes.
The following piece of code might work.
Qt Code:
{ pb->setCheckable(true); pb->setStyleSheet(str); vLyt->addWidget(pb); }To copy to clipboard, switch view to plain text mode
Bookmarks