User Expandable QPushButton in Qt application
-
Hi
Well, not directly
But QSizeGrip can be used to make a fast / not so fancy / hack-ish version
Note, you need to handle deselecting it again and remove the QSizeGrip etc.
the code is not complete for really using QSizeGrip.For a more full version using sizing object , you can peek at this
http://www.davidwdrell.net/wordpress/?page_id=46
It can work for normal widgets too with only slight modification.Disclaimer. Just for fun code. Ugly , incomplete and hackish. #include <QSizeGrip> #include <QGridLayout> ... QWidget *the_widget_you_scale=ui->pushButton; /// BIG FAT NOTE: PushButtons used fixed height so it wont scale in that direction unless u disable it. the_widget_you_scale->setWindowFlags(Qt::SubWindow); QSizeGrip * sizeGrip = new QSizeGrip(this); QGridLayout * layout = new QGridLayout(the_widget_you_scale); layout->addWidget(sizeGrip, 0,0,1,1,Qt::AlignBottom | Qt::AlignRight);