#include <QtGui>
#include <QMainWindow>
int main(int argc, char *argv[])
{
mainWin->setMinimumSize(400, 400);
// Dock Windows
mainWin->addDockWidget(Qt::RightDockWidgetArea, dock);
dock->setMinimumSize(100, 10);
mainWin->addDockWidget(Qt::BottomDockWidgetArea, dock);
dock->setMinimumSize(10, 100);
// Central widget
mainWin->setCentralWidget(frame);
// two simple push buttons
box->addWidget(pb);
box->addWidget(pb);
mainWin->show();
return app.exec();
}
#include <QtGui>
#include <QMainWindow>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QMainWindow *mainWin = new QMainWindow;
mainWin->setMinimumSize(400, 400);
// Dock Windows
QDockWidget *dock = new QDockWidget("Test DockWindow 1", mainWin);
mainWin->addDockWidget(Qt::RightDockWidgetArea, dock);
dock->setMinimumSize(100, 10);
dock = new QDockWidget("Test DockWindow 2", mainWin);
mainWin->addDockWidget(Qt::BottomDockWidgetArea, dock);
dock->setMinimumSize(10, 100);
// Central widget
QFrame *frame = new QFrame(mainWin);
mainWin->setCentralWidget(frame);
QHBoxLayout *box = new QHBoxLayout(frame);
// two simple push buttons
QPushButton *pb = new QPushButton("Push Me!", frame);
box->addWidget(pb);
pb = new QPushButton("Me too!", frame);
box->addWidget(pb);
mainWin->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks