gui
Class info
Classes
| Name | Children | Inherits |
|---|---|---|
| AbstractFileIconProvider prettyqt.gui.abstractfileiconprovider File icons for the QFileSystemModel class. |
||
| AbstractFileIconProviderMixin prettyqt.gui.abstractfileiconprovider |
||
| AbstractTextDocumentLayout prettyqt.gui.abstracttextdocumentlayout Abstract base class used to implement custom layouts for QTextDocuments. |
||
| AbstractTextDocumentLayoutMixin prettyqt.gui.abstracttextdocumentlayout |
||
| AccessibilityHints prettyqt.gui.accessibilityhints Contains platform accessibility hints and settings. |
||
| AccessibilityHintsMixin prettyqt.gui.accessibilityhints |
||
| Action prettyqt.gui.action Abstraction for user commands that can be added to different GUI components. |
|
|
| ActionGroup prettyqt.gui.actiongroup Groups actions together. |
||
| ActionMixin prettyqt.gui.action |
||
| BackingStore prettyqt.gui.backingstore Drawing area for QWindow. |
||
| Bitmap prettyqt.gui.bitmap Monochrome (1-bit depth) pixmaps. |
||
| Brush prettyqt.gui.brush Defines the fill pattern of shapes drawn by QPainter. |
|
|
| Clipboard prettyqt.gui.clipboard Access to the window system clipboard. |
||
| Color prettyqt.gui.color Colors based on RGB, HSV or CMYK values. |
||
| ColorSpace prettyqt.gui.colorspace Color space abstraction. |
|
|
| ColorTransform prettyqt.gui.colortransform Transformation between color spaces. |
||
| ConicalGradient prettyqt.gui.conicalgradient Used in combination with QBrush to specify a conical gradient brush. |
||
| Cursor prettyqt.gui.cursor Provides a mouse cursor with an arbitrary shape. |
|
|
| DesktopServices prettyqt.gui.desktopservices Methods for accessing common desktop services. |
||
| DoubleValidator prettyqt.gui.doublevalidator Range checking of floating-point numbers. |
||
| Drag prettyqt.gui.drag Support for MIME-based drag and drop data transfer. |
||
| Font prettyqt.gui.font Specifies a query for a font used for drawing text. |
||
| FontDatabase prettyqt.gui.fontdatabase Information about the fonts available in the underlying window system. |
||
| FontInfo prettyqt.gui.fontinfo General information about fonts. |
||
| FontMetrics prettyqt.gui.fontmetrics Font metrics information. |
||
| FontMetricsF prettyqt.gui.fontmetricsf Font metrics information. |
||
| FontVariableAxis prettyqt.gui.fontvariableaxis Represents a variable axis in a font. |
||
| Gradient prettyqt.gui.gradient Used in combination with QBrush to specify gradient fills. |
||
| GradientMixin prettyqt.gui.gradient |
||
| GuiApplication prettyqt.gui.guiapplication Manages the GUI application's control flow and main settings. |
||
| GuiApplicationMixin prettyqt.gui.guiapplication |
|
|
| Icon prettyqt.gui.icon Scalable icons in different modes and states. |
|
|
| IconEngine prettyqt.gui.iconengine Abstract base class for QIcon renderers. |
|
|
| Image prettyqt.gui.image Hardware-independent image representation with direct access to the pixel data. |
|
|
| ImageIOHandler prettyqt.gui.imageiohandler Defines the common image I/O interface for all image formats in Qt. |
||
| ImageReader prettyqt.gui.imagereader Format independent interface for reading images from files or other devices. |
||
| ImageWriter prettyqt.gui.imagewriter Format independent interface for writing images to files or other devices. |
||
| InputMethod prettyqt.gui.inputmethod |
||
| IntValidator prettyqt.gui.intvalidator Validator that ensures a string contains a integer within a specified range. |
||
| KeySequence prettyqt.gui.keysequence Encapsulates a key sequence as used by shortcuts. |
||
| LinearGradient prettyqt.gui.lineargradient Used in combination with QBrush to specify a linear gradient brush. |
||
| Matrix4x4 prettyqt.gui.matrix4x4 Represents a 4x4 transformation matrix in 3D space. |
||
| Movie prettyqt.gui.movie Convenience class for playing movies with QImageReader. |
||
| PageLayout prettyqt.gui.pagelayout Describes the size, orientation and margins of a page. |
||
| PageRanges prettyqt.gui.pageranges Represents a collection of page ranges. |
||
| PageSize prettyqt.gui.pagesize Describes the size and name of a defined page size. |
||
| PagedPaintDevice prettyqt.gui.pagedpaintdevice |
||
| PagedPaintDeviceMixin prettyqt.gui.pagedpaintdevice |
||
| PaintDevice prettyqt.gui.paintdevice The base class of objects that can be painted on with QPainter. |
||
| PaintDeviceMixin prettyqt.gui.paintdevice |
||
| PaintDeviceWindow prettyqt.gui.paintdevicewindow |
||
| PaintDeviceWindowMixin prettyqt.gui.paintdevicewindow |
||
| Painter prettyqt.gui.painter Performs low-level painting on widgets and other paint devices. |
||
| PainterMixin prettyqt.gui.painter |
||
| PainterPath prettyqt.gui.painterpath |
||
| PainterPathStroker prettyqt.gui.painterpathstroker |
||
| Palette prettyqt.gui.palette Contains color groups for each widget state. |
|
|
| PdfOutputIntent prettyqt.gui.pdfoutputintent Metadata describing the color reproduction characteristics of a PDF document. |
||
| PdfWriter prettyqt.gui.pdfwriter Class to generate PDFs that can be used as a paint device. |
||
| Pen prettyqt.gui.pen Defines how a QPainter should draw lines and outlines of shapes. |
|
|
| Picture prettyqt.gui.picture Paint device that records and replays QPainter commands. |
|
|
| Pixmap prettyqt.gui.pixmap |
||
| PixmapCache prettyqt.gui.pixmapcache Application-wide cache for pixmaps. |
||
| PixmapMixin prettyqt.gui.pixmap Off-screen image representation that can be used as a paint device. |
|
|
| Polygon prettyqt.gui.polygon List of points using integer precision. |
|
|
| PolygonF prettyqt.gui.polygonf List of points using floating point precision. |
|
|
| Quaternion prettyqt.gui.quaternion Represents a quaternion consisting of a vector and scalar. |
||
| RadialGradient prettyqt.gui.radialgradient Used in combination with QBrush to specify a radial gradient brush. |
||
| RasterWindow prettyqt.gui.rasterwindow Convenience class for using QPainter on a QWindow. |
||
| Region prettyqt.gui.region |
|
|
| RegularExpressionValidator prettyqt.gui.regularexpressionvalidator Used to check a string against a regular expression. |
||
| Screen prettyqt.gui.screen Used to query screen properties. |
||
| SessionManager prettyqt.gui.sessionmanager |
||
| Shortcut prettyqt.gui.shortcut |
||
| StandardItem prettyqt.gui.standarditem |
|
|
| StandardItemModel prettyqt.gui.standarditemmodel |
||
| StaticText prettyqt.gui.statictext |
||
| StyleHints prettyqt.gui.stylehints |
||
| StyleHintsMixin prettyqt.gui.stylehints |
||
| Surface prettyqt.gui.surface |
||
| SurfaceFormat prettyqt.gui.surfaceformat |
|
|
| SurfaceMixin prettyqt.gui.surface |
||
| SyntaxHighlighter prettyqt.gui.syntaxhighlighter |
|
|
| TextBlock prettyqt.gui.textblock |
||
| TextBlockFormat prettyqt.gui.textblockformat |
||
| TextBlockGroup prettyqt.gui.textblockgroup |
||
| TextBlockUserData prettyqt.gui.textblockuserdata Storage for the user data associated with each line. |
||
| TextCharFormat prettyqt.gui.textcharformat |
||
| TextCharFormatMixin prettyqt.gui.textcharformat |
||
| TextCursor prettyqt.gui.textcursor |
||
| TextDocument prettyqt.gui.textdocument |
|
|
| TextDocumentFragment prettyqt.gui.textdocumentfragment |
||
| TextDocumentWriter prettyqt.gui.textdocumentwriter |
||
| TextFormat prettyqt.gui.textformat |
||
| TextFormatMixin prettyqt.gui.textformat |
|
|
| TextFrame prettyqt.gui.textframe |
|
|
| TextFrameFormat prettyqt.gui.textframeformat |
|
|
| TextImageFormat prettyqt.gui.textimageformat |
||
| TextLayout prettyqt.gui.textlayout |
||
| TextLength prettyqt.gui.textlength |
||
| TextLine prettyqt.gui.textline |
||
| TextListFormat prettyqt.gui.textlistformat |
||
| TextObject prettyqt.gui.textobject |
||
| TextObjectInterface prettyqt.gui.textobjectinterface |
||
| TextObjectMixin prettyqt.gui.textobject |
|
|
| TextOption prettyqt.gui.textoption |
||
| TextTable prettyqt.gui.texttable |
|
|
| TextTableCell prettyqt.gui.texttablecell |
||
| TextTableCellFormat prettyqt.gui.texttablecellformat |
||
| TextTableFormat prettyqt.gui.texttableformat |
|
|
| Transform prettyqt.gui.transform |
|
|
| UndoCommand prettyqt.gui.undocommand |
||
| UndoGroup prettyqt.gui.undogroup |
|
|
| UndoStack prettyqt.gui.undostack |
|
|
| Validator prettyqt.gui.validator |
||
| ValidatorMixin prettyqt.gui.validator |
||
| Vector2D prettyqt.gui.vector2d Represents a vector or vertex in 2D space. |
||
| Vector3D prettyqt.gui.vector3d |
||
| Vector4D prettyqt.gui.vector4d |
||
| Window prettyqt.gui.window |
||
| WindowMixin prettyqt.gui.window |
🛈 DocStrings
Base classes for graphical user interface (GUI) components.
AbstractFileIconProvider
Bases: AbstractFileIconProviderMixin, QAbstractFileIconProvider
File icons for the QFileSystemModel class.
Source code in prettyqt/gui/abstractfileiconprovider.py
AbstractTextDocumentLayout
Bases: AbstractTextDocumentLayoutMixin, QAbstractTextDocumentLayout
Abstract base class used to implement custom layouts for QTextDocuments.
Source code in prettyqt/gui/abstracttextdocumentlayout.py
AccessibilityHints
Bases: AccessibilityHintsMixin
Contains platform accessibility hints and settings.
Source code in prettyqt/gui/accessibilityhints.py
AccessibilityHintsMixin
Bases: ObjectMixin, _AccessibilityHintsBase
Source code in prettyqt/gui/accessibilityhints.py
get_contrast_preference() -> ContrastPreferenceStr
get_motion_preference() -> MotionPreferenceStr
Action
Bases: ActionMixin, QAction
Abstraction for user commands that can be added to different GUI components.
Source code in prettyqt/gui/action.py
ActionGroup
Bases: ObjectMixin, QActionGroup
Groups actions together.
Source code in prettyqt/gui/actiongroup.py
get_exclusion_policy() -> ExclusionPolicyStr
set_exclusion_policy(policy: ExclusionPolicyStr | QtGui.QActionGroup.ExclusionPolicy | None)
Set exclusion policy to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
ExclusionPolicyStr | ExclusionPolicy | None
|
exclusion policy to use |
required |
Source code in prettyqt/gui/actiongroup.py
ActionMixin
Bases: ObjectMixin, _ActionBase
Source code in prettyqt/gui/action.py
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 | |
get_menu_role() -> MenuRoleStr
get_priority() -> PriorityStr
get_shortcut_context() -> constants.ShortcutContextStr
set_icon(icon: datatypes.IconType)
Set the icon for the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
IconType
|
icon to use |
required |
set_menu_role(role: MenuRoleStr | gui.QAction.MenuRole)
set_priority(priority: PriorityStr | gui.QAction.Priority)
Set priority of the action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
priority
|
PriorityStr | Priority
|
priority for the action |
required |
set_shortcut_context(context: constants.ShortcutContextStr | constants.ShortcutContext)
Set shortcut context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
ShortcutContextStr | ShortcutContext
|
shortcut context |
required |
Source code in prettyqt/gui/action.py
BackingStore
Bases: QBackingStore
Drawing area for QWindow.
Source code in prettyqt/gui/backingstore.py
Bitmap
Brush
Bases: SerializeMixin, QBrush
Defines the fill pattern of shapes drawn by QPainter.
Source code in prettyqt/gui/brush.py
Clipboard
Bases: ObjectMixin
Access to the window system clipboard.
Source code in prettyqt/gui/clipboard.py
Color
Bases: QColor
Colors based on RGB, HSV or CMYK values.
Source code in prettyqt/gui/color.py
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 | |
drift(factor: float = 1.0) -> Self
Return color that is lighter or darker than the base color.
Source code in prettyqt/gui/color.py
interpolate_color(start: QtGui.QColor, end: QtGui.QColor, percent: int, colorspace: SpecStr | None = 'rgb') -> Self
classmethod
Get an interpolated color value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
QColor
|
The start color. |
required |
end
|
QColor
|
The end color. |
required |
percent
|
int
|
Which value to get (0 - 100) |
required |
colorspace
|
SpecStr | None
|
The desired interpolation color system, QColor::{Rgb,Hsv,Hsl} (from QColor::Spec enum) If None, start is used except when percent is 100. |
'rgb'
|
Return
The interpolated QColor, with the same spec as the given start color.
Source code in prettyqt/gui/color.py
ColorSpace
Bases: SerializeMixin, QColorSpace
Color space abstraction.
Source code in prettyqt/gui/colorspace.py
get_primaries() -> PrimariesStr
get_transfer_function() -> TransformFunctionStr
set_primaries(primaries: PrimariesStr | QtGui.QColorSpace.Primaries)
Set primaries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
primaries
|
PrimariesStr | Primaries
|
primaries to use |
required |
set_transfer_function(fn: TransformFunctionStr | QtGui.QColorSpace.TransferFunction, gamma: float = 0.0)
Set transfer function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fn
|
TransformFunctionStr | TransferFunction
|
transfer function to use |
required |
gamma
|
float
|
gamma value |
0.0
|
Source code in prettyqt/gui/colorspace.py
ColorTransform
Bases: QColorTransform
Transformation between color spaces.
Source code in prettyqt/gui/colortransform.py
map_color(color: datatypes.ColorType) -> gui.Color
ConicalGradient
Bases: GradientMixin, QConicalGradient
Used in combination with QBrush to specify a conical gradient brush.
Source code in prettyqt/gui/conicalgradient.py
get_css() -> str
Convert gradient to a CSS string. Can be used for stylesheets.
Source code in prettyqt/gui/conicalgradient.py
Cursor
Bases: SerializeMixin, QCursor
Provides a mouse cursor with an arbitrary shape.
This class is mainly used to create mouse cursors that are associated
with particular widgets and to get and set the position of the mouse cursor.
Qt has a number of standard cursor shapes, but you can also make custom cursor
shapes based on a QBitmap, a mask and a hotspot.
To associate a cursor with a widget, use widget.set_cursor().
To associate a cursor with all widgets (normally for a short period of time),
use GuiApplication.set_override_cursor().
To set a cursor shape use QCursor.setShape() or use the QCursor
constructor which takes the shape as argument, or you can use one of the
predefined cursors defined in the Qt.CursorShape enum.
If you want to create a cursor with your own bitmap,
either use the QCursor constructor which takes a bitmap and a mask
or the constructor which takes a pixmap as arguments.
To set or get the position of the mouse cursor use the
static methods QCursor.pos() and QCursor.setPos().
!!! note: It is possible to create a QCursor before QGuiApplication, but it is not useful except as a place-holder for a real QCursor created after QGuiApplication. Attempting to use a QCursor that was created before QGuiApplication will result in a crash.
Source code in prettyqt/gui/cursor.py
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 | |
get_shape() -> constants.CursorShapeStr
set_pos(where: Literal['screen', 'current'] | gui.QScreen | widgets.QWidget | core.QRect | core.QPoint | tuple[int, int] | tuple[int, int, int, int], how: Literal['center', 'top', 'left', 'bottom', 'right', 'top_left', 'top_right', 'bottom_left', 'bottom_right'] = 'center', x_offset: int = 0, y_offset: int = 0, duration: int = 0)
classmethod
Position cursor onto screen position / widget / window / screen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
where
|
Literal['screen', 'current'] | QScreen | QWidget | QRect | QPoint | tuple[int, int] | tuple[int, int, int, int]
|
where to position on |
required |
how
|
Literal['center', 'top', 'left', 'bottom', 'right', 'top_left', 'top_right', 'bottom_left', 'bottom_right']
|
How to align |
'center'
|
x_offset
|
int
|
additional x offset for final position |
0
|
y_offset
|
int
|
additional y offset for final position |
0
|
duration
|
int
|
movement time |
0
|
Source code in prettyqt/gui/cursor.py
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 | |
set_shape(shape: constants.CursorShapeStr)
Set cursor shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
CursorShapeStr
|
shape to use |
required |
DesktopServices
Bases: QDesktopServices
Methods for accessing common desktop services.
Source code in prettyqt/gui/desktopservices.py
DoubleValidator
Bases: ValidatorMixin, QDoubleValidator
Range checking of floating-point numbers.
Source code in prettyqt/gui/doublevalidator.py
Drag
Bases: ObjectMixin, QDrag
Support for MIME-based drag and drop data transfer.
Source code in prettyqt/gui/drag.py
Font
Bases: QFont
Specifies a query for a font used for drawing text.
Source code in prettyqt/gui/font.py
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 | |
get_capitalization() -> CapitalizationStr
get_hinting_preference() -> HintingPreferenceStr
get_letter_spacing_type() -> SpacingTypeStr
get_style() -> StyleStr
get_weight() -> WeightStr
set_capitalization(capitalization: CapitalizationStr | gui.Font.Capitalization)
Set the font capitalization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capitalization
|
CapitalizationStr | Capitalization
|
font capitalization |
required |
Source code in prettyqt/gui/font.py
set_family(family: str, fallback: str | None = None)
Set the font family.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
family
|
str
|
font family |
required |
fallback
|
str | None
|
fallback font family |
None
|
Source code in prettyqt/gui/font.py
set_hinting_preference(preference: HintingPreferenceStr | gui.Font.HintingPreference)
Set the hinting preference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preference
|
HintingPreferenceStr | HintingPreference
|
hinting preference |
required |
Source code in prettyqt/gui/font.py
set_letter_spacing(typ: SpacingTypeStr | gui.Font.SpacingType, spacing: float)
Set the letter spacing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
SpacingTypeStr | SpacingType
|
letter spacing type |
required |
spacing
|
float
|
spacing |
required |
Source code in prettyqt/gui/font.py
set_style(style: StyleStr | gui.Font.Style)
Set the font style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
StyleStr | Style
|
font style |
required |
set_style_hint(hint: StyleHintStr | gui.QFont.StyleHint)
Set the style hint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hint
|
StyleHintStr | StyleHint
|
style hint |
required |
set_weight(weight: WeightStr | gui.QFont.Weight)
Set the font weight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
weight
|
WeightStr | Weight
|
font weight |
required |
FontDatabase
Bases: QFontDatabase
Information about the fonts available in the underlying window system.
Source code in prettyqt/gui/fontdatabase.py
FontInfo
FontMetrics
Bases: QFontMetrics
Font metrics information.
Source code in prettyqt/gui/fontmetrics.py
FontMetricsF
Bases: QFontMetricsF
Font metrics information.
Source code in prettyqt/gui/fontmetricsf.py
FontVariableAxis
Bases: QFontVariableAxis
Represents a variable axis in a font.
Source code in prettyqt/gui/fontvariableaxis.py
get_tag() -> str
set_tag(tag: str | QtGui.QFont.Tag)
Set the axis tag from a string or QFont.Tag.
Source code in prettyqt/gui/fontvariableaxis.py
Gradient
Bases: GradientMixin, QGradient
Used in combination with QBrush to specify gradient fills.
Source code in prettyqt/gui/gradient.py
GradientMixin
Bases: _GradientBase
Source code in prettyqt/gui/gradient.py
get_coordinate_mode() -> CoordinateModeStr
get_spread() -> SpreadStr
get_type() -> TypeStr
set_coordinate_mode(mode: CoordinateModeStr | gui.QGradient.CoordinateMode)
Set the coordinate mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
CoordinateModeStr | CoordinateMode
|
coordinate mode |
required |
set_spread(method: SpreadStr | gui.QGradient.Spread)
Set the spread method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
SpreadStr | Spread
|
spread method |
required |
GuiApplication
Bases: GuiApplicationMixin, QGuiApplication
Manages the GUI application's control flow and main settings.
Source code in prettyqt/gui/guiapplication.py
GuiApplicationMixin
Bases: CoreApplicationMixin, _GuiApplicationBase
Source code in prettyqt/gui/guiapplication.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 | |
copy_to_clipboard(text: str)
classmethod
get_application_state() -> list[constants.ApplicationStateStr]
classmethod
Get the current application state.
Source code in prettyqt/gui/guiapplication.py
get_high_dpi_scale_factor_rounding_policy() -> constants.HighDpiScaleFactorRoundingPolicyStr
classmethod
Get the current high dpi scale factor rounding policy.
Source code in prettyqt/gui/guiapplication.py
get_layout_direction() -> constants.LayoutDirectionStr
set_high_dpi_scale_factor_rounding_policy(policy: constants.HighDpiScaleFactorRoundingPolicyStr | constants.HighDpiScaleFactorRoundingPolicy)
classmethod
Set high dpi scale factor rounding policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
HighDpiScaleFactorRoundingPolicyStr | HighDpiScaleFactorRoundingPolicy
|
rounding policy |
required |
Source code in prettyqt/gui/guiapplication.py
set_icon(icon: datatypes.IconType)
Set the default window icon.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
icon
|
IconType
|
icon to use |
required |
set_layout_direction(direction: constants.LayoutDirectionStr | constants.LayoutDirection)
Set layout direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
direction
|
LayoutDirectionStr | LayoutDirection
|
layout direction |
required |
Source code in prettyqt/gui/guiapplication.py
Icon
Bases: SerializeMixin, QIcon
Scalable icons in different modes and states.
Source code in prettyqt/gui/icon.py
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 | |
for_mimetype(path: os.PathLike[str] | str) -> Self | None
classmethod
Try to create an icon from theme using the file mimetype.
Returns None if there is no theme icon for the mimetype.
Source code in prettyqt/gui/icon.py
from_char(char: str, background='black', color='white') -> Self
classmethod
Create a QIcon with a given character.
Source code in prettyqt/gui/icon.py
from_theme(name: ThemeIconStr | gui.QIcon.ThemeIcon | str, fallback: gui.QIcon | None = None) -> Self
classmethod
Create an icon from a theme name or Qt 6.7+ ThemeIcon.
Source code in prettyqt/gui/icon.py
IconEngine
Bases: QIconEngine
Abstract base class for QIcon renderers.
Source code in prettyqt/gui/iconengine.py
Image
Bases: SerializeMixin, PaintDeviceMixin, QImage
Hardware-independent image representation with direct access to the pixel data.
Source code in prettyqt/gui/image.py
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 | |
ImageIOHandler
Bases: mod
Defines the common image I/O interface for all image formats in Qt.
Source code in prettyqt/gui/imageiohandler.py
get_option(option: ImageOptionStr | mod.ImageOption) -> datatypes.Variant
Return the value assigned to option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
option
|
ImageOptionStr | ImageOption
|
option to get |
required |
Source code in prettyqt/gui/imageiohandler.py
set_option(option: ImageOptionStr | mod.ImageOption, value: datatypes.Variant)
Set option to given value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
option
|
ImageOptionStr | ImageOption
|
option to use |
required |
value
|
Variant
|
value to set |
required |
Source code in prettyqt/gui/imageiohandler.py
supports_option(option: ImageOptionStr | mod.ImageOption) -> bool
Return whether the image handler supports given option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
option
|
ImageOptionStr | ImageOption
|
option to check |
required |
Source code in prettyqt/gui/imageiohandler.py
ImageReader
Bases: QImageReader
Format independent interface for reading images from files or other devices.
Source code in prettyqt/gui/imagereader.py
get_error() -> ImageReaderErrorStr
get_transformation() -> gui.imageiohandler.TransformationStr
Return the transformation and orientation the image has been set to.
Source code in prettyqt/gui/imagereader.py
supports_option(option: gui.imageiohandler.ImageOptionStr | gui.QImageIOHandler.ImageOption) -> bool
Return whether the image handler supports given option.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
option
|
ImageOptionStr | ImageOption
|
option to check |
required |
Source code in prettyqt/gui/imagereader.py
ImageWriter
Bases: QImageWriter
Format independent interface for writing images to files or other devices.
Source code in prettyqt/gui/imagewriter.py
get_error() -> ImageWriterErrorStr
get_transformation() -> gui.imageiohandler.TransformationStr
Return the transformation and orientation the image has been set to.
Source code in prettyqt/gui/imagewriter.py
set_transformation(origin: gui.imageiohandler.TransformationStr | gui.ImageIOHandler.Transformation)
Set the image transformations metadata including orientation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
origin
|
TransformationStr | Transformation
|
transformation to use |
required |
Source code in prettyqt/gui/imagewriter.py
IntValidator
Bases: ValidatorMixin, QIntValidator
Validator that ensures a string contains a integer within a specified range.
Source code in prettyqt/gui/intvalidator.py
KeySequence
Bases: QKeySequence
Encapsulates a key sequence as used by shortcuts.
Source code in prettyqt/gui/keysequence.py
LinearGradient
Bases: GradientMixin, QLinearGradient
Used in combination with QBrush to specify a linear gradient brush.
Source code in prettyqt/gui/lineargradient.py
get_css() -> str
Convert gradient to a CSS string. Can be used for stylesheets.
Source code in prettyqt/gui/lineargradient.py
Matrix4x4
Movie
Bases: ObjectMixin, QMovie
Convenience class for playing movies with QImageReader.
Source code in prettyqt/gui/movie.py
get_cache_mode() -> CacheModeStr
get_state() -> MovieStateStr
set_cache_mode(mode: CacheModeStr | QtGui.QMovie.CacheMode)
Set cache mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
CacheModeStr | CacheMode
|
cache mode |
required |
PageLayout
Bases: QPageLayout
Describes the size, orientation and margins of a page.
Source code in prettyqt/gui/pagelayout.py
get_mode() -> ModeStr
get_orientation() -> OrientationStr
get_units() -> UnitStr
set_mode(mode: ModeStr | gui.QPageLayout.Mode)
set_orientation(orientation: OrientationStr | gui.QPageLayout.Orientation)
Set orientation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orientation
|
OrientationStr | Orientation
|
orientation |
required |
set_units(unit: UnitStr | gui.QPageLayout.Unit)
PageRanges
Bases: QPageRanges
Represents a collection of page ranges.
Source code in prettyqt/gui/pageranges.py
PageSize
Bases: QPageSize
Describes the size and name of a defined page size.
Source code in prettyqt/gui/pagesize.py
get_definition_units() -> UnitStr
Get the definition unit.
Source code in prettyqt/gui/pagesize.py
PaintDevice
Bases: PaintDeviceMixin, QPaintDevice
The base class of objects that can be painted on with QPainter.
Source code in prettyqt/gui/paintdevice.py
PaintDeviceMixin
Bases: _PaintDeviceBase
Source code in prettyqt/gui/paintdevice.py
get_metric(metric: MetricStr | QtGui.QPaintDevice.PaintDeviceMetric) -> int
Return metric information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric
|
MetricStr | PaintDeviceMetric
|
metric information to get |
required |
Source code in prettyqt/gui/paintdevice.py
Painter
Bases: PainterMixin, QPainter
Performs low-level painting on widgets and other paint devices.
Source code in prettyqt/gui/painter.py
PainterMixin
Bases: _PainterBase
Source code in prettyqt/gui/painter.py
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 | |
get_composition_mode() -> CompositionModeStr
get_pen() -> gui.Pen
set_composition_mode(mode: CompositionModeStr | gui.QPainter.CompositionMode)
Set the current composition mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
CompositionModeStr | CompositionMode
|
composition mode |
required |
Source code in prettyqt/gui/painter.py
set_pen(style: constants.PenStyleStr | None = 'solid', width: float = 1.0, color: datatypes.ColorType = 'black', brush: gui.QBrush | None = None, miter_limit: float = 2.0, join_style: constants.JoinStyleStr = 'bevel', cap_style: constants.CapStyleStr = 'square') -> gui.Pen
Set pen to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
PenStyleStr | None
|
pen style |
'solid'
|
width
|
float
|
pen width |
1.0
|
color
|
ColorType
|
pen color |
'black'
|
brush
|
QBrush | None
|
pen brush |
None
|
miter_limit
|
float
|
miter limit |
2.0
|
join_style
|
JoinStyleStr
|
pen join style |
'bevel'
|
cap_style
|
CapStyleStr
|
pen cap style |
'square'
|
Source code in prettyqt/gui/painter.py
PainterPath
Bases: QPainterPath
Source code in prettyqt/gui/painterpath.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 | |
get_fill_rule() -> constants.FillRuleStr
set_fill_rule(rule: constants.FillRuleStr | constants.FillRule)
Set fill rule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rule
|
FillRuleStr | FillRule
|
fill rule to use |
required |
PainterPathStroker
Bases: QPainterPathStroker
Source code in prettyqt/gui/painterpathstroker.py
get_cap_style() -> constants.CapStyleStr | constants.PenCapStyle
get_join_style() -> constants.JoinStyleStr
set_cap_style(style: constants.CapStyleStr | constants.PenCapStyle)
Set cap style to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
CapStyleStr | PenCapStyle
|
cap style to use |
required |
set_join_style(style: constants.JoinStyleStr | constants.PenJoinStyle)
Set join style to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
JoinStyleStr | PenJoinStyle
|
join style to use |
required |
Palette
Bases: SerializeMixin, QPalette
Contains color groups for each widget state.
Source code in prettyqt/gui/palette.py
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 | |
get_color_group() -> GroupStr
set_color_group(group: GroupStr | gui.QPalette.ColorGroup, window_text: gui.QBrush, button: gui.QBrush, light: gui.QBrush, dark: gui.QBrush, mid: gui.QBrush, text: gui.QBrush, bright_text: gui.QBrush, base: gui.QBrush, window: gui.QBrush)
Set the color group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
GroupStr | ColorGroup
|
color group to use |
required |
window_text
|
QBrush
|
window text brush |
required |
button
|
QBrush
|
button brush |
required |
light
|
QBrush
|
light brush |
required |
dark
|
QBrush
|
dark brush |
required |
mid
|
QBrush
|
mid brush |
required |
text
|
QBrush
|
text brush |
required |
bright_text
|
QBrush
|
bright text brush |
required |
base
|
QBrush
|
base brush |
required |
window
|
QBrush
|
window brush |
required |
Source code in prettyqt/gui/palette.py
PdfOutputIntent
Bases: QPdfOutputIntent
Metadata describing the color reproduction characteristics of a PDF document.
Source code in prettyqt/gui/pdfoutputintent.py
get_output_profile() -> gui.ColorSpace
get_registry_name() -> core.Url
PdfWriter
Bases: ObjectMixin, PagedPaintDeviceMixin, QPdfWriter
Class to generate PDFs that can be used as a paint device.
Source code in prettyqt/gui/pdfwriter.py
set_pdf_version(version: gui.pagedpaintdevice.PdfVersionStr | gui.PagedPaintDevice.PdfVersion)
Set pdf version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
PdfVersionStr | PdfVersion
|
pdf version |
required |
Source code in prettyqt/gui/pdfwriter.py
Pen
Bases: SerializeMixin, QPen
Defines how a QPainter should draw lines and outlines of shapes.
Source code in prettyqt/gui/pen.py
get_cap_style() -> constants.CapStyleStr
get_join_style() -> constants.JoinStyleStr
get_style() -> constants.PenStyleStr
set_cap_style(style: constants.CapStyleStr | constants.PenCapStyle)
Set cap style to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
CapStyleStr | PenCapStyle
|
cap style to use |
required |
set_join_style(style: constants.JoinStyleStr | constants.PenJoinStyle)
Set join style to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
JoinStyleStr | PenJoinStyle
|
join style to use |
required |
set_style(style: constants.PenStyleStr | constants.PenStyle | list[float] | None)
Set pen style to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
PenStyleStr | PenStyle | list[float] | None
|
pen style to use |
required |
Source code in prettyqt/gui/pen.py
Picture
Bases: SerializeMixin, PaintDeviceMixin, QPicture
Paint device that records and replays QPainter commands.
Source code in prettyqt/gui/picture.py
PixmapCache
Bases: QPixmapCache
Application-wide cache for pixmaps.
Source code in prettyqt/gui/pixmapcache.py
PixmapMixin
Bases: SerializeMixin, PaintDeviceMixin, _PixmapBase
Off-screen image representation that can be used as a paint device.
Source code in prettyqt/gui/pixmap.py
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 | |
create_checkerboard_pattern(n: int, color_1: datatypes.ColorType, color_2: datatypes.ColorType) -> Self
classmethod
Construct tileable checkerboard pattern for paint events.
Source code in prettyqt/gui/pixmap.py
get_image_data_url() -> str
Render the contents of the pixmap as a data URL (RFC-2397).
Source code in prettyqt/gui/pixmap.py
Polygon
Bases: SerializeMixin, QPolygon
List of points using integer precision.
Source code in prettyqt/gui/polygon.py
PolygonF
Bases: SerializeMixin, QPolygonF
List of points using floating point precision.
Source code in prettyqt/gui/polygonf.py
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 | |
Quaternion
Bases: QQuaternion
Represents a quaternion consisting of a vector and scalar.
Source code in prettyqt/gui/quaternion.py
RadialGradient
Bases: GradientMixin, QRadialGradient
Used in combination with QBrush to specify a radial gradient brush.
Source code in prettyqt/gui/radialgradient.py
get_css() -> str
Convert gradient to a CSS string. Can be used for stylesheets.
Source code in prettyqt/gui/radialgradient.py
RasterWindow
Bases: PaintDeviceWindowMixin, QRasterWindow
Convenience class for using QPainter on a QWindow.
Source code in prettyqt/gui/rasterwindow.py
RegularExpressionValidator
Bases: ValidatorMixin, QRegularExpressionValidator
Used to check a string against a regular expression.
Source code in prettyqt/gui/regularexpressionvalidator.py
Screen
Used to query screen properties.
Source code in prettyqt/gui/screen.py
SessionManager
Bases: ObjectMixin
Source code in prettyqt/gui/sessionmanager.py
get_restart_hint() -> RestartHintStr
set_restart_hint(style: RestartHintStr | QtGui.QSessionManager.RestartHint)
Set the restart hint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
RestartHintStr | RestartHint
|
restart hint |
required |
Shortcut
Bases: ObjectMixin, QShortcut
Source code in prettyqt/gui/shortcut.py
get_context() -> constants.ShortcutContextStr
get_key() -> gui.KeySequence
set_context(context: constants.ShortcutContextStr | constants.ShortcutContext)
Set shortcut context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
ShortcutContextStr | ShortcutContext
|
shortcut context |
required |
StandardItem
Bases: SerializeMixin, QStandardItem
Source code in prettyqt/gui/standarditem.py
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 | |
get_checkstate() -> constants.CheckStateStr
get_text_alignment() -> constants.AlignmentStr
set_checkstate(state: constants.CheckStateStr | constants.CheckState | bool)
Set checkstate of the checkbox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
CheckStateStr | CheckState | bool
|
checkstate to use |
required |
Source code in prettyqt/gui/standarditem.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(alignment: constants.AlignmentStr | constants.AlignmentFlag)
Set the alignment of the text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
AlignmentStr | AlignmentFlag
|
alignment for the format |
required |
Source code in prettyqt/gui/standarditem.py
StaticText
Bases: QStaticText
Source code in prettyqt/gui/statictext.py
get_performance_hint() -> PerformanceHintStr
get_text_format() -> constants.TextFormatStr
Return current text format.
Possible values: "rich", "plain", "auto", "markdown"
set_performance_hint(hint: PerformanceHintStr | QtGui.QStaticText.PerformanceHint)
Set the performance hint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hint
|
PerformanceHintStr | PerformanceHint
|
performance hint to use |
required |
set_text_format(text_format: constants.TextFormatStr | constants.TextFormat)
Set the text format.
Allowed values are "rich", "plain", "auto", "markdown"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_format
|
TextFormatStr | TextFormat
|
text format to use |
required |
Source code in prettyqt/gui/statictext.py
StyleHintsMixin
Bases: ObjectMixin, _StyleHintsBase
Source code in prettyqt/gui/stylehints.py
get_accessibility() -> gui.AccessibilityHints
get_color_scheme() -> constants.ColorSchemeStr
get_context_menu_trigger() -> ContextMenuTriggerStr
get_tab_focus_behavior() -> constants.TabFocusBehaviorStr
Return current focus behavior on press of the tab key.
set_color_scheme(scheme: constants.ColorSchemeStr | constants.ColorScheme)
Set color scheme override.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scheme
|
ColorSchemeStr | ColorScheme
|
color scheme |
required |
set_context_menu_trigger(trigger: ContextMenuTriggerStr | QtCore.Qt.ContextMenuTrigger)
SurfaceMixin
Bases: _SurfaceBase
Source code in prettyqt/gui/surface.py
get_surface_class() -> SurfaceClassStr
TextBlock
Bases: QTextBlock
Source code in prettyqt/gui/textblock.py
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 | |
find_parent_scope(limit: int = 5000) -> TextBlock | None
Find parent scope, if the block is not a fold trigger.
Source code in prettyqt/gui/textblock.py
get_fold_level() -> int
Get the block fold level.
:return: The block fold level
get_state() -> int
Get the user state, generally used for syntax highlighting.
:return: The block state
is_collapsed() -> bool
Check if the block is expanded or collased.
:return: False for an open trigger, True for for closed trigger
Source code in prettyqt/gui/textblock.py
is_fold_trigger() -> bool
Check if the block is a fold trigger.
:return: True if the block is a fold trigger (represented as a node in the fold panel)
Source code in prettyqt/gui/textblock.py
set_collapsed(val: int)
Set the fold trigger state (collapsed or expanded).
:param val: The new trigger state (True=collapsed, False=expanded)
Source code in prettyqt/gui/textblock.py
set_fold_level(val: int)
Set the block fold level.
:param val: The new fold level [0-7]
Source code in prettyqt/gui/textblock.py
set_fold_trigger(val: int)
Set the block fold trigger flag (True means the block is a fold trigger).
:param val: value to set
Source code in prettyqt/gui/textblock.py
set_state(state: int)
Set the user state, generally used for syntax highlighting.
:param state: new state value.
Source code in prettyqt/gui/textblock.py
TextBlockFormat
Bases: TextFormatMixin, QTextBlockFormat
Source code in prettyqt/gui/textblockformat.py
get_alignment() -> constants.AlignmentStr
get_marker() -> MarkerTypeStr
get_page_break_policy() -> gui.textformat.PageBreakFlagStr
Get the current page break policy.
set_alignment(alignment: constants.AlignmentStr | constants.AlignmentFlag)
Set the alignment of the format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
AlignmentStr | AlignmentFlag
|
alignment for the format |
required |
Source code in prettyqt/gui/textblockformat.py
set_marker(marker: MarkerTypeStr | gui.QTextBlockFormat.MarkerType)
Set the marker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
marker
|
MarkerTypeStr | MarkerType
|
marker |
required |
set_page_break_policy(policy: gui.textformat.PageBreakFlagStr | gui.QTextFormat.PageBreakFlag)
Set page break policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
PageBreakFlagStr | PageBreakFlag
|
page break policy |
required |
Source code in prettyqt/gui/textblockformat.py
TextBlockUserData
Bases: QTextBlockUserData
Storage for the user data associated with each line.
Source code in prettyqt/gui/textblockuserdata.py
TextCharFormatMixin
Bases: TextFormatMixin, _TextCharFormatBase
Source code in prettyqt/gui/textcharformat.py
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 | |
get_font_weight() -> gui.font.WeightStr
get_underline_style() -> UnderlineStyleStr
get_vertical_alignment() -> VerticalAlignmentStr
set_font_style_hint(hint: gui.font.StyleHintStr | gui.Font.StyleHint)
Set the font style hint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hint
|
StyleHintStr | StyleHint
|
font style hint |
required |
set_font_weight(weight: gui.font.WeightStr | gui.Font.Weight)
Set the font weight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
weight
|
WeightStr | Weight
|
font weight |
required |
set_underline_style(style: UnderlineStyleStr | mod.UnderlineStyle)
Set the underline style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
UnderlineStyleStr | UnderlineStyle
|
underline style |
required |
set_vertical_alignment(alignment: VerticalAlignmentStr | gui.QTextCharFormat.VerticalAlignment)
Set the vertical alignment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
VerticalAlignmentStr | VerticalAlignment
|
vertical alignment |
required |
Source code in prettyqt/gui/textcharformat.py
TextCursor
Bases: QTextCursor
Source code in prettyqt/gui/textcursor.py
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 | |
edit_block(join_previous: bool = False)
Context manager for edit blocks. Can be used for undo actions.
Source code in prettyqt/gui/textcursor.py
get_cursor_position() -> tuple[int, int]
Return the QTextCursor position.
The position is a tuple made up of the line number (0 based) and the column number (0 based). :return: tuple(line, column)
Source code in prettyqt/gui/textcursor.py
select_text(start_pos: int | tuple[int, int] | MoveOperationStr, end_pos: int | tuple[int, int] | MoveOperationStr) -> str
Select text from start position to end position.
Positions can be either an integer index or a move operation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_pos
|
int | tuple[int, int] | MoveOperationStr
|
Start position |
required |
end_pos
|
int | tuple[int, int] | MoveOperationStr
|
End position |
required |
Source code in prettyqt/gui/textcursor.py
set_position(pos: int | tuple[int, int], mode: MoveModeStr | gui.QTextCursor.MoveMode = 'move')
Set cursor to given position.
0-indexed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pos
|
int | tuple[int, int]
|
Cursor position |
required |
mode
|
MoveModeStr | MoveMode
|
Move mode |
'move'
|
Source code in prettyqt/gui/textcursor.py
TextFormatMixin
Bases: _TextFormatBase
Source code in prettyqt/gui/textformat.py
get_layout_direction() -> constants.LayoutDirectionStr
set_layout_direction(direction: constants.LayoutDirectionStr | constants.LayoutDirection)
Set layout direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
direction
|
LayoutDirectionStr | LayoutDirection
|
layout direction |
required |
Source code in prettyqt/gui/textformat.py
TextLength
Bases: QTextLength
Source code in prettyqt/gui/textlength.py
TextListFormat
Bases: TextFormatMixin, QTextListFormat
Source code in prettyqt/gui/textlistformat.py
get_style() -> StyleStr
set_style(style: StyleStr | gui.QTextListFormat.Style)
Set the style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
StyleStr | Style
|
style |
required |
TextTableCellFormat
Bases: TextCharFormatMixin, QTextTableCellFormat
Source code in prettyqt/gui/texttablecellformat.py
get_bottom_border_style() -> gui.textframeformat.BorderStyleStr
Get the current bottom border style.
get_left_border_style() -> gui.textframeformat.BorderStyleStr
Get the current left border style.
get_right_border_style() -> gui.textframeformat.BorderStyleStr
Get the current right border style.
get_top_border_style() -> gui.textframeformat.BorderStyleStr
Get the current top border style.
set_border_style(style: gui.textframeformat.BorderStyleStr | gui.QTextFrameFormat.BorderStyle)
Set border style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
BorderStyleStr | BorderStyle
|
border style |
required |
Source code in prettyqt/gui/texttablecellformat.py
set_bottom_border_style(style: gui.textframeformat.BorderStyleStr | gui.QTextFrameFormat.BorderStyle)
Set bottom border style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
BorderStyleStr | BorderStyle
|
bottom border style |
required |
Source code in prettyqt/gui/texttablecellformat.py
set_left_border_style(style: gui.textframeformat.BorderStyleStr | gui.QTextFrameFormat.BorderStyle)
Set left border style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
BorderStyleStr | BorderStyle
|
left border style |
required |
Source code in prettyqt/gui/texttablecellformat.py
set_right_border_style(style: gui.textframeformat.BorderStyleStr | gui.QTextFrameFormat.BorderStyle)
Set right border style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
BorderStyleStr | BorderStyle
|
right border style |
required |
Source code in prettyqt/gui/texttablecellformat.py
set_top_border_style(style: gui.textframeformat.BorderStyleStr | gui.QTextFrameFormat.BorderStyle)
Set top border style.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
BorderStyleStr | BorderStyle
|
top border style |
required |
Source code in prettyqt/gui/texttablecellformat.py
TextTableFormat
Bases: TextFrameFormatMixin, QTextTableFormat
Source code in prettyqt/gui/texttableformat.py
get_alignment() -> constants.AlignmentStr
set_alignment(alignment: constants.AlignmentStr | constants.AlignmentFlag)
Set the alignment of the format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
AlignmentStr | AlignmentFlag
|
alignment for the format |
required |
Vector2D
Bases: QVector2D
Represents a vector or vertex in 2D space.
Source code in prettyqt/gui/vector2d.py
WindowMixin
Bases: ObjectMixin, SurfaceMixin, _WindowBase
Source code in prettyqt/gui/window.py
get_visibility() -> VisibilityStr
set_modality(modality: constants.WindowModalityStr | constants.WindowModality) -> None
Set modality for the window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modality
|
WindowModalityStr | WindowModality
|
modality for the window |
required |
Source code in prettyqt/gui/window.py
set_visibility(visibility: VisibilityStr | gui.QWindow.Visibility)
Set window visibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visibility
|
VisibilityStr | Visibility
|
window visibility |
required |
start_system_resize(edge: constants.EdgeStr | constants.Edge) -> bool
Start system resize.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge
|
EdgeStr | Edge
|
edge to resize |
required |
get_repr(_obj: Any, *args: Any, **kwargs: Any) -> str
Get a suitable repr string for an object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_obj
|
Any
|
The object to get a repr for. |
required |
*args
|
Any
|
Arguments for the repr |
()
|
**kwargs
|
Any
|
Keyword arguments for the repr |
{}
|