Skip to content

PrettyQt: Pythonic layer on top of PyQt6 / PySide6

Package status Package status

Features

Name Children Inherits
LogRecordModel
prettyqt.itemmodels.logrecordmodel
ActionsModel
prettyqt.itemmodels.actionsmodel
StorageInfoModel
prettyqt.itemmodels.storageinfomodel
ShortcutsModel
prettyqt.itemmodels.shortcutsmodel
ColumnTableModel
prettyqt.itemmodels.columnitemmodel
RegexMatchesModel
prettyqt.itemmodels.regexmatchesmodel
FrameInfoModel
prettyqt.itemmodels.frameinfomodel
DataClassFieldsModel
prettyqt.itemmodels.dataclassfieldsmodel
BaseFieldsModel
prettyqt.itemmodels.basefieldsmodel
DataClassModel
prettyqt.itemmodels.dataclassmodel
BaseDataclassModel
prettyqt.itemmodels.basedataclassmodel
MappingModel
prettyqt.itemmodels.mappingmodel
ModelIndexModel
prettyqt.itemmodels.modelindexmodel
QObjectPropertiesModel
prettyqt.itemmodels.qobjectpropertiesmodel
WidgetsDetailsModel
prettyqt.itemmodels.widgetsdetailsmodel
AbstractTableModel
prettyqt.core.abstracttablemodel
ImportlibTreeModel
prettyqt.itemmodels.importlibdistributionmodel
JsonModel
prettyqt.itemmodels.jsonmodel
XmlModel
prettyqt.itemmodels.xmlmodel
BaseXmlModel
prettyqt.itemmodels.xmlmodel
PythonObjectTreeModel
prettyqt.itemmodels.pythonobjecttreemodel
ColumnItemModel
prettyqt.itemmodels.columnitemmodel
AstModel
prettyqt.itemmodels.astmodel
SubClassTreeModel
prettyqt.itemmodels.classtreemodel
  • BaseClassTreeModel
ParentClassTreeModel
prettyqt.itemmodels.classtreemodel
  • BaseClassTreeModel
BaseClassTreeModel
prettyqt.itemmodels.classtreemodel
ModuleInfoModel
prettyqt.itemmodels.moduleinfomodel
TupleTreeModel
prettyqt.itemmodels.tupletreemodel
WidgetHierarchyModel
prettyqt.itemmodels.widgethierarchymodel
  • BaseHierarchyModel
LayoutHierarchyModel
prettyqt.itemmodels.widgethierarchymodel
  • BaseHierarchyModel
