-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef46e26
commit 9700c25
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ output/ | |
*.spec | ||
*.txt | ||
*.imtag | ||
ui/custom_input_iu.py | ||
compile.py | ||
__old_code.py | ||
test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |