Formlayout
The most easy way to create Qt form dialogs and widgets with Python
Install / Use
/learn @PierreRaybaut/FormlayoutREADME
formlayout
Python module providing the most easy way to create Qt form dialogs and widgets
<img src="https://raw.githubusercontent.com/PierreRaybaut/formlayout/master/doc/images/advanced1.png"> <img src="https://raw.githubusercontent.com/PierreRaybaut/formlayout/master/doc/images/advanced2.png"> <img src="https://raw.githubusercontent.com/PierreRaybaut/formlayout/master/doc/images/advanced3.png">With formlayout, generating a form is very easy:
- To show a dialog box, just call the
feditfunction. - To set-up the form dialog, simply use lists to pass parameters (field names, default values, ...).
- To embedd
formlayoutin your own library, just copy theformlayoutautoconsistent single script (zero dependency, except Qt itself).
See documentation for more details (mostly examples) on the library and changelog for recent history of changes.
Overview
Graphical user interface (GUI) libraries are usually designed to address issues which are far more complex than a simple dialog box. As a consequence, generating simple form layouts or dialogs is generally not as easy as it should be: the feature-line count ratio is very low for the most simple dialog boxes.
Within this context, formlayout provides the absolute minimum API required
to create form dialog boxes (or layouts). To show a dialog box, simply call
the fedit function. To set-up the dialog box, just use lists to pass the
required parameters (field names, default values, ...).
Simple Example
With formlayout, generating a form is very easy.
Here is a simple example (more are included in source package):
from formlayout import fedit
datalist = [('Name', 'Paul'),
(None, None),
(None, 'Information:'),
('Age', 30),
('Sex', [0, 'Male', 'Female']),
('Size', 12.1),
('Eyes', 'green'),
('Married', True),
]
fedit(datalist, title="Describe yourself", comment="This is just an <b>example</b>.")
<img src="https://raw.githubusercontent.com/PierreRaybaut/formlayout/master/doc/images/simple.png">
Installation
The only requirements are Python and Qt:
- Python >=2.6 or Python >=3.2
- PyQt4 >=4.4 or PyQt5 >= 5.5 or PySide
Installation from the source package is straightforward:
python setup.py install
Related Skills
node-connect
352.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
