MyDialog::MyDialog() : QDialog() { QMainWindow * mainWindow = new QMainWindow(); // or your own class // inheriting QMainWindow QToolBar * myToolBar = new QToolBar(); mainWindow->addToolBar(myToolBar); QHBoxLayout * layout = new QHBoxLayout(); layout->addWidget(mainWindow); setLayout(layout);
}
QMainWindow实例化,当成Widget添加到布局
在qdialog中实现增加toolbar
最新推荐文章于 2024-04-18 15:15:59 发布