简体   繁体   中英

How to use a single UI for two projects in QT?

I need a small help. I have two projects in QT,one a publisher having mainwindow.cpp,main.cpp,mainwindow.ui,qnode and other a subscriber with the same number of files. i want to combine the two .ui files together or lets just say create a new .ui with two tabs each one accessing the publisher.ui and subscriber.ui. How can i do it?

You can use a QStackedWidget .

http://doc.qt.io/qt-5/qstackedwidget.html

Simply add some QPushButton instances that can be checkable, and use those as your "tabs". You can use the QStackedWidget index property quite easily with both QWidget UIs and QML UIs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM