File: anyqt.rst

package info (click to toggle)
python-anyqt 0.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 560 kB
  • sloc: python: 4,087; makefile: 192; sh: 3
file content (585 lines) | stat: -rw-r--r-- 14,322 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
.. module:: AnyQt


:mod:`AnyQt`
============

.. autofunction:: availableapi

.. autofunction:: setpreferredapi

.. autofunction:: selectapi

.. autodata:: USED_API


:mod:`AnyQt.QtCore`
-------------------

Export a Qt5 compatible QtCore module.

* PyQt5: Full :mod:`PyQt5.QtCore` module is reexported
* PyQt4: Full :mod:`PyQt4.QtCore` module is reexported and in addition
  `QAbstractProxyModel`, `QIdentityProxyModel`, `QItemSelection`,
  `QItemSelectionModel`, `QItemSelectionRange`, `QSortFilterProxyModel`,
  `QStringListModel`, are imported from :mod:`PyQt4.QtGui`

.. note::
    The folowing are not available when using :mod:`PyQt5`:
        * 'QAbstractFileEngine'
        * 'QAbstractFileEngineHandler'
        * 'QAbstractFileEngineIterator'
        * 'QFSFileEngine'
        * 'QPyNullVariant'
        * 'QSystemLocale'
        * 'SIGNAL'
        * 'SLOT'
        * 'qInstallMsgHandler'
        * 'qSwap'

.. note::
    QUrl in Qt5 has a different interface (some functionality was split into
    QUrlParse). No attempt is made to taper over the differences.

* :class:`QSignalMapper` imported from this module has `mappedInt`,
  `mappedString`, `mappedObject` and `mappedWidget` signals defined even
  when not present in Qt < 5.15. Use these instead of deprecated `mapped`
  overloads for forward compatibility with Qt6

  .. note:: A subclass of the real QSignalMapper is used.


* A forward compatible :func:`QLibraryInfo.path` is available (new in Qt6
  replaces :func:`QLibrartInfo.location`)


Use `AnyQt.QtCore.QT_VERSION` to check if a feature is present.


:mod:`AnyQt.QtGui`
------------------

Export a Qt5 compatible QtGui module.

