The viewactions module¶
ViewActions provides QActions to control a View.
-
class
ViewActions
(*args, **kwargs)[source]¶ Bases:
PyQt5.QtCore.QObject
ViewActions provides QActions to control a View.
Use setView() to connect the actions with a View. If no View is connected, and an action is used; the viewRequested signal is emitted. You can connect this signal and call setView() in the called slot; the action is then performed on the View.
The attribute smartLayoutOrientationEnabled (defaulting to True) enables some intuitive behaviour: if set to True, for layout modes that do not make sense in horizontal mode the orientation is automatically set to Vertical; and when the user chooses Horizontal orientation in such modes, the layout mode is set to “single”.
-
smartLayoutOrientationEnabled
= True¶
-
viewRequested
¶
-
setView
(view)[source]¶ Connects all the actions to the View.
Use None to set no view. If a view was previously set, all connections are removed from that View.
-
view
()[source]¶ Return the View.
If no View is set, viewRequested is emitted. You can connect to this signal to create a View, and call setView() to use it to perform the requested action.
-
updateFromProperties
(properties)[source]¶ Set the actions to the state stored in the given ViewProperties.
-
-
class
PagerAction
(*args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QWidgetAction
PagerAction shows a spinbox widget with the current page number.
When the current page number is changed (by the user or by calling setCurrentPageNumber()) the signal currentPageNumberChanged() is emitted with the new current page number.
You can use the instance or class attributes buttonSymbols, focusPolicy and the displayFormat() method to influence behaviour and appearance of the spinbox widget(s) that is/are created when this action is added to a toolbar.
The displayFormat string should contain the text “{num}”. You can also include the string “{total}”, so the page count is displayed as well.
-
currentPageNumberChanged
¶
-
focusPolicy
= 2¶
-
setButtonSymbols
(buttonSymbols)[source]¶ Set the
buttonSymbols
property, and update already existing widgets.
-
-
class
ZoomerAction
(*args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QWidgetAction
ZoomerAction provides a combobox with view modes and zoom factors.
-
zoomFactorChanged
¶
-
viewModeChanged
¶
-
viewModes
()[source]¶ Return the view modes that are displayed in the combobox.
See setViewModes() for explanation.
-
setViewModes
(modes)[source]¶ Set the view modes to display on top of the zoom values in the box.
An iterable of tuples (mode, name) is expected; every mode is a viewMode, the name is displayed. By default modes 1, 2 and 3 are displayed with the names “Width”, “Height”, “Page”.
-
zoomFactors
()[source]¶ Return the zoom factors that are displayed in the combobox.
A zoom factor of 100% is represented by a floating point value of 1.0.
-