Skip to main content

It provides a simple way to create text input dialogs.

Project description

PySide6-Fluent-Widgets-TextInputDialog

TextInputDialog is a library for creating text input dialogs based on PySide6-Fluent-Widgets. It provides a simple way to create text input dialogs.

Usage

from qfluentwidgets_textinputdialog import TextInputDialog



# Create a text input dialog

dialog = TextInputDialog(parent)



# 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 PySide6.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.2

Project details


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 PySide6-Fluent-Widgets-TextInputDialog-0.0.2.tar.gz.

File metadata

File hashes

Hashes for PySide6-Fluent-Widgets-TextInputDialog-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3613712cdc0325550cb7f50b179b54d14df85499a2b2e4c8564742c1b9858dd0
MD5 e8b7fabe62742d38834e997f5f5e5d14
BLAKE2b-256 f4141e23d07b1228bc46f0afd6791da920dae00dcf3fd783de4fdb3722eae8ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page