-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.cpp
63 lines (51 loc) · 1.74 KB
/
mainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "mainwindow.hpp"
#include <QString>
#include <QDebug>
#include <QScreen>
#include <QGuiApplication>
#include <QSize>
#include <QDockWidget>
#include <QWidget>
#include <QStatusBar>
#include <QToolBar>
#ifdef QT_DEBUG
#include <QDebug>
#endif
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
mMenu=new MenuBar();
mStatusBar=new QStatusBar(this);
mLeftDock=new QDockWidget(tr("List of devices"),this);
mRight=new QDockWidget(tr("Images"),this);
mRightBottom=new QDockWidget(tr("Informations"),this);
mToolBar=new QToolBar(this);
mScreenSize=QGuiApplication::screens().at(0)->availableSize();
mStatusBar->showMessage(tr("Ready"));
mStatusBar->show();
setStatusBar(mStatusBar);
mLeftDock->setAllowedAreas(Qt::LeftDockWidgetArea);
mLeftDock->setWidget(new QWidget);
mLeftDock->setFeatures(QDockWidget::NoDockWidgetFeatures);
addDockWidget(Qt::LeftDockWidgetArea, mLeftDock);
setMenuBar(mMenu->getMenuBar());
mRight->setWidget(new QWidget);
mRight->setFeatures(QDockWidget::NoDockWidgetFeatures);
splitDockWidget(mLeftDock,mRight,Qt::Horizontal);
mRightBottom->setWidget(new QWidget);
mRightBottom->setFeatures(QDockWidget::NoDockWidgetFeatures);
splitDockWidget(mRight,mRightBottom,Qt::Vertical);
mToolBar->addAction(tr("Add Image"));
mToolBar->addAction(tr("Login in"));
addToolBar(mToolBar);
setWindowTitle(tr("Desktop Application for India Rose"));
setMaximumSize(mScreenSize);
setMinimumSize(mScreenSize/2);
showMaximized();
// Put the size of the qdock after the show function
mLeftDock->setMaximumWidth(mScreenSize.width()/3);
mRightBottom->setMaximumHeight(mScreenSize.height()/2);
}
MainWindow::~MainWindow()
{
}