Skip to content
Snippets Groups Projects
Commit 8c20fc2c authored by Felix Goding's avatar Felix Goding
Browse files

Add text boxes to get input from user for name/id

parent d83fd2c1
No related branches found
No related tags found
1 merge request!19Implemented a GUI framework
Pipeline #11938 passed
......@@ -42,9 +42,6 @@ class DragButton(QPushButton):
super(DragButton, self).mouseReleaseEvent(event)
def clicked():
print ("Drag button clicked")
class subwindow(QWidget):
def createWindow(self,WindowWidth,WindowHeight):
parent=None
......@@ -98,7 +95,7 @@ class MainWindow(QMainWindow):
addition_button = DragButton("Addition", self)
addition_button.move(10, 130)
addition_button.setFixedSize(70, 20)
addition_button.clicked.connect(clicked)
addition_button.clicked.connect(self.clicked)
addition_counter = 1
subtraction_button = DragButton("Subtraction", self)
......@@ -124,6 +121,9 @@ class MainWindow(QMainWindow):
def exit_app(self, checked):
QApplication.quit()
def clicked(self):
print ("Drag button clicked")
def paintEvent(self, e):
painter = QPainter(self)
......@@ -140,17 +140,31 @@ class MainWindow(QMainWindow):
self.sub_window.properties_label.setFont(QFont('SansSerif', 14, QFont.Bold))
self.sub_window.properties_label.setAlignment(Qt.AlignCenter)
name_label = QLabel(self.sub_window)
name_label.setText('Name:')
self.sub_window.name_label = QLabel(self.sub_window)
self.sub_window.name_label.setText('Name:')
self.sub_window.name_label.move(20, 40)
self.sub_window.name_line = QLineEdit(self.sub_window)
self.sub_window.name_line.setPlaceholderText("Write a name here")
self.sub_window.name_line.move(70, 40)
self.sub_window.name_line.resize(100, 20)
self.sub_window.id_label = QLabel(self.sub_window)
self.sub_window.id_label.setText('Id:')
self.sub_window.id_label.move(20, 70)
id_label = QLabel(self.sub_window)
id_label.setText('Id:')
self.sub_window.id_line = QLineEdit(self.sub_window)
self.sub_window.id_line.setPlaceholderText("Write an id here")
self.sub_window.id_line.move(70, 70)
self.sub_window.id_line.resize(100, 20)
"""
vertical_box = QVBoxLayout()
vertical_box.addWidget(name_label)
vertical_box.addWidget(self.sub_window.name_label)
vertical_box.addWidget(id_label)
self.sub_window.setLayout(vertical_box)
"""
self.sub_window.show()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment