-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodingQuestion5.qml
More file actions
155 lines (144 loc) · 4.09 KB
/
CodingQuestion5.qml
File metadata and controls
155 lines (144 loc) · 4.09 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import QtQuick 2.15
import QtQuick.Controls 2.15
import LogicHandler 1.0
import filehandler 1.0
ApplicationWindow {
id: mainWindow
visible: true
width: 500
height: 700
title: "Coding Questions"
LogicHandler {
id: logicHandler
}
FileHandler {
id: filehandler
questionFilePath: ":/CodingQuestions/.qtcreator/question5.txt"
exampleOutputFilePath: ":/CodingQuestions/.qtcreator/exampleoutput5.txt"
}
ErrorPopup {
id: errorPopup
}
Rectangle {
width: 500
height: 700
color: "#000000"
anchors.centerIn: parent
radius: 20
gradient: Gradient {
GradientStop { position: 0.0; color: "#0d1e35" }
GradientStop { position: 1.0; color: "#2a4b7e" }
}
border.color: "#5dd0f0"
border.width: 3
Text {
x: 161
y: 28
text: "Coding Challenge"
font.bold: true
font.pixelSize: 28
color: "white"
}
// Daily Quest Section
Text {
x: 105
y: 83
text: "TRAIN TO BECOME\nA FORMIDABLE PROGRAMMER"
font.pixelSize: 18
font.bold: true
color: "white"
horizontalAlignment: Text.AlignHCenter
}
Rectangle {
id: questionSection
x: 72
y: 150
width: 341
height: 212
color: "#0d1e35"
TextEdit {
id: textEdit
anchors.fill: parent
anchors.leftMargin: 8
anchors.rightMargin: 8
anchors.topMargin: 8
anchors.bottomMargin: 102
color: "#eedfdf"
font.pixelSize: 13
wrapMode: TextEdit.WordWrap
readOnly: true
text: filehandler.readQuestion()
}
Rectangle {
id: outputSection
x: 8
y: 116
width: 325
height: 88
color: "#19375f"
TextEdit {
id: textEdit1
color: "#f7f1f1"
anchors.fill: parent
anchors.rightMargin: 0
anchors.leftMargin: 0
anchors.topMargin: 0
anchors.bottomMargin: 0
font.pixelSize: 13
wrapMode: TextEdit.WordWrap
readOnly: true
text: filehandler.readExampleOutput()
}
}
}
Rectangle {
id: codeEditor
x: 72
y: 392
width: 341
height: 200
color: "#19375f"
border.color: "#0d1e35"
border.width: 8
TextEdit {
width: 320
height: 120
id: codeTextEdit
anchors.fill: parent
anchors.leftMargin: 8
anchors.rightMargin: 8
anchors.topMargin: 8
anchors.bottomMargin: 8
color: "#eedfdf"
font.pixelSize: 11
text: "Write your code here..."
}
}
Button {
y: 598
width: 91
height: 40
text: "Run"
anchors.horizontalCenterOffset: 103
anchors.horizontalCenter: parent.horizontalCenter
onClicked: logicHandler.handleNavigation("Quest.qml", mainWindow)
}
Button {
y: 598
width: 91
height: 40
text: "Clear"
anchors.horizontalCenterOffset: -121
anchors.horizontalCenter: parent.horizontalCenter
// not working for now
}
Button {
y: 652
width: 100
height: 40
text: "Back"
anchors.horizontalCenter: parent.horizontalCenter
onClicked: logicHandler.handleNavigation("Quest.qml", mainWindow)
}
}
}