#ifndef UI_MAINWINDOW_H#define UI_MAINWINDOW_H#include <QtCore/QVariant>#include <QtGui/QAction>#include <QtGui/QApplication>#include <QtGui/QButtonGroup>#include <QtGui/QDockWidget>#include <QtGui/QHBoxLayout>#include <QtGui/QListWidget>#include <QtGui/QMainWindow>#include <QtGui/QMdiArea>#include <QtGui/QMenuBar>#include <QtGui/QStatusBar>#include <QtGui/QTextEdit>#include <QtGui/QToolBar>#include <QtGui/QToolBox>#include <QtGui/QVBoxLayout>#include <QtGui/QWidget>QT_BEGIN_NAMESPACEclass Ui_MainWindow{public: QWidget *centralwidget; QHBoxLayout *horizontalLayout; QMdiArea *mdiArea; QWidget *subwindow; QMenuBar *menubar; QStatusBar *statusbar; QToolBar *toolBar; QDockWidget *dockMenu; QWidget *dockWidgetContents; QVBoxLayout *verticalLayout; QToolBox *toolBox; QWidget *page; QVBoxLayout *verticalLayout_2; QListWidget *listWidget; QWidget *page_2; QDockWidget *dockLogger; QWidget *dockWidgetContents_2; QVBoxLayout *verticalLayout_3; QTextEdit *textEdit; void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) MainWindow->setObjectName(QString::fromUtf8("MainWindow")); MainWindow->resize(1000, 650); MainWindow->setDockOptions(QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks|QMainWindow::ForceTabbedDocks|QMainWindow::VerticalTabs); MainWindow->setUnifiedTitleAndToolBarOnMac(false); centralwidget = new QWidget(MainWindow); centralwidget->setObjectName(QString::fromUtf8("centralwidget")); horizontalLayout = new QHBoxLayout(centralwidget); horizontalLayout->setSpacing(0); horizontalLayout->setMargin(0); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); mdiArea = new QMdiArea(centralwidget); mdiArea->setObjectName(QString::fromUtf8("mdiArea")); mdiArea->setFrameShadow(QFrame::Plain); mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setViewMode(QMdiArea::TabbedView); mdiArea->setTabShape(QTabWidget::Rounded); subwindow = new QWidget(); subwindow->setObjectName(QString::fromUtf8("subwindow")); mdiArea->addSubWindow(subwindow); horizontalLayout->addWidget(mdiArea); MainWindow->setCentralWidget(centralwidget); menubar = new QMenuBar(MainWindow); menubar->setObjectName(QString::fromUtf8("menubar")); menubar->setGeometry(QRect(0, 0, 1000, 22)); MainWindow->setMenuBar(menubar); statusbar = new QStatusBar(MainWindow); statusbar->setObjectName(QString::fromUtf8("statusbar")); MainWindow->setStatusBar(statusbar); toolBar = new QToolBar(MainWindow); toolBar->setObjectName(QString::fromUtf8("toolBar")); toolBar->setMinimumSize(QSize(32, 32)); MainWindow->addToolBar(Qt::TopToolBarArea, toolBar); dockMenu = new QDockWidget(MainWindow); dockMenu->setObjectName(QString::fromUtf8("dockMenu")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(dockMenu->sizePolicy().hasHeightForWidth()); dockMenu->setSizePolicy(sizePolicy); dockMenu->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable); dockMenu->setAllowedAreas(Qt::LeftDockWidgetArea); dockWidgetContents = new QWidget(); dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents")); verticalLayout = new QVBoxLayout(dockWidgetContents); verticalLayout->setSpacing(0); verticalLayout->setMargin(0); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); toolBox = new QToolBox(dockWidgetContents); toolBox->setObjectName(QString::fromUtf8("toolBox")); toolBox->setEnabled(true); sizePolicy.setHeightForWidth(toolBox->sizePolicy().hasHeightForWidth()); toolBox->setSizePolicy(sizePolicy); toolBox->setMinimumSize(QSize(120, 0)); page = new QWidget(); page->setObjectName(QString::fromUtf8("page")); page->setGeometry(QRect(0, 0, 256, 366)); verticalLayout_2 = new QVBoxLayout(page); verticalLayout_2->setSpacing(0); verticalLayout_2->setMargin(0); verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2")); listWidget = new QListWidget(page); listWidget->setObjectName(QString::fromUtf8("listWidget")); listWidget->setFrameShape(QFrame::NoFrame); listWidget->setLineWidth(0); listWidget->setFlow(QListView::TopToBottom); listWidget->setResizeMode(QListView::Fixed); listWidget->setLayoutMode(QListView::SinglePass); verticalLayout_2->addWidget(listWidget); toolBox->addItem(page, QApplication::translate("MainWindow", "Page 1", 0, QApplication::UnicodeUTF8)); page_2 = new QWidget(); page_2->setObjectName(QString::fromUtf8("page_2")); page_2->setGeometry(QRect(0, 0, 256, 366)); toolBox->addItem(page_2, QApplication::translate("MainWindow", "Page 2", 0, QApplication::UnicodeUTF8)); verticalLayout->addWidget(toolBox); dockMenu->setWidget(dockWidgetContents); MainWindow->addDockWidget(static_cast<Qt::DockWidgetArea>(1), dockMenu); dockLogger = new QDockWidget(MainWindow); dockLogger->setObjectName(QString::fromUtf8("dockLogger")); dockLogger->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable); dockLogger->setAllowedAreas(Qt::BottomDockWidgetArea); dockWidgetContents_2 = new QWidget(); dockWidgetContents_2->setObjectName(QString::fromUtf8("dockWidgetContents_2")); verticalLayout_3 = new QVBoxLayout(dockWidgetContents_2); verticalLayout_3->setSpacing(0); verticalLayout_3->setMargin(0); verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3")); verticalLayout_3->setSizeConstraint(QLayout::SetMinimumSize); textEdit = new QTextEdit(dockWidgetContents_2); textEdit->setObjectName(QString::fromUtf8("textEdit")); verticalLayout_3->addWidget(textEdit); dockLogger->setWidget(dockWidgetContents_2); MainWindow->addDockWidget(static_cast<Qt::DockWidgetArea>(8), dockLogger); retranslateUi(MainWindow); toolBox->setCurrentIndex(0); QMetaObject::connectSlotsByName(MainWindow); } // setupUi void retranslateUi(QMainWindow *MainWindow) { MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8)); subwindow->setWindowTitle(QApplication::translate("MainWindow", "Subwindow", 0, QApplication::UnicodeUTF8)); toolBar->setWindowTitle(QApplication::translate("MainWindow", "toolBar", 0, QApplication::UnicodeUTF8)); dockMenu->setWindowTitle(QApplication::translate("MainWindow", "\320\234\320\276\320\264\321\203\320\273\320\270 \321\201\320\270\321\201\321\202\320\265\320\274\321\213", 0, QApplication::UnicodeUTF8)); toolBox->setItemText(toolBox->indexOf(page), QApplication::translate("MainWindow", "Page 1", 0, QApplication::UnicodeUTF8)); toolBox->setItemText(toolBox->indexOf(page_2), QApplication::translate("MainWindow", "Page 2", 0, QApplication::UnicodeUTF8)); dockLogger->setWindowTitle(QApplication::translate("MainWindow", "\320\241\320\277\320\270\321\201\320\276\320\272 \321\201\320\276\320\261\321\213\321\202\320\270\320\271", 0, QApplication::UnicodeUTF8)); Q_UNUSED(MainWindow); } // retranslateUi};namespace Ui { class MainWindow: public Ui_MainWindow {};} // namespace UiQT_END_NAMESPACE#endif // UI_MAINWINDOW_H
MainWindow->addDockWidget(static_cast<Qt::DockWidgetArea>(1), dockMenu); dockLogger = new QDockWidget(MainWindow); dockLogger->setObjectName(QString::fromUtf8("dockLogger")); dockLogger->setMinimumSize(QSize(80, 80)); dockLogger->setFeatures(QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable); dockLogger->setAllowedAreas(Qt::BottomDockWidgetArea); dockWidgetContents_2 = new QWidget(); dockWidgetContents_2->setObjectName(QString::fromUtf8("dockWidgetContents_2")); QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Minimum); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); sizePolicy1.setHeightForWidth(dockWidgetContents_2->sizePolicy().hasHeightForWidth()); dockWidgetContents_2->setSizePolicy(sizePolicy1); dockWidgetContents_2->setMinimumSize(QSize(0, 80)); verticalLayout_3 = new QVBoxLayout(dockWidgetContents_2); verticalLayout_3->setSpacing(0); verticalLayout_3->setMargin(0); verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3")); verticalLayout_3->setSizeConstraint(QLayout::SetMinimumSize); textEdit = new QTextEdit(dockWidgetContents_2); textEdit->setObjectName(QString::fromUtf8("textEdit")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Minimum); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); sizePolicy2.setHeightForWidth(textEdit->sizePolicy().hasHeightForWidth()); textEdit->setSizePolicy(sizePolicy2); textEdit->setMinimumSize(QSize(0, 80)); textEdit->setMaximumSize(QSize(16777215, 16777215));
QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Minimum);//...dockWidgetContents_2->setMinimumSize(QSize(0, 80));
QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Maximum);//...dockWidgetContents_2->setMaximumSize(QSize(0, 80));