* PyQt5: Full :mod:`PyQt5.QtGui` module is reexported
* PyQt4: The following members are imported from :mod:`PyQt4.QtGui`:
    * 'QAbstractTextDocumentLayout'
    * 'QActionEvent'
    * 'QBitmap'
    * 'QBrush'
    * 'QClipboard'
    * 'QCloseEvent'
    * 'QColor'
    * 'QConicalGradient'
    * 'QContextMenuEvent'
    * 'QCursor'
    * 'QDesktopServices'
    * 'QDoubleValidator'
    * 'QDrag'
    * 'QDragEnterEvent'
    * 'QDragLeaveEvent'
    * 'QDragMoveEvent'
    * 'QDropEvent'
    * 'QFileOpenEvent'
    * 'QFocusEvent'
    * 'QFont'
    * 'QFontDatabase'
    * 'QFontInfo'
    * 'QFontMetrics'
    * 'QFontMetricsF'
    * 'QGlyphRun'
    * 'QGradient'
    * 'QHelpEvent'
    * 'QHideEvent'
    * 'QHoverEvent'
    * 'QIcon'
    * 'QIconDragEvent'
    * 'QIconEngine'
    * 'QImage'
    * 'QImageIOHandler'
    * 'QImageReader'
    * 'QImageWriter'
    * 'QInputEvent'
    * 'QInputMethodEvent'
    * 'QIntValidator'
    * 'QKeyEvent'
    * 'QKeySequence'
    * 'QLinearGradient'
    * 'QMatrix2x2'
    * 'QMatrix2x3'
    * 'QMatrix2x4'
    * 'QMatrix3x2'
    * 'QMatrix3x3'
    * 'QMatrix3x4'
    * 'QMatrix4x2'
    * 'QMatrix4x3'
    * 'QMatrix4x4'
    * 'QMouseEvent'
    * 'QMoveEvent'
    * 'QMovie'
    * 'QPaintDevice'
    * 'QPaintEngine'
    * 'QPaintEngineState'
    * 'QPaintEvent'
    * 'QPainter'
    * 'QPainterPath'
    * 'QPainterPathStroker'
    * 'QPalette'
    * 'QPen'
    * 'QPicture'
    * 'QPictureIO'
    * 'QPixmap'
    * 'QPixmapCache'
    * 'QPolygon'
    * 'QPolygonF'
    * 'QQuaternion'
    * 'QRadialGradient'
    * 'QRawFont'
    * 'QRegExpValidator'
    * 'QRegion'
    * 'QResizeEvent'
    * 'QSessionManager'
    * 'QShortcutEvent'
    * 'QShowEvent'
    * 'QStandardItem'
    * 'QStandardItemModel'
    * 'QStaticText'
    * 'QStatusTipEvent'
    * 'QSyntaxHighlighter'
    * 'QTabletEvent'
    * 'QTextBlock'
    * 'QTextBlockFormat'
    * 'QTextBlockGroup'
    * 'QTextBlockUserData'
    * 'QTextCharFormat'
    * 'QTextCursor'
    * 'QTextDocument'
    * 'QTextDocumentFragment'
    * 'QTextDocumentWriter'
    * 'QTextFormat'
    * 'QTextFragment'
    * 'QTextFrame'
    * 'QTextFrameFormat'
    * 'QTextImageFormat'
    * 'QTextInlineObject'
    * 'QTextItem'
    * 'QTextLayout'
    * 'QTextLength'
    * 'QTextLine'
    * 'QTextList'
    * 'QTextListFormat'
    * 'QTextObject'
    * 'QTextObjectInterface'
    * 'QTextOption'
    * 'QTextTable'
    * 'QTextTableCell'
    * 'QTextTableCellFormat'
    * 'QTextTableFormat'
    * 'QTouchEvent'
    * 'QTransform'
    * 'QValidator'
    * 'QVector2D'
    * 'QVector3D'
    * 'QVector4D'
    * 'QWhatsThisClickedEvent'
    * 'QWheelEvent'
    * 'QWindowStateChangeEvent'
    * 'qAlpha'
    * 'qBlue'
    * 'qFuzzyCompare'
    * 'qGray'
    * 'qGreen'
    * 'qIsGray'
    * 'qRed'
    * 'qRgb'
    * 'qRgba'

* When using a Qt4 API, the :class:`QWheelEvent` gains a Qt5 compatible
  :func:`angleDelta` method.

* A backported QGuiApplication.screenAt static method is added if not
  implemented by Qt5

* A QFontMetrics(F).horizontalAdvance method is made available if not present
  in Qt (<5.11)

* An missing QPdfWriter.setPageSize(QPageSize) overload for PyQt5 is added.

* All members of :class:`QFontDatabase` can be called as static methods the
  same way as in Qt 6.

* :class:`QAction` has ctypes based :func:`menu()` and  :func:`setMenu()`
  members if/when not present in PyQt6


:mod:`AnyQt.QtWidgets`
----------------------

Export a Qt5 compatible QtWidgets module

