Skip to content

PrettyQt: Pythonic layer on top of PyQt6 / PySide6

PyPI Latest Version Package status Package status

Features

Name Children Inherits
LogRecordModel
prettyqt.itemmodels.logrecordmodel
Model to display a list of logging.LogRecords.
    ActionsModel
    prettyqt.itemmodels.actionsmodel
    Table model to display a list of QActions.
      StorageInfoModel
      prettyqt.itemmodels.storageinfomodel
      Model to display a list of core.QStorageInfos.
        ShortcutsModel
        prettyqt.itemmodels.shortcutsmodel
        Model to display a list of gui.QShortcuts.
          ColumnTableModel
          prettyqt.itemmodels.columnitemmodel
          List-based table model with columns defined by ColumnItem classes.
          RegexMatchesModel
          prettyqt.itemmodels.regexmatchesmodel
          Model to display a list of re.Matches.
            FrameInfoModel
            prettyqt.itemmodels.frameinfomodel
            Model to display a list of inspect.Frameinfos / inspect.Tracebacks.
              DataClassFieldsModel
              prettyqt.itemmodels.dataclassfieldsmodel
              Table model to display the fields and their metadata of an dataclass.
                BaseFieldsModel
                prettyqt.itemmodels.basefieldsmodel
                Base table model showing the fields of a single dataclass-like instance.
                DataClassModel
                prettyqt.itemmodels.dataclassmodel
                Table model to display a list of dataclasses.
                  BaseDataclassModel
                  prettyqt.itemmodels.basedataclassmodel
                  Base table model for a list of dataclass-like instances.
                  MappingModel
                  prettyqt.itemmodels.mappingmodel
                  Table model for a list of mappings. Columns are the keys of the first mapping.
                    ModelIndexModel
                    prettyqt.itemmodels.modelindexmodel
                    Table model for displaying a the data of a list of ModelIndexes.
                      QObjectPropertiesModel
                      prettyqt.itemmodels.qobjectpropertiesmodel
                        WidgetsDetailsModel
                        prettyqt.itemmodels.widgetsdetailsmodel
                          AbstractTableModel
                          prettyqt.core.abstracttablemodel
                          Abstract model that can be subclassed to create table models.
                          ImportlibTreeModel
                          prettyqt.itemmodels.importlibdistributionmodel
                          Model showing the dependency tree of a distribution.
                            JsonModel
                            prettyqt.itemmodels.jsonmodel
                              XmlModel
                              prettyqt.itemmodels.xmlmodel
                              Xml model for the builtin ElementTree. Child items are created lazily.
                                BaseXmlModel
                                prettyqt.itemmodels.xmlmodel
                                PythonObjectTreeModel
                                prettyqt.itemmodels.pythonobjecttreemodel
                                  ColumnItemModel
                                  prettyqt.itemmodels.columnitemmodel
                                  TreeModel with columns defined by ColumnItem classes.
                                  AstModel
                                  prettyqt.itemmodels.astmodel
                                  Tree model to display an Abstract syntax tree.
                                    SubClassTreeModel
                                    prettyqt.itemmodels.classtreemodel
                                    Model to display the subclass tree of a python class.
                                      • BaseClassTreeModel
                                      ParentClassTreeModel
                                      prettyqt.itemmodels.classtreemodel
                                      Tree model to display the parent class tree of a python class.
                                        • BaseClassTreeModel
                                        BaseClassTreeModel
                                        prettyqt.itemmodels.classtreemodel
                                        Base Tree Model to display class tree structures.
                                        ModuleInfoModel
                                        prettyqt.itemmodels.moduleinfomodel
                                        Tree Model to display a module hierarchy (using pkgutil).
                                          TupleTreeModel
                                          prettyqt.itemmodels.tupletreemodel
                                          Base Tree Model to display a dict[tuple[Any], str] data structure.
                                            WidgetHierarchyModel
                                            prettyqt.itemmodels.widgethierarchymodel
                                            Tree model showing the child tree of a QObject.
                                              • BaseHierarchyModel
                                              LayoutHierarchyModel
                                              prettyqt.itemmodels.widgethierarchymodel
                                              Tree model showing the layout hierarchy of widgets.
                                                • BaseHierarchyModel
                                                BaseHierarchyModel
                                                prettyqt.itemmodels.widgethierarchymodel
                                                ScrollAreaTocModel
                                                prettyqt.custom_widgets.scrollareatocwidget
                                                  MkNodesModel
                                                  prettyqt.prettyqtmarkdown.markdownmodel
                                                  An ItemModel for displaying a mknodes tree.
                                                    Name Children Inherits
                                                    TableToListProxyModel
                                                    prettyqt.itemmodels.proxies.tabletolistproxymodel
                                                    Proxy model to flatten a table to a list.
                                                      • FlatProxyModel
                                                      MeltProxyModel
                                                      prettyqt.itemmodels.proxies.meltproxymodel
                                                      Proxy model to unpivot a table from wide format to long format.
                                                        • FlatProxyModel
                                                        UnmeltProxyModel
                                                        prettyqt.itemmodels.proxies.unmeltproxymodel
                                                        Proxy model to pivot a table from long format to wide format.
                                                          • FlatProxyModel
                                                          FlatProxyModel
                                                          prettyqt.itemmodels.proxies.flatproxymodel
                                                          Base class for proxies which reshape a source table into another flat table.
                                                          FlattenTreeProxyModel
                                                          prettyqt.itemmodels.proxies.flattentreeproxymodel
                                                          Proxy model to flatten a tree to appear like a table.
                                                            AbstractProxyModel
                                                            prettyqt.core.abstractproxymodel
                                                            Base class for proxy item models that can do sorting, filtering and processing.
                                                            SliceDisplayTextProxyModel
                                                            prettyqt.itemmodels.proxies.slicedisplaytextproxymodel
                                                            Proxy model to convert and format non-str values for the DisplayRole.
                                                              SliceChangeIconSizeProxyModel
                                                              prettyqt.itemmodels.proxies.slicechangeiconsizeproxymodel
                                                              Proxy model which changes the icon size of the Decoration role.
                                                                SliceFilterProxyModel
                                                                prettyqt.itemmodels.proxies.slicefilterproxymodel
                                                                Proxy model to filter an item view based on python slicing syntax.
                                                                  SliceCheckableProxyModel
                                                                  prettyqt.itemmodels.proxies.slicecheckableproxymodel
                                                                  Proxy model to make a model checkable.
                                                                    SliceCheckableTreeProxyModel
                                                                    prettyqt.itemmodels.proxies.slicecheckableproxymodel
                                                                    Proxy model to make a tree model checkable.
                                                                      SliceAppearanceProxyModel
                                                                      prettyqt.itemmodels.proxies.sliceappearanceproxymodel
                                                                        SliceChangeFlagsProxyModel
                                                                        prettyqt.itemmodels.proxies.slicechangeflagsproxymodel
                                                                        Proxy model to selectively change the ItemFlags of the source model.
                                                                          SliceColorValuesProxyModel
                                                                          prettyqt.itemmodels.proxies.slicecolorvaluesproxymodel
                                                                          Model to color cells of a numerical table based on their value.
                                                                            SliceColorCategoriesProxyModel
                                                                            prettyqt.itemmodels.proxies.slicecolorcategoriesproxymodel
                                                                            Proxy model to apply coloring to categories.
                                                                              SliceValueTransformationProxyModel
                                                                              prettyqt.itemmodels.proxies.slicevaluetransformationproxymodel
                                                                              A proxy model which transforms cell contents based on a Callable.
                                                                                SliceHighlightCurrentProxyModel
                                                                                prettyqt.itemmodels.proxies.slicehighlightcurrentproxymodel
                                                                                Proxy model which highlights all cells with same data as current index.
                                                                                  SliceMapRoleProxyModel
                                                                                  prettyqt.itemmodels.proxies.slicemaproleproxymodel
                                                                                  Proxy model for mapping one role to another.
                                                                                    SliceToMarkdownProxyModel
                                                                                    prettyqt.itemmodels.proxies.slicetomarkdownproxymodel
                                                                                    Proxy model which transforms cell contents to markdown.
                                                                                      SliceIdentityProxyModel
                                                                                      prettyqt.itemmodels.proxies.sliceidentityproxymodel
                                                                                      Base model for slice proxy models.
                                                                                      ColumnOrderProxyModel
                                                                                      prettyqt.itemmodels.proxies.columnorderproxymodel
                                                                                      Proxy model which reorders the columns of the source model.
                                                                                        AppearanceProxyModel
                                                                                        prettyqt.itemmodels.proxies.appearanceproxymodel
                                                                                        Proxy model for changing the "style roles" of the source model.
                                                                                          ChangeHeadersProxyModel
                                                                                          prettyqt.itemmodels.proxies.changeheadersproxymodel
                                                                                          Proxy model for changing the header data (either horizontal or vertical).
                                                                                            ColumnJoinerProxyModel
                                                                                            prettyqt.itemmodels.proxies.columnjoinerproxymodel
                                                                                            Proxy model which joins the contents of several columns.
                                                                                              HighlightMouseProxyModel
                                                                                              prettyqt.itemmodels.proxies.highlightmouseproxymodel
                                                                                              Proxy model which highlights all cells with same row / column as mouse position.
                                                                                                IdentityProxyModel
                                                                                                prettyqt.core.identityproxymodel
                                                                                                Proxies its source model unmodified.
                                                                                                FuzzyFilterProxyModel
                                                                                                prettyqt.itemmodels.proxies.fuzzyfilterproxymodel
                                                                                                A FilterProxyModel which sorts the results based on a matching score.
                                                                                                  MultiColumnFilterProxyModel
                                                                                                  prettyqt.itemmodels.proxies.multicolumnfilterproxymodel
                                                                                                  A SortFilterProxyModel which filters based on multiple columns in one go.
                                                                                                    SubsetFilterProxyModel
                                                                                                    prettyqt.itemmodels.proxies.subsetfilterproxymodel
                                                                                                    A FilterProxyModel to filter based on slices, ranges, indexes or Callables.
                                                                                                      ValueFilterProxyModel
                                                                                                      prettyqt.itemmodels.proxies.valuefilterproxymodel
                                                                                                      Proxy model for filtering based on non-str values.
                                                                                                        RangeFilterProxyModel
                                                                                                        prettyqt.itemmodels.proxies.rangefilterproxymodel
                                                                                                          PredicateFilterProxyModel
                                                                                                          prettyqt.itemmodels.proxies.predicatefilterproxymodel
                                                                                                          A simple filter proxy model with settable filter predicates.
                                                                                                            SubsequenceProxyModel
                                                                                                            prettyqt.custom_widgets.subsequencecompleter
                                                                                                            Accepts rows whose text contains the search term's characters in order.
                                                                                                              SortFilterProxyModel
                                                                                                              prettyqt.core.sortfilterproxymodel
                                                                                                              Support for sorting and filtering data passed between another model and a view.
                                                                                                              TransposeProxyModel
                                                                                                              prettyqt.core.transposeproxymodel
                                                                                                              This proxy transposes the source model.
                                                                                                                Name Children Inherits
                                                                                                                AlphaNumericValidator
                                                                                                                prettyqt.validators.alphanumericvalidator
                                                                                                                Validator which checks whether only alphanumeric characters are included.
                                                                                                                  BlacklistValidator
                                                                                                                  prettyqt.validators.blacklistvalidator
                                                                                                                  Validator which excludes a fixed list of strings.
                                                                                                                  ColorValidator
                                                                                                                  prettyqt.validators.colorvalidator
                                                                                                                  Validator which checks for strings representing a color.
                                                                                                                    CompositeValidator
                                                                                                                    prettyqt.validators.compositevalidator
                                                                                                                    BaseClass for combined validators.
                                                                                                                    FunctionValidator
                                                                                                                    prettyqt.validators.functionvalidator
                                                                                                                    Validator which checks based on a given Callable.
                                                                                                                      HexValidator
                                                                                                                      prettyqt.validators.hexvalidator
                                                                                                                      Validator which checks for hexadecimal values.
                                                                                                                        IntegerValidator
                                                                                                                        prettyqt.validators.integervalidator
                                                                                                                        Validator to check for integer values.
                                                                                                                          JsonValidator
                                                                                                                          prettyqt.validators.jsonvalidator
                                                                                                                          Validator which checks for strings which can be parsed as JSON.
                                                                                                                            MonotonicListValidator
                                                                                                                            prettyqt.validators.monotoniclistvalidator
                                                                                                                            Validator which checks whether given string contains a monotonic list.
                                                                                                                              NotStrictValidator
                                                                                                                              prettyqt.validators.notstrictvalidator
                                                                                                                              Validator which turns Invalid state into Intermediate state.
                                                                                                                                PathValidator
                                                                                                                                prettyqt.validators.pathvalidator
                                                                                                                                Validator which checks whether given string is a valid path.
                                                                                                                                  PythonCodeValidator
                                                                                                                                  prettyqt.validators.pythoncodevalidator
                                                                                                                                  Validator which checks whether given string is valid Python code.
                                                                                                                                    QssValidator
                                                                                                                                    prettyqt.validators.qssvalidator
                                                                                                                                    Validator which checks whether given string is a parseable css string.
                                                                                                                                      RegexPatternValidator
                                                                                                                                      prettyqt.validators.regexpatternvalidator
                                                                                                                                      Validator which checks whether given string is a parseable regex pattern.
                                                                                                                                        BaseRegexValidator
                                                                                                                                        prettyqt.validators.regexvalidators
                                                                                                                                        BaseScientificValidator
                                                                                                                                        prettyqt.validators.scientificvalidators
                                                                                                                                        TextLengthValidator
                                                                                                                                        prettyqt.validators.textlengthvalidator
                                                                                                                                        Validator which checks whether given text has a specific length.
                                                                                                                                          WhitelistValidator
                                                                                                                                          prettyqt.validators.whitelistvalidator
                                                                                                                                          Validator which allows a fixed list of strings.
                                                                                                                                          Name Children Inherits
                                                                                                                                          ButtonDelegate
                                                                                                                                          prettyqt.itemdelegates.buttondelegate
                                                                                                                                          Delegate to show a button inside a table cell.
                                                                                                                                            HtmlItemDelegate
                                                                                                                                            prettyqt.itemdelegates.htmlitemdelegate
                                                                                                                                            Delegate do display HTML text.
                                                                                                                                              • BaseMarkupDelegate
                                                                                                                                              MarkdownItemDelegate
                                                                                                                                              prettyqt.itemdelegates.htmlitemdelegate
                                                                                                                                              Delegate do display Markdown text.
                                                                                                                                                • BaseMarkupDelegate
                                                                                                                                                BaseMarkupDelegate
                                                                                                                                                prettyqt.itemdelegates.htmlitemdelegate
                                                                                                                                                IconDelegate
                                                                                                                                                prettyqt.itemdelegates.icondelegate
                                                                                                                                                Delegate to paint QIcons, QPixmaps, QColors and QImages.
                                                                                                                                                  NoFocusDelegate
                                                                                                                                                  prettyqt.itemdelegates.nofocusdelegate
                                                                                                                                                  Delegate to remove dotted border on cell focus.
                                                                                                                                                    ProgressBarDelegate
                                                                                                                                                    prettyqt.itemdelegates.progressbardelegate
                                                                                                                                                    Delegate to show a value in form of a progress bar.
                                                                                                                                                      RadioDelegate
                                                                                                                                                      prettyqt.itemdelegates.radiodelegate
                                                                                                                                                        RenderLinkDelegate
                                                                                                                                                        prettyqt.itemdelegates.renderlinkdelegate
                                                                                                                                                          StarDelegate
                                                                                                                                                          prettyqt.itemdelegates.stardelegate
                                                                                                                                                          A delegate class that allows us to render our star ratings.
                                                                                                                                                            EditorDelegate
                                                                                                                                                            prettyqt.itemdelegates.editordelegate
                                                                                                                                                            Delegate which supports editing a large range of data types.
                                                                                                                                                              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