Skip to content

Commit

Permalink
add custom_ui.py
Browse files Browse the repository at this point in the history
  • Loading branch information
electro199 committed Jun 8, 2024
1 parent ef46e26 commit 9700c25
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ output/
*.spec
*.txt
*.imtag
ui/custom_input_iu.py
compile.py
__old_code.py
test.py
50 changes: 50 additions & 0 deletions ui/custom_input_iu.py
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

0 comments on commit 9700c25

Please sign in to comment.