So, how does this differ from having dock widgets with no title bars?
#include <QtGui>
{
public:
{
// just some 2 dummy example widgets to fill splitters with
for (int i = 0; i < 10; ++i)
for (int r = 0; r < table->rowCount(); ++r)
for (int c = 0; c < table->columnCount(); ++c)
label->setAlignment(Qt::AlignCenter);
v->addWidget(list);
v->addWidget(table);
h->addWidget(v);
h->addWidget(label);
setCentralWidget(h);
}
};
int main(int argc, char *argv[])
{
MainWindow w;
w.show();
return a.exec();
}
#include <QtGui>
class MainWindow: public QMainWindow
{
public:
MainWindow(QWidget* parent = 0): QMainWindow(parent)
{
// just some 2 dummy example widgets to fill splitters with
QListWidget* list = new QListWidget;
for (int i = 0; i < 10; ++i)
list->addItem(QString::number(i));
QTableWidget* table = new QTableWidget(4, 1);
for (int r = 0; r < table->rowCount(); ++r)
for (int c = 0; c < table->columnCount(); ++c)
table->setItem(r, c, new QTableWidgetItem(QString::number(r*c+1)));
QLabel* label = new QLabel("central");
label->setAlignment(Qt::AlignCenter);
QSplitter* h = new QSplitter(Qt::Horizontal);
QSplitter* v = new QSplitter(Qt::Vertical);
v->addWidget(list);
v->addWidget(table);
h->addWidget(v);
h->addWidget(label);
setCentralWidget(h);
}
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks