Editor API
UnigineEditor public API
|
Window manager class. This class is used to manage tool windows in the Editor. More...
Inherits QObject.
Classes | |
struct | RestoreState |
Auxiliary information required to restore window state (insert it back to where it was taken from). See the take method. More... | |
Public Types | |
enum | AreaType { LAST_USED_AREA, NEW_FLOATING_AREA, ROOT_AREA_LEFT, ROOT_AREA_RIGHT, ROOT_AREA_TOP, ROOT_AREA_BOTTOM, NO_AREA } |
ToolWindowManager area type. More... | |
enum | RefType { REF_ADD_TO, REF_LEFT_OF, REF_RIGHT_OF, REF_TOP_OF, REF_BOTTOM_OF } |
Anchor type defining the way to layout tool windows. More... | |
Signals | |
void | windowShown (QWidget *widget) |
This signal is emitted when a tool window is shown, with the tool window as an argument. More... | |
void | beforeHide (QWidget *widget) |
This signal is emitted before a tool window is hidden, with the tool window as an argument. More... | |
void | windowHidden (QWidget *widget) |
This signal is emitted when a tool window is hidden, with the tool window as an argument. More... | |
void | tabSwitched (QWidget *widget) |
This signal is emitted when switching between tabs, with the target tab as an argument. More... | |
void | stateRestored () |
This signal is emitted when the state of the Tool Window Manager is restored. More... | |
Static Public Member Functions | |
static WindowManager * | instance () |
Returns the instance of the WindowManager class. This method is used to subscribe to signals. More... | |
static void | add (QWidget *widget, AreaType area=AreaType::LAST_USED_AREA) |
Adds the specified tool window to the specified area of the main window. By default the tool window is added to the last used one. More... | |
static void | add (QWidget *widget, RefType ref, QWidget *area) |
Adds the specified tool window to the specified window area according to the specified anchor type (RefType). More... | |
static void | add (const Unigine::Vector< QWidget * > &widgets, AreaType area=AreaType::LAST_USED_AREA) |
Adds the specified set of tool windows to the specified area of the main window. By default tool windows are added to the last used one. More... | |
static void | add (const Unigine::Vector< QWidget * > &widgets, RefType ref, QWidget *area) |
Adds the specified set of tool windows to the specified area according to the specified anchor type (RefType). More... | |
static void | addCornerWidget (QWidget *parent, QWidget *child) |
Adds the specified widget as a corner widget (child) to the specified window(parent). It is a widget to be shown in the top-right corner of the window. More... | |
static bool | remove (QWidget *widget) |
Removes the specified tool window. More... | |
static bool | has (QWidget *widget) |
Checks if the specified tool window exists. More... | |
static RestoreState | take (QWidget *widget) |
Takes the specified window from the Window Manager and saves its current state to be used later to restore it (restore()). This can be used for maximizing a viewport to fullscreen. More... | |
static bool | restore (QWidget *widget, RestoreState state) |
Restores the specified window back to where it was taken from (take()) using the saved state. This can be used to return a viewport back to normal state after maximizing it to fullscreen. More... | |
static void | move (QWidget *widget, AreaType area=AreaType::LAST_USED_AREA) |
Moves the specified tool window to the specified area of the main window. By default the tool window is moved to the last used one. More... | |
static void | move (QWidget *widget, RefType ref, QWidget *area) |
Moves the specified tool window to the specified window area according to the specified anchor type (RefType). More... | |
static void | move (const Unigine::Vector< QWidget * > &widgets, AreaType area=AreaType::LAST_USED_AREA) |
Moves the specified set of tool windows to the specified area of the main window. By default tool windows are moved to the last used one. More... | |
static void | move (const Unigine::Vector< QWidget * > &widgets, RefType ref, QWidget *area) |
Moves the specified set of tool windows to the specified area according to the specified anchor type (RefType). More... | |
static void | resize (QWidget *widget, int width, int height) |
Resizes the specified tool window. More... | |
static void | activate (QWidget *widget) |
Activates the specified tool window. More... | |
static void | hide (QWidget *widget) |
Hides the specified tool window. More... | |
static bool | isHidden (QWidget *widget) |
Checks whether the specified tool window is hidden. More... | |
static void | show (QWidget *widget) |
Shows the specified tool window. More... | |
static void | setVisible (QWidget *widget, bool visible) |
Sets visibility for the specified tool window (similar to show / hide) More... | |
static bool | isVisible (QWidget *widget) |
Checks whether the specified tool window is visible. More... | |
static QWidget * | getArea (QWidget *widget) |
Returns the area to which the specified tool window belongs. More... | |
static Unigine::Vector< QWidget * > | allWindows () |
Returns the list of all existing tool windows. More... | |
static QMenu * | findMenu (const char *name) |
Searches for a submenu of the main menu bar with the specified name. More... | |
static QToolBar * | findToolBar (const char *name) |
Searches for a toolbar with the specified name. More... | |
static QWidget * | getArea (const QString &area_name) |
Returns a window area by its name. More... | |
static QString | getAreaName (QWidget *widget) |
Returns the name of the area to which the specified tool window belongs. More... | |
static QWidget * | getFloatingWindow (QWidget *child) |
Returns the state of a floating area (a separate window that can be moved atop of the main window) to which the tool window belongs. In case the parent area is not a floating one, an empty QByteArray shall be returned. More... | |
static bool | restoreLastWindowConfig (QWidget *widget, const QString &area_name) |
Restores the state of the specified tool window in the window area with the specified name using the data of the previous session. In case of a failure to obtain the data from the previous session, default settings shall be used. More... | |
Window manager class. This class is used to manage tool windows in the Editor.
ToolWindowManager area type.
|
static |
Activates the specified tool window.
widget | Tool window to be activated. |
|
static |
Adds the specified tool window to the specified area of the main window. By default the tool window is added to the last used one.
widget | Tool window to be added. |
area | Main window area to which the specified tool window is to be added. |
To get a window area use getArea()
|
static |
Adds the specified tool window to the specified window area according to the specified anchor type (RefType).
widget | Tool window to be added. |
ref | Anchor type to define the layout relative to the specified area. |
area | Window area to which the specified tool window is to be added. |
|
static |
Adds the specified set of tool windows to the specified area of the main window. By default tool windows are added to the last used one.
widgets | List of tool windows to be added. |
area | Main window area to which the specified tool windows are to be added. |
|
static |
Adds the specified set of tool windows to the specified area according to the specified anchor type (RefType).
widgets | List of tool windows to be added. |
ref | Anchor type to define the layout relative to the specified area. |
area | Window area to which the specified tool windows are to be added. |
To get a window area use getArea()
|
static |
Adds the specified widget as a corner widget (child) to the specified window(parent). It is a widget to be shown in the top-right corner of the window.
parent | Window to which the corner widget is to be added. |
child | Corner widget to be added. |
|
static |
Returns the list of all existing tool windows.
|
signal |
This signal is emitted before a tool window is hidden, with the tool window as an argument.
|
static |
Searches for a submenu of the main menu bar with the specified name.
name | Name of the submenu to be found. |
|
static |
Searches for a toolbar with the specified name.
name | Name of the toolbar to be found. |
|
static |
Returns the area to which the specified tool window belongs.
widget | Tool window for which the area is to be obtained. |
|
static |
Returns a window area by its name.
area_name | Name of the window area. |
|
static |
Returns the name of the area to which the specified tool window belongs.
widget | Tool window for which the area name is to be obtained. |
|
static |
Returns the state of a floating area (a separate window that can be moved atop of the main window) to which the tool window belongs. In case the parent area is not a floating one, an empty QByteArray shall be returned.
child | Tool window for which the area name is to be obtained. |
|
static |
Checks if the specified tool window exists.
widget | Tool window to be checked. |
|
static |
Hides the specified tool window.
widget | Tool window to be hidden. |
|
static |
Returns the instance of the WindowManager class. This method is used to subscribe to signals.
Example:
|
static |
Checks whether the specified tool window is hidden.
widget | Tool window to be checked. |
|
static |
Checks whether the specified tool window is visible.
widget | Tool window to be checked. |
|
static |
Moves the specified tool window to the specified area of the main window. By default the tool window is moved to the last used one.
widget | Tool window to be moved. |
area | Main window area to which the specified tool window is to be moved. |
To get a window area use getArea()
|
static |
Moves the specified tool window to the specified window area according to the specified anchor type (RefType).
widget | Tool window to be moved. |
ref | Anchor type to define the layout relative to the specified area. |
area | Window area to which the specified tool window is to be moved. |
|
static |
Moves the specified set of tool windows to the specified area of the main window. By default tool windows are moved to the last used one.
widgets | List of tool windows to be moved. |
area | Main window area to which the specified tool windows are to be moved. |
|
static |
Moves the specified set of tool windows to the specified area according to the specified anchor type (RefType).
widgets | List of tool windows to be moved. |
ref | Anchor type to define the layout relative to the specified area. |
area | Window area to which the specified tool windows are to be moved. |
To get a window area use getArea()
|
static |
Removes the specified tool window.
widget | Tool window to be removed. |
|
static |
Resizes the specified tool window.
widget | Tool window to be resized. |
width | New tool window width, in pixels. |
height | New tool window height, in pixels. |
|
static |
Restores the specified window back to where it was taken from (take()) using the saved state. This can be used to return a viewport back to normal state after maximizing it to fullscreen.
widget | Window to be restored. |
state | Previously saved restore state to be used. |
|
static |
Restores the state of the specified tool window in the window area with the specified name using the data of the previous session. In case of a failure to obtain the data from the previous session, default settings shall be used.
widget | Tool window to be restored. |
area_name | Name of the window area. |
|
static |
|
static |
Shows the specified tool window.
widget | Tool window to be shown. |
|
signal |
This signal is emitted when the state of the Tool Window Manager is restored.
|
signal |
This signal is emitted when switching between tabs, with the target tab as an argument.
|
static |
Takes the specified window from the Window Manager and saves its current state to be used later to restore it (restore()). This can be used for maximizing a viewport to fullscreen.
widget | Window to be taken. |
|
signal |
This signal is emitted when a tool window is hidden, with the tool window as an argument.
|
signal |
This signal is emitted when a tool window is shown, with the tool window as an argument.