Reputation: 415
i have some concatenate toolbar. For every toolbar i have call:
toolbar->setGeometry(x,y,width,height)
but i have no resize.
I try to call
toolbar->updateGeometry();
but nothing.
My goal is to expand every toolbar with my size definition
Upvotes: 1
Views: 3524
Reputation: 19102
There is a good chance you are using this for repositioning your toolbars on init and saving at closing.
Here is a solid way to do that:
What you really need is to use the QMainWindow
saveGeometry()
and restoreGeometry()
functions and save and load the byte array through the QSettings interface.
writeSettings
QSettings s;
s.beginGroup("MainWindow");
this->restoreGeometry(s.value("geometry").toByteArray());
this->restoreState(s.value("windowState").toByteArray());
s.endGroup();
readSettings
QSettings s;
s.beginGroup("MainWindow");
s.setValue("geometry", saveGeometry());
s.setValue("windowState", saveState());
s.endGroup();
Hope that helps.
Upvotes: 2
Reputation: 98425
The toolbar's geometry is either managed by a layout or by the main window.
You'd need to show how is the toolbar used/displayed.
Upvotes: 0
Reputation: 4110
You can try QWidget::resize( int w, int h ) to resize the toolbar.
toolbar-> resize( 200, 20 );
Upvotes: 1