widgets
Class info
Classes
| Name | Children | Inherits |
|---|---|---|
| AbstractButton prettyqt.widgets.abstractbutton |
||
| AbstractButtonMixin prettyqt.widgets.abstractbutton Abstract button widget base class, providing functionality common to buttons. |
||
| AbstractGraphicsShapeItem prettyqt.widgets.abstractgraphicsshapeitem Common base for all path items. |
||
| AbstractGraphicsShapeItemMixin prettyqt.widgets.abstractgraphicsshapeitem |
||
| AbstractItemDelegate prettyqt.widgets.abstractitemdelegate Used to display and edit data items from a model. |
||
| AbstractItemDelegateMixin prettyqt.widgets.abstractitemdelegate |
||
| AbstractItemView prettyqt.widgets.abstractitemview The basic functionality for item view classes. |
||
| AbstractItemViewMixin prettyqt.widgets.abstractitemview |
||
| AbstractScrollArea prettyqt.widgets.abstractscrollarea Scrolling area with on-demand scroll bars. |
||
| AbstractScrollAreaMixin prettyqt.widgets.abstractscrollarea |
||
| AbstractSlider prettyqt.widgets.abstractslider Integer value within a range. |
||
| AbstractSliderMixin prettyqt.widgets.abstractslider |
|
|
| AbstractSpinBox prettyqt.widgets.abstractspinbox Spinbox and a line edit to display values. |
||
| AbstractSpinBoxMixin prettyqt.widgets.abstractspinbox |
||
| Application prettyqt.widgets.application Manages the GUI application's control flow and main settings. |
|
|
| BoxLayout prettyqt.widgets.boxlayout Lines up child widgets horizontally or vertically. |
|
|
| ButtonGroup prettyqt.widgets.buttongroup Container to organize groups of button widgets. |
||
| CalendarWidget prettyqt.widgets.calendarwidget Monthly based calendar widget allowing the user to select a date. |
||
| CheckBox prettyqt.widgets.checkbox Checkbox with a text label. |
||
| ColorDialog prettyqt.widgets.colordialog Dialog widget for specifying colors. |
||
| ColumnView prettyqt.widgets.columnview Model/view implementation of a column view. |
||
| ComboBox prettyqt.widgets.combobox Combined button and popup list. |
|
|
| ComboBoxMixin prettyqt.widgets.combobox Combobox that lets the user select a font family. |
||
| CommandLinkButton prettyqt.widgets.commandlinkbutton Vista style command link button. |
||
| CommonStyle prettyqt.widgets.commonstyle Encapsulates the common Look and Feel of a GUI. |
||
| CommonStyleMixin prettyqt.widgets.commonstyle |
||
| Completer prettyqt.widgets.completer Completions based on an item model. |
||
| DataWidgetMapper prettyqt.widgets.datawidgetmapper Mapping between a section of a data model to widgets. |
||
| DateEdit prettyqt.widgets.dateedit Widget for editing dates based on the QDateTimeEdit widget. |
||
| DateTimeEdit prettyqt.widgets.datetimeedit |
||
| DateTimeEditMixin prettyqt.widgets.datetimeedit Widget for editing dates and times. |
||
| Dial prettyqt.widgets.dial Rounded range control (like a speedometer or potentiometer). |
||
| Dialog prettyqt.widgets.dialog The base class of dialog windows. |
|
|
| DialogButtonBox prettyqt.widgets.dialogbuttonbox Widget presenting buttons in a layout that is appropriate to the widget style. |
||
| DialogMixin prettyqt.widgets.dialog |
||
| DockWidget prettyqt.widgets.dockwidget Widget that can be docked inside a QMainWindow . |
||
| DoubleSpinBox prettyqt.widgets.doublespinbox Spin box widget that takes doubles. |
||
| ErrorMessage prettyqt.widgets.errormessage Error message display dialog. |
||
| FileDialog prettyqt.widgets.filedialog Dialog that allow users to select files or directories. |
||
| FileIconProvider prettyqt.widgets.fileiconprovider File icons for the QFileSystemModel class. |
||
| FileSystemModel prettyqt.widgets.filesystemmodel |
|
|
| FocusFrame prettyqt.widgets.focusframe Focus frame which can be outside of a widget's normal paintable area. |
||
| FontComboBox prettyqt.widgets.fontcombobox Combobox that lets the user select a font family. |
||
| FontDialog prettyqt.widgets.fontdialog Dialog widget for selecting a font. |
||
| FormLayout prettyqt.widgets.formlayout Manages forms of input widgets and their associated labels. |
||
| Frame prettyqt.widgets.frame The base class of widgets that can have a frame. |
||
| FrameMixin prettyqt.widgets.frame |
||
| Gesture prettyqt.widgets.gesture A gesture, containing properties that describe the corresponding user input. |
||
| GestureMixin prettyqt.widgets.gesture |
|
|
| GestureRecognizer prettyqt.widgets.gesturerecognizer Provides the infrastructure for gesture recognition. |
||
| GestureRecognizerMixin prettyqt.widgets.gesturerecognizer |
||
| GraphicsAnchor prettyqt.widgets.graphicsanchor Represents an anchor between two items in a QGraphicsAnchorLayout. |
||
| GraphicsAnchorLayout prettyqt.widgets.graphicsanchorlayout |
||
| GraphicsBlurEffect prettyqt.widgets.graphicsblureffect |
||
| GraphicsColorizeEffect prettyqt.widgets.graphicscolorizeeffect |
||
| GraphicsDropShadowEffect prettyqt.widgets.graphicsdropshadoweffect |
||
| GraphicsEffect prettyqt.widgets.graphicseffect The base class for all graphics effects. |
||
| GraphicsEffectMixin prettyqt.widgets.graphicseffect |
||
| GraphicsEllipseItem prettyqt.widgets.graphicsellipseitem Ellipse item that you can add to a QGraphicsScene. |
||
| GraphicsGridLayout prettyqt.widgets.graphicsgridlayout Grid layout for managing widgets in Graphics View. |
||
| GraphicsItem prettyqt.widgets.graphicsitem The base class for all graphical items in a QGraphicsScene. |
||
| GraphicsItemGroup prettyqt.widgets.graphicsitemgroup Container that treats a group of items as a single item. |
||
| GraphicsItemMixin prettyqt.widgets.graphicsitem |
||
| GraphicsLayout prettyqt.widgets.graphicslayout The base class for all layouts in Graphics View. |
||
| GraphicsLayoutItem prettyqt.widgets.graphicslayoutitem Can be inherited to allow your custom items to be managed by layouts. |
||
| GraphicsLayoutItemMixin prettyqt.widgets.graphicslayoutitem |
||
| GraphicsLayoutMixin prettyqt.widgets.graphicslayout |
||
| GraphicsLineItem prettyqt.widgets.graphicslineitem Line item that you can add to a QGraphicsScene. |
||
| GraphicsLinearLayout prettyqt.widgets.graphicslinearlayout Horizontal or vertical layout for managing widgets in Graphics View. |
||
| GraphicsObject prettyqt.widgets.graphicsobject Base class for all graphics items that require signals, slots and properties. |
||
| GraphicsObjectMixin prettyqt.widgets.graphicsobject |
||
| GraphicsOpacityEffect prettyqt.widgets.graphicsopacityeffect |
||
| GraphicsPathItem prettyqt.widgets.graphicspathitem Path item that you can add to a QGraphicsScene. |
||
| GraphicsPixmapItem prettyqt.widgets.graphicspixmapitem Pixmap item that you can add to a QGraphicsScene. |
||
| GraphicsPolygonItem prettyqt.widgets.graphicspolygonitem Polygon item that you can add to a QGraphicsScene. |
||
| GraphicsProxyWidget prettyqt.widgets.graphicsproxywidget Proxy layer for embedding a QWidget in a QGraphicsScene. |
||
| GraphicsRectItem prettyqt.widgets.graphicsrectitem Rectangle item that you can add to a QGraphicsScene. |
||
| GraphicsRotation prettyqt.widgets.graphicsrotation Rotation transformation around a given axis. |
||
| GraphicsScale prettyqt.widgets.graphicsscale |
||
| GraphicsScene prettyqt.widgets.graphicsscene Surface for managing a large number of 2D graphical items. |
||
| GraphicsSimpleTextItem prettyqt.widgets.graphicssimpletextitem Simple text path item that you can add to a QGraphicsScene. |
||
| GraphicsTextItem prettyqt.widgets.graphicstextitem Text item that you can add to a QGraphicsScene to display formatted text. |
||
| GraphicsTransform prettyqt.widgets.graphicstransform Abstract base class for building advanced transformations on QGraphicsItems. |
||
| GraphicsTransformMixin prettyqt.widgets.graphicstransform |
||
| GraphicsView prettyqt.widgets.graphicsview Widget for displaying the contents of a QGraphicsScene. |
||
| GraphicsViewMixin prettyqt.widgets.graphicsview |
||
| GraphicsWidget prettyqt.widgets.graphicswidget The base class for all widget items in a QGraphicsScene. |
||
| GraphicsWidgetMixin prettyqt.widgets.graphicswidget |
||
| GridLayout prettyqt.widgets.gridlayout Lays out widgets in a grid. |
||
| GroupBox prettyqt.widgets.groupbox Group box frame with a title. |
||
| HBoxLayout prettyqt.widgets.hboxlayout Lines up widgets horizontally. |
|
|
| HeaderView prettyqt.widgets.headerview Header row or header column for item views. |
|
|
| InputDialog prettyqt.widgets.inputdialog Simple convenience dialog to get a single value from the user. |
||
| ItemDelegate prettyqt.widgets.itemdelegate Display and editing facilities for data items from a model. |
||
| ItemEditorCreatorBase prettyqt.widgets.itemeditorcreatorbase Abstract base class for implementing new item editor creators. |
||
| ItemEditorFactory prettyqt.widgets.itemeditorfactory Widgets for editing item data in views and delegates. |
||
| KeySequenceEdit prettyqt.widgets.keysequenceedit Allows to input a QKeySequence. |
||
| LCDNumber prettyqt.widgets.lcdnumber Displays a number with LCD-like digits. |
||
| Label prettyqt.widgets.label Text or image display. |
|
|
| Layout prettyqt.widgets.layout The base class of geometry managers. |
||
| LayoutItem prettyqt.widgets.layoutitem Abstract item that a QLayout manipulates. |
||
| LayoutItemMixin prettyqt.widgets.layoutitem |
||
| LayoutMixin prettyqt.widgets.layout |
|
|
| LineEdit prettyqt.widgets.lineedit One-line text editor. |
||
| ListView prettyqt.widgets.listview List or icon view onto a model. |
||
| ListViewMixin prettyqt.widgets.listview |
||
| ListWidget prettyqt.widgets.listwidget Item-based list widget. |
|
|
| ListWidgetItem prettyqt.widgets.listwidgetitem Item for use with the QListWidget item view class. |
|
|
| MainWindow prettyqt.widgets.mainwindow Main application window. |
||
| MdiArea prettyqt.widgets.mdiarea Area in which MDI windows are displayed. |
||
| MdiSubWindow prettyqt.widgets.mdisubwindow Subwindow class for QMdiArea. |
||
| Menu prettyqt.widgets.menu Menu widget for use in menu bars, context menus, and other popup menus. |
|
|
| MenuBar prettyqt.widgets.menubar Horizontal menu bar. |
||
| MessageBox prettyqt.widgets.messagebox Modal dialog for informing the user (and for receiving an answer). |
||
| PanGesture prettyqt.widgets.pangesture Describes a panning gesture made by the user. |
||
| PinchGesture prettyqt.widgets.pinchgesture Describes a pinch gesture made by the user. |
||
| PlainTextDocumentLayout prettyqt.widgets.plaintextdocumentlayout Implements a plain text layout for QTextDocument. |
||
| PlainTextEdit prettyqt.widgets.plaintextedit Widget that is used to edit and display plain text. |
||
| PlainTextEditMixin prettyqt.widgets.plaintextedit |
||
| ProgressBar prettyqt.widgets.progressbar Horizontal or vertical progress bar. |
||
| ProgressDialog prettyqt.widgets.progressdialog Feedback on the progress of a slow operation. |
||
| ProxyStyle prettyqt.widgets.proxystyle Convenience class that simplifies dynamically overriding QStyle elements. |
|
|
| PushButton prettyqt.widgets.pushbutton Command button. |
||
| PushButtonMixin prettyqt.widgets.pushbutton |
||
| RadioButton prettyqt.widgets.radiobutton Radio button with a text label. |
||
| RhiWidget prettyqt.widgets.rhiwidget Widget for rendering 3D graphics via the Qt Rendering Hardware Interface. |
||
| RhiWidgetMixin prettyqt.widgets.rhiwidget |
||
| RubberBand prettyqt.widgets.rubberband Rectangle or line that can indicate a selection or a boundary. |
|
|
| ScrollArea prettyqt.widgets.scrollarea Scrolling view onto another widget. |
||
| ScrollBar prettyqt.widgets.scrollbar Vertical or horizontal scroll bar. |
|
|
| Scroller prettyqt.widgets.scroller Enables kinetic scrolling for any scrolling widget or graphics item. |
||
| ScrollerProperties prettyqt.widgets.scrollerproperties Stores the settings for a QScroller. |
||
| SizeGrip prettyqt.widgets.sizegrip Resize handle for resizing top-level windows. |
||
| SizePolicy prettyqt.widgets.sizepolicy Layout attribute describing horizontal and vertical resizing policy. |
||
| Slider prettyqt.widgets.slider Vertical or horizontal slider. |
||
| SpacerItem prettyqt.widgets.spaceritem Blank space in a layout. |
||
| SpinBox prettyqt.widgets.spinbox |
||
| SplashScreen prettyqt.widgets.splashscreen Splash screen that can be shown during application startup. |
|
|
| Splitter prettyqt.widgets.splitter Implements a splitter widget. |
|
|
| SplitterHandle prettyqt.widgets.splitterhandle Handle functionality for the splitter. |
||
| StackedLayout prettyqt.widgets.stackedlayout Layout containing stack of widgets where only one widget is visible at a time. |
||
| StackedWidget prettyqt.widgets.stackedwidget Widget containing stack of widgets where only one widget is visible at a time. |
||
| StatusBar prettyqt.widgets.statusbar Horizontal bar suitable for presenting status information. |
||
| Style prettyqt.widgets.style Abstract base class that encapsulates the look and feel of a GUI. |
||
| StyleFactory prettyqt.widgets.stylefactory |
||
| StyleMixin prettyqt.widgets.style |
||
| StyleOption prettyqt.widgets.styleoption |
||
| StyleOptionButton prettyqt.widgets.styleoptionbutton |
||
| StyleOptionComboBox prettyqt.widgets.styleoptioncombobox |
||
| StyleOptionComplex prettyqt.widgets.styleoptioncomplex |
||
| StyleOptionComplexMixin prettyqt.widgets.styleoptioncomplex |
||
| StyleOptionDockWidget prettyqt.widgets.styleoptiondockwidget |
||
| StyleOptionFocusRect prettyqt.widgets.styleoptionfocusrect |
||
| StyleOptionFrame prettyqt.widgets.styleoptionframe |
||
| StyleOptionGraphicsItem prettyqt.widgets.styleoptiongraphicsitem |
||
| StyleOptionGroupBox prettyqt.widgets.styleoptiongroupbox |
||
| StyleOptionHeader prettyqt.widgets.styleoptionheader |
||
| StyleOptionHeaderMixin prettyqt.widgets.styleoptionheader |
||
| StyleOptionHeaderV2 prettyqt.widgets.styleoptionheaderv2 Describes the parameters for drawing a header (v2). |
||
| StyleOptionMenuItem prettyqt.widgets.styleoptionmenuitem |
||
| StyleOptionMenuItemMixin prettyqt.widgets.styleoptionmenuitem |
||
| StyleOptionMenuItemV2 prettyqt.widgets.styleoptionmenuitemv2 Describes the parameters for drawing a menu item (v2). |
||
| StyleOptionMixin prettyqt.widgets.styleoption |
||
| StyleOptionProgressBar prettyqt.widgets.styleoptionprogressbar |
||
| StyleOptionRubberBand prettyqt.widgets.styleoptionrubberband |
||
| StyleOptionSizeGrip prettyqt.widgets.styleoptionsizegrip |
||
| StyleOptionSlider prettyqt.widgets.styleoptionslider |
||
| StyleOptionSpinBox prettyqt.widgets.styleoptionspinbox |
||
| StyleOptionTab prettyqt.widgets.styleoptiontab |
||
| StyleOptionTabBarBase prettyqt.widgets.styleoptiontabbarbase |
||
| StyleOptionTabWidgetFrame prettyqt.widgets.styleoptiontabwidgetframe |
||
| StyleOptionTitleBar prettyqt.widgets.styleoptiontitlebar |
||
| StyleOptionToolBar prettyqt.widgets.styleoptiontoolbar |
||
| StyleOptionToolBox prettyqt.widgets.styleoptiontoolbox |
||
| StyleOptionToolButton prettyqt.widgets.styleoptiontoolbutton |
||
| StyleOptionViewItem prettyqt.widgets.styleoptionviewitem |
||
| StylePainter prettyqt.widgets.stylepainter Convenience class for drawing QStyle elements inside a widget. |
||
| StyledItemDelegate prettyqt.widgets.styleditemdelegate |
|
|
| SwipeGesture prettyqt.widgets.swipegesture |
|
|
| SystemTrayIcon prettyqt.widgets.systemtrayicon Icon for an application in the system tray. |
||
| TabBar prettyqt.widgets.tabbar Tab bar, e.g. for use in tabbed dialogs. |
|
|
| TabWidget prettyqt.widgets.tabwidget Stack of tabbed widgets. |
||
| TableView prettyqt.widgets.tableview Default model/view implementation of a table view. |
||
| TableViewMixin prettyqt.widgets.tableview |
|
|
| TableWidget prettyqt.widgets.tablewidget |
|
|
| TableWidgetItem prettyqt.widgets.tablewidgetitem Item for use with the QTableWidget class. |
||
| TableWidgetSelectionRange prettyqt.widgets.tablewidgetselectionrange |
||
| TapAndHoldGesture prettyqt.widgets.tapandholdgesture |
||
| TapGesture prettyqt.widgets.tapgesture Describes a tap gesture made by the user. |
||
| TextBrowser prettyqt.widgets.textbrowser Rich text browser with hypertext navigation. |
||
| TextEdit prettyqt.widgets.textedit Widget that is used to edit and display both plain and rich text. |
||
| TextEditMixin prettyqt.widgets.textedit |
||
| TimeEdit prettyqt.widgets.timeedit Widget for editing times based on the QDateTimeEdit widget. |
||
| ToolBar prettyqt.widgets.toolbar Movable panel that contains a set of controls. |
|
|
| ToolBox prettyqt.widgets.toolbox Column of tabbed widget items. |
||
| ToolButton prettyqt.widgets.toolbutton Quick-access button to commands or options, usually used inside a QToolBar. |
||
| ToolTip prettyqt.widgets.tooltip Tool tips (balloon help) for any widget. |
||
| TreeView prettyqt.widgets.treeview Default model/view implementation of a tree view. |
||
| TreeViewMixin prettyqt.widgets.treeview |
|
|
| TreeWidget prettyqt.widgets.treewidget Tree view that uses a predefined tree model. |
|
|
| TreeWidgetItem prettyqt.widgets.treewidgetitem |
|
|
| TreeWidgetItemIterator prettyqt.widgets.treewidgetitemiterator |
||
| UndoView prettyqt.widgets.undoview Displays the contents of a QUndoStack. |
||
| VBoxLayout prettyqt.widgets.vboxlayout Lines up widgets vertically. |
|
|
| WhatsThis prettyqt.widgets.whatsthis Simple description of any widget, i.e. answering the question "What's This?". |
||
| Widget prettyqt.widgets.widget The base class of all user interface objects. |
|
|
| WidgetAction prettyqt.widgets.widgetaction |
||
| WidgetItem prettyqt.widgets.widgetitem Layout item that represents a widget. |
||
| WidgetMixin prettyqt.widgets.widget |
||
| Wizard prettyqt.widgets.wizard Framework for wizards. |
|
|
| WizardPage prettyqt.widgets.wizardpage The base class for wizard pages. |
|
🛈 DocStrings
Classes to extend Qt GUI with widgets.
AbstractButtonMixin
Bases: WidgetMixin, _AbstractButtonBase
Abstract button widget base class, providing functionality common to buttons.
Source code in prettyqt/widgets/abstractbutton.py
set_icon(icon: datatypes.IconType)
Set the icon for the button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
IconType
|
icon to use |
required |
set_icon_size(size: datatypes.SizeType)
set_style_icon(icon: widgets.style.StandardPixmapStr | widgets.QStyle.StandardPixmap, size: datatypes.SizeType = 15)
Set theme icon for the button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
StandardPixmapStr | StandardPixmap
|
icon to use |
required |
size
|
SizeType
|
icon size |
15
|
Source code in prettyqt/widgets/abstractbutton.py
AbstractGraphicsShapeItem
Bases: AbstractGraphicsShapeItemMixin, QAbstractGraphicsShapeItem
Common base for all path items.
Source code in prettyqt/widgets/abstractgraphicsshapeitem.py
AbstractItemDelegate
Bases: AbstractItemDelegateMixin, QAbstractItemDelegate
Used to display and edit data items from a model.
Source code in prettyqt/widgets/abstractitemdelegate.py
AbstractItemView
Bases: AbstractItemViewMixin, QAbstractItemView
The basic functionality for item view classes.
Source code in prettyqt/widgets/abstractitemview.py
AbstractItemViewMixin
Bases: AbstractScrollAreaMixin, _AbstractItemViewBase
Source code in prettyqt/widgets/abstractitemview.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 | |
get_drag_drop_mode() -> DragDropModeStr
get_drop_indicator_position() -> DropIndicatorPositionStr
Return position of the drop indicator in relation to the closest item.
get_horizontal_scroll_mode() -> ScrollModeStr
get_model(skip_proxies: bool = False) -> core.QAbstractItemModel
Get current model of the ItemView.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip_proxies
|
bool
|
Whether to get current model or the non-proxy sourceModel. |
False
|
Source code in prettyqt/widgets/abstractitemview.py
get_models(proxies_only: bool = False) -> listdelegators.ListDelegator[core.QAbstractProxyModel]
Get a list of all (proxy) models connected to this view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
proxies_only
|
bool
|
whether the non-proxy sourceModel should be included. |
False
|
Source code in prettyqt/widgets/abstractitemview.py
get_selection_behavior() -> SelectionBehaviourStr
Return current selection behavior.
get_selection_mode() -> SelectionModeStr
get_size_hint_for_column(col: int, row_limit: int = 25) -> int
Get a size hint for given column by finding widest cell.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col
|
int
|
columnt to get size hint for. |
required |
row_limit
|
int
|
number of rows to check. |
25
|
Source code in prettyqt/widgets/abstractitemview.py
get_state() -> StateStr
get_vertical_scroll_mode() -> ScrollModeStr
get_visible_section_span(orientation: constants.OrientationStr | constants.Orientation) -> tuple[int, int]
Get range of visible sections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
OrientationStr | Orientation
|
Whether to get section span for horizontal or vertical header. |
required |
Source code in prettyqt/widgets/abstractitemview.py
highlight_when_inactive()
jump_to_column(col_num: int)
Make sure column at given index is visible.
scrolls to column at given index
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col_num
|
int
|
column to scroll to |
required |
Source code in prettyqt/widgets/abstractitemview.py
num_selected() -> int
Return amount of selected rows.
scroll_to_bottom()
scroll_to_top()
selectAll()
Override, we dont want to selectAll for too many items bc of performance.
Source code in prettyqt/widgets/abstractitemview.py
selected_data(role: constants.ItemDataRole = constants.USER_ROLE) -> Generator[Any]
Return generator yielding selected userData.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role
|
ItemDataRole
|
ItemRole to return data for. |
USER_ROLE
|
Source code in prettyqt/widgets/abstractitemview.py
selected_indexes() -> listdelegators.ListDelegator[core.QModelIndex]
Return list of selected indexes in first row.
Source code in prettyqt/widgets/abstractitemview.py
selected_names() -> Generator[Any]
selected_rows() -> Generator[int]
set_current_index(index: core.QModelIndex | tuple | None, operation: Literal['select', 'deselect', 'toggle'] = 'select', *, clear: bool = True, current: bool = False, expand: Literal['rows', 'columns'] | None = None)
Set current index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
QModelIndex | tuple | None
|
Index to set. |
required |
operation
|
Literal['select', 'deselect', 'toggle']
|
Whether to select, deselect or toggle the current state. |
'select'
|
clear
|
bool
|
Clear Whether to clear previously selected indexes. |
True
|
current
|
bool
|
Current selection will be updated. |
False
|
expand
|
Literal['rows', 'columns'] | None
|
Whether to expand selection to whole column / row. |
None
|
Source code in prettyqt/widgets/abstractitemview.py
set_delegate(delegate: widgets.QAbstractItemDelegate | DelegateStr | None, *, column: int | Sequence | None = None, row: int | Sequence | None = None, persistent: bool = False, **kwargs: Any)
Set a item delegate for the view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delegate
|
QAbstractItemDelegate | DelegateStr | None
|
Delegate to set. Can also be the id of the delegate. |
required |
column
|
int | Sequence | None
|
Column the delegate should be set for. |
None
|
row
|
int | Sequence | None
|
Row the column should be set for. |
None
|
persistent
|
bool
|
If True, open persistent editors for given area. |
False
|
kwargs
|
Any
|
Keyword args to pass to the Delegate ctor if delegate is set by id. |
{}
|
Source code in prettyqt/widgets/abstractitemview.py
set_drag_drop_mode(mode: DragDropModeStr | widgets.QAbstractItemView.DragDropMode)
Set drag-drop mode for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
DragDropModeStr | DragDropMode
|
drag-drop mode to use |
required |
Source code in prettyqt/widgets/abstractitemview.py
set_horizontal_scroll_mode(mode: ScrollModeStr | widgets.QAbstractItemView.ScrollMode)
Set the horizontal scroll mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ScrollModeStr | ScrollMode
|
mode to set |
required |
Source code in prettyqt/widgets/abstractitemview.py
set_model(model: core.QAbstractItemModel | None)
Set the model of this View.
Source code in prettyqt/widgets/abstractitemview.py
set_model_for(data: Any)
Set model for given data type.
Pass any data structure and an appropriate model will be chosen automatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any
|
data to choose model for. |
required |
Source code in prettyqt/widgets/abstractitemview.py
set_scroll_mode(mode: ScrollModeStr | widgets.QAbstractItemView.ScrollMode)
Set the scroll mode for both directions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ScrollModeStr | ScrollMode
|
mode to set |
required |
Source code in prettyqt/widgets/abstractitemview.py
set_selection_behavior(behavior: SelectionBehaviourStr | widgets.QAbstractItemView.SelectionBehavior)
Set selection behavior for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
behavior
|
SelectionBehaviourStr | SelectionBehavior
|
Selection behavior |
required |
Source code in prettyqt/widgets/abstractitemview.py
set_selection_mode(mode: SelectionModeStr | widgets.QAbstractItemView.SelectionMode | None)
Set selection mode for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
SelectionModeStr | SelectionMode | None
|
selection mode to use |
required |
Source code in prettyqt/widgets/abstractitemview.py
set_state(state: StateStr | widgets.QAbstractItemView.State)
Set state for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
StateStr | State
|
state to use |
required |
set_vertical_scroll_mode(mode: ScrollModeStr | widgets.QAbstractItemView.ScrollMode)
Set the vertical scroll mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ScrollModeStr | ScrollMode
|
mode to set |
required |
Source code in prettyqt/widgets/abstractitemview.py
toggle_select_all()
Select all items from list (deselect when all selected).
Source code in prettyqt/widgets/abstractitemview.py
AbstractScrollArea
Bases: AbstractScrollAreaMixin, QAbstractScrollArea
Scrolling area with on-demand scroll bars.
Source code in prettyqt/widgets/abstractscrollarea.py
AbstractScrollAreaMixin
Bases: FrameMixin, _AbstractScrollAreaBase
Source code in prettyqt/widgets/abstractscrollarea.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
get_size_adjust_policy() -> SizeAdjustPolicyStr
scroll_to_bottom()
scroll_to_top()
set_horizontal_scrollbar_policy(mode: constants.ScrollBarPolicyStr | constants.ScrollBarPolicy)
Set the horizontal scrollbar visibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ScrollBarPolicyStr | ScrollBarPolicy
|
visibilty to set |
required |
Source code in prettyqt/widgets/abstractscrollarea.py
set_horizontal_scrollbar_width(width: int)
Set the horizontal scrollbar width.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
int
|
width in pixels |
required |
Source code in prettyqt/widgets/abstractscrollarea.py
set_scrollbar_policy(mode: constants.ScrollBarPolicyStr | constants.ScrollBarPolicy)
Set the policy for both scrollbars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ScrollBarPolicyStr | ScrollBarPolicy
|
visibilty to set |
required |
Source code in prettyqt/widgets/abstractscrollarea.py
set_scrollbar_width(width: int)
Set the width for both scrollbars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
int
|
width in pixels |
required |
set_size_adjust_policy(policy: SizeAdjustPolicyStr | area.SizeAdjustPolicy)
Set size adjust policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
SizeAdjustPolicyStr | SizeAdjustPolicy
|
size adjust policy to use |
required |
set_vertical_scrollbar_policy(mode: constants.ScrollBarPolicyStr | constants.ScrollBarPolicy)
Set the vertical scrollbar visibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ScrollBarPolicyStr | ScrollBarPolicy
|
visibilty to set |
required |
Source code in prettyqt/widgets/abstractscrollarea.py
set_vertical_scrollbar_width(width: int)
Set the vertical scrollbar width.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
int
|
width in pixels |
required |
Source code in prettyqt/widgets/abstractscrollarea.py
AbstractSlider
Bases: AbstractSliderMixin, QAbstractSlider
Integer value within a range.
Source code in prettyqt/widgets/abstractslider.py
AbstractSliderMixin
Bases: WidgetMixin, _AbstractSliderBase
Source code in prettyqt/widgets/abstractslider.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
get_orientation() -> constants.OrientationStr
get_repeat_action() -> SliderActionStr
is_horizontal() -> bool
is_vertical() -> bool
scroll_to_max()
scroll_to_min()
set_auto_scroll_to_end(scroll: bool = True)
Set to always scroll to the end when range changes.
Source code in prettyqt/widgets/abstractslider.py
set_horizontal()
set_orientation(orientation: constants.OrientationStr | constants.Orientation)
Set the orientation of the slider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
OrientationStr | Orientation
|
orientation for the slider |
required |
Source code in prettyqt/widgets/abstractslider.py
set_repeat_action(action: SliderActionStr | widgets.QAbstractSlider.SliderAction, threshold: int = 500, repeat_time: int = 50)
Set the repeat action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
SliderActionStr | SliderAction
|
repeat action |
required |
threshold
|
int
|
initial delay in ms |
500
|
repeat_time
|
int
|
repeat time in ms |
50
|
Source code in prettyqt/widgets/abstractslider.py
set_vertical()
trigger_action(action: SliderActionStr | widgets.QAbstractSlider.SliderAction)
AbstractSpinBox
Bases: AbstractSpinBoxMixin, QAbstractSpinBox
Spinbox and a line edit to display values.
Source code in prettyqt/widgets/abstractspinbox.py
AbstractSpinBoxMixin
Bases: WidgetMixin, _AbstractSpinBoxBase
Source code in prettyqt/widgets/abstractspinbox.py
get_button_symbols() -> SymbolStr
get_correction_mode() -> CorrectionModeStr
get_step_type() -> StepTypeStr
set_button_symbols(mode: SymbolStr | QtWidgets.QSpinBox.ButtonSymbols)
set_correction_mode(mode: CorrectionModeStr | QtWidgets.QSpinBox.CorrectionMode)
Set correction mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
CorrectionModeStr | CorrectionMode
|
correction mode to use |
required |
set_step_type(mode: StepTypeStr | QtWidgets.QSpinBox.StepType)
Set step type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
StepTypeStr | StepType
|
step type to use |
required |
Application
BoxLayout
ButtonGroup
Bases: ObjectMixin, QButtonGroup
Container to organize groups of button widgets.
Source code in prettyqt/widgets/buttongroup.py
CalendarWidget
Bases: WidgetMixin, QCalendarWidget
Monthly based calendar widget allowing the user to select a date.
Source code in prettyqt/widgets/calendarwidget.py
get_selection_mode() -> SelectionModeStr
set_selection_mode(mode: SelectionModeStr | widgets.QCalendarWidget.SelectionMode | None)
Set selection mode for given calendar widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
SelectionModeStr | SelectionMode | None
|
selection mode to use |
required |
Source code in prettyqt/widgets/calendarwidget.py
CheckBox
Bases: AbstractButtonMixin, QCheckBox
Checkbox with a text label.
Source code in prettyqt/widgets/checkbox.py
get_checkstate() -> constants.CheckStateStr
set_checkstate(state: constants.CheckStateStr | constants.CheckState)
Set checkstate of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
CheckStateStr | CheckState
|
checkstate to use |
required |
ColorDialog
Bases: DialogMixin, QColorDialog
Dialog widget for specifying colors.
Source code in prettyqt/widgets/colordialog.py
ColumnView
Bases: AbstractItemViewMixin, QColumnView
Model/view implementation of a column view.
Source code in prettyqt/widgets/columnview.py
ComboBox
Bases: ComboBoxMixin, QComboBox
Combined button and popup list.
Source code in prettyqt/widgets/combobox.py
ComboBoxMixin
Bases: WidgetMixin, _ComboBoxBase
Combobox that lets the user select a font family.
Source code in prettyqt/widgets/combobox.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
get_insert_policy() -> InsertPolicyStr
get_label_drawing_mode() -> LabelDrawingModeStr
get_size_adjust_policy() -> SizeAdjustPolicyStr
hide_completer()
set_icon_size(size: datatypes.SizeType)
set_insert_policy(policy: InsertPolicyStr | mod.InsertPolicy)
Set insert policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
InsertPolicyStr | InsertPolicy
|
insert policy to use |
required |
set_label_drawing_mode(mode: LabelDrawingModeStr | mod.LabelDrawingMode)
Set label drawing mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
LabelDrawingModeStr | LabelDrawingMode
|
label drawing mode to use |
required |
set_size_adjust_policy(policy: SizeAdjustPolicyStr | mod.SizeAdjustPolicy)
Set size adjust policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
SizeAdjustPolicyStr | SizeAdjustPolicy
|
size adjust policy to use |
required |
CommandLinkButton
Bases: PushButtonMixin, QCommandLinkButton
Vista style command link button.
Source code in prettyqt/widgets/commandlinkbutton.py
CommonStyle
Bases: CommonStyleMixin, QCommonStyle
Encapsulates the common Look and Feel of a GUI.
Source code in prettyqt/widgets/commonstyle.py
Completer
Bases: ObjectMixin, QCompleter
Completions based on an item model.
Source code in prettyqt/widgets/completer.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
get_completion_mode() -> CompletionModeStr
get_filter_mode() -> constants.FilterModeStr
get_sort_mode() -> SortModeStr
is_case_sensitive() -> bool
set_case_sensitive(state: bool)
Set case sensitivity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
bool
|
case sensitive |
required |
Source code in prettyqt/widgets/completer.py
set_completion_mode(mode: CompletionModeStr | widgets.QCompleter.CompletionMode)
Set completion mode to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
CompletionModeStr | CompletionMode
|
completion mode to use |
required |
set_filter_mode(mode: constants.FilterModeStr | constants.MatchFlag)
Set filter mode to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
FilterModeStr | MatchFlag
|
filter mode to use |
required |
set_sort_mode(mode: SortModeStr | widgets.QCompleter.ModelSorting | None)
Set sort mode to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
SortModeStr | ModelSorting | None
|
sort mode to use |
required |
Source code in prettyqt/widgets/completer.py
DataWidgetMapper
Bases: ObjectMixin, QDataWidgetMapper
Mapping between a section of a data model to widgets.
Source code in prettyqt/widgets/datawidgetmapper.py
get_orientation() -> constants.OrientationStr
get_submit_policy() -> SubmitPolicyStr
set_orientation(orientation: constants.OrientationStr | constants.Orientation)
Set the orientation of the data widget mapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
OrientationStr | Orientation
|
orientation for the data widget mapper |
required |
Source code in prettyqt/widgets/datawidgetmapper.py
set_submit_policy(policy: SubmitPolicyStr | widgets.QDataWidgetMapper.SubmitPolicy)
Set the submit policy of the mapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
SubmitPolicyStr | SubmitPolicy
|
submit_policy for the data widget mapper |
required |
Source code in prettyqt/widgets/datawidgetmapper.py
DateEdit
Bases: DateTimeEditMixin, QDateEdit
Widget for editing dates based on the QDateTimeEdit widget.
Source code in prettyqt/widgets/dateedit.py
DateTimeEditMixin
Bases: AbstractSpinBoxMixin, _DateTimeEditBase
Widget for editing dates and times.
Source code in prettyqt/widgets/datetimeedit.py
Dial
Bases: AbstractSliderMixin, QDial
Rounded range control (like a speedometer or potentiometer).
Source code in prettyqt/widgets/dial.py
Dialog
Bases: DialogMixin, QDialog
The base class of dialog windows.
Source code in prettyqt/widgets/dialog.py
DialogButtonBox
Bases: WidgetMixin, QDialogButtonBox
Widget presenting buttons in a layout that is appropriate to the widget style.
Source code in prettyqt/widgets/dialogbuttonbox.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
add_button(button: widgets.QPushButton | str, role: RoleStr | widgets.QDialogButtonBox.ButtonRole = 'accept', callback: Callable | None = None) -> widgets.QPushButton
Add a button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button
|
QPushButton | str
|
button to add |
required |
role
|
RoleStr | ButtonRole
|
role of the button |
'accept'
|
callback
|
Callable | None
|
function to call when button gets clicked |
None
|
add_default_button(button: StandardButtonStr | widgets.QDialogButtonBox.StandardButton, callback: Callable | None = None) -> widgets.QPushButton
Add a default button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button
|
StandardButtonStr | StandardButton
|
button to add |
required |
callback
|
Callable | None
|
function to call when button gets clicked |
None
|
get_orientation() -> constants.OrientationStr
set_orientation(orientation: constants.OrientationStr | constants.Orientation)
Set the orientation of the button box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
OrientationStr | Orientation
|
orientation for the button box |
required |
Source code in prettyqt/widgets/dialogbuttonbox.py
DockWidget
Bases: WidgetMixin, QDockWidget
Widget that can be docked inside a QMainWindow .
Source code in prettyqt/widgets/dockwidget.py
DoubleSpinBox
Bases: AbstractSpinBoxMixin, QDoubleSpinBox
Spin box widget that takes doubles.
Source code in prettyqt/widgets/doublespinbox.py
ErrorMessage
Bases: DialogMixin, QErrorMessage
Error message display dialog.
Source code in prettyqt/widgets/errormessage.py
FileDialog
Bases: DialogMixin, QFileDialog
Dialog that allow users to select files or directories.
Source code in prettyqt/widgets/filedialog.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | |
get_accept_mode() -> AcceptModeStr
get_directory() -> pathlib.Path
Return current directory.
returns current directory level as a Pathlib object
get_file_mode() -> FileModeStr
get_label_text(label: LabelStr | widgets.QFileDialog.DialogLabel) -> str
get_view_mode() -> ViewModeStr
set_accept_mode(mode: AcceptModeStr | widgets.QFileDialog.AcceptMode)
Set accept mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
AcceptModeStr | AcceptMode
|
accept mode to use |
required |
set_directory(path: datatypes.PathType)
set_extension_filter(extension_dict: dict[str, list[str]])
Set filter based on given dictionary.
dict must contain "'name': ['.ext1', '.ext2']" as key-value pairs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extension_dict
|
dict[str, list[str]]
|
filter dictionary |
required |
Source code in prettyqt/widgets/filedialog.py
set_file_mode(mode: FileModeStr | widgets.QFileDialog.FileMode)
Set the file mode of the dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
FileModeStr | FileMode
|
mode to use |
required |
set_label_text(label: LabelStr | widgets.QFileDialog.DialogLabel, text: str)
Set the label text for button label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
LabelStr | DialogLabel
|
button to set text for |
required |
text
|
str
|
text to use |
required |
Source code in prettyqt/widgets/filedialog.py
set_view_mode(mode: ViewModeStr | widgets.QFileDialog.ViewMode)
Set view mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ViewModeStr | ViewMode
|
view mode to use |
required |
FileIconProvider
Bases: AbstractFileIconProviderMixin, QFileIconProvider
File icons for the QFileSystemModel class.
Source code in prettyqt/widgets/fileiconprovider.py
FocusFrame
Bases: WidgetMixin, QFocusFrame
Focus frame which can be outside of a widget's normal paintable area.
Source code in prettyqt/widgets/focusframe.py
FontComboBox
Bases: ComboBoxMixin, QFontComboBox
Combobox that lets the user select a font family.
Source code in prettyqt/widgets/fontcombobox.py
get_font_filters() -> list[FontFilterStr]
set_font_filters(*filters: FontFilterStr)
Set font filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filters
|
FontFilterStr
|
font filters to use |
()
|
FontDialog
Bases: DialogMixin, QFontDialog
Dialog widget for selecting a font.
Source code in prettyqt/widgets/fontdialog.py
FormLayout
Bases: LayoutMixin, QFormLayout
Manages forms of input widgets and their associated labels.
Source code in prettyqt/widgets/formlayout.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
__len__() -> int
get_field_growth_policy() -> FieldGrowthPolicyStr
Return current field growth policy.
get_form_alignment() -> constants.AlignmentStr
get_label_alignment() -> constants.AlignmentStr
get_row_wrap_policy() -> RowWrapPolicyStr
set_field_growth_policy(policy: FieldGrowthPolicyStr | mod.FieldGrowthPolicy)
Set field growth policy to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
FieldGrowthPolicyStr | FieldGrowthPolicy
|
field growth policy to use |
required |
Source code in prettyqt/widgets/formlayout.py
set_form_alignment(alignment: constants.AlignmentStr | constants.AlignmentFlag)
Set the alignment of the form.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
AlignmentStr | AlignmentFlag
|
alignment for the form |
required |
Source code in prettyqt/widgets/formlayout.py
set_label_alignment(alignment: constants.AlignmentStr | constants.AlignmentFlag)
Set the alignment of the label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
AlignmentStr | AlignmentFlag
|
alignment for the label |
required |
Source code in prettyqt/widgets/formlayout.py
set_row_wrap_policy(policy: RowWrapPolicyStr | mod.RowWrapPolicy)
Set row wrap policy to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
RowWrapPolicyStr | RowWrapPolicy
|
row wrap policy to use |
required |
Frame
Bases: FrameMixin, QFrame
The base class of widgets that can have a frame.
Source code in prettyqt/widgets/frame.py
FrameMixin
Bases: WidgetMixin, _FrameBase
Source code in prettyqt/widgets/frame.py
get_frame_shadow() -> ShadowStr | None
get_frame_shape() -> FrameShapeStr
set_frame_shadow(style: ShadowStr | widgets.QFrame.Shadow)
Set frame shadow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
ShadowStr | Shadow
|
frame style to use |
required |
set_frame_shape(shape: FrameShapeStr | widgets.QFrame.Shape)
Set frame shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
FrameShapeStr | Shape
|
frame shape to use |
required |
Gesture
Bases: GestureMixin, QGesture
A gesture, containing properties that describe the corresponding user input.
Source code in prettyqt/widgets/gesture.py
GestureMixin
Bases: ObjectMixin, _GestureBase
Source code in prettyqt/widgets/gesture.py
get_gesture_cancel_policy() -> GestureCancelPolicyStr
Return current gesture cancel policy.
get_gesture_type() -> constants.GestureTypeStr
get_state() -> constants.GestureStateStr
set_gesture_cancel_policy(policy: GestureCancelPolicyStr | widgets.QGesture.GestureCancelPolicy)
Set gesture cancel policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
GestureCancelPolicyStr | GestureCancelPolicy
|
gesture cancel policy to use |
required |
Source code in prettyqt/widgets/gesture.py
GestureRecognizer
Bases: GestureRecognizerMixin, QGestureRecognizer
Provides the infrastructure for gesture recognition.
GraphicsAnchor
Bases: ObjectMixin, QGraphicsAnchor
Represents an anchor between two items in a QGraphicsAnchorLayout.
Source code in prettyqt/widgets/graphicsanchor.py
get_size_policy() -> widgets.sizepolicy.SizePolicyStr
set_size_policy(policy: widgets.sizepolicy.SizePolicyStr | widgets.QSizePolicy.Policy)
Set the size policy of the anchor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
SizePolicyStr | Policy
|
size policy to use |
required |
Source code in prettyqt/widgets/graphicsanchor.py
GraphicsEffect
Bases: GraphicsEffectMixin, QGraphicsEffect
The base class for all graphics effects.
Source code in prettyqt/widgets/graphicseffect.py
GraphicsEllipseItem
Bases: AbstractGraphicsShapeItemMixin, QGraphicsEllipseItem
Ellipse item that you can add to a QGraphicsScene.
Source code in prettyqt/widgets/graphicsellipseitem.py
GraphicsGridLayout
Bases: GraphicsLayoutMixin, QGraphicsGridLayout
Grid layout for managing widgets in Graphics View.
Source code in prettyqt/widgets/graphicsgridlayout.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
GraphicsItem
Bases: GraphicsItemMixin, QGraphicsItem
The base class for all graphical items in a QGraphicsScene.
Source code in prettyqt/widgets/graphicsitem.py
GraphicsItemGroup
Bases: GraphicsItemMixin, QGraphicsItemGroup
Container that treats a group of items as a single item.
Source code in prettyqt/widgets/graphicsitemgroup.py
GraphicsItemMixin
Bases: _GraphicsItemBase
Source code in prettyqt/widgets/graphicsitem.py
get_cache_mode() -> CacheModeStr
get_panel_modality() -> PanelModalityStr
set_cache_mode(mode: CacheModeStr | QtWidgets.QGraphicsItem.CacheMode)
Set cache mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
CacheModeStr | CacheMode
|
cache mode |
required |
set_panel_modality(modality: PanelModalityStr | QtWidgets.QGraphicsItem.PanelModality)
Set panel modality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modality
|
PanelModalityStr | PanelModality
|
panel modality |
required |
GraphicsLayout
Bases: GraphicsLayoutMixin, QGraphicsLayout
The base class for all layouts in Graphics View.
Source code in prettyqt/widgets/graphicslayout.py
GraphicsLayoutItem
Bases: GraphicsLayoutItemMixin, QGraphicsLayoutItem
Can be inherited to allow your custom items to be managed by layouts.
Source code in prettyqt/widgets/graphicslayoutitem.py
GraphicsLayoutItemMixin
Bases: _GraphicsLayoutItemBase
Source code in prettyqt/widgets/graphicslayoutitem.py
set_size_policy(horizontal: widgets.sizepolicy.SizePolicyStr, vertical: widgets.sizepolicy.SizePolicyStr, control_type: widgets.sizepolicy.ControlTypeStr = 'default')
Set the size policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizontal
|
SizePolicyStr
|
horizontal size policy |
required |
vertical
|
SizePolicyStr
|
vertical size policy |
required |
control_type
|
ControlTypeStr
|
control type associated with the widget |
'default'
|
Source code in prettyqt/widgets/graphicslayoutitem.py
GraphicsLineItem
Bases: GraphicsItemMixin, QGraphicsLineItem
Line item that you can add to a QGraphicsScene.
Source code in prettyqt/widgets/graphicslineitem.py
GraphicsLinearLayout
Bases: GraphicsLayoutMixin, QGraphicsLinearLayout
Horizontal or vertical layout for managing widgets in Graphics View.
Source code in prettyqt/widgets/graphicslinearlayout.py
GraphicsObject
Bases: GraphicsObjectMixin, QGraphicsObject
Base class for all graphics items that require signals, slots and properties.
Source code in prettyqt/widgets/graphicsobject.py
GraphicsPathItem
Bases: AbstractGraphicsShapeItemMixin, QGraphicsPathItem
Path item that you can add to a QGraphicsScene.
Source code in prettyqt/widgets/graphicspathitem.py
GraphicsPixmapItem
Bases: GraphicsItemMixin, QGraphicsPixmapItem
Pixmap item that you can add to a QGraphicsScene.
Source code in prettyqt/widgets/graphicspixmapitem.py
get_shape_mode() -> ShapeModeStr
get_transformation_mode() -> constants.TransformationModeStr
Return current transformation mode.
set_shape_mode(mode: ShapeModeStr | widgets.QGraphicsPixmapItem.ShapeMode)
Set shape mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ShapeModeStr | ShapeMode
|
shape mode to use |
required |
set_transformation_mode(mode: constants.TransformationModeStr | constants.TransformationMode)
Set transformation mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
TransformationModeStr | TransformationMode
|
transformation mode to use |
required |
Source code in prettyqt/widgets/graphicspixmapitem.py
GraphicsPolygonItem
Bases: AbstractGraphicsShapeItemMixin, QGraphicsPolygonItem
Polygon item that you can add to a QGraphicsScene.
Source code in prettyqt/widgets/graphicspolygonitem.py
GraphicsProxyWidget
Bases: GraphicsWidgetMixin, QGraphicsProxyWidget
Proxy layer for embedding a QWidget in a QGraphicsScene.
Source code in prettyqt/widgets/graphicsproxywidget.py
GraphicsRectItem
Bases: AbstractGraphicsShapeItemMixin, QGraphicsRectItem
Rectangle item that you can add to a QGraphicsScene.
Source code in prettyqt/widgets/graphicsrectitem.py
GraphicsRotation
Bases: GraphicsTransformMixin, QGraphicsRotation
Rotation transformation around a given axis.
Source code in prettyqt/widgets/graphicsrotation.py
GraphicsScene
Bases: ObjectMixin, QGraphicsScene
Surface for managing a large number of 2D graphical items.
Source code in prettyqt/widgets/graphicsscene.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | |
GridType
get_item_index_method() -> ItemIndexMethodStr
set_item_index_method(method: ItemIndexMethodStr | widgets.QGraphicsScene.ItemIndexMethod)
Set item index method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
ItemIndexMethodStr | ItemIndexMethod
|
item index method to use |
required |
Source code in prettyqt/widgets/graphicsscene.py
GraphicsSimpleTextItem
Bases: AbstractGraphicsShapeItemMixin, QGraphicsSimpleTextItem
Simple text path item that you can add to a QGraphicsScene.
Source code in prettyqt/widgets/graphicssimpletextitem.py
GraphicsTextItem
Bases: GraphicsObjectMixin, QGraphicsTextItem
Text item that you can add to a QGraphicsScene to display formatted text.
Source code in prettyqt/widgets/graphicstextitem.py
GraphicsTransform
Bases: GraphicsTransformMixin, QGraphicsTransform
Abstract base class for building advanced transformations on QGraphicsItems.
Source code in prettyqt/widgets/graphicstransform.py
GraphicsView
Bases: GraphicsViewMixin, QGraphicsView
Widget for displaying the contents of a QGraphicsScene.
Source code in prettyqt/widgets/graphicsview.py
GraphicsViewMixin
Bases: AbstractScrollAreaMixin, _GraphicsViewBase
Source code in prettyqt/widgets/graphicsview.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
get_cache_mode() -> CacheModeStr
get_drag_mode() -> DragModeStr
get_pixel_size()
Return vector with length and width of one view pixel in scene coordinates.
Source code in prettyqt/widgets/graphicsview.py
get_resize_anchor() -> ViewportAnchorStr
get_rubberband_selection_mode() -> constants.ItemSelectionModeStr
Return current rubberband selection mode.
Source code in prettyqt/widgets/graphicsview.py
get_transformation_anchor() -> ViewportAnchorStr
Return current transformation anchor.
get_view_rect() -> core.QRectF
Return the boundaries of the view in scene coordinates.
get_viewport_update_mode() -> ViewportUpdateModeStr
Return current viewport update mode.
get_zoom() -> float
Return the viewer zoom level.
set_cache_mode(mode: CacheModeStr | mod.CacheModeFlag)
Set the cache mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
CacheModeStr | CacheModeFlag
|
cache mode to use |
required |
set_drag_mode(mode: DragModeStr | mod.DragMode)
Set the behavior for dragging the mouse while the left mouse button is pressed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
DragModeStr | DragMode
|
drag mode to use |
required |
set_resize_anchor(mode: ViewportAnchorStr | mod.ViewportAnchor)
Set how the view should position the scene during resizes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ViewportAnchorStr | ViewportAnchor
|
resize anchor to use |
required |
Source code in prettyqt/widgets/graphicsview.py
set_rubberband_selection_mode(mode: constants.ItemSelectionModeStr | constants.ItemSelectionMode)
Set the behavior for selecting items with a rubber band selection rectangle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ItemSelectionModeStr | ItemSelectionMode
|
rubberband selection mode to use |
required |
Source code in prettyqt/widgets/graphicsview.py
set_transformation_anchor(mode: ViewportAnchorStr | mod.ViewportAnchor)
Set how the view should position the scene during transformations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ViewportAnchorStr | ViewportAnchor
|
transformation anchor to use |
required |
Source code in prettyqt/widgets/graphicsview.py
set_viewport_update_mode(mode: ViewportUpdateModeStr | mod.ViewportUpdateMode)
Set how the viewport should update its contents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ViewportUpdateModeStr | ViewportUpdateMode
|
viewport update mode to use |
required |
Source code in prettyqt/widgets/graphicsview.py
GraphicsWidget
Bases: GraphicsWidgetMixin, QGraphicsWidget
The base class for all widget items in a QGraphicsScene.
Source code in prettyqt/widgets/graphicswidget.py
GraphicsWidgetMixin
Bases: GraphicsObjectMixin, GraphicsLayoutItemMixin, _GraphicsWidgetBase
Source code in prettyqt/widgets/graphicswidget.py
get_focus_policy() -> constants.FocusPolicyStr
Return way the widget accepts keyboard focus.
set_focus_policy(policy: constants.FocusPolicyStr | constants.FocusPolicy)
Set the way the widget accepts keyboard focus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
FocusPolicyStr | FocusPolicy
|
Focus policy |
required |
Source code in prettyqt/widgets/graphicswidget.py
window_frame_section_at(point: datatypes.PointType) -> constants.WindowFrameSectionStr
Return the window frame section at given position.
Source code in prettyqt/widgets/graphicswidget.py
GridLayout
Bases: LayoutMixin, QGridLayout
Lays out widgets in a grid.
Source code in prettyqt/widgets/gridlayout.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
get_origin_corner() -> constants.CornerStr
set_origin_corner(corner: constants.CornerStr | constants.Corner)
Set the origin corner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
corner
|
CornerStr | Corner
|
origin corner |
required |
GroupBox
Bases: WidgetMixin, QGroupBox
Group box frame with a title.
A group box provides a frame, a title on top, a keyboard shortcut, and displays various other widgets inside itself. The keyboard shortcut moves keyboard focus to one of the group box's child widgets.
Source code in prettyqt/widgets/groupbox.py
get_alignment() -> constants.HorizontalAlignmentStr
set_alignment(alignment: constants.HorizontalAlignmentStr | constants.AlignmentFlag)
Set the title alignment of the groupbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
HorizontalAlignmentStr | AlignmentFlag
|
title alignment for the groupbox |
required |
Source code in prettyqt/widgets/groupbox.py
HBoxLayout
HeaderView
InputDialog
Bases: DialogMixin, QInputDialog
Simple convenience dialog to get a single value from the user.
Source code in prettyqt/widgets/inputdialog.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
get_input_mode() -> InputModeStr
get_text_echo_mode() -> widgets.lineedit.EchoModeStr
set_input_mode(mode: InputModeStr | mod.InputMode)
Set input mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
InputModeStr | InputMode
|
input mode to use |
required |
set_text_echo_mode(mode: widgets.lineedit.EchoModeStr | widgets.QLineEdit.EchoMode)
Set text echo mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
EchoModeStr | EchoMode
|
echo mode to use |
required |
Source code in prettyqt/widgets/inputdialog.py
ItemDelegate
Bases: AbstractItemDelegateMixin, QItemDelegate
Display and editing facilities for data items from a model.
Source code in prettyqt/widgets/itemdelegate.py
ItemEditorCreatorBase
ItemEditorFactory
Bases: QItemEditorFactory
Widgets for editing item data in views and delegates.
Source code in prettyqt/widgets/itemeditorfactory.py
KeySequenceEdit
Bases: WidgetMixin, QKeySequenceEdit
Allows to input a QKeySequence.
Source code in prettyqt/widgets/keysequenceedit.py
LCDNumber
Bases: FrameMixin, QLCDNumber
Displays a number with LCD-like digits.
Source code in prettyqt/widgets/lcdnumber.py
get_mode() -> ModeStr
get_segment_style() -> SegmentStyleStr
set_mode(mode: ModeStr | widgets.QLCDNumber.Mode)
Set the lcd mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ModeStr | Mode
|
lcd mode to use |
required |
set_segment_style(style: SegmentStyleStr | widgets.QLCDNumber.SegmentStyle)
Set the segment style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
SegmentStyleStr | SegmentStyle
|
segment style to use |
required |
Label
Bases: FrameMixin, QLabel
Text or image display.
Source code in prettyqt/widgets/label.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
get_text_format() -> constants.TextFormatStr
get_text_interaction() -> list[constants.TextInteractionStr]
Return current text interaction mode.
set_alignment(horizontal: constants.HorizontalAlignmentStr | None = None, vertical: constants.VerticalAlignmentStr | None = None)
Set the alignment of the label's contents.
Source code in prettyqt/widgets/label.py
set_indent(indent: int) -> Label
set_text(text: str) -> Label
set_text_format(text_format: constants.TextFormatStr | constants.TextFormat) -> Label
Set the text format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_format
|
TextFormatStr | TextFormat
|
text format to use |
required |
Source code in prettyqt/widgets/label.py
set_text_interaction(*types: constants.TextInteractionStr) -> Label
Set the text interaction mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
types
|
TextInteractionStr
|
text interaction mode to use |
()
|
Source code in prettyqt/widgets/label.py
set_weight(weight: gui.font.WeightStr | gui.QFont.Weight) -> Label
Set the font weight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
weight
|
WeightStr | Weight
|
font weight |
required |
Source code in prettyqt/widgets/label.py
Layout
Bases: LayoutMixin, QLayout
The base class of geometry managers.
Source code in prettyqt/widgets/layout.py
LayoutItem
Bases: LayoutItemMixin, QLayoutItem
Abstract item that a QLayout manipulates.
Source code in prettyqt/widgets/layoutitem.py
LayoutItemMixin
Bases: _LayoutItemBase
Source code in prettyqt/widgets/layoutitem.py
get_alignment() -> constants.AlignmentStr
set_alignment(alignment: constants.AlignmentStr)
Set the alignment of the layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
AlignmentStr
|
alignment for the layout |
required |
LayoutMixin
Bases: ObjectMixin, LayoutItemMixin, _LayoutBase
Source code in prettyqt/widgets/layout.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
get_size_constraint() -> SizeConstraintStr
set_alignment(alignment: constants.AlignmentStr | constants.AlignmentFlag, item: widgets.QWidget | widgets.QLayout | None = None) -> bool
Set the alignment for widget / layout to alignment.
Returns true if w is found in this layout (not including child layouts).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
AlignmentStr | AlignmentFlag
|
alignment for the layout |
required |
item
|
QWidget | QLayout | None
|
set alignment for specific child only |
None
|
Source code in prettyqt/widgets/layout.py
set_size_constraint(mode: SizeConstraintStr | widgets.QLayout.SizeConstraint)
Set the size mode of the layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
SizeConstraintStr | SizeConstraint
|
size mode for the layout |
required |
Source code in prettyqt/widgets/layout.py
LineEdit
Bases: WidgetMixin, QLineEdit
One-line text editor.
Source code in prettyqt/widgets/lineedit.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
get_cursor_move_style() -> constants.CursorMoveStyleStr
get_echo_mode() -> EchoModeStr
set_cursor_move_style(style: constants.CursorMoveStyleStr | constants.CursorMoveStyle)
Set cursor move style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
CursorMoveStyleStr | CursorMoveStyle
|
cursor move style to use |
required |
Source code in prettyqt/widgets/lineedit.py
set_echo_mode(mode: EchoModeStr | widgets.QLineEdit.EchoMode)
Set echo mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
EchoModeStr | EchoMode
|
echo mode to use |
required |
set_read_only(value: bool = True)
Set text to read-only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
bool
|
True, for read-only, otherwise False |
True
|
ListView
Bases: ListViewMixin, QListView
List or icon view onto a model.
Source code in prettyqt/widgets/listview.py
ListViewMixin
Bases: AbstractItemViewMixin, _ListViewBase
Source code in prettyqt/widgets/listview.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
get_flow() -> FlowStr
get_layout_mode() -> LayoutModeStr
get_movement() -> MovementStr
get_resize_mode() -> ResizeModeStr
get_view_mode() -> ViewModeStr
set_flow(mode: FlowStr | widgets.QListView.Flow)
Set flow mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
FlowStr | Flow
|
flow mode to use |
required |
set_layout_mode(mode: LayoutModeStr | widgets.QListView.LayoutMode)
Set layout mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
LayoutModeStr | LayoutMode
|
layout mode to use |
required |
set_movement(mode: MovementStr | widgets.QListView.Movement)
Set movement mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
MovementStr | Movement
|
movement mode to use |
required |
set_resize_mode(mode: ResizeModeStr | widgets.QListView.ResizeMode)
Set resize mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ResizeModeStr | ResizeMode
|
resize mode to use |
required |
set_view_mode(mode: ViewModeStr | widgets.QListView.ViewMode)
Set view mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ViewModeStr | ViewMode
|
view mode to use |
required |
ListWidget
Bases: ListViewMixin, QListWidget
Item-based list widget.
Source code in prettyqt/widgets/listwidget.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
ListWidgetItem
Bases: SerializeMixin, QListWidgetItem
Item for use with the QListWidget item view class.
Source code in prettyqt/widgets/listwidgetitem.py
get_checkstate() -> constants.CheckStateStr
set_checkstate(state: constants.CheckStateStr | constants.CheckState)
Set checkstate of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
CheckStateStr | CheckState
|
checkstate to use |
required |
set_icon(icon: datatypes.IconType)
Set the icon for the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
IconType
|
icon to use |
required |
set_text_alignment(horizontal: constants.HorizontalAlignmentStr | constants.AlignmentFlag | None = None, vertical: constants.VerticalAlignmentStr | constants.AlignmentFlag | None = None)
Set text alignment of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizontal
|
HorizontalAlignmentStr | AlignmentFlag | None
|
horizontal text alignment to use |
None
|
vertical
|
VerticalAlignmentStr | AlignmentFlag | None
|
vertical text alignment to use |
None
|
Source code in prettyqt/widgets/listwidgetitem.py
MainWindow
Bases: WidgetMixin, QMainWindow
Main application window.
Source code in prettyqt/widgets/mainwindow.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | |
add_toolbar(toolbar: widgets.QToolBar, area: constants.ToolbarAreaStr | constants.ToolBarArea | Literal['auto'] = 'auto')
Adds a toolbar to the mainmenu at specified area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
toolbar
|
QToolBar
|
toolbar to use |
required |
area
|
ToolbarAreaStr | ToolBarArea | Literal['auto']
|
area of the toolbar |
'auto'
|
Source code in prettyqt/widgets/mainwindow.py
add_toolbar_break(position: constants.ToolbarAreaStr | constants.ToolBarArea = 'top')
Adds a toolbar break to the given area behind the last item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
ToolbarAreaStr | ToolBarArea
|
position of the toolbar |
'top'
|
Source code in prettyqt/widgets/mainwindow.py
get_tab_shape() -> widgets.tabwidget.TabShapeStr
get_tool_button_style() -> constants.ToolButtonStyleStr
save_window_state(recursive: bool = False)
Save current window state as QSetting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recursive
|
bool
|
Description |
False
|
Source code in prettyqt/widgets/mainwindow.py
set_tab_shape(shape: widgets.tabwidget.TabShapeStr | widgets.QTabWidget.TabShape)
Set tab shape for the tabwidget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
TabShapeStr | TabShape
|
tab shape to use |
required |
Source code in prettyqt/widgets/mainwindow.py
set_widget(widget: widgets.QWidget | None) -> widgets.QWidget | None
Set widget and return previous one if existing.
MdiArea
Bases: AbstractScrollAreaMixin, QMdiArea
Area in which MDI windows are displayed.
Source code in prettyqt/widgets/mdiarea.py
get_tab_position() -> TabPositionStr
get_view_mode() -> ViewModeStr
get_window_order() -> WindowOrderStr
set_tab_position(position: TabPositionStr | widgets.QTabWidget.TabPosition)
Set tab position for the MDI area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
TabPositionStr | TabPosition
|
tabs position to use |
required |
set_view_mode(mode: ViewModeStr | widgets.QMdiArea.ViewMode)
Set view mode for the MDI area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ViewModeStr | ViewMode
|
view mode to use |
required |
set_window_order(mode: WindowOrderStr | widgets.QMdiArea.WindowOrder)
Set the window order behaviour for the MDI area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
WindowOrderStr | WindowOrder
|
window order behaviour to use |
required |
Source code in prettyqt/widgets/mdiarea.py
MdiSubWindow
Bases: WidgetMixin, QMdiSubWindow
Subwindow class for QMdiArea.
Source code in prettyqt/widgets/mdisubwindow.py
Menu
MenuBar
Bases: WidgetMixin, QMenuBar
Horizontal menu bar.
Source code in prettyqt/widgets/menubar.py
MessageBox
Bases: DialogMixin, QMessageBox
Modal dialog for informing the user (and for receiving an answer).
Source code in prettyqt/widgets/messagebox.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | |
add_button(button: StandardButtonStr | widgets.QMessageBox.StandardButton) -> widgets.QPushButton
get_text_format() -> constants.TextFormatStr
set_option(option: OptionStr | widgets.QMessageBox.Option, on: bool = True)
Set a message box option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
option
|
OptionStr | Option
|
option to set |
required |
on
|
bool
|
whether to enable or disable the option |
True
|
Source code in prettyqt/widgets/messagebox.py
set_text_format(text_format: constants.TextFormatStr | constants.TextFormat)
Set the text format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_format
|
TextFormatStr | TextFormat
|
text format to use |
required |
Source code in prettyqt/widgets/messagebox.py
test_option(option: OptionStr | widgets.QMessageBox.Option) -> bool
Return whether a message box option is enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
option
|
OptionStr | Option
|
option to test |
required |
PanGesture
Bases: GestureMixin, QPanGesture
Describes a panning gesture made by the user.
Source code in prettyqt/widgets/pangesture.py
PinchGesture
Bases: GestureMixin, QPinchGesture
Describes a pinch gesture made by the user.
Source code in prettyqt/widgets/pinchgesture.py
PlainTextDocumentLayout
Bases: AbstractTextDocumentLayoutMixin, QPlainTextDocumentLayout
Implements a plain text layout for QTextDocument.
Source code in prettyqt/widgets/plaintextdocumentlayout.py
PlainTextEdit
Bases: PlainTextEditMixin, QPlainTextEdit
Widget that is used to edit and display plain text.
Source code in prettyqt/widgets/plaintextedit.py
PlainTextEditMixin
Bases: AbstractScrollAreaMixin, _PlainTextEditBase
Source code in prettyqt/widgets/plaintextedit.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | |
get_line_wrap_mode() -> LineWrapModeStr
get_pixel_height(exact: bool = True) -> float
Returns the pixel height of the text area.
Source code in prettyqt/widgets/plaintextedit.py
get_word_wrap_mode() -> gui.textoption.WordWrapModeStr
Get the current word wrap mode.
set_line_wrap_mode(mode: LineWrapModeStr | widgets.QPlainTextEdit.LineWrapMode)
Set line wrap mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
LineWrapModeStr | LineWrapMode
|
line wrap mode to use |
required |
set_read_only(value: bool = True)
Make the PlainTextEdit read-only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
bool
|
True, for read-only, otherwise False |
True
|
set_word_wrap_mode(mode: gui.textoption.WordWrapModeStr | gui.QTextOption.WrapMode)
Set word wrap mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
WordWrapModeStr | WrapMode
|
word wrap mode to use |
required |
Source code in prettyqt/widgets/plaintextedit.py
show_whitespace_and_tabs(show: bool)
Set show white spaces flag.
Source code in prettyqt/widgets/plaintextedit.py
wheelEvent(event)
Handle wheel event for zooming.
Source code in prettyqt/widgets/plaintextedit.py
ProgressBar
Bases: WidgetMixin, QProgressBar
Horizontal or vertical progress bar.
Source code in prettyqt/widgets/progressbar.py
get_alignment() -> constants.AlignmentStr
get_orientation() -> constants.OrientationStr
get_text_direction() -> TextDirectionStr
Return current text direction.
Source code in prettyqt/widgets/progressbar.py
set_alignment(alignment: constants.AlignmentStr | constants.AlignmentFlag)
Set the alignment of the layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
AlignmentStr | AlignmentFlag
|
alignment for the layout |
required |
Source code in prettyqt/widgets/progressbar.py
set_orientation(orientation: constants.OrientationStr | constants.Orientation)
Set the orientation of the progress bar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
OrientationStr | Orientation
|
orientation for the progress bar |
required |
Source code in prettyqt/widgets/progressbar.py
set_text_direction(text_direction: TextDirectionStr | widgets.QProgressBar.Direction)
Set the text direction of the layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_direction
|
TextDirectionStr | Direction
|
text direction for the layout |
required |
Source code in prettyqt/widgets/progressbar.py
ProgressDialog
Bases: DialogMixin, QProgressDialog
Feedback on the progress of a slow operation.
Source code in prettyqt/widgets/progressdialog.py
ProxyStyle
Bases: CommonStyleMixin, QProxyStyle
Convenience class that simplifies dynamically overriding QStyle elements.
Source code in prettyqt/widgets/proxystyle.py
PushButton
RadioButton
Bases: AbstractButtonMixin, QRadioButton
Radio button with a text label.
Source code in prettyqt/widgets/radiobutton.py
RhiWidget
Bases: RhiWidgetMixin, QRhiWidget
Widget for rendering 3D graphics via the Qt Rendering Hardware Interface.
Source code in prettyqt/widgets/rhiwidget.py
RhiWidgetMixin
Bases: WidgetMixin, _RhiWidgetBase
Source code in prettyqt/widgets/rhiwidget.py
get_api() -> ApiStr
get_color_buffer_format() -> TextureFormatStr
get_fixed_color_buffer_size() -> core.Size
set_api(api: ApiStr | mod.Api)
Set the graphics API to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api
|
ApiStr | Api
|
graphics API |
required |
set_color_buffer_format(fmt: TextureFormatStr | mod.TextureFormat)
Set the texture format for the color buffer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmt
|
TextureFormatStr | TextureFormat
|
texture format |
required |
RubberBand
ScrollArea
Bases: AbstractScrollAreaMixin, QScrollArea
Scrolling view onto another widget.
Source code in prettyqt/widgets/scrollarea.py
get_visible_widgets(typ: type[T] = widgets.QWidget, partial_allowed: bool = True, margin: int = 10, recursive: bool = True) -> listdelegators.ListDelegator[T]
Return all widgets which are visible in the viewport.
Results can be filtered by type and whether widget is fully or partially visible. A positive margin increases the area to search for widgets, a negative margin decreases it.
Source code in prettyqt/widgets/scrollarea.py
ScrollBar
Scroller
Bases: ObjectMixin
Enables kinetic scrolling for any scrolling widget or graphics item.
Source code in prettyqt/widgets/scroller.py
ScrollerProperties
Bases: QScrollerProperties
Stores the settings for a QScroller.
Source code in prettyqt/widgets/scrollerproperties.py
get_scroll_metric(metric: ScrollmetricStr | mod.ScrollMetric) -> Any
Return scroll metric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric
|
ScrollmetricStr | ScrollMetric
|
Scroll metric to get |
required |
Source code in prettyqt/widgets/scrollerproperties.py
set_scroll_metric(metric: ScrollmetricStr | mod.ScrollMetric, value: Any)
Set scroll metric.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric
|
ScrollmetricStr | ScrollMetric
|
Scroll metric to set |
required |
value
|
Any
|
Value to set |
required |
Source code in prettyqt/widgets/scrollerproperties.py
SizeGrip
Bases: WidgetMixin, QSizeGrip
Resize handle for resizing top-level windows.
Source code in prettyqt/widgets/sizegrip.py
SizePolicy
Bases: QSizePolicy
Layout attribute describing horizontal and vertical resizing policy.
Source code in prettyqt/widgets/sizepolicy.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
get_control_type() -> ControlTypeStr
get_horizontal_policy() -> SizePolicyStr
get_vertical_policy() -> SizePolicyStr
set_control_type(typ: ControlTypeStr | QtWidgets.QSizePolicy.ControlType)
Set the control type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
ControlTypeStr | ControlType
|
control type to set |
required |
set_horizontal_policy(policy: SizePolicyStr | QtWidgets.QSizePolicy.Policy)
Set the horizontal policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
SizePolicyStr | Policy
|
policy to set |
required |
set_vertical_policy(policy: SizePolicyStr | QtWidgets.QSizePolicy.Policy)
Set the horizontal policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
SizePolicyStr | Policy
|
policy to set |
required |
Slider
Bases: AbstractSliderMixin, QSlider
Vertical or horizontal slider.
Source code in prettyqt/widgets/slider.py
get_tick_position() -> TickPositionStr
set_tick_position(position: TickPositionAllStr | widgets.QSlider.TickPosition)
Set the tick position for the slider.
For vertical orientation, "above" equals to "left" and "below" to "right".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
TickPositionAllStr | TickPosition
|
position for the ticks |
required |
Source code in prettyqt/widgets/slider.py
SpacerItem
Bases: LayoutItemMixin, QSpacerItem
Blank space in a layout.
Source code in prettyqt/widgets/spaceritem.py
SplashScreen
Splitter
SplitterHandle
Bases: WidgetMixin, QSplitterHandle
Handle functionality for the splitter.
Source code in prettyqt/widgets/splitterhandle.py
get_orientation() -> constants.OrientationStr
set_orientation(orientation: constants.OrientationStr | constants.Orientation)
Set the orientation of the slider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
OrientationStr | Orientation
|
orientation for the slider |
required |
Source code in prettyqt/widgets/splitterhandle.py
StackedLayout
Bases: LayoutMixin, QStackedLayout
Layout containing stack of widgets where only one widget is visible at a time.
Source code in prettyqt/widgets/stackedlayout.py
StackedWidget
Bases: FrameMixin, QStackedWidget
Widget containing stack of widgets where only one widget is visible at a time.
Source code in prettyqt/widgets/stackedwidget.py
StatusBar
Bases: WidgetMixin, QStatusBar
Horizontal bar suitable for presenting status information.
Source code in prettyqt/widgets/statusbar.py
Style
Bases: StyleMixin, QStyle
Abstract base class that encapsulates the look and feel of a GUI.
Source code in prettyqt/widgets/style.py
StyleOptionHeaderV2
Bases: StyleOptionHeaderMixin, QStyleOptionHeaderV2
Describes the parameters for drawing a header (v2).
Source code in prettyqt/widgets/styleoptionheaderv2.py
StyleOptionMenuItemV2
Bases: StyleOptionMenuItemMixin, QStyleOptionMenuItemV2
Describes the parameters for drawing a menu item (v2).
Source code in prettyqt/widgets/styleoptionmenuitemv2.py
StyleOptionSlider
Bases: StyleOptionComplexMixin, QStyleOptionSlider
Source code in prettyqt/widgets/styleoptionslider.py
is_horizontal() -> bool
is_vertical() -> bool
set_horizontal() -> None
StylePainter
Bases: PainterMixin, QStylePainter
Convenience class for drawing QStyle elements inside a widget.
Source code in prettyqt/widgets/stylepainter.py
SystemTrayIcon
Bases: ObjectMixin, QSystemTrayIcon
Icon for an application in the system tray.
Source code in prettyqt/widgets/systemtrayicon.py
set_icon(icon: datatypes.IconType)
Set the system tray icon.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
IconType
|
icon to use |
required |
TabBar
TabWidget
Bases: WidgetMixin, QTabWidget
Stack of tabbed widgets.
Source code in prettyqt/widgets/tabwidget.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
add(widget: widgets.QWidget | widgets.QLayout)
Add widget / layout to TabWidget.
Tab label is chosen based on following order: windowTitle -> objectName -> className
Source code in prettyqt/widgets/tabwidget.py
attach_tab(widget: widgets.QWidget | widgets.QLayout, name: str, icon: datatypes.IconType = None, insert_at: int | None = None)
Re-attach tab.
Re-attach the tab by removing the content from the DetachedTab window, closing it, and placing the content back into the DetachableTabWidget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
widget
|
Union[QWidget, QLayout]
|
the content widget from the DetachedTab window |
required |
name
|
str
|
the name of the detached tab |
required |
icon
|
IconType
|
the window icon for the detached tab |
None
|
insert_at
|
Optional[int]
|
insert the re-attached tab at the given index |
None
|
Source code in prettyqt/widgets/tabwidget.py
close_detached_tabs()
detach_tab(index: int, point: datatypes.PointType)
Detach tab by removing its contents and placing them in a DetachedTab window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
index location of the tab to be detached |
required |
point
|
QPoint
|
screen pos for creating the new DetachedTab window |
required |
Source code in prettyqt/widgets/tabwidget.py
get_tab_position() -> TabPositionStr
get_tab_shape() -> TabShapeStr
open_widget(widget: widgets.QWidget, title: str = 'Unnamed')
Create a tab containing delivered widget.
set_icon_size(size: datatypes.SizeType)
set_tab_position(position: TabPositionStr | widgets.QTabWidget.TabPosition)
Set tab position for the tabwidget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
TabPositionStr | TabPosition
|
tab position to use |
required |
set_tab_shape(shape: TabShapeStr | widgets.QTabWidget.TabShape)
Set tab shape for the tabwidget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
TabShapeStr | TabShape
|
tab shape to use |
required |
update_tab_bar_visibility()
Update visibility of the tabBar depending of the number of tabs.
0 or 1 tab -> tabBar hidden, 2+ tabs - >tabBar visible need to be called explicitly, or be connected to tabInserted/tabRemoved
Source code in prettyqt/widgets/tabwidget.py
TableView
Bases: TableViewMixin, QTableView
Default model/view implementation of a table view.
Source code in prettyqt/widgets/tableview.py
TableViewMixin
Bases: AbstractItemViewMixin, _TableViewBase
Source code in prettyqt/widgets/tableview.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |
auto_span(orientation: constants.OrientationStr | constants.Orientation = constants.HORIZONTAL, role=constants.DISPLAY_ROLE, start: tuple[int, int] = (0, 0), end: tuple[int, int] | None = None) -> list[tuple[int, int, int, int]]
Set spans in given direction based on same content in given role.
Source code in prettyqt/widgets/tableview.py
get_grid_style() -> constants.PenStyleStr
get_visible_section_span(orientation: constants.OrientationStr | constants.Orientation, margin: int = 0) -> tuple[int, int]
Get a tuple containing the visible start/end indexes.
if there are no items visible, return -1, -1
Source code in prettyqt/widgets/tableview.py
set_grid_style(style: constants.PenStyleStr | constants.PenStyle)
Set grid style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
PenStyleStr | PenStyle
|
grid style to use |
required |
set_sorting_enabled(enabled: bool, do_sort: bool = False)
Hack to avoid direct sort when setting sorting enabled.
Source code in prettyqt/widgets/tableview.py
TableWidgetItem
Bases: QTableWidgetItem
Item for use with the QTableWidget class.
Source code in prettyqt/widgets/tablewidgetitem.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
get_checkstate() -> constants.CheckStateStr
set_checkstate(state: constants.CheckStateStr | constants.CheckState)
Set checkstate of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
CheckStateStr | CheckState
|
checkstate to use |
required |
set_editable(editable: bool)
set_flag(flag_name: constants.ItemFlagStr | constants.ItemFlag, value: bool)
Set a flag based on str name.
Source code in prettyqt/widgets/tablewidgetitem.py
set_icon(icon: datatypes.IconType)
Set the icon for the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
IconType
|
icon to use |
required |
set_text_alignment(horizontal: constants.HorizontalAlignmentStr | constants.AlignmentFlag | None = None, vertical: constants.VerticalAlignmentStr | constants.AlignmentFlag | None = None)
Set text alignment of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizontal
|
HorizontalAlignmentStr | AlignmentFlag | None
|
horizontal text alignment to use |
None
|
vertical
|
VerticalAlignmentStr | AlignmentFlag | None
|
vertical text alignment to use |
None
|
Source code in prettyqt/widgets/tablewidgetitem.py
TapGesture
Bases: GestureMixin, QTapGesture
Describes a tap gesture made by the user.
Source code in prettyqt/widgets/tapgesture.py
TextBrowser
Bases: TextEditMixin, QTextBrowser
Rich text browser with hypertext navigation.
Source code in prettyqt/widgets/textbrowser.py
TextEdit
Bases: TextEditMixin, QTextEdit
Widget that is used to edit and display both plain and rich text.
Source code in prettyqt/widgets/textedit.py
TextEditMixin
Bases: AbstractScrollAreaMixin, _TextEditBase
Source code in prettyqt/widgets/textedit.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
get_auto_formatting() -> AutoFormattingStr
get_line_wrap_mode() -> LineWrapModeStr
get_word_wrap_mode() -> gui.textoption.WordWrapModeStr
set_auto_formatting(mode: AutoFormattingStr | widgets.QTextEdit.AutoFormattingFlag)
Set auto formatting mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
AutoFormattingStr | AutoFormattingFlag
|
auto formatting mode to use |
required |
Source code in prettyqt/widgets/textedit.py
set_line_wrap_mode(mode: LineWrapModeStr | widgets.QTextEdit.LineWrapMode)
Set line wrap mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
LineWrapModeStr | LineWrapMode
|
line wrap mode to use |
required |
set_word_wrap_mode(mode: gui.textoption.WordWrapModeStr | gui.QTextOption.WrapMode)
Set word wrap mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
WordWrapModeStr | WrapMode
|
word wrap mode to use |
required |
Source code in prettyqt/widgets/textedit.py
TimeEdit
Bases: DateTimeEditMixin, QTimeEdit
Widget for editing times based on the QDateTimeEdit widget.
Source code in prettyqt/widgets/timeedit.py
ToolBar
ToolBox
Bases: FrameMixin, QToolBox
Column of tabbed widget items.
Source code in prettyqt/widgets/toolbox.py
ToolButton
Bases: AbstractButtonMixin, QToolButton
Quick-access button to commands or options, usually used inside a QToolBar.
Source code in prettyqt/widgets/toolbutton.py
get_arrow_type() -> constants.ArrowTypeStr
get_popup_mode() -> PopupModeStr
get_style() -> constants.ToolButtonStyleStr
set_arrow_type(mode: constants.ArrowTypeStr | constants.ArrowType)
Set the arrow type of the toolbutton.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ArrowTypeStr | ArrowType
|
arrow type to use |
required |
set_popup_mode(mode: PopupModeStr | widgets.QToolButton.ToolButtonPopupMode)
Set the popup mode of the toolbutton.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
PopupModeStr | ToolButtonPopupMode
|
popup mode to use |
required |
set_style(style: constants.ToolButtonStyleStr | constants.ToolButtonStyle)
Set the toolbutton style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
ToolButtonStyleStr | ToolButtonStyle
|
style to use |
required |
ToolTip
Bases: QToolTip
Tool tips (balloon help) for any widget.
Source code in prettyqt/widgets/tooltip.py
TreeView
Bases: TreeViewMixin, QTreeView
Default model/view implementation of a tree view.
Source code in prettyqt/widgets/treeview.py
TreeViewMixin
Bases: AbstractItemViewMixin, _TreeViewBase
Source code in prettyqt/widgets/treeview.py
set_expanded(index: core.ModelIndex | Iterable[core.ModelIndex], expanded: bool = True)
Set expaned state of an index or an Iterable of indexes.
Source code in prettyqt/widgets/treeview.py
set_sorting_enabled(enabled: bool, do_sort: bool = False)
Hack to avoid direct sort when setting sorting enabled.
Source code in prettyqt/widgets/treeview.py
TreeWidget
TreeWidgetItem
Bases: SerializeMixin, QTreeWidgetItem
Source code in prettyqt/widgets/treewidgetitem.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | |
get_checkstate(column: int = 0) -> constants.CheckStateStr
Return checkstate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column
|
int
|
column |
0
|
get_child_indicator_policy() -> ChildIndicatorPolicyStr
Return current child indicator policy.
get_children(recursive: bool = False) -> listdelegators.ListDelegator[QtWidgets.QTreeWidgetItem]
Get children of this item.
recursive option is written iteratively to also support original QTreeWidgetItems.
Source code in prettyqt/widgets/treewidgetitem.py
set_checkstate(state: constants.CheckStateStr | constants.CheckState, column: int = 0)
Set checkstate of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
CheckStateStr | CheckState
|
checkstate to use |
required |
column
|
int
|
column |
0
|
Source code in prettyqt/widgets/treewidgetitem.py
set_child_indicator_policy(policy: ChildIndicatorPolicyStr | mod.ChildIndicatorPolicy)
Set the child indicator policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
ChildIndicatorPolicyStr | ChildIndicatorPolicy
|
child indicator policy |
required |
Source code in prettyqt/widgets/treewidgetitem.py
set_icon(icon: datatypes.IconType, column: int = 0)
Set the icon for the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
IconType
|
icon to use |
required |
column
|
int
|
column |
0
|
UndoView
Bases: ListViewMixin, QUndoView
Displays the contents of a QUndoStack.
Source code in prettyqt/widgets/undoview.py
set_clean_icon(icon: datatypes.IconType)
Set the icon for the clean button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
IconType
|
icon to use |
required |
VBoxLayout
WhatsThis
Bases: QWhatsThis
Simple description of any widget, i.e. answering the question "What's This?".
Source code in prettyqt/widgets/whatsthis.py
Widget
Bases: WidgetMixin, QWidget
The base class of all user interface objects.
Source code in prettyqt/widgets/widget.py
WidgetItem
Bases: LayoutItemMixin, QWidgetItem
Layout item that represents a widget.
Source code in prettyqt/widgets/widgetitem.py
WidgetMixin
Bases: ObjectMixin, PaintDeviceMixin, _WidgetBase
Source code in prettyqt/widgets/widget.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 | |
add_action(text: str | gui.Action, *, parent: widgets.QWidget | None = None, data: Any = None, callback: Callable | None = None, **kwargs: Any) -> gui.Action
Add an action to the menu.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str | Action
|
Label for the action |
required |
parent
|
QWidget | None
|
parent |
None
|
data
|
Any
|
data for the Action |
None
|
callback
|
Callable | None
|
callback to be called when action is triggered |
None
|
kwargs
|
Any
|
kwargs passed to action ctor |
{}
|
Returns: Action added to menu
Source code in prettyqt/widgets/widget.py
add_shortcut(keysequence: datatypes.KeyCombinationType, *, callback: Callable | None = None, context: constants.ShortcutContextStr = 'window') -> gui.Shortcut
Add shortcut to widget.
Adds as shortcut for given callback and context to this widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
keysequence
|
KeyCombinationType
|
Key sequence |
required |
callback
|
Callable | None
|
Callback for the shortcut |
None
|
context
|
ShortcutContextStr
|
context for this shortcut |
'window'
|
Source code in prettyqt/widgets/widget.py
child_at(*args, typ: type[widgets.QWidget] | None = None)
Get child widget at position. If type is given, search parents recursively.
Source code in prettyqt/widgets/widget.py
delete_children()
Delete all children of the specified QObject.
Source code in prettyqt/widgets/widget.py
edit_font() -> Generator[gui.Font]
edit_palette() -> Generator[gui.Palette]
Context manager to edit the palette of the widget.
edit_stylesheet() -> Generator[qstylizer.style.StyleSheet]
Context manager to edit the stylesheet (using qstylizer).
get_background_role() -> gui.palette.RoleStr
get_context_menu_policy() -> constants.ContextPolicyStr
get_focus_policy() -> constants.FocusPolicyStr
Return waay the widget accepts keyboard focus.
get_foreground_role() -> gui.palette.RoleStr
get_icon() -> gui.Icon | None
get_image() -> gui.QPixmap
Get a pixmap for the widget.
Implements a workaround to also include QOpenGlWidgets.
Source code in prettyqt/widgets/widget.py
get_layout_direction() -> constants.LayoutDirectionStr
Get the current layout direction.
get_modality() -> constants.WindowModalityStr
Get the current modality modes as a string.
get_size_policy() -> widgets.SizePolicy
get_stylesheet() -> qstylizer.style.StyleSheet
get_window_state() -> constants.WindowStateStr
grab_keyboard_events() -> Generator[None]
grab_mouse_events(cursor_shape: constants.CursorShapeStr | None = None) -> Generator[None]
Context manager to grab mouse events.
Source code in prettyqt/widgets/widget.py
insertAction(position_or_action: int | gui.QAction, action: gui.QAction)
Extend insertAction to also allow int index.
Source code in prettyqt/widgets/widget.py
map_from(widget: widgets.QWidget | Literal['global', 'parent', 'window'], pos_or_rect: datatypes.PointType | datatypes.RectType | datatypes.PointFType | datatypes.RectFType) -> core.QRect | core.QRectF | core.QPoint | core.QPointF
Map a point or rect from a widget, global position or parent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
widget
|
QWidget | Literal['global', 'parent', 'window']
|
What to map from. |
required |
pos_or_rect
|
PointType | RectType | PointFType | RectFType
|
Point or rect to map. |
required |
Source code in prettyqt/widgets/widget.py
map_to(widget: widgets.QWidget | Literal['global', 'parent', 'window'], pos_or_rect: datatypes.PointType | datatypes.RectType | datatypes.PointFType | datatypes.RectFType) -> core.QRect | core.QRectF | core.QPoint | core.QPointF
Map a point or rect to a widget, global position or parent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
widget
|
QWidget | Literal['global', 'parent', 'window']
|
What to map to. |
required |
pos_or_rect
|
PointType | RectType | PointFType | RectFType
|
Point or rect to map. |
required |
Source code in prettyqt/widgets/widget.py
position_on(where: PositionPossibilityType, how: Literal['center', 'top', 'left', 'bottom', 'right', 'top_left', 'top_right', 'bottom_left', 'bottom_right'] = 'center', *, scale_ratio: float | None = None, x_offset: int = 0, y_offset: int = 0)
Position widget on another widget / window / screen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
where
|
PositionPossibilityType
|
where to positin on |
required |
how
|
Literal['center', 'top', 'left', 'bottom', 'right', 'top_left', 'top_right', 'bottom_left', 'bottom_right']
|
How to align |
'center'
|
scale_ratio
|
float | None
|
Resize to scale_ratio * target size |
None
|
x_offset
|
int
|
additional x offset for final position |
0
|
y_offset
|
int
|
additional y offset for final position |
0
|
Source code in prettyqt/widgets/widget.py
983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 | |
raise_to_top()
Brings a widget to top with all means available.
Source code in prettyqt/widgets/widget.py
set_attributes(*, accept_drops: bool | None = None, always_show_tooltips: bool | None = None, custom_whats_this: bool | None = None, delete_on_close: bool | None = None, disabled: bool | None = None, dont_show_on_screen: bool | None = None, force_disabled: bool | None = None, force_updates_disabled: bool | None = None, hover: bool | None = None, input_method_enabled: bool | None = None, keyboard_focus_change: bool | None = None, key_compression: bool | None = None, layout_on_entire_rect: bool | None = None, layout_uses_widget_rect: bool | None = None, mapped: bool | None = None, mouse_no_mask: bool | None = None, mouse_tracking: bool | None = None, moved: bool | None = None, no_child_events_for_parent: bool | None = None, no_child_events_from_children: bool | None = None, no_mouse_replay: bool | None = None, no_mouse_propagation: bool | None = None, transparent_for_mouse_events: bool | None = None, no_system_background: bool | None = None, opaque_paint_event: bool | None = None, outside_ws_range: bool | None = None, paint_on_screen: bool | None = None, paint_unclipped: bool | None = None, pending_move_event: bool | None = None, pending_resize_egent: bool | None = None, quit_on_close: bool | None = None, resized: bool | None = None, right_to_left: bool | None = None, set_cursor: bool | None = None, set_font: bool | None = None, set_palette: bool | None = None, set_style: bool | None = None, static_contents: bool | None = None, style_sheet: bool | None = None, style_sheet_target: bool | None = None, tablet_tracking: bool | None = None, translucent_background: bool | None = None, under_mouse: bool | None = None, updates_disabled: bool | None = None, window_modified: bool | None = None, window_propagation: bool | None = None, mac_always_show_tool_window: bool | None = None, set_locale: bool | None = None, styled_background: bool | None = None, show_without_activating: bool | None = None, native_window: bool | None = None, dont_create_native_ancestors: bool | None = None, accept_touch_events: bool | None = None, touch_pad_single_touch_events: bool | None = None, always_stack_on_top: bool | None = None, contents_margins_respects_safe_area: bool | None = None)
Set window attributes.
Attributes:
| Name | Type | Description |
|---|---|---|
accept_drops |
set AcceptDrops attribute |
|
always_show_tooltips |
set AlwaysShowToolTips attribute |
|
custom_whats_this |
set CustomWhatsThis attribute |
|
delete_on_close |
set DeleteOnClose attribute |
|
disabled |
set Disabled attribute |
|
dont_show_on_screen |
set DontShowOnScreen attribute |
|
force_disabled |
set ForceDisabled attribute |
|
force_updates_disabled |
set ForceUpdatesDisabled attribute |
|
hover |
set Hover attribute |
|
input_method_enabled |
set InputMethodEnabled attribute |
|
keyboard_focus_change |
set KeyboardFocusChange attribute |
|
key_compression |
set KeyCompression attribute |
|
layout_on_entire_rect |
set LayoutOnEntireRect attribute |
|
layout_uses_widget_rect |
set LayoutUsesWidgetRect attribute |
|
mapped |
set Mapped attribute |
|
mouse_no_mask |
set MouseNoMask attribute |
|
mouse_tracking |
set MouseTracking attribute |
|
moved |
set Moved attribute |
|
no_child_events_for_parent |
set NoChildEventsForParent attribute |
|
no_child_events_from_children |
set NoChildEventsFromChildren attribute |
|
no_mouse_replay |
set NoMouseReplay attribute |
|
no_mouse_propagation |
set NoMousePropagation attribute |
|
transparent_for_mouse_events |
set TransparentForMouseEvents attribute |
|
no_system_background |
set NoSystemBackground attribute |
|
opaque_paint_event |
set OpaquePaintEvent attribute |
|
outside_ws_range |
set OutsideWSRange attribute |
|
paint_on_screen |
set PaintOnScreen attribute |
|
paint_unclipped |
set PaintUnclipped attribute |
|
pending_move_event |
set PendingMoveEvent attribute |
|
pending_resize_egent |
set PendingResizeEvent attribute |
|
quit_on_close |
set QuitOnClose attribute |
|
resized |
set Resized attribute |
|
right_to_left |
set RightToLeft attribute |
|
set_cursor |
set SetCursor attribute |
|
set_font |
set SetFont attribute |
|
set_palette |
set SetPalette attribute |
|
set_style |
set SetStyle attribute |
|
static_contents |
set StaticContents attribute |
|
style_sheet |
set StyleSheet attribute |
|
style_sheet_target |
set StyleSheetTarget attribute |
|
tablet_tracking |
set TabletTracking attribute |
|
translucent_background |
set TranslucentBackground attribute |
|
under_mouse |
set UnderMouse attribute |
|
updates_disabled |
set UpdatesDisabled attribute |
|
window_modified |
set WindowModified attribute |
|
window_propagation |
set WindowPropagation attribute |
|
mac_always_show_tool_window |
set MacAlwaysShowToolWindow attribute |
|
set_locale |
set SetLocale attribute |
|
styled_background |
set StyledBackground attribute |
|
show_without_activating |
set ShowWithoutActivating attribute |
|
native_window |
set NativeWindow attribute |
|
dont_create_native_ancestors |
set DontCreateNativeAncestors attribute |
|
accept_touch_events |
set AcceptTouchEvents attribute |
|
touch_pad_single_touch_events |
set TouchPadAcceptSingleTouchEvents attribute |
|
always_stack_on_top |
set AlwaysStackOnTop attribute |
|
contents_margins_respects_safe_area |
set ContentsMarginsRespectsSafeArea attribute |
Source code in prettyqt/widgets/widget.py
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 | |
set_background_role(role: gui.palette.RoleStr | gui.Palette.ColorRole)
set_context_menu_policy(policy: constants.ContextPolicyStr | constants.ContextMenuPolicy)
set_cursor(cursor: constants.CursorShapeStr | constants.CursorShape | gui.QCursor)
Set the cursor for this widget.
Source code in prettyqt/widgets/widget.py
set_flags(*, minimize: bool | None = None, maximize: bool | None = None, close: bool | None = None, stay_on_top: bool | None = None, frameless: bool | None = None, window: bool | None = None, dialog: bool | None = None, tooltip: bool | None = None, tool: bool | None = None, customize: bool | None = None, cover: bool | None = None, window_title: bool | None = None)
Set window flags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
minimize
|
bool | None
|
set WindowMinimizeButtonHint flag |
None
|
maximize
|
bool | None
|
set WindowMaximizeButtonHint flag |
None
|
close
|
bool | None
|
set WindowCloseButtonHint flag |
None
|
stay_on_top
|
bool | None
|
set WindowStaysOnTopHint flag |
None
|
frameless
|
bool | None
|
set FramelessWindowHint flag |
None
|
window
|
bool | None
|
set Window flag |
None
|
dialog
|
bool | None
|
set Dialog flag |
None
|
tooltip
|
bool | None
|
set ToolTip flag |
None
|
tool
|
bool | None
|
set Tool flag |
None
|
customize
|
bool | None
|
set CustomizeWindowHint flag |
None
|
cover
|
bool | None
|
set CoverWindow flag |
None
|
window_title
|
bool | None
|
set WindowTitleHint flag |
None
|
Source code in prettyqt/widgets/widget.py
set_focus_policy(policy: constants.FocusPolicyStr | constants.FocusPolicy)
Set the way the widget accepts keyboard focus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
str
|
Focus policy |
required |
Source code in prettyqt/widgets/widget.py
set_font(font_name: gui.QFont | str | None = None, *, font_size: int | None = None, weight: int | None = None, italic: bool = False) -> gui.QFont
Set the font for this widget.
Source code in prettyqt/widgets/widget.py
set_foreground_role(role: gui.palette.RoleStr | gui.Palette.ColorRole)
set_icon(icon: datatypes.IconType)
Set the window icon.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
IconType
|
icon to use |
required |
Source code in prettyqt/widgets/widget.py
set_layout(layout: LayoutStr | widgets.QLayout, *, margin: int | None = None, **kwargs: datatypes.VariantType) -> widgets.QLayout
set_layout(
layout: Literal["horizontal"], *, margin: int | None = None, **kwargs
) -> widgets.HBoxLayout
set_layout(
layout: Literal["vertical"], *, margin: int | None = None, **kwargs
) -> widgets.VBoxLayout
set_layout(
layout: Literal["border"], *, margin: int | None = None, **kwargs
) -> custom_widgets.BorderLayout
set_layout(
layout: Literal["flow"], *, margin: int | None = None, **kwargs
) -> custom_widgets.FlowLayout
Quick way to set a layout.
Sets layout to given layout, also allows setting margin and spacing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layout
|
LayoutStr | QLayout
|
Layout to set |
required |
margin
|
int | None
|
margin to use in pixels |
None
|
kwargs
|
VariantType
|
keyword arguments passed to layout |
{}
|
Source code in prettyqt/widgets/widget.py
set_layout_direction(direction: constants.LayoutDirectionStr | constants.LayoutDirection | None)
Set layout direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
direction
|
LayoutDirectionStr | LayoutDirection | None
|
layout direction |
required |
Source code in prettyqt/widgets/widget.py
set_margin(margin: datatypes.MarginsType)
Set content margins for the widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
margin
|
MarginsType
|
margins to use |
required |
set_mask(area: datatypes.RectType | gui.QRegion | gui.QBitmap | None, typ: gui.region.RegionTypeStr = 'rectangle')
Set mask of the widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
area
|
RectType | QRegion | QBitmap | None
|
Mask area |
required |
typ
|
RegionTypeStr
|
type of region (only used if area is a QRegion) |
'rectangle'
|
Source code in prettyqt/widgets/widget.py
set_modality(modality: constants.WindowModalityStr | constants.WindowModality)
Set modality for the dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modality
|
WindowModalityStr | WindowModality
|
modality for the main window |
required |
Source code in prettyqt/widgets/widget.py
set_size_policy(horizontal: widgets.sizepolicy.SizePolicyStr | widgets.QSizePolicy.Policy | None = None, vertical: widgets.sizepolicy.SizePolicyStr | widgets.QSizePolicy.Policy | None = None)
Set the size policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizontal
|
SizePolicyStr | Policy | None
|
horizontal size policy |
None
|
vertical
|
SizePolicyStr | Policy | None
|
vertical size policy |
None
|
Source code in prettyqt/widgets/widget.py
set_style(style: str | widgets.QStyle)
set_stylesheet(ss: str | qstylizer.style.StyleSheet | datatypes.PathType | None)
Set stylesheet for this widget.
Source code in prettyqt/widgets/widget.py
set_tooltip(tooltip: str | datatypes.PathType, *, size: datatypes.SizeType | None = None, rich_text: bool = False)
Set a tooltip for this widget.
In image can get displayed by passing a PathLike object.
Source code in prettyqt/widgets/widget.py
set_window_state(state: constants.WindowStateStr | constants.WindowState)
Set window state for given item view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
WindowStateStr | WindowState
|
window state to use |
required |
show_tooltip(duration: int | None = None)
Show the tooltip of this widget for given time.
When no duration is given, it will get calculated based on length.
Source code in prettyqt/widgets/widget.py
toggle_fullscreen() -> bool
toggle_maximized() -> bool
updates_off() -> Generator[None]
Context manager to turn off updates for this widget.