diff --git a/modules/gui/doc/layout.rst b/modules/gui/doc/layout.rst index 9a45cbd1908a5801b0279bbccb3d8fb3787c60b5..5906dd96480480eb231af83ddf2ecdf146bba269 100644 --- a/modules/gui/doc/layout.rst +++ b/modules/gui/doc/layout.rst @@ -47,13 +47,13 @@ Perspective :param name: The name of the menu :type arg2: :class:`str` - :rtype: :class:`QtCore.QMenu` + :rtype: :class:`QMenu` .. method:: GetMenuBar() Returns the Menubar of the Application. Can be used to add some menupoints. - :rtype: :class:`QtCore.QMenuBar` + :rtype: :class:`QMenuBar` .. method:: GetPanels() @@ -86,9 +86,10 @@ how to add a widget to the MDI area: .. code-block:: python + from PyQt5 import QtWidgets app = gui.GostyApp.Instance() main_area = app.perspective.main_area - label = QtGui.QLabel("Hello World") + label = QtWidgets.QLabel("Hello World") main_area.AddWidget("The beginning..", label) .. class:: MainArea @@ -106,7 +107,7 @@ how to add a widget to the MDI area: :param name: is the unique name (within the scope of the main area) for the widget that is used to restore and save the widget geometry. :type name: :class:`str` :param widget: is the widget to be added to the main area. - :type widget: :class:`QtCore.QWidget` + :type widget: :class:`QWidget` :param window_state: custom window_state for the widget. See Qt Documentation to learn more about WindowStates. :type name: :class:`QWindowState` @@ -121,7 +122,7 @@ how to add a widget to the MDI area: :param name: is the unique name (within the scope of the main area) for the widget that is used to restore and save the widget geometry. :type name: :class:`str` :param widget: is the widget to be added to the main area - :type widget: :class:`QtCore.QWidget` + :type widget: :class:`QWidget` :param width: width of the widget inside the mdi :type width: :class:`int` :param height: height of the widget inside the mdi @@ -138,7 +139,7 @@ how to add a widget to the MDI area: :param title: string that is displayed in the gui. :type title: :class:`str` :param widget: is the widget to be added to the main area. - :type widget: :class:`QtCore.QWidget` + :type widget: :class:`QWidget` .. method:: ShowSubWindow(widget) @@ -149,7 +150,7 @@ how to add a widget to the MDI area: behavior! :param widget: widget which you want to make visible - :type widget: :class:`QtCore.QWidget` + :type widget: :class:`QWidget` .. method:: HideSubWindow(widget) @@ -161,7 +162,7 @@ how to add a widget to the MDI area: behavior! :param widget: widget which you want to hide - :type widget: :class:`QtCore.QWidget` + :type widget: :class:`QWidget` .. method:: EnableTabbedMode(tabbed_mode) @@ -207,12 +208,12 @@ and finally display it in the right side bar: .. code-block:: python - qwidget = QtGui.QLabel("Test") - widget = gui.WrappedWidget(qwidget) + from PyQt5 import QtWidgets + qwidget = QtWidgets.QLabel("Test") + widget = gui.Widget(qwidget) panels = gui.GostyApp.Instance().perspective.GetPanels() panels.AddWidgetToPool("Test Label",widget) panels.AddWidget(gui.PanelPosition.RIGHT_PANEL, widget) - qwidget.show() .. class:: PanelManager @@ -263,7 +264,7 @@ and finally display it in the right side bar: :param name: Name which is displayed in the gui. :type name: :class:`str` :param widget: Widget which will be added to the WidgetPool of this class and the WidgetRegistry. - :type widget: :class:`WrappedWidget` + :type widget: :class:`Widget` .. method:: GetMenu() @@ -276,7 +277,7 @@ and finally display it in the right side bar: Get the SIP-QObject (QObject), learn more about :doc:`python_cpp`. - :rtype: PyQt4.QObject + :rtype: :class:`QObject` .. method:: RemoveWidget(widget) @@ -284,7 +285,7 @@ and finally display it in the right side bar: The widget will be removed if it is in a PanelBar :param arg2: widget which should be removed - :type arg2: :class:`WrappedWidget` + :type arg2: :class:`Widget` .. data:: PanelPosition @@ -307,8 +308,9 @@ describes how this is done within Python and PyQt: .. code-block:: python + from PyQt5 import QtWidgets menu_bar = gui.GostyApp.Instance().perspective.GetMenuBar() - test_action = QtGui.QAction('Test Menu Point', menu_bar) + test_action = QtWidgets.QAction('Test Menu Point', menu_bar) test = menu_bar.addMenu('&Test') test.addAction(test_action) diff --git a/modules/gui/doc/python_cpp.rst b/modules/gui/doc/python_cpp.rst index e6dab30196592a6e2ade46968b21134d54da7b71..0f4be50a63797040a7965daa68b143f9b9b8204c 100644 --- a/modules/gui/doc/python_cpp.rst +++ b/modules/gui/doc/python_cpp.rst @@ -2,7 +2,7 @@ Mixing PyQt and C++ Widgets ================================================================================ .. currentmodule:: ost.gui -PyQt4 is a set of Python bindings for Qt4. The exposure from C++ to Python is +PyQt5 is a set of Python bindings for Qt5. The exposure from C++ to Python is done with SIP, which has a different mechanism than boost::python. To access a exported boost::python Qt-Object from Python we provide a method @@ -19,7 +19,8 @@ input for Qt Objects. It handles the cast to a C++ Qt Object internally. .. code-block:: python + from PyQt5 import QtWidgets persp = gui.GostyApp.Instance().perspective test = persp.GetMenu("Test") #Get boost::python qobject - test_action = QtGui.QAction('&Test me', test) #Create Python SIP Object + test_action = QtWidgets.QAction('&Test me', test) #Create Python SIP Object test.addAction(test_action) #Add Action to boost::python object diff --git a/modules/gui/doc/scene_win.rst b/modules/gui/doc/scene_win.rst index 8d3f5f69833973b614ca27cf32def17baf87daac..e10c81e6572db08b40b3c0364e81ca740d801719 100644 --- a/modules/gui/doc/scene_win.rst +++ b/modules/gui/doc/scene_win.rst @@ -24,7 +24,7 @@ selected objects. Get the SIP-QObject (QWidget), learn more about :doc:`python_cpp`. - :rtype: PyQt4.QWidget + :rtype: QWidget .. method:: Hide() @@ -53,8 +53,9 @@ be shown. .. code-block:: python + from PyQt5 import QtWidgets cm = gui.GostyApp.Instance().scene_win.GetContextMenu() - action = QtGui.QAction("Test single entity", cm.qobject) + action = QtWidgets.QAction("Test single entity", cm.qobject) cm.AddAction(action, gui.ContextActionType.ENTITY | gui.ContextActionType.SINGLE) .. class:: ContextMenu @@ -67,7 +68,7 @@ be shown. :param action: The Action which should be displayed in the context menu - :type action: :class:`QtCore.QAction` + :type action: :class:`QAction` :param flags: Flags that indicates, when the context_menu should be active. The action will be shown, when all flags are true. @@ -79,7 +80,7 @@ be shown. Get the SIP-QObject (QObject), learn more about :doc:`python_cpp`. - :rtype: PyQt4.QObject + :rtype: QObject .. data:: ContextActionType diff --git a/modules/gui/doc/sequence_viewer.rst b/modules/gui/doc/sequence_viewer.rst index 8b654a1c7cdd1fe3eb03445f83f63467a8c3b3a4..cdc2fbbd76723de43e3fae5cc7e4d19c98563424 100644 --- a/modules/gui/doc/sequence_viewer.rst +++ b/modules/gui/doc/sequence_viewer.rst @@ -180,7 +180,7 @@ can use the :meth:`AddEntity` method. If you want to load an alignment, the :met Get the SIP-QObject (QWidget), learn more about :doc:`python_cpp`. - :rtype: PyQt4.QWidget + :rtype: QWidget .. method:: Hide()