BaseHierarchyModel
prettyqt.itemmodels.widgethierarchymodel
MarkdownModel
prettyqt.prettyqtmarkdown.markdownmodel
ScrollAreaTocModel
prettyqt.custom_widgets.scrollareatocwidget
Name Children Inherits
FlattenTreeProxyModel
prettyqt.itemmodels.proxies.flattentreeproxymodel
MeltProxyModel
prettyqt.itemmodels.proxies.meltproxymodel
ColumnJoinerProxyModel
prettyqt.itemmodels.proxies.columnjoinerproxymodel
AbstractProxyModel
prettyqt.core.abstractproxymodel
SliceDisplayTextProxyModel
prettyqt.itemmodels.proxies.slicedisplaytextproxymodel
SliceChangeIconSizeProxyModel
prettyqt.itemmodels.proxies.slicechangeiconsizeproxymodel
SliceFilterProxyModel
prettyqt.itemmodels.proxies.slicefilterproxymodel
SliceCheckableProxyModel
prettyqt.itemmodels.proxies.slicecheckableproxymodel
SliceCheckableTreeProxyModel
prettyqt.itemmodels.proxies.slicecheckableproxymodel
SliceAppearanceProxyModel
prettyqt.itemmodels.proxies.sliceappearanceproxymodel
SliceChangeFlagsProxyModel
prettyqt.itemmodels.proxies.slicechangeflagsproxymodel
SliceColorValuesProxyModel
prettyqt.itemmodels.proxies.slicecolorvaluesproxymodel
SliceColorCategoriesProxyModel
prettyqt.itemmodels.proxies.slicecolorcategoriesproxymodel
SliceValueTransformationProxyModel
prettyqt.itemmodels.proxies.slicevaluetransformationproxymodel
SliceHighlightCurrentProxyModel
prettyqt.itemmodels.proxies.slicehighlightcurrentproxymodel
SliceMapRoleProxyModel
prettyqt.itemmodels.proxies.slicemaproleproxymodel
SliceToMarkdownProxyModel
prettyqt.itemmodels.proxies.slicetomarkdownproxymodel
SliceIdentityProxyModel
prettyqt.itemmodels.proxies.sliceidentityproxymodel
TableToListProxyModel
prettyqt.itemmodels.proxies.tabletolistproxymodel
ColumnOrderProxyModel
prettyqt.itemmodels.proxies.columnorderproxymodel
AppearanceProxyModel
prettyqt.itemmodels.proxies.appearanceproxymodel
ChangeHeadersProxyModel
prettyqt.itemmodels.proxies.changeheadersproxymodel
HighlightMouseProxyModel
prettyqt.itemmodels.proxies.highlightmouseproxymodel
IdentityProxyModel
prettyqt.core.identityproxymodel
FuzzyFilterProxyModel
prettyqt.itemmodels.proxies.fuzzyfilterproxymodel
MultiColumnFilterProxyModel
prettyqt.itemmodels.proxies.multicolumnfilterproxymodel
SubsetFilterProxyModel
prettyqt.itemmodels.proxies.subsetfilterproxymodel
ValueFilterProxyModel
prettyqt.itemmodels.proxies.valuefilterproxymodel
RangeFilterProxyModel
prettyqt.itemmodels.proxies.rangefilterproxymodel
PredicateFilterProxyModel
prettyqt.itemmodels.proxies.predicatefilterproxymodel
SortFilterProxyModel
prettyqt.core.sortfilterproxymodel
TransposeProxyModel
prettyqt.core.transposeproxymodel
Name Children Inherits
AlphaNumericValidator
prettyqt.validators.alphanumericvalidator
BlacklistValidator
prettyqt.validators.blacklistvalidator
ColorValidator
prettyqt.validators.colorvalidator
CompositeValidator
prettyqt.validators.compositevalidator
FunctionValidator
prettyqt.validators.functionvalidator
HexValidator
prettyqt.validators.hexvalidator
IntegerValidator
prettyqt.validators.integervalidator
JsonValidator
prettyqt.validators.jsonvalidator
MonotonicListValidator
prettyqt.validators.monotoniclistvalidator
NotStrictValidator
prettyqt.validators.notstrictvalidator
PathValidator
prettyqt.validators.pathvalidator
PythonCodeValidator
prettyqt.validators.pythoncodevalidator
QssValidator
prettyqt.validators.qssvalidator
RegexPatternValidator
prettyqt.validators.regexpatternvalidator
BaseRegexValidator
prettyqt.validators.regexvalidators
BaseScientificValidator
prettyqt.validators.scientificvalidators
TextLengthValidator
prettyqt.validators.textlengthvalidator
WhitelistValidator
prettyqt.validators.whitelistvalidator
Name Children Inherits
ButtonDelegate
prettyqt.itemdelegates.buttondelegate
HtmlItemDelegate
prettyqt.itemdelegates.htmlitemdelegate
  • BaseMarkupDelegate
MarkdownItemDelegate
prettyqt.itemdelegates.htmlitemdelegate
  • BaseMarkupDelegate
BaseMarkupDelegate
prettyqt.itemdelegates.htmlitemdelegate
IconDelegate
prettyqt.itemdelegates.icondelegate
NoFocusDelegate
prettyqt.itemdelegates.nofocusdelegate
ProgressBarDelegate
prettyqt.itemdelegates.progressbardelegate
RadioDelegate
prettyqt.itemdelegates.radiodelegate
RenderLinkDelegate
prettyqt.itemdelegates.renderlinkdelegate
StarDelegate
prettyqt.itemdelegates.stardelegate
EditorDelegate
prettyqt.itemdelegates.editordelegate
WidgetDelegate
prettyqt.itemdelegates.widgetdelegate
SizeHintDelegate
prettyqt.custom_widgets.multicombobox

PrettyQt basically is a wrapper for the whole Qt API (either on top of PySide6 or PyQt6 bindings). Perhaps it can be seen as a small Python equivalent of the KDE framework.

Main objective is to make Qt feel "pythonic". Qt is originally a C++ Framework, and using it can be quite cumbersome for Python developers. (very restrictive when it comes to types, very OOP-centric, lot of enum use, snakeCase naming etc.)

PrettyQt aims to improve this by:

  • adding more powerful methods to the classes, which accept more types and have more options (in form of keyword arguments)
  • doing type conversions for method parameters to lessen the strictness for types.
  • raising Exceptions or returning None instead of returning *1 or invalid objects.
  • all enum getters/setters also work with strings. Everything typed with Literals for an excellent IDE experience. (Example: )
  • adding a lot of __dunder__ methods to the classes to make them behave like good python citizens.

Read more about the general API design.

Where to get it

pip

The latest released version is available at the Python package index.

pip install prettyqt