--- main.cpp | 3 ++- mainwindow.cpp | 21 ++++++--------------- mainwindow.h | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) --- a/main.cpp +++ b/main.cpp @@ -31,7 +31,8 @@ int main(int argc,char **argv) QCoreApplication::setApplicationName("serial-io"); MainWindow mainWin; + mainWin.show(); - return mainWin.exec(); + return application.exec(); } --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -57,14 +57,17 @@ MainWindow::MainWindow() // GUI stuff createActions(); + QWidget *centralWidget = new QWidget; QVBoxLayout *mainLayout = new QVBoxLayout; + centralWidget->setLayout(mainLayout); + setCentralWidget(centralWidget); createMenus(); createToolBars(); createStatusBar(); - mainLayout->addWidget(menuBar); - mainLayout->addWidget(fileToolBar); + setMenuBar(menuBar); + addToolBar(fileToolBar); createTypeBox(); mainLayout->addWidget(horizontalGroupBox); @@ -204,22 +207,10 @@ MainWindow::MainWindow() /****/ - mainLayout->addWidget(statusBar); + setStatusBar(statusBar); - setLayout(mainLayout); - setWindowTitle(tr("Serial I/O Manager")); - Qt::WindowFlags flags; - - flags = this->windowFlags(); - - flags |= Qt::WindowMinMaxButtonsHint; - - flags = flags & (!Qt::WindowContextHelpButtonHint); - - setWindowFlags(flags); - viewTools(); viewSendType(); viewWidth(); --- a/mainwindow.h +++ b/mainwindow.h @@ -59,7 +59,7 @@ class QDomDocument; The class show the pulldown menu, toolbar, options, transceiver window and a tabbar for the comandline, send buffer and events. */ -class MainWindow : public QDialog +class MainWindow : public QMainWindow { Q_OBJECT