* PyQt5: Full :mod:`PyQt5.QtWidgets` module is reexported
* PyQt4: The following members from PyQt4.QtGui are exported:
    * 'QAbstractButton'
    * 'QAbstractGraphicsShapeItem'
    * 'QAbstractItemDelegate'
    * 'QAbstractItemView'
    * 'QAbstractScrollArea'
    * 'QAbstractSlider'
    * 'QAbstractSpinBox'
    * 'QAction'
    * 'QActionGroup'
    * 'QApplication'
    * 'QBoxLayout'
    * 'QButtonGroup'
    * 'QCalendarWidget'
    * 'QCheckBox'
    * 'QColorDialog'
    * 'QColumnView'
    * 'QComboBox'
    * 'QCommandLinkButton'
    * 'QCommonStyle'
    * 'QCompleter'
    * 'QDataWidgetMapper'
    * 'QDateEdit'
    * 'QDateTimeEdit'
    * 'QDesktopWidget'
    * 'QDial'
    * 'QDialog'
    * 'QDialogButtonBox'
    * 'QDirModel'
    * 'QDockWidget'
    * 'QDoubleSpinBox'
    * 'QErrorMessage'
    * 'QFileDialog'
    * 'QFileIconProvider'
    * 'QFileSystemModel'
    * 'QFocusFrame'
    * 'QFontComboBox'
    * 'QFontDialog'
    * 'QFormLayout'
    * 'QFrame'
    * 'QGesture'
    * 'QGestureEvent'
    * 'QGestureRecognizer'
    * 'QGraphicsAnchor'
    * 'QGraphicsAnchorLayout'
    * 'QGraphicsBlurEffect'
    * 'QGraphicsColorizeEffect'
    * 'QGraphicsDropShadowEffect'
    * 'QGraphicsEffect'
    * 'QGraphicsEllipseItem'
    * 'QGraphicsGridLayout'
    * 'QGraphicsItem'
    * 'QGraphicsItemGroup'
    * 'QGraphicsLayout'
    * 'QGraphicsLayoutItem'
    * 'QGraphicsLineItem'
    * 'QGraphicsLinearLayout'
    * 'QGraphicsObject'
    * 'QGraphicsOpacityEffect'
    * 'QGraphicsPathItem'
    * 'QGraphicsPixmapItem'
    * 'QGraphicsPolygonItem'
    * 'QGraphicsProxyWidget'
    * 'QGraphicsRectItem'
    * 'QGraphicsRotation'
    * 'QGraphicsScale'
    * 'QGraphicsScene'
    * 'QGraphicsSceneContextMenuEvent'
    * 'QGraphicsSceneDragDropEvent'
    * 'QGraphicsSceneEvent'
    * 'QGraphicsSceneHelpEvent'
    * 'QGraphicsSceneHoverEvent'
    * 'QGraphicsSceneMouseEvent'
    * 'QGraphicsSceneMoveEvent'
    * 'QGraphicsSceneResizeEvent'
    * 'QGraphicsSceneWheelEvent'
    * 'QGraphicsSimpleTextItem'
    * 'QGraphicsTextItem'
    * 'QGraphicsTransform'
    * 'QGraphicsView'
    * 'QGraphicsWidget'
    * 'QGridLayout'
    * 'QGroupBox'
    * 'QHBoxLayout'
    * 'QHeaderView'
    * 'QInputDialog'
    * 'QItemDelegate'
    * 'QItemEditorCreatorBase'
    * 'QItemEditorFactory'
    * 'QKeyEventTransition'
    * 'QLCDNumber'
    * 'QLabel'
    * 'QLayout'
    * 'QLayoutItem'
    * 'QLineEdit'
    * 'QListView'
    * 'QListWidget'
    * 'QListWidgetItem'
    * 'QMacCocoaViewContainer'
    * 'QMainWindow'
    * 'QMdiArea'
    * 'QMdiSubWindow'
    * 'QMenu'
    * 'QMenuBar'
    * 'QMessageBox'
    * 'QMouseEventTransition'
    * 'QPanGesture'
    * 'QPinchGesture'
    * 'QPlainTextDocumentLayout'
    * 'QPlainTextEdit'
    * 'QProgressBar'
    * 'QProgressDialog'
    * 'QPushButton'
    * 'QRadioButton'
    * 'QRubberBand'
    * 'QScrollArea'
    * 'QScrollBar'
    * 'QShortcut'
    * 'QSizeGrip'
    * 'QSizePolicy'
    * 'QSlider'
    * 'QSpacerItem'
    * 'QSpinBox'
    * 'QSplashScreen'
    * 'QSplitter'
    * 'QSplitterHandle'
    * 'QStackedLayout'
    * 'QStackedWidget'
    * 'QStatusBar'
    * 'QStyle'
    * 'QStyleFactory'
    * 'QStyleHintReturn'
    * 'QStyleHintReturnMask'
    * 'QStyleHintReturnVariant'
    * 'QStyleOption'
    * 'QStyleOptionButton'
    * 'QStyleOptionComboBox'
    * 'QStyleOptionComplex'
    * 'QStyleOptionDockWidget'
    * 'QStyleOptionFocusRect'
    * 'QStyleOptionFrame'
    * 'QStyleOptionGraphicsItem'
    * 'QStyleOptionGroupBox'
    * 'QStyleOptionHeader'
    * 'QStyleOptionMenuItem'
    * 'QStyleOptionProgressBar'
    * 'QStyleOptionRubberBand'
    * 'QStyleOptionSizeGrip'
    * 'QStyleOptionSlider'
    * 'QStyleOptionSpinBox'
    * 'QStyleOptionTab'
    * 'QStyleOptionTabBarBase'
    * 'QStyleOptionTabWidgetFrame'
    * 'QStyleOptionTitleBar'
    * 'QStyleOptionToolBar'
    * 'QStyleOptionToolBox'
    * 'QStyleOptionToolButton'
    * 'QStyleOptionViewItem'
    * 'QStylePainter'
    * 'QStyledItemDelegate'
    * 'QSwipeGesture'
    * 'QSystemTrayIcon'
    * 'QTabBar'
    * 'QTabWidget'
    * 'QTableView'
    * 'QTableWidget'
    * 'QTableWidgetItem'
    * 'QTableWidgetSelectionRange'
    * 'QTapAndHoldGesture'
    * 'QTapGesture'
    * 'QTextBrowser'
    * 'QTextEdit'
    * 'QTimeEdit'
    * 'QToolBar'
    * 'QToolBox'
    * 'QToolButton'
    * 'QToolTip'
    * 'QTreeView'
    * 'QTreeWidget'
    * 'QTreeWidgetItem'
    * 'QTreeWidgetItemIterator'
    * 'QUndoCommand'
    * 'QUndoGroup'
    * 'QUndoStack'
    * 'QUndoView'
    * 'QVBoxLayout'
    * 'QWIDGETSIZE_MAX'
    * 'QWhatsThis'
    * 'QWidget'
    * 'QWidgetAction'
    * 'QWidgetItem'
    * 'QWizard'
    * 'QWizardPage'
    * 'qApp'
    * 'qDrawBorderPixmap'
    * 'qDrawPlainRect'
    * 'qDrawShadeLine'
    * 'qDrawShadePanel'
    * 'qDrawShadeRect'
    * 'qDrawWinButton'
    * 'qDrawWinPanel'


