-
Notifications
You must be signed in to change notification settings - Fork 0
/
formevent.cpp
110 lines (86 loc) · 1.88 KB
/
formevent.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
/* Copyright 2016 EtlamGit*/
#include "formevent.h"
#include "ui_formevent.h"
#include <iostream>
#include <QTimeZone>
FormEvent::FormEvent(QWidget *parent) :
QWidget(parent),
ui(new Ui::FormEvent)
{
ui->setupUi(this);
// fill time zones
QList<QByteArray> ids = QTimeZone::availableTimeZoneIds();
foreach (QByteArray id, ids)
{
ui->comboBox_TimeZone->addItem(id);
}
// find & select local (=system) Time Zone
QString sysTimeZone = QTimeZone::systemTimeZoneId();
int index = ui->comboBox_TimeZone->findText( sysTimeZone );
if ( index != -1 ) { // -1 for not found
ui->comboBox_TimeZone->setCurrentIndex( index );
}
}
FormEvent::~FormEvent()
{
delete ui;
}
// public interface
QString FormEvent::getTitle()
{
return ui->lineEdit_Title->text();
}
bool FormEvent::isLocation()
{
return ui->groupBox_Location->isChecked();
}
QString FormEvent::getLocation()
{
return ui->lineEdit_Location->text();
}
bool FormEvent::isStartTime()
{
return ui->checkBox_Start->isChecked();
}
QTime FormEvent::getStartTime()
{
return ui->timeEdit_Start->time();
}
QString FormEvent::getStartTimeText()
{
return ui->timeEdit_Start->text();
}
bool FormEvent::isEndTime()
{
return ui->checkBox_End->isChecked();
}
QTime FormEvent::getEndTime()
{
return ui->timeEdit_End->time();
}
QString FormEvent::getEndTimeText()
{
return ui->timeEdit_End->text();
}
bool FormEvent::isClass()
{
return ui->groupBox_Class->isChecked();
}
QString FormEvent::getClass()
{
QStringList test1 = ui->comboBox_Class->currentText().split(',');
QString test2 = test1.first();
return ui->comboBox_Class->currentText().split(' ').first();
}
bool FormEvent::isComment()
{
return ui->groupBox_Comment->isChecked();
}
QString FormEvent::getComment()
{
return ui->plainTextEdit->toPlainText();
}
QString FormEvent::getTimeZone()
{
return ui->comboBox_TimeZone->currentText();
}