-
Notifications
You must be signed in to change notification settings - Fork 0
/
ddmMainWindow.cpp
133 lines (114 loc) · 3.49 KB
/
ddmMainWindow.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#include <QFileDialog>
#include <QLabel>
#include <QList>
#include <QWebSettings>
#include "ddmApplication.h"
#include "ddmMainWindow.h"
#include "ui_ddmMainWindow.h"
#include "widgets/ddmCentralWidget.h"
/**
* Конструктор класса
*
* @param parent Родитель (владелец) окна
* @author Цалко Т.В.
* @since 2.0
*/
ddmMainWindow::ddmMainWindow( QWidget* parent ) : QMainWindow( parent )
{
QWebSettings::globalSettings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
Ui::ddmMainWindow* ui = new Ui::ddmMainWindow;
ui->setupUi( this );
this->setWindowFlags( this->windowFlags() | Qt::WindowMaximizeButtonHint );
// Панель статуса
this->m_statusBarLat = new QLabel( this );
this->m_statusBarLat->setFrameStyle( QFrame::Panel | QFrame::Sunken );
this->m_statusBarLat->setFixedWidth( 70 );
this->m_statusBarLat->setAlignment( Qt::AlignCenter );
ui->statusBar->addPermanentWidget( m_statusBarLat );
this->m_statusBarLng = new QLabel( this );
this->m_statusBarLng->setFrameStyle( QFrame::Panel | QFrame::Sunken );
this->m_statusBarLng->setFixedWidth( 70 );
this->m_statusBarLng->setAlignment( Qt::AlignCenter );
ui->statusBar->addPermanentWidget( m_statusBarLng );
this->ui = ui;
this->ui->menuData->menuAction()->setVisible( false );
this->ui->openAction->setVisible( false );
this->ui->createTableViewAction->setVisible( false );
this->setupEvents();
}
/**
* Настройка обработчиков главного окна
*
* @author Цалко Т.В.
* @since 2.0
*/
void ddmMainWindow::setupEvents()
{
// добавляем обработку нажатия кнопки выход
connect( this->ui->quitAction, SIGNAL( triggered() ), this, SLOT( slotQuit() ) );
// обновляем html страницу
this->ui->reloadAction->setShortcut( QKeySequence( tr( "F5" ) ) );
connect( this->ui->reloadAction, SIGNAL( triggered() ), this, SLOT( slotReload() ) );
connect( this->ui->increaseZoomAction, SIGNAL( triggered() ), this, SLOT( slotIncreaseZoom() ) );
connect( this->ui->decreaseZoomAction, SIGNAL( triggered() ), this, SLOT( slotDecreaseZoom() ) );
}
/**
* @brief ddmMainWindow::slotReload
* @author Цалко Т.В.
* @since 2.0
*/
void ddmMainWindow::slotReload()
{
ddmApp->centralWidget()->reload();
}
/**
* @brief ddmMainWindow::slotIncreaseZoom
* @author Цалко Т.В.
* @since 2.0
*/
void ddmMainWindow::slotIncreaseZoom()
{
ddmApp->centralWidget()->increaseZoom();
}
/**
*
*
* @author Цалко Т.В.
* @since 2.0
*/
void ddmMainWindow::slotDecreaseZoom()
{
ddmApp->centralWidget()->decreaseZoom();
}
/**
* Обработчик события перемещения курсора по карте
*
* @param lat Долгота
* @param lng Широта
* @author Марунин А.В.
* @since 2.0
*/
void ddmMainWindow::slotMapMouseMove( double lat, double lng )
{
this->m_statusBarLat->setText( QObject::tr( "%1" ).arg( lat ) );
this->m_statusBarLng->setText( QObject::tr( "%1" ).arg( lng ) );
}
/**
*
*
* @author Цалко Т.В.
* @since 2.0
*/
void ddmMainWindow::slotQuit()
{
this->close();
}
/**
* Деструктор класса
*
* @author Цалко Т.В.
* @since 2.0
*/
ddmMainWindow::~ddmMainWindow()
{
}