我正在尝试创建一个布局类似于Qt的BorderLayout example的应用程序,并将其用作模板。如何像QSplitter一样通过在它们之间的边界上拖动鼠标来使区域可调整大小?
最佳答案
我设法完全不使用BorderLayout来解决问题:
QTextBrowser *centralWidget = new QTextBrowser;
centralWidget->setPlainText(tr("Central widget"));
QLabel* west = createLabel( "West" );
QLabel* east = createLabel( "East" );
QLabel* south = createLabel( "South" );
QSplitter* splitter = new QSplitter();
splitter->addWidget(west);
splitter->addWidget(centralWidget);
splitter->addWidget(east);
QSplitter* splitter2 = new QSplitter( Qt::Orientation::Vertical );
splitter2->addWidget( splitter );
splitter2->addWidget( south );
关于c++ - 如何使Qt的BorderLayout项目可调整大小?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23934930/