core
Class info
Classes
| Name | Children | Inherits |
|---|---|---|
| AbstractAnimation prettyqt.core.abstractanimation |
||
| AbstractAnimationMixin prettyqt.core.abstractanimation The base of all animations. |
||
| AbstractEventDispatcher prettyqt.core.abstracteventdispatcher Interface to manage Qt's event queue. |
||
| AbstractItemModel prettyqt.core.abstractitemmodel The abstract interface for item model classes. |
||
| AbstractItemModelMixin prettyqt.core.abstractitemmodel |
||
| AbstractListModel prettyqt.core.abstractlistmodel Abstract model that can be subclassed to create one-dimensional list models. |
||
| AbstractListModelMixin prettyqt.core.abstractlistmodel |
||
| AbstractNativeEventFilter prettyqt.core.abstractnativeeventfilter Interface for receiving native events, such as MSG or XCB event structs. |
||
| AbstractProxyModel prettyqt.core.abstractproxymodel Base class for proxy item models that can do sorting, filtering and processing. |
|
|
| AbstractProxyModelMixin prettyqt.core.abstractproxymodel |
||
| AbstractTableModel prettyqt.core.abstracttablemodel Abstract model that can be subclassed to create table models. |
||
| AbstractTableModelMixin prettyqt.core.abstracttablemodel |
||
| AnimationGroup prettyqt.core.animationgroup Abstract base class for groups of animations. |
||
| AnimationGroupMixin prettyqt.core.animationgroup |
||
| AsyncBridge prettyqt.core.aio Runs a standard `asyncio` loop in a background thread bridged to Qt. |
||
| BasicTimer prettyqt.core.basictimer Timer events for objects. |
||
| BluetoothPermission prettyqt.core.bluetoothpermission Access Bluetooth peripherals. |
||
| Buffer prettyqt.core.buffer QIODevice interface for a QByteArray. |
||
| ByteArray prettyqt.core.bytearray Array of bytes. |
||
| ByteArrayMatcher prettyqt.core.bytearraymatcher Holds a sequence of bytes that can be quickly matched in a byte array. |
||
| Calendar prettyqt.core._calendar Describes calendar systems. |
||
| CalendarPermission prettyqt.core.calendarpermission Access the user's calendar. |
||
| CameraPermission prettyqt.core.camerapermission Access the camera for taking pictures or videos. |
||
| Collator prettyqt.core.collator Compares strings according to a localized collation algorithm. |
||
| CollatorSortKey prettyqt.core.collatorsortkey Can be used to speed up string collation. |
||
| CommandLineOption prettyqt.core.commandlineoption Defines a possible command-line option. |
||
| CommandLineParser prettyqt.core.commandlineparser Means for handling the command line options. |
||
| ConcatenateTablesProxyModel prettyqt.core.concatenatetablesproxymodel Proxies multiple source models, concatenating their rows. |
||
| ContactsPermission prettyqt.core.contactspermission Access the user's contacts. |
||
| CoreApplication prettyqt.core.coreapplication Event loop for Qt applications without UI. |
||
| CoreApplicationMixin prettyqt.core.coreapplication |
||
| CryptographicHash prettyqt.core.cryptographichash Way to generate cryptographic hashes. |
||
| DataStream prettyqt.core.datastream Serialization of binary data to a QIODevice. |
||
| Date prettyqt.core.date Date functions. |
||
| DateTime prettyqt.core._datetime DateTime funcitons. |
||
| DeadlineTimer prettyqt.core.deadlinetimer Marks a deadline in the future. |
||
| Dir prettyqt.core.dir Access to directory structures and their contents. |
||
| DirIterator prettyqt.core.diriterator Iterator for directory entrylists. |
||
| EasingCurve prettyqt.core.easingcurve Easing curves for controlling animation. |
|
|
| ElapsedTimer prettyqt.core.elapsedtimer Fast way to calculate elapsed times. |
||
| Event prettyqt.core.event The base class of all event classes. Event objects contain event parameters. |
||
| EventLoop prettyqt.core.eventloop Means of entering and leaving an event loop. |
||
| File prettyqt.core.file Interface for reading from and writing to files. |
||
| FileDevice prettyqt.core.filedevice |
||
| FileDeviceMixin prettyqt.core.filedevice Interface for reading from and writing to open files. |
||
| FileInfo prettyqt.core.fileinfo System-independent file information. |
||
| FileMixin prettyqt.core.file |
||
| FileSelector prettyqt.core.fileselector Convenient way of selecting file variants. |
||
| FileSystemWatcher prettyqt.core.filesystemwatcher Interface for monitoring files and directories for modifications. |
||
| IODevice prettyqt.core.iodevice The base interface class of all I/O devices in Qt. |
||
| IODeviceMixin prettyqt.core.iodevice |
||
| IdentityProxyModel prettyqt.core.identityproxymodel Proxies its source model unmodified. |
||
| ItemSelection prettyqt.core.itemselection Manages information about selected items in a model. |
||
| ItemSelectionModel prettyqt.core.itemselectionmodel Keeps track of a view's selected items. |
||
| ItemSelectionRange prettyqt.core.itemselectionrange Manages information about a range of selected items in a model. |
||
| JsonDocument prettyqt.core.jsondocument Way to read and write JSON documents. |
||
| JsonValue prettyqt.core.jsonvalue Encapsulates a value in JSON. |
||
| KeyCombination prettyqt.core.keycombination Stores a combination of a key with optional modifiers. |
|
|
| Library prettyqt.core.library Loads shared libraries at runtime. |
||
| LibraryInfo prettyqt.core.libraryinfo Information about the Qt library. |
||
| Line prettyqt.core.line Two-dimensional vector using integer precision. |
||
| LineF prettyqt.core.linef Two-dimensional vector using floating point precision. |
||
| Locale prettyqt.core._locale Converts between numbers and their string representations in various languages. |
||
| LocationPermission prettyqt.core.locationpermission Access the user's location. |
||
| LockFile prettyqt.core.lockfile Locking between processes using a file. |
||
| LoggingCategory prettyqt.core.loggingcategory Represents a category, or 'area' in the logging infrastructure. |
||
| Margins prettyqt.core.margins Defines the four margins of a rectangle. |
||
| MarginsF prettyqt.core.marginsf Defines the four margins of a rectangle (floating point precision). |
||
| MessageAuthenticationCode prettyqt.core.messageauthenticationcode Way to generate hash-based message authentication codes (HMAC). |
||
| MetaEnum prettyqt.core.metaenum Meta-data about an enumerator. |
||
| MetaMethod prettyqt.core.metamethod Meta-data about an member method. |
||
| MetaObject prettyqt.core.metaobject Contains meta-information about Qt objects. |
||
| MetaProperty prettyqt.core.metaproperty Meta-data about a property. |
||
| MetaType prettyqt.core.metatype Manages named types in the meta-object system. |
||
| MicrophonePermission prettyqt.core.microphonepermission Access the microphone for monitoring or recording sound. |
||
| MimeData prettyqt.core.mimedata Container for data that records information about its MIME type. |
||
| MimeDatabase prettyqt.core.mimedatabase Maintains a database of MIME types. |
||
| MimeType prettyqt.core.mimetype Describes types of file or data, represented by a MIME type string. |
||
| ModelRoleData prettyqt.core.modelroledata Holds a role and the data associated to that role. |
||
| Mutex prettyqt.core.mutex Access serialization between threads. |
||
| NativeIpcKey prettyqt.core.nativeipckey Holds a native key used by QSystemSemaphore and QSharedMemory. |
||
| Object prettyqt.core.object The base class of all Qt objects. |
|
|
| ObjectMixin prettyqt.core.object |
||
| OperatingSystemVersion prettyqt.core.operatingsystemversion Information about the operating system version. |
||
| ParallelAnimationGroup prettyqt.core.parallelanimationgroup Parallel group of animations. |
||
| PauseAnimation prettyqt.core.pauseanimation Pause for QSequentialAnimationGroup. |
||
| Permission prettyqt.core.permission Opaque wrapper of a typed permission. |
||
| PersistentModelIndex prettyqt.core.persistentmodelindex Used to locate data in a data model. |
||
| PluginLoader prettyqt.core.pluginloader Load a plugin at runtime. |
||
| Process prettyqt.core.process Used to start external programs and to communicate with them. |
||
| ProcessEnvironment prettyqt.core.processenvironment Holds the environment variables that can be passed to a program. |
||
| PropertyAnimation prettyqt.core.propertyanimation Animates Qt properties. |
||
| RandomGenerator prettyqt.core.randomgenerator Allows one to obtain random values from a high-quality Random Number Generator. |
||
| RangeModel prettyqt.core.rangemodel Item model wrapping a Python sequence or table range. |
||
| ReadWriteLock prettyqt.core.readwritelock Read-write locking between threads. |
||
| RegularExpression prettyqt.core.regularexpression Pattern matching using regular expressions. |
||
| RegularExpressionMatch prettyqt.core.regularexpressionmatch The results of a matching a QRegularExpression against a string. |
||
| RegularExpressionMatchIterator prettyqt.core.regularexpressionmatchiterator Iterator on the results of a global match of a QRegularExpression. |
||
| Resource prettyqt.core._resource Interface for reading directly from resources. |
||
| Runnable prettyqt.core.runnable The base class for all runnable objects. |
|
|
| SaveFile prettyqt.core.savefile Interface for safely writing to files. |
||
| Semaphore prettyqt.core.semaphore General counting semaphore. |
||
| SequentialAnimationGroup prettyqt.core.sequentialanimationgroup Sequential group of animations. |
||
| Settings prettyqt.core.settings Settings class which wraps everything into a dict to preserve data types. |
|
|
| SharedMemory prettyqt.core.sharedmemory Access to a shared memory segment. |
||
| SignalBlocker prettyqt.core.signalblocker Exception-safe wrapper around QObject.blockSignals(). |
||
| SignalMapper prettyqt.core.signalmapper Bundles signals from identifiable senders. |
||
| Size prettyqt.core.size Defines the size of a two-dimensional object using integer point precision. |
||
| SizeF prettyqt.core.sizef Defines the size of a two-dimensional object using floating point precision. |
||
| SocketNotifier prettyqt.core.socketnotifier Support for monitoring activity on a file descriptor. |
||
| SortFilterProxyModel prettyqt.core.sortfilterproxymodel Support for sorting and filtering data passed between another model and a view. |
||
| StandardPaths prettyqt.core.standardpaths Methods for accessing standard paths. |
||
| StorageInfo prettyqt.core.storageinfo Provides information about currently mounted storage and drives. |
||
| StringConverter prettyqt.core.stringconverter Base class for encoding and decoding text. |
||
| StringConverterMixin prettyqt.core.stringconverter |
||
| StringDecoder prettyqt.core.stringdecoder State-based decoder for text. |
||
| StringEncoder prettyqt.core.stringencoder State-based encoder for text. |
||
| StringListModel prettyqt.core.stringlistmodel Model that supplies strings to views. |
|
|
| StringListModelMixin prettyqt.core.stringlistmodel |
||
| TemporaryDir prettyqt.core.temporarydir Creates a unique directory for temporary use. |
||
| TemporaryFile prettyqt.core.temporaryfile I/O device that operates on temporary files. |
||
| TextBoundaryFinder prettyqt.core.textboundaryfinder Way of finding Unicode text boundaries in a string. |
||
| TextStream prettyqt.core.textstream Convenient interface for reading and writing text. |
||
| Thread prettyqt.core.thread Platform-independent way to manage threads. |
||
| ThreadPool prettyqt.core.threadpool Manages a collection of QThreads. |
||
| Time prettyqt.core._time Clock time functions. |
||
| TimeLine prettyqt.core.timeline Timeline for controlling animations. |
||
| TimeZone prettyqt.core.timezone Identifies how a time representation relates to UTC. |
||
| Timer prettyqt.core.timer Repetitive and single-shot timers. |
|
|
| Translator prettyqt.core.translator Internationalization support for text output. |
|
|
| TransposeProxyModel prettyqt.core.transposeproxymodel This proxy transposes the source model. |
||
| Url prettyqt.core.url Convenient interface for working with URLs. |
|
|
| UrlQuery prettyqt.core.urlquery Way to manipulate a key-value pairs in a URL's query. |
||
| Uuid prettyqt.core._uuid Stores a Universally Unique Identifier (UUID). |
||
| UuidMixin prettyqt.core._uuid |
||
| VariantAnimation prettyqt.core.variantanimation Base class for animations. |
||
| VariantAnimationMixin prettyqt.core.variantanimation |
||
| VersionNumber prettyqt.core.versionnumber Contains a version number with an arbitrary number of segments. |
||
| XmlStreamReader prettyqt.core.xmlstreamreader Fast parser for reading well-formed XML via a simple streaming API. |
||
| XmlStreamWriter prettyqt.core.xmlstreamwriter XML writer with a simple streaming API. |
🛈 DocStrings
Core non-graphical classes used by other modules.
AbstractAnimationMixin
Bases: ObjectMixin, _AbstractAnimationBase
The base of all animations.
Source code in prettyqt/core/abstractanimation.py
get_direction() -> DirectionStr
get_state() -> StateStr
restart_animation(policy: DeletionPolicyStr | core.QAbstractAnimation.DeletionPolicy = 'keep')
Restart the animation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
DeletionPolicyStr | DeletionPolicy
|
animation policy |
'keep'
|
Source code in prettyqt/core/abstractanimation.py
set_direction(direction: DirectionStr | core.QAbstractAnimation.Direction)
Set animation direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
direction
|
DirectionStr | Direction
|
animation direction |
required |
start_animation(policy: DeletionPolicyStr | core.QAbstractAnimation.DeletionPolicy = 'keep', interval: int = 0, single_shot: bool = True)
Start the animation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
DeletionPolicyStr | DeletionPolicy
|
animation policy |
'keep'
|
interval
|
int
|
time interval / delay for timer |
0
|
single_shot
|
bool
|
whether animation gets triggered once or in intervals |
True
|
Source code in prettyqt/core/abstractanimation.py
AbstractEventDispatcher
Bases: ObjectMixin, QAbstractEventDispatcher
Interface to manage Qt's event queue.
Source code in prettyqt/core/abstracteventdispatcher.py
AbstractItemModel
Bases: AbstractItemModelMixin, QAbstractItemModel
The abstract interface for item model classes.
Source code in prettyqt/core/abstractitemmodel.py
AbstractItemModelMixin
Bases: ObjectMixin, _AbstractItemModelBase
Source code in prettyqt/core/abstractitemmodel.py
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 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 | |
change_layout()
Context manager to change the layout.
wraps calls with correct signals emitted at beginning: layoutAboutToBeChanged emitted at end: layoutChanged
Source code in prettyqt/core/abstractitemmodel.py
from_checkstate(value: Any) -> bool
staticmethod
Convert a value passed to setData for CheckStateRole into a bool.
Views may pass either an int or a CheckState enum member, and enum members
are always truthy, so bool(value) cannot be used.
Source code in prettyqt/core/abstractitemmodel.py
get_breadcrumbs_path(index: core.ModelIndex, role: constants.ItemDataRole = constants.DISPLAY_ROLE) -> list[str]
get_child_indexes(index: core.ModelIndex) -> listdelegators.ListDelegator[core.ModelIndex]
Get all child indexes for given index (first column only).
To get indexes recursively, use iter_tree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
ModelIndex
|
ModelIndex to get children from |
required |
Source code in prettyqt/core/abstractitemmodel.py
get_column_type(column: int, *, rows_to_check: int = 10, role=constants.DISPLAY_ROLE) -> type | None
Guess column data type by checking values of first rows with given role.
Source code in prettyqt/core/abstractitemmodel.py
get_index_key(index: core.ModelIndex, *, include_column: bool = False, parent_index: core.ModelIndex | None = None) -> tuple[tuple[int, int] | int, ...]
Return a key tuple for given ModelIndex.
The key tuple consists either of row integers or (row, column) indices describing the index position from top to bottom.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
ModelIndex
|
ModelIndex to get a key for |
required |
include_column
|
bool
|
whether to include the column in the index key. |
False
|
parent_index
|
ModelIndex | None
|
Get key up to given ModelIndex. By default, get key up to root. |
None
|
Source code in prettyqt/core/abstractitemmodel.py
index_from_key(key_path: Sequence[tuple[int, int] | int], *, parent_index: core.ModelIndex | None = None) -> core.ModelIndex
Return a ModelIndex for the given key path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key_path
|
Sequence[tuple[int, int] | int]
|
Key path to get an index for. Should be a sequence of either (row, column) or row indices |
required |
parent_index
|
ModelIndex | None
|
ModelIndex to start indexing from. Defaults to root index. |
None
|
Source code in prettyqt/core/abstractitemmodel.py
iter_tree(parent_index: core.ModelIndex | None = None, *, depth: int | None = None, fetch_more: bool = False) -> Iterator[core.ModelIndex]
Iter through all indexes of the model tree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent_index
|
ModelIndex | None
|
parent index |
None
|
depth
|
int | None
|
maximum iteration depth |
None
|
fetch_more
|
bool
|
call fetchMore for all indexes until canFetchMore returns False |
False
|
Source code in prettyqt/core/abstractitemmodel.py
reset_model()
Context manager to reset the model.
wraps calls with correct signals emitted at beginning: beginResetModel emitted at end: endResetModel
Source code in prettyqt/core/abstractitemmodel.py
search_tree(value: Any, *, role: constants.ItemDataRole | int = constants.DISPLAY_ROLE, parent_index: core.ModelIndex | None = None, max_results: int | None = None, depth: int | None = None) -> listdelegators.ListDelegator[core.ModelIndex]
Search the tree for indexes with a given value in given role.
Compared to QAbstractItemModel.match, this method allows to set a maximum search depth and passing several values to search for as a list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
Item or list of items to search for. |
required |
role
|
ItemDataRole | int
|
Index role to search in. |
DISPLAY_ROLE
|
parent_index
|
ModelIndex | None
|
start index for searching. If None, whole tree is searched. |
None
|
max_results
|
int | None
|
stop searching after x amount of hits. 'None' means no limit. |
None
|
depth
|
int | None
|
search depth. Search depth. 'None' means no limit. |
None
|
Source code in prettyqt/core/abstractitemmodel.py
to_display_text(value: Any) -> str
staticmethod
Convert an arbitrary value into a string suitable for DisplayRole.
Source code in prettyqt/core/abstractitemmodel.py
AbstractListModel
Bases: AbstractListModelMixin, QAbstractListModel
Abstract model that can be subclassed to create one-dimensional list models.
Source code in prettyqt/core/abstractlistmodel.py
AbstractNativeEventFilter
Bases: QAbstractNativeEventFilter
Interface for receiving native events, such as MSG or XCB event structs.
Source code in prettyqt/core/abstractnativeeventfilter.py
AbstractProxyModel
Bases: AbstractProxyModelMixin, QAbstractProxyModel
Base class for proxy item models that can do sorting, filtering and processing.
Source code in prettyqt/core/abstractproxymodel.py
AbstractProxyModelMixin
Bases: AbstractItemModelMixin, _AbstractProxyModelBase
Source code in prettyqt/core/abstractproxymodel.py
first_item_index() -> core.ModelIndex
Return the first child of the root item.
Source code in prettyqt/core/abstractproxymodel.py
source_index_from_key(key_path: Sequence[tuple[int, int] | int], parent_index: core.ModelIndex | None = None) -> core.ModelIndex
Return a QModelIndex of the sourceModel for the given key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key_path
|
Sequence[tuple[int, int] | int]
|
Key path to get an index for. Should be a sequence of either (row, column) or row indices |
required |
parent_index
|
ModelIndex | None
|
ModelIndex to start indexing from. Defaults to root index. |
None
|
Source code in prettyqt/core/abstractproxymodel.py
AbstractTableModel
Bases: AbstractTableModelMixin, QAbstractTableModel
Abstract model that can be subclassed to create table models.
Source code in prettyqt/core/abstracttablemodel.py
AnimationGroup
Bases: AnimationGroupMixin, QAnimationGroup
Abstract base class for groups of animations.
Source code in prettyqt/core/animationgroup.py
AnimationGroupMixin
Bases: AbstractAnimationMixin, _AnimationGroupBase
Source code in prettyqt/core/animationgroup.py
targetObject() -> core.QObject
Return shared targetObject if existing.
Source code in prettyqt/core/animationgroup.py
AsyncBridge
Runs a standard asyncio loop in a background thread bridged to Qt.
Both submit() (Qt -> asyncio) and call_in_gui_thread() (asyncio -> Qt)
propagate contextvars.Context, preserving OpenTelemetry spans and any
other context variables seamlessly across thread boundaries.
Source code in prettyqt/core/aio.py
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 | |
call_in_gui_thread(fn: Callable[..., T], *args: Any, **kwargs: Any) -> asyncio.Future[T]
Marshal fn(*args, **kwargs) onto the Qt main thread and await its result.
Source code in prettyqt/core/aio.py
start() -> Self
Start the background asyncio event loop thread.
Source code in prettyqt/core/aio.py
stop(timeout: float = 5.0) -> None
Cancel pending tasks and stop the background event loop thread.
Source code in prettyqt/core/aio.py
submit(coro: Coroutine[Any, Any, T], *, context: contextvars.Context | None = None, on_error: Callable[[BaseException], Any] | None = None) -> concurrent.futures.Future[T]
Submit a coroutine to the background loop, preserving contextvars.
Source code in prettyqt/core/aio.py
BasicTimer
Bases: QBasicTimer
Timer events for objects.
Source code in prettyqt/core/basictimer.py
BluetoothPermission
Bases: QBluetoothPermission
Access Bluetooth peripherals.
Source code in prettyqt/core/bluetoothpermission.py
get_communication_modes() -> list[CommunicationModeStr]
Return the active Bluetooth communication modes.
Source code in prettyqt/core/bluetoothpermission.py
set_communication_modes(modes: CommunicationModeStr | QtCore.QBluetoothPermission.CommunicationMode)
Set the Bluetooth communication modes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modes
|
CommunicationModeStr | CommunicationMode
|
communication modes to set |
required |
Source code in prettyqt/core/bluetoothpermission.py
Buffer
Bases: IODeviceMixin, QBuffer
QIODevice interface for a QByteArray.
Source code in prettyqt/core/buffer.py
ByteArray
ByteArrayMatcher
Bases: QByteArrayMatcher
Holds a sequence of bytes that can be quickly matched in a byte array.
Source code in prettyqt/core/bytearraymatcher.py
Calendar
Bases: QCalendar
Describes calendar systems.
Source code in prettyqt/core/_calendar.py
CalendarPermission
Bases: QCalendarPermission
Access the user's calendar.
Source code in prettyqt/core/calendarpermission.py
get_access_mode() -> AccessModeStr
set_access_mode(mode: AccessModeStr | QtCore.QCalendarPermission.AccessMode)
Set the calendar access mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
AccessModeStr | AccessMode
|
access mode to use |
required |
CameraPermission
Collator
Bases: QCollator
Compares strings according to a localized collation algorithm.
Source code in prettyqt/core/collator.py
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/core/collator.py
CollatorSortKey
CommandLineOption
CommandLineParser
Bases: QCommandLineParser
Means for handling the command line options.
Source code in prettyqt/core/commandlineparser.py
set_options_after_positional_arguments_mode(mode: OptionsAfterPosArgStr | mod.OptionsAfterPositionalArgumentsMode)
Set the options after positional arguments mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
OptionsAfterPosArgStr | OptionsAfterPositionalArgumentsMode
|
options after positional arguments mode |
required |
Source code in prettyqt/core/commandlineparser.py
set_single_dash_word_option_mode(mode: SingleDashWordStr)
Set the single dash word option mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
SingleDashWordStr
|
single dash word option mode |
required |
ConcatenateTablesProxyModel
Bases: AbstractItemModelMixin, QConcatenateTablesProxyModel
Proxies multiple source models, concatenating their rows.
Source code in prettyqt/core/concatenatetablesproxymodel.py
ContactsPermission
Bases: QContactsPermission
Access the user's contacts.
Source code in prettyqt/core/contactspermission.py
get_access_mode() -> AccessModeStr
set_access_mode(mode: AccessModeStr | QtCore.QContactsPermission.AccessMode)
Set the contacts access mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
AccessModeStr | AccessMode
|
access mode to use |
required |
CoreApplication
Bases: CoreApplicationMixin, QCoreApplication
Event loop for Qt applications without UI.
Source code in prettyqt/core/coreapplication.py
CoreApplicationMixin
Bases: ObjectMixin, _CoreApplicationBase
Source code in prettyqt/core/coreapplication.py
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 | |
disable_async_slots() -> None
staticmethod
enable_async_slots(*, on_error: Callable[[BaseException], Any] | None = None)
staticmethod
Allow connecting async def functions directly to Qt signals.
Source code in prettyqt/core/coreapplication.py
in_main_thread() -> bool
Check if we are in the thread in which QApplication object was created.
Source code in prettyqt/core/coreapplication.py
CryptographicHash
Bases: QCryptographicHash
Way to generate cryptographic hashes.
Source code in prettyqt/core/cryptographichash.py
DataStream
Bases: QDataStream
Serialization of binary data to a QIODevice.
Source code in prettyqt/core/datastream.py
get_byte_order() -> ByteOrderStr
get_floating_point_precision() -> FloatingPointPrecisionStr
Return floating point precision.
get_status() -> StatusStr
set_byte_order(order: ByteOrderStr | QtCore.QDataStream.ByteOrder)
Set byte order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
ByteOrderStr | ByteOrder
|
byte order to use |
required |
set_floating_point_precision(precision: FloatingPointPrecisionStr | QtCore.QDataStream.FloatingPointPrecision)
Set floating point precision.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
precision
|
FloatingPointPrecisionStr | FloatingPointPrecision
|
floating point precision |
required |
Source code in prettyqt/core/datastream.py
set_status(status: StatusStr)
Date
Bases: QDate
Date functions.
Source code in prettyqt/core/date.py
DateTime
Bases: QDateTime
DateTime funcitons.
Source code in prettyqt/core/_datetime.py
get_time_spec() -> constants.TimeSpecStr
set_time_spec(spec: constants.TimeSpecStr | constants.TimeSpec)
Set the time specification.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
TimeSpecStr | TimeSpec
|
time specification to use |
required |
Source code in prettyqt/core/_datetime.py
DeadlineTimer
Bases: QDeadlineTimer
Marks a deadline in the future.
Source code in prettyqt/core/deadlinetimer.py
get_type() -> constants.TimerTypeStr
set_type(typ: constants.TimerTypeStr | constants.TimerType)
Set the timer type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
TimerTypeStr | TimerType
|
timer type |
required |
Dir
Bases: QDir
Access to directory structures and their contents.
Source code in prettyqt/core/dir.py
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 | |
DirIterator
Bases: QDirIterator
Iterator for directory entrylists.
Source code in prettyqt/core/diriterator.py
EasingCurve
Bases: SerializeMixin, QEasingCurve
Easing curves for controlling animation.
Source code in prettyqt/core/easingcurve.py
get_type() -> TypeStr
set_type(typ: TypeStr | QtCore.QEasingCurve.Type)
Set easing curve type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
TypeStr | Type
|
easing curve type |
required |
ElapsedTimer
Bases: QElapsedTimer
Fast way to calculate elapsed times.
Source code in prettyqt/core/elapsedtimer.py
Event
Bases: QEvent
The base class of all event classes. Event objects contain event parameters.
Source code in prettyqt/core/event.py
EventLoop
Bases: ObjectMixin, QEventLoop
Means of entering and leaving an event loop.
Source code in prettyqt/core/eventloop.py
File
FileDeviceMixin
Bases: IODeviceMixin, _FileDeviceBase
Interface for reading from and writing to open files.
Source code in prettyqt/core/filedevice.py
get_error() -> FileErrorStr
get_file_time(typ: FileTimeStr | core.QFileDevice.FileTime) -> dt.datetime | None
Return current file time.
Source code in prettyqt/core/filedevice.py
is_executable() -> bool
is_readable() -> bool
is_writable() -> bool
set_file_time(file_time: datatypes.DateTimeType, typ: FileTimeStr | core.QFileDevice.FileTime) -> bool
Set file time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_time
|
DateTimeType
|
file time to set |
required |
typ
|
FileTimeStr | FileTime
|
file time type |
required |
Source code in prettyqt/core/filedevice.py
FileInfo
Bases: QFileInfo
System-independent file information.
Source code in prettyqt/core/fileinfo.py
FileSelector
Bases: ObjectMixin, QFileSelector
Convenient way of selecting file variants.
Source code in prettyqt/core/fileselector.py
FileSystemWatcher
Bases: ObjectMixin, QFileSystemWatcher
Interface for monitoring files and directories for modifications.
Source code in prettyqt/core/filesystemwatcher.py
IODevice
Bases: IODeviceMixin, QIODevice
The base interface class of all I/O devices in Qt.
Source code in prettyqt/core/iodevice.py
IdentityProxyModel
Bases: AbstractProxyModelMixin, QIdentityProxyModel
Proxies its source model unmodified.
Source code in prettyqt/core/identityproxymodel.py
ItemSelection
ItemSelectionModel
Bases: ObjectMixin, QItemSelectionModel
Keeps track of a view's selected items.
Source code in prettyqt/core/itemselectionmodel.py
ItemSelectionRange
Bases: QItemSelectionRange
Manages information about a range of selected items in a model.
Source code in prettyqt/core/itemselectionrange.py
JsonDocument
Bases: QJsonDocument
Way to read and write JSON documents.
Source code in prettyqt/core/jsondocument.py
JsonValue
KeyCombination
Bases: SerializeMixin, QKeyCombination
Stores a combination of a key with optional modifiers.
Source code in prettyqt/core/keycombination.py
has_key() -> bool
has_modifier(modifier: constants.KeyboardModifierStr) -> bool
is_moving() -> bool
is_moving_func() -> bool
is_typing() -> bool
True if key is a letter or number.
Source code in prettyqt/core/keycombination.py
Library
Bases: ObjectMixin, QLibrary
Loads shared libraries at runtime.
Source code in prettyqt/core/library.py
LibraryInfo
Bases: QLibraryInfo
Information about the Qt library.
Source code in prettyqt/core/libraryinfo.py
Line
Bases: QLine
Two-dimensional vector using integer precision.
Source code in prettyqt/core/line.py
LineF
Bases: QLineF
Two-dimensional vector using floating point precision.
Source code in prettyqt/core/linef.py
Locale
Bases: QLocale
Converts between numbers and their string representations in various languages.
Source code in prettyqt/core/_locale.py
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 | |
LocationPermission
Bases: QLocationPermission
Access the user's location.
Source code in prettyqt/core/locationpermission.py
get_accuracy() -> AccuracyStr
get_availability() -> AvailabilityStr
set_accuracy(accuracy: AccuracyStr | QtCore.QLocationPermission.Accuracy)
Set the desired location accuracy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
accuracy
|
AccuracyStr | Accuracy
|
accuracy to use |
required |
set_availability(availability: AvailabilityStr | QtCore.QLocationPermission.Availability)
Set the desired location availability.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
availability
|
AvailabilityStr | Availability
|
availability to use |
required |
Source code in prettyqt/core/locationpermission.py
LockFile
Bases: QLockFile
Locking between processes using a file.
Source code in prettyqt/core/lockfile.py
LoggingCategory
Bases: QLoggingCategory
Represents a category, or 'area' in the logging infrastructure.
Source code in prettyqt/core/loggingcategory.py
Margins
Bases: QMargins
Defines the four margins of a rectangle.
Source code in prettyqt/core/margins.py
MarginsF
Bases: QMarginsF
Defines the four margins of a rectangle (floating point precision).
Source code in prettyqt/core/marginsf.py
MessageAuthenticationCode
Bases: QMessageAuthenticationCode
Way to generate hash-based message authentication codes (HMAC).
Source code in prettyqt/core/messageauthenticationcode.py
MetaEnum
Meta-data about an enumerator.
Source code in prettyqt/core/metaenum.py
MetaMethod
Meta-data about an member method.
Source code in prettyqt/core/metamethod.py
get_normalized_method_signature() -> str
Returns something like 'objectNameChanged(QString)'.
Source code in prettyqt/core/metamethod.py
MetaObject
Contains meta-information about Qt objects.
Source code in prettyqt/core/metaobject.py
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 | |
connect_signals(source_qobject: core.QObject, fn_or_qobject: Callable | core.QObject, only_notifiers: bool = False) -> list[core.QMetaObject.Connection]
Connect all signals of a given qobject.
Either connect all signals to a function or connect each signal to the corresponding signal of the receiver.
Source code in prettyqt/core/metaobject.py
copy(qobject: T, forward_signals: bool = True) -> T
Create a copy of given QObject.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qobject
|
T
|
QObject to create a copied instance for. |
required |
forward_signals
|
bool
|
Whether to connect all signals from qobject to the new instance. |
True
|
Source code in prettyqt/core/metaobject.py
copy_properties_to(source: core.QObject, target: core.QObject)
classmethod
Sets all properties of target to value of source.
Only sets properties which exist for both QObjects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
QObject
|
Source QObject |
required |
target
|
QObject
|
Target QObject |
required |
Source code in prettyqt/core/metaobject.py
get_all_super_classes() -> list[MetaObject]
get_class_info(include_super: bool = True) -> dict[str, str]
Get MetaObject class info.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_super
|
bool
|
Whether to include class info from parent classes. |
True
|
Source code in prettyqt/core/metaobject.py
get_constructor(index: int | str) -> core.MetaMethod
Get ctor MetaMethod based on index or name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int | str
|
index or constructor name |
required |
Source code in prettyqt/core/metaobject.py
get_constructors() -> list[core.MetaMethod]
get_enum(index: int | str) -> core.MetaEnum
Get MetaEnum based on index or name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int | str
|
index or Enum name |
required |
Source code in prettyqt/core/metaobject.py
get_enums(include_super: bool = True) -> list[core.MetaEnum]
Get all MetaEnums based on given criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_super
|
bool
|
Whether to include Enums from parent classes. |
True
|
Source code in prettyqt/core/metaobject.py
get_meta_type() -> core.MetaType
get_method(index: int | str) -> core.MetaMethod
Get MetaMethod based on index or name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int | str
|
index or method name |
required |
Source code in prettyqt/core/metaobject.py
get_methods(include_super: bool = True, type_filter: core.metamethod.MethodTypeStr | None = None, filter_internal: bool = True) -> list[core.MetaMethod]
Get all MetaMethods based on given criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_super
|
bool
|
Whether to include Methods from parent classes |
True
|
type_filter
|
MethodTypeStr | None
|
Method type to filter for. |
None
|
filter_internal
|
bool
|
Filter Qt-internal methods |
True
|
Source code in prettyqt/core/metaobject.py
get_name() -> str
get_plain_methods(include_super: bool = True) -> list[core.MetaMethod]
Get all plain MetaMethods based on given criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_super
|
bool
|
Whether to include plain methods from parent classes |
True
|
Source code in prettyqt/core/metaobject.py
get_properties(include_super: bool = True, only_writable: bool = False, only_stored: bool = False, only_bindable: bool = False, only_designable: bool = False, only_final: bool = False, only_required: bool = False, only_enum_type: bool = False, only_flag_type: bool = False, only_with_notifiers: bool = False, only_with_type_name: str = '') -> list[core.MetaProperty]
Get all MetaProperties based on given criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_super
|
bool
|
Whether to include properties from parent classes, |
True
|
only_writable
|
bool
|
Whether to filter for writable properties. |
False
|
only_stored
|
bool
|
Whether to filter for stored properties. |
False
|
only_bindable
|
bool
|
Whether to filter for bindable properties. |
False
|
only_designable
|
bool
|
Whether to filter for designable properties. |
False
|
only_final
|
bool
|
Whether to filter for final properties. |
False
|
only_required
|
bool
|
Whether to filter for required properties. |
False
|
only_enum_type
|
bool
|
Whether to filter for Enum type properties. |
False
|
only_flag_type
|
bool
|
Whether to filter for Flag_type properties. |
False
|
only_with_notifiers
|
bool
|
Whether to filter for properties with notifier. |
False
|
only_with_type_name
|
str
|
Only include properties with given give name as type. |
''
|
Source code in prettyqt/core/metaobject.py
get_property(index: int | str) -> core.MetaProperty
Get MetaProperty based on index or name.
Only returns non-dynamic properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int | str
|
index or property name |
required |
Source code in prettyqt/core/metaobject.py
get_property_class_affiliations() -> dict[str, list[core.MetaProperty]]
Get a mapping of class -> property affiliations.
Source code in prettyqt/core/metaobject.py
get_property_values(qobject: core.QObject, cast_types: bool = False) -> dict[str, Any]
Get a dictionary containing all MetaProperties values from given qobject.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qobject
|
QObject
|
QObject to get properties from |
required |
cast_types
|
bool
|
Whether to cast types to PrettyQt classes. |
False
|
Source code in prettyqt/core/metaobject.py
get_signals(include_super: bool = True, only_notifiers: bool = False) -> list[core.MetaMethod]
Get all signal MetaMethods based on given criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_super
|
bool
|
Whether to include Signals from parent classes |
True
|
only_notifiers
|
bool
|
Whether to filter for property notifier signals |
False
|
Source code in prettyqt/core/metaobject.py
get_slots(include_super: bool = True) -> list[core.MetaMethod]
Get all slot MetaMethods based on given criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_super
|
bool
|
Whether to include Slots from parent classes |
True
|
Source code in prettyqt/core/metaobject.py
get_super_class() -> MetaObject | None
get_user_property() -> core.MetaProperty | None
has_property(name: str)
Check if a property with given name exists.
Only checks for non-dynamic properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
property name |
required |
Source code in prettyqt/core/metaobject.py
MetaProperty
Meta-data about a property.
Source code in prettyqt/core/metaproperty.py
MetaType
Bases: QMetaType
Manages named types in the meta-object system.
Source code in prettyqt/core/metatype.py
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 | |
MicrophonePermission
MimeData
Bases: ObjectMixin, QMimeData
Container for data that records information about its MIME type.
Source code in prettyqt/core/mimedata.py
MimeDatabase
Bases: QMimeDatabase
Maintains a database of MIME types.
Source code in prettyqt/core/mimedatabase.py
MimeType
Bases: QMimeType
Describes types of file or data, represented by a MIME type string.
Source code in prettyqt/core/mimetype.py
ModelRoleData
Mutex
Bases: QMutex
Access serialization between threads.
Source code in prettyqt/core/mutex.py
NativeIpcKey
Bases: QNativeIpcKey
Holds a native key used by QSystemSemaphore and QSharedMemory.
Source code in prettyqt/core/nativeipckey.py
get_type() -> TypeStr
set_type(typ: TypeStr | QtCore.QNativeIpcKey.Type)
Set the IPC key type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
TypeStr | Type
|
IPC key type to use |
required |
Object
Bases: ObjectMixin, QObject
The base class of all Qt objects.
Source code in prettyqt/core/object.py
ObjectMixin
Bases: _ObjectBase
Source code in prettyqt/core/object.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 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 | |
add_callback_for_event(callback: Callable[[core.QEvent], bool], include: core.QEvent.Type | core.event.TypeStr | Sequence[core.QEvent.Type | core.event.TypeStr] | None = None, exclude: core.QEvent.Type | core.event.TypeStr | Sequence[core.QEvent.Type | core.event.TypeStr] | None = None) -> eventfilters.EventCatcher
Connect widget events to a callback.
if include is set, it behaves like a whitelist. if exclude is set, it behaves like a blacklist. The QEvent is passed to the callback as an argument, and the callback needs to return True or False to indicate whether the Event should be filtered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
Callable[[QEvent], bool]
|
Callback to execute when event is triggered |
required |
include
|
Type | TypeStr | Sequence[Type | TypeStr] | None
|
Events to include |
None
|
exclude
|
Type | TypeStr | Sequence[Type | TypeStr] | None
|
Events to exclude |
None
|
Source code in prettyqt/core/object.py
find_child(typ: type[T] = core.QObject, name: str | core.QRegularExpression | None = None, recursive: bool = True) -> T | None
Find a child with given type and name.
Source code in prettyqt/core/object.py
find_children(typ: type[T] = core.QObject, name: str | datatypes.PatternType | None = None, recursive: bool = True, property_selector: dict[str, Any] | None = None, only_prettyqt_classes: bool = False) -> listdelegators.ListDelegator[T]
Find children with given type and name.
Children can be filtered by passing a property selector dictionary. It must contain the property name for keys and either a value which must be set or a predicate function which gets the property value as an argument and must return True if the child should be included.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
type[T]
|
Subclass of QObject (can also be a UnionType) |
QObject
|
name
|
str | PatternType | None
|
ObjectName filter. None includes all. |
None
|
recursive
|
bool
|
whether to search for children recursively. |
True
|
property_selector
|
dict[str, Any] | None
|
dict containing PropertyName -> Value/Predicate pairs. |
None
|
only_prettyqt_classes
|
bool
|
only include objects with prettyqt superpowers. |
False
|
Source code in prettyqt/core/object.py
find_parent(typ: type[T] = core.QObject, name: str | None = None) -> T | None
Find parent with given type or name.
Source code in prettyqt/core/object.py
get_dynamic_properties() -> dict[str, Any]
Get a dictionary with all dynamic properties.
get_properties(include_super: bool = True, cast: bool = True, only_writable: bool = False, only_nonempty: bool = False) -> dict[str, Any]
Get a dictionary containing all properties and their values.
Source code in prettyqt/core/object.py
installEventFilter(filter_: core.QObject | str, **kwargs)
Override to also allow setting eventfilters by name.
Source code in prettyqt/core/object.py
properties_set_to(**kwargs)
Context manager to temporarily set properties to different values.
Source code in prettyqt/core/object.py
set_object_name(name: str)
set_properties(props: dict[str, Any], include_super: bool = True)
Set properties from a dictionary.
Source code in prettyqt/core/object.py
set_unique_id()
signal_blocked(signal: core.SignalInstance, receiver: Callable | core.SignalInstance)
Context manager to temporarily disconnect specific signal.
Source code in prettyqt/core/object.py
signals_blocked()
Context manager to temporarily block emitting signals.
start_callback_timer(callback: Callable, interval: int | str, single_shot: bool = False, timer_type: constants.TimerTypeStr = 'coarse') -> core.Timer
Start timer and execute callback when timeout reached.
Source code in prettyqt/core/object.py
start_timer(interval: int | str, timer_type: constants.TimerTypeStr = 'coarse') -> int | None
Start a timer and return the timer id, to be used in timerEvent.
Source code in prettyqt/core/object.py
OperatingSystemVersion
Bases: QOperatingSystemVersion
Information about the operating system version.
Source code in prettyqt/core/operatingsystemversion.py
ParallelAnimationGroup
Bases: AnimationGroupMixin, QParallelAnimationGroup
Parallel group of animations.
Source code in prettyqt/core/parallelanimationgroup.py
PauseAnimation
Bases: AbstractAnimationMixin, QPauseAnimation
Pause for QSequentialAnimationGroup.
Source code in prettyqt/core/pauseanimation.py
Permission
Bases: QPermission
Opaque wrapper of a typed permission.
Source code in prettyqt/core/permission.py
get_status() -> constants.PermissionStatusStr
PersistentModelIndex
Bases: QPersistentModelIndex
Used to locate data in a data model.
Source code in prettyqt/core/persistentmodelindex.py
PluginLoader
Bases: ObjectMixin, QPluginLoader
Load a plugin at runtime.
Source code in prettyqt/core/pluginloader.py
Process
Bases: IODeviceMixin, QProcess
Used to start external programs and to communicate with them.
Source code in prettyqt/core/process.py
set_input_channel_mode(mode: InputChannelModeStr | core.QProcess.InputChannelMode)
Set the input channel mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
InputChannelModeStr | InputChannelMode
|
mode to set |
required |
set_process_channel_mode(mode: ProcessChannelModeStr | core.QProcess.ProcessChannelMode)
Set the process channel mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
ProcessChannelModeStr | ProcessChannelMode
|
mode to set |
required |
Source code in prettyqt/core/process.py
set_read_channel(channel: ProcessChannelStr | core.QProcess.ProcessChannel)
Set the input channel channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
ProcessChannelStr | ProcessChannel
|
channel to set |
required |
set_state(state: ProcessStateStr | core.QProcess.ProcessState)
Set the process state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
ProcessStateStr | ProcessState
|
state to set |
required |
ProcessEnvironment
Bases: QProcessEnvironment, MutableMapping
Holds the environment variables that can be passed to a program.
Source code in prettyqt/core/processenvironment.py
Property
Bases: Property
Template class that enables automatic property bindings.
Source code in prettyqt/core/property.py
PropertyAnimation
Bases: VariantAnimationMixin, QPropertyAnimation
Animates Qt properties.
Source code in prettyqt/core/propertyanimation.py
get_property_value() -> Any
Return the value of the property which should get animated.
RandomGenerator
RangeModel
Bases: AbstractItemModelMixin, QRangeModel
Item model wrapping a Python sequence or table range.
Source code in prettyqt/core/rangemodel.py
get_auto_connect_policy() -> AutoConnectPolicyStr
set_auto_connect_policy(policy: AutoConnectPolicyStr | core.QRangeModel.AutoConnectPolicy)
Set the auto-connect policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
AutoConnectPolicyStr | AutoConnectPolicy
|
auto-connect policy to use |
required |
Source code in prettyqt/core/rangemodel.py
ReadWriteLock
Bases: QReadWriteLock
Read-write locking between threads.
Source code in prettyqt/core/readwritelock.py
RegularExpression
Bases: QRegularExpression
Pattern matching using regular expressions.
Source code in prettyqt/core/regularexpression.py
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 | |
RegularExpressionMatch
Bases: QRegularExpressionMatch
The results of a matching a QRegularExpression against a string.
Source code in prettyqt/core/regularexpressionmatch.py
RegularExpressionMatchIterator
Bases: QRegularExpressionMatchIterator
Iterator on the results of a global match of a QRegularExpression.
Source code in prettyqt/core/regularexpressionmatchiterator.py
Resource
Bases: QResource
Interface for reading directly from resources.
Source code in prettyqt/core/_resource.py
Runnable
SaveFile
Bases: FileDeviceMixin, QSaveFile
Interface for safely writing to files.
Source code in prettyqt/core/savefile.py
Semaphore
Bases: QSemaphore
General counting semaphore.
Source code in prettyqt/core/semaphore.py
SequentialAnimationGroup
Bases: AnimationGroupMixin, QSequentialAnimationGroup
Sequential group of animations.
Source code in prettyqt/core/sequentialanimationgroup.py
append_reversed() -> core.SequentialAnimationGroup
Return copy of animation with appended reverse animation.
Source code in prettyqt/core/sequentialanimationgroup.py
reverse()
Reverse animation in-place by switching start and end values.
Source code in prettyqt/core/sequentialanimationgroup.py
reversed() -> SequentialAnimationGroup
Return a reversed copy of the animation.
Source code in prettyqt/core/sequentialanimationgroup.py
Settings
Bases: Settings_
Settings class which wraps everything into a dict to preserve data types.
Source code in prettyqt/core/settings.py
SharedMemory
SignalBlocker
SignalMapper
Bases: ObjectMixin, QSignalMapper
Bundles signals from identifiable senders.
Source code in prettyqt/core/signalmapper.py
Size
Bases: QSize
Defines the size of a two-dimensional object using integer point precision.
Source code in prettyqt/core/size.py
SizeF
Bases: QSizeF
Defines the size of a two-dimensional object using floating point precision.
Source code in prettyqt/core/sizef.py
SocketNotifier
Bases: ObjectMixin, QSocketNotifier
Support for monitoring activity on a file descriptor.
Source code in prettyqt/core/socketnotifier.py
SortFilterProxyModel
Bases: AbstractProxyModelMixin, QSortFilterProxyModel
Support for sorting and filtering data passed between another model and a view.
Source code in prettyqt/core/sortfilterproxymodel.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 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 | |
change_filter(direction: DirectionStr | core.QSortFilterProxyModel.Direction = 'both')
Context manager wrapping beginFilterChange() / endFilterChange().
Source code in prettyqt/core/sortfilterproxymodel.py
get_filter_case_sensitivity() -> constants.CaseSensitivityStr
Return current filter case sensitivity.
Source code in prettyqt/core/sortfilterproxymodel.py
invalidate_rows_filter()
set_filter_case_sensitivity(sensitivity: constants.CaseSensitivityStr | constants.CaseSensitivity)
Set the filter case sensitivity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sensitivity
|
CaseSensitivityStr | CaseSensitivity
|
filter case sensitivity |
required |
Source code in prettyqt/core/sortfilterproxymodel.py
StandardPaths
Bases: QStandardPaths
Methods for accessing standard paths.
Source code in prettyqt/core/standardpaths.py
StorageInfo
Bases: QStorageInfo
Provides information about currently mounted storage and drives.
Source code in prettyqt/core/storageinfo.py
StringConverter
Bases: StringConverterMixin, QStringConverter
Base class for encoding and decoding text.
Source code in prettyqt/core/stringconverter.py
StringDecoder
Bases: StringConverterMixin, QStringDecoder
State-based decoder for text.
Source code in prettyqt/core/stringdecoder.py
StringEncoder
Bases: StringConverterMixin, QStringEncoder
State-based encoder for text.
Source code in prettyqt/core/stringencoder.py
StringListModel
Bases: StringListModelMixin, QStringListModel
Model that supplies strings to views.
Source code in prettyqt/core/stringlistmodel.py
TemporaryDir
Bases: QTemporaryDir
Creates a unique directory for temporary use.
Source code in prettyqt/core/temporarydir.py
TemporaryFile
TextBoundaryFinder
Bases: QTextBoundaryFinder
Way of finding Unicode text boundaries in a string.
Source code in prettyqt/core/textboundaryfinder.py
TextStream
Bases: QTextStream
Convenient interface for reading and writing text.
Source code in prettyqt/core/textstream.py
get_field_alignment() -> FieldAlignmentStr
get_real_number_notation() -> RealNumberNotationStr
Get current real number notation.
get_status() -> StatusStr
set_field_alignment(alignment: FieldAlignmentStr | QtCore.QTextStream.FieldAlignment)
Set the field alignment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alignment
|
FieldAlignmentStr | FieldAlignment
|
field alignment |
required |
set_real_number_notation(notation: RealNumberNotationStr | QtCore.QTextStream.RealNumberNotation)
Set the real number notation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
notation
|
RealNumberNotationStr | RealNumberNotation
|
real number notation |
required |
Source code in prettyqt/core/textstream.py
set_status(status: StatusStr | QtCore.QTextStream.Status)
Set the status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status
|
StatusStr | Status
|
status |
required |
Thread
Bases: ObjectMixin, QThread
Platform-independent way to manage threads.
Source code in prettyqt/core/thread.py
ThreadPool
Bases: ObjectMixin, QThreadPool
Manages a collection of QThreads.
Note: signals only work correctly when exclusively using start_worker method.
Source code in prettyqt/core/threadpool.py
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 | |
instance() -> Self
classmethod
Return global ThreadPool singleton. (globalInstance always returns Qt type).
Time
Bases: QTime
Clock time functions.
Source code in prettyqt/core/_time.py
TimeLine
Bases: ObjectMixin, QTimeLine
Timeline for controlling animations.
Source code in prettyqt/core/timeline.py
get_direction() -> DirectionStr
get_state() -> StateStr
set_direction(direction: DirectionStr | core.QTimeLine.Direction)
Set the direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
direction
|
DirectionStr | Direction
|
direction |
required |
TimeZone
Bases: QTimeZone
Identifies how a time representation relates to UTC.
Source code in prettyqt/core/timezone.py
Timer
Bases: ObjectMixin, QTimer
Repetitive and single-shot timers.
Source code in prettyqt/core/timer.py
get_type() -> constants.TimerTypeStr
set_type(typ: constants.TimerTypeStr | constants.TimerType)
Set the timer type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
TimerTypeStr | TimerType
|
timer type |
required |
Translator
TransposeProxyModel
Bases: AbstractProxyModelMixin, QTransposeProxyModel
This proxy transposes the source model.
Source code in prettyqt/core/transposeproxymodel.py
Url
Bases: SerializeMixin, QUrl
Convenient interface for working with URLs.
Source code in prettyqt/core/url.py
is_special_url() -> bool
UrlQuery
Bases: QUrlQuery, MutableMapping
Way to manipulate a key-value pairs in a URL's query.
Source code in prettyqt/core/urlquery.py
Uuid
UuidMixin
Bases: _UuidBase
Source code in prettyqt/core/_uuid.py
to_string(fmt: StringFormatStr | QtCore.QUuid.StringFormat = 'with_braces') -> str
Return string representation of the Uuid.
Allowed values are "with_braces", "without_braces", "id_128"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmt
|
StringFormatStr | StringFormat
|
Uuid format to use |
'with_braces'
|
Source code in prettyqt/core/_uuid.py
VariantAnimation
Bases: VariantAnimationMixin, QVariantAnimation
Base class for animations.
Source code in prettyqt/core/variantanimation.py
VariantAnimationMixin
Bases: AbstractAnimationMixin, _VariantAnimationBase
Source code in prettyqt/core/variantanimation.py
append_reversed() -> Self
Append the reversed animation, effectively doubling the duration.
Source code in prettyqt/core/variantanimation.py
reverse()
VersionNumber
Bases: QVersionNumber
Contains a version number with an arbitrary number of segments.
Source code in prettyqt/core/versionnumber.py
major() -> int
micro() -> int
XmlStreamReader
Bases: QXmlStreamReader
Fast parser for reading well-formed XML via a simple streaming API.
Source code in prettyqt/core/xmlstreamreader.py
get_error() -> ErrorStr
get_token_type() -> TokenTypeStr
XmlStreamWriter
Bases: QXmlStreamWriter
XML writer with a simple streaming API.
Source code in prettyqt/core/xmlstreamwriter.py
document(version: str | None = None, standalone: bool | None = None)
Context manager wrapping writeStartDocument / writeEndDocument.
Source code in prettyqt/core/xmlstreamwriter.py
element(name: str, namespace_uri: str | None = None)
Context manager wrapping writeStartElement / writeEndElement.
Source code in prettyqt/core/xmlstreamwriter.py
async_slots_enabled(*, on_error: Callable[[BaseException], Any] | None = None) -> Generator[AsyncSlotHook]
Context manager enabling async def signal connections temporarily.
Source code in prettyqt/core/aio.py
disable_async_slots() -> None
Disable automatic scheduling of async def slots connected to Qt signals.
Source code in prettyqt/core/aio.py
enable_async_slots(*, on_error: Callable[[BaseException], Any] | None = None) -> AsyncSlotHook
Enable connecting async def functions directly to Qt signals.
Source code in prettyqt/core/aio.py
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 |
{}
|
Source code in prettyqt/utils/__init__.py
run_in_gui_thread(fn: Callable[..., T], *args: Any, **kwargs: Any) -> T
async
Execute fn(*args, **kwargs) on Qt's main GUI thread and await the result.
Source code in prettyqt/core/aio.py
schedule_coroutine(coro: Coroutine[Any, Any, T], *, loop: asyncio.AbstractEventLoop | None = None, on_error: Callable[[BaseException], Any] | None = None, use_bridge: bool = True) -> asyncio.Task[T] | concurrent.futures.Future[T]
Schedule a coroutine onto the active asyncio loop or AsyncBridge.
- If a running
asyncioloop exists on the current thread (orloopis passed), creates a trackedasyncio.Task(preservingcontextvarsand preventing premature GC). - Otherwise, if
use_bridgeis True, submits to the sharedAsyncBridge(preservingcontextvarsacross the thread boundary).
Source code in prettyqt/core/aio.py
wait_for_signal(signal: Any, *, timeout: float | None = None) -> Any
async
Await the next emission of a Qt signal.
Returns None for 0-arg signals, the single argument for 1-arg signals,
or a tuple of arguments for multi-arg signals. Safe across both main-thread
loops (qasync/qtinter) and AsyncBridge worker threads.