How to add a widget to QMainwindow in qt creator
-
@veera
Hi
Even when I read the post a few times, im not really sure what you ask about.Do you ask how to make tabs dynamic ?
Or just widgets at runtime?Do you ask how to connect on to MS SQL server
which is running in Ubuntu 16.10 ( i though it only runs on windows)
or what do you ask about ?for database , you can start here
http://doc.qt.io/qt-5/qtsql-index.html -
leave the data base part ....i want implement mainwindow with some ribbon panel controls on it if i am try to click it has to open the another window which has to open attached with mainwindow not separately thats it ...this much i need to achieve initially.
-
Ok
So tasks are
1: Create ribbon like widget.
Try to use http://doc.qt.io/qt-5/qtabwidget.html#details
When it works, you can style it ( with stylesheets) to make it look more like an ribbon.
stylesheets from here http://developers-club.com/posts/48963/2:
- click it has to open the another window which has to open attached with mainwindow
What do you mean by attached here?
if you open a dialog with the mainwindows as parent, its both blocks the mainwindow and is
very attached to it.
void mainwindow::somebuttonpress() {
MyDialog dialog(this);
dialog.exec();
}
- click it has to open the another window which has to open attached with mainwindow
-
Thanks for your valuable reply.......if add any dialog designer class without button to my qt project if there is a pushbutton in mainwindow.ui after that dialog window is opening it separately...i don't want to open it has a seperate window .....that has to attached to mainwindow as a tab.......in screen sheet you can see it.......
-
Ok but it has function for that.
http://doc.qt.io/qt-5/qtabwidget.html#addTab
so you can also do it run time. -
Hi ,
No ....need to call in the run time There is Qmainwindow ui in that i have implemented there is a open pushbutton using style sheet ,if i press its has to open qtabwidget after words .....i will show my tableview in that ,its already connected with database server ..........this is my implementation idea....