[Solved]How to enable Layouts in splitter Horizontally or Vertically in Qt Designer
-
Hi all,
I am designing an ui. so i want to use Layout Horizontally in Splitter and Layout Vertically in Splitter. but these two are in disable mode. How can i enable them so that i can use them properly.
Thanx in Advance.
-
Hi,
What do you mean, disabled mode??
Are you using designer? In my (just downloaded the latest version) designer it does not support splitters.
In code it is easy:
@
QSplitter * m_MainWindowSplitter_p = new QSplitter(this->centralWidget());
m_MainWindowSplitter_p->setOrientation(Qt::Vertical);// Application Layer widgets m_ScrollApplicationLayer_p = new QScrollArea; m_ScrollApplicationLayer_p->setWidgetResizable(true); m_ScrollApplicationLayer_p->setWidget(m_ApplicationLayer_wp); m_MainWindowSplitter_p->addWidget(m_ScrollApplicationLayer_p);
@
-
I am using qt creator . and my ui is opened in designer.
-
Actually I just want to set it through designer. but i can't select layout in splitter since i m not able to select them . where as i am able to use any other layout like horizontal layout, vertical layout or grid layout.
-
Ahh, I see in the new designer they added the QSplitter in the layouts.
<< Let's check it>>
Ah,
First do a 'break layout" on your top level widget/layout. Then you are able to select the widgets you need and select the hor/ver splitter -
!http://postimg.org/image/pvebw3tn3/
This is how it is showing splitter in disable mode. and i not using any layout till now so i can't click on break layout.
-
!http://s7.postimg.org/ee1skbsyz/layout.png(scr)!
qxoz: you can use Picture tag for posting images
-
Well, it's correct. Widget could have only one layout. Other layouts must be inside this layout.
Take a look to "Using Layouts in Qt Designer":http://qt-project.org/doc/qt-5/designer-layouts.html -
If you don't have any other layouts then to make them enabled you need to select the items that you want to split with a splitter.
!http://s29.postimg.org/yfr8wkopz/qtcreator_splitter_enabled.png()! -
Thanx to all of you for your valuable suggestion. Now I am very close to solution. Till an extend it is fixed.