It provides a simple way to create text input dialogs.
Project description
PyQt6-Fluent-Widgets-TextInputDialog
TextInputDialog is a library for creating text input dialogs based on PyQt6-Fluent-Widgets. It provides a simple way to create text input dialogs.
Usage
from qfluentwidgets_textinputdialog import TextInputDialog
# Set the language (default is English)
TextInputDialog.setLanguage(TextInputDialog.Language.ENGLISH)
# Get the text input
text, success = TextInputDialog.getText(parent, title=..., placeholder=..., yesButton=..., noButton=..., mode=...)
Parameters
-
parent
: The parent widget. -
title
: The title of the dialog (optional, default is "Please enter"). -
placeholder
: The placeholder text for the input field (optional). -
yesButton
: The text for the confirm button (optional, default is "Confirm"). -
noButton
: The text for the cancel button (optional, default is "Cancel"). -
mode
: The input mode (optional, default is LINEEDIT, can be LINEEDIT or TEXTEDIT).
Example
from PyQt6.QtWidgets import QApplication, QMainWindow, QPushButton
from qfluentwidgets_textinputdialog import TextInputDialog
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("TextInputDialog Example")
self.setGeometry(100, 100, 500, 500)
button = QPushButton("Open Dialog", self)
button.setGeometry(100, 100, 200, 50)
button.clicked.connect(self.open_dialog)
def open_dialog(self):
text, success = TextInputDialog.getText(self, title="Please enter your name", placeholder="Enter your name", yesButton="OK", noButton="Cancel")
if success:
print("Your name is:", text)
app = QApplication([])
window = MainWindow()
window.show()
app.exec()
Version
Current version: 0.0.3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file PyQt6-Fluent-Widgets-TextInputDialog-0.0.3.tar.gz
.
File metadata
- Download URL: PyQt6-Fluent-Widgets-TextInputDialog-0.0.3.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df2886c88b60e4a60f6a40b467529dfd92b3ea936fc5839ac4c5f5c990b71365 |
|
MD5 | f4736e15d444d54ee6b71cd5112a75e3 |
|
BLAKE2b-256 | 0a3b4bb8204d472e7e0ecf8f9eeea308ecb269042fb3763328edf3bdcae0e068 |