diff --git a/.gitignore b/.gitignore index ebb1a41..cf0c3af 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ output/ *.spec *.txt *.imtag -ui/custom_input_iu.py compile.py __old_code.py test.py diff --git a/ui/custom_input_iu.py b/ui/custom_input_iu.py new file mode 100644 index 0000000..19544b5 --- /dev/null +++ b/ui/custom_input_iu.py @@ -0,0 +1,50 @@ +from PySide6.QtWidgets import ( + QApplication, + QMainWindow, + QPushButton, + QVBoxLayout, + QWidget, + QDialog, + QLabel, + QLineEdit, + QVBoxLayout, + QPushButton, +) + + +class InputDialog(QDialog): + def __init__(self): + super().__init__() + + self.setWindowTitle("Input Dialog") + + # Create layout + layout = QVBoxLayout() + + # Create label + self.label = QLabel("Enter your text:") + layout.addWidget(self.label) + + # Create text input + self.text_input = QLineEdit() + layout.addWidget(self.text_input) + + # Create button + self.button = QPushButton("OK") + layout.addWidget(self.button) + + # Connect button click signal to the slot + self.button.clicked.connect(self.on_button_clicked) + + # Set the layout + self.setLayout(layout) + + def on_button_clicked(self): + # Retrieve the text from the input + self.input_text = self.text_input.text() + + # Close the dialog + self.accept() + + def get_input_text(self): + return self.input_text