..
  Known unavailable in PyQt4
    * 'QKeySequenceEdit',
    * 'QOpenGLWidget',
    * 'QProxyStyle',
    * 'QScroller',
    * 'QScrollerProperties',


* :class:`QFileDialog`\'s get{Open,Save}Filename provide a consistent PyQt5
  compatible interface (i.e. they return `(filename: str, format: str)` tuple.

* :class:`QHeaderView` provides a consistent forward compatible methods:
     * :func:`QHeaderView.setSectionResizeMode`
     * :func:`QHeaderView.sectionResizeMode`
     * :func:`QHeaderView.sectionsClickable`
     * :func:`QHeaderView.setSectionsClickable`
     * :func:`QHeaderView.sectionsMovable`
     * :func:`QHeaderView.setSectionsMovable`

* The versioned :class:`QStyleOption` subclasses in :mod:`PyQt4.QtGui` are
  renamed to their unversioned conterpart (e.g. the
  :class:`QStyleOptionViewItemV4` is exported as
  :class:`QStyleOptionViewItem`

* A forward compatible :func:`QWidget.grab` method is made available when
  using a Qt4 backend.

* A backward compatible :func:`QAbstractItemView.viewOptions` method is made
  available when using a Qt6 backend.

* A forward compatible :func:`QAbstractItemView.itemDelegateForIndex` method
  is made available (new in Qt 6.0). Use this instead of deprecated
  :func:`QAbstractItemView.itemDelegate(QModelIndex)` overload.

* A :func:`QWidget.screen` method is made available when not present in
  Qt5 (<5.14).

* :class:`QButtonGroup` imported from this module has `idClicked`, `idPressed`,
  `idReleased` and `idToggled` signals defined even when not present in
  Qt < 5.15. Use these instead of `clicked[int]`, `pressed[int]` and
  `toggled[int]` overloads for compatibility with Qt6 where they are
  removed.

  .. note:: A subclass of the real QGroupBox is used.

* :class:`QComboBox` imported from this module has `textActivated` and
  `textHighlighted` signals defined even when not present in Qt < 5.14.
  Use these instead of `activated[int]` and `highlighted[int]` overloads
  for compatibility with Qt6 where they are removed.

  .. note:: A subclass of the real QComboBox is used.

* :func:`QTextEdit.setTabStopDistance`, `QTextEdit.tabStopDistance`
  :func:`QPlainTextEdit.setTabStopDistance` :func:`QTextPlainEdit.setTabStopDistance`
  are made available if not present Qt5 (<5.10). Use these instead of the obsolete
  `setTabStopWidth` ...

:mod:`AnyQt.QtMultimedia`
-------------------------

:mod:`AnyQt.QtMultimediaWidgets`
--------------------------------

Qt5-only QtMultimediaWidgets module.

:mod:`AnyQt.QtNetwork`
----------------------

:mod:`AnyQt.QtPrintSupport`
---------------------------

Export a Qt5 compatible QtPrintSupport module.

:mod:`AnyQt.Qml`
----------------
Qt5-only Qml module.

:mod:`AnyQt.QtQuick`
--------------------

Qt5-only QtQuick module.

:mod:`AnyQt.QtSql`
------------------

:mod:`AnyQt.QtSvg`
------------------

:mod:`AnyQt.QtSvgWidgets`
-------------------------
A Qt6 compatible QtSvgWidgets module

:mod:`AnyQt.QtTest`
-------------------

A PyQt5 API compatible QSignalSpy class is provided when using PyQt4 backend

:mod:`AnyQt.QtDBus`
-------------------

:mod:`AnyQt.QtDesigner`
-----------------------

:mod:`AnyQt.QtHelp`
-------------------

:mod:`AnyQt.QtMacExtras`
------------------------

* PyQt5: Full :mod:`PyQt5.QtMacExtras` is reexported
* PyQt4: :class:`QMacPasteboardMime` is imported from :mod:`PyQt4.QtGui`

:mod:`AnyQt.QtOpenGL`
---------------------

:mod:`AnyQt.QtWebChannel`
-------------------------------

Export a Qt5 compatible QtWebChannel module.

:mod:`AnyQt.QtWebEngineWidgets`
-------------------------------

Qt5-only QtWebEngineWidgets module.

:mod:`AnyQt.QtWebKit`
---------------------

Export a Qt5 compatible QtWebKit module.

:mod:`AnyQt.QtWebKitWidgets`
----------------------------

Export a Qt5 compatible QtWebKitWidgets module.

:mod:`AnyQt.QtWebSockets`
-------------------------------

Qt5-only QtWebSockets module.

:mod:`AnyQt.QtWinExtras`
------------------------

Qt5-only QtWinExtras module.

:mod:`AnyQt.QtX11Extras`
------------------------

* Qt5: Full :mod:`QtX11Extras` is reexported
* Qt4: :class:`QX11Info` is imported from :mod:`QtGui`

:mod:`AnyQt.QtXml`
------------------

:mod:`AnyQt.QtXmlPatterns`
--------------------------

:mod:`AnyQt.sip`
----------------

When using a PyQt4/5 then this is an alias for the corresponding sip module