| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 6 | |
See picture... Button is flat + it has only icon set and text set to QString(). Method popups menu at position that menus bottom-left corner is at same point as top-left corner of button. Buttons are inserted into StatusBar... StatusBar has deleted layout and QHBoxLayout setin instead of it. here is snippet: statusBar()->setSizeGripEnabled(FALSE); delete statusBar()->layout(); bottomBar=new QHBoxLayout( statusBar() ); bottomBar->setSpacing(0); bottomBar->setMargin(0); bottomMenuButton = new QPushButton( QIcon( QCoreApplication::applicationDirPath()+"/icons/default/menu.png" ), QString() ); bottomMenuButton->setIconSize( QImage( QCoreApplication::applicationDirPath()+"/icons/default/menu.png" ).size() ); bottomMenuButton->setFlat(TRUE); bottomMenuButton->setFixedSize( bottomMenuButton->sizeHint() ); connect( bottomMenuButton, SIGNAL( clicked() ), this, SLOT( popupBottomMenu() ) ); bottomBar->addStretch(); statusBar()->setLayout( bottomBar ); statusBar()->setSizeGripEnabled(TRUE); bottomBar->insertWidget( 0, bottomMenuButton ); additional buttons are inserted always on position 2 bottomBar->insertWidget( 2, widget );
Attachment:
Picture 1.png
Description: PNG image