c++ - How to create QSplitter ui class via qt designer? -
i new qt , need implement monitoring interface following considerations:
- i have main window, on should put multiple screens, qsplitter appears best solution.
- the interface provides user option of changing number of cameras,
qsplitter
should created/re-created during run time.
the problem have many cameras pre-define widgets them, need create qsplitter
ui instances dynamically. problem can't find qsplitter
classes when using qt designer
, creating qsplitter
class programatically not working mainwindow
has been created through qt designer
(.ui). hear suggestions regarding issue, if there better approaches, please let me know.
qsplitter
isn't strict ui element, it's parent element controls child elements. if want through designer you'd run headaches, basic gist select number of widgets controlled it, , click layout horizontally/vertically in splitter
button in layout buttons group.
what might best doing creating child elements programmatically, creating splitter programmatically, adding child widgets somesplitter->addwidget(...)
. in qt docs there's sample code this:
qsplitter *splitter = new qsplitter(parent); qlistview *listview = new qlistview; qtreeview *treeview = new qtreeview; qtextedit *textedit = new qtextedit; splitter->addwidget(listview); splitter->addwidget(treeview); splitter->addwidget(textedit);
http://doc.qt.io/qt-5/qsplitter.html#details
and if want in designer there's guide here: http://www.bogotobogo.com/qt/qt5_splitter.php
Comments
Post a Comment