Editor API
UnigineEditor public API
Editor::WindowManager Class Referencefinal

Window manager class. This class is used to manage tool windows in the Editor. More...

#include <WindowManager.h>

Inheritance diagram for Editor::WindowManager:

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 when 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 stateRestored ()
 This signal is emitted when the state of the Tool Window Manager is restored. More...
 

Static Public Member Functions

static WindowManagerinstance ()
 Returns the instance of the WindowManager class. This method is used to subscribe to signals. More...
 
static void add (QWidget *widget, AreaType area=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 QVector< QWidget * > &widgets, AreaType area=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 QVector< 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)
 
static void remove (QWidget *widget)
 Removes the specified tool window. More...
 
static bool has (QWidget *widget)
 Checks if the specified tool window exists. More...
 
static void move (QWidget *widget, AreaType area=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 QVector< QWidget * > &widgets, AreaType area=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 QVector< 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 bool isVisible (QWidget *widget)
 Checks whether the specified tool window is visible. More...
 
static QWidget * getArea (QWidget *child)
 Returns the area to which the specified tool window belongs. More...
 
static QVector< QWidget * > allWindows ()
 Returns the list of all existing tool windows. More...
 
static QMenu * findMenu (const QString &name)
 Searches for a submenu of the main menu bar with the specified name. More...
 

Friends

class Editor::Presenter
 

Detailed Description

Window manager class. This class is used to manage tool windows in the Editor.

Member Enumeration Documentation

◆ AreaType

ToolWindowManager area type.

Enumerator
LAST_USED_AREA 

Last used area.

NEW_FLOATING_AREA 

New floating area.

ROOT_AREA_LEFT 

Left part of the root area.

ROOT_AREA_RIGHT 

Right part of the root area.

ROOT_AREA_TOP 

Upper part of the root area.

ROOT_AREA_BOTTOM 

Lower part of the root area.

NO_AREA 

No area.

◆ RefType

Anchor type defining the way to layout tool windows.

Enumerator
REF_ADD_TO 

New tab occupying the whole area.

REF_LEFT_OF 

Left anchor of the area.

REF_RIGHT_OF 

Right anchor of the area.

REF_TOP_OF 

Top anchor of the area.

REF_BOTTOM_OF 

Bottom anchor of the area.

Member Function Documentation

◆ activate()

static void Editor::WindowManager::activate ( QWidget *  widget)
static

Activates the specified tool window.

Parameters
widgetTool window to be activated.

◆ add() [1/4]

static void Editor::WindowManager::add ( QWidget *  widget,
AreaType  area = LAST_USED_AREA 
)
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.

Parameters
widgetTool window to be added.
areaMain window area to which the specified tool window is to be added.

To get a window area use getArea()

◆ add() [2/4]

static void Editor::WindowManager::add ( QWidget *  widget,
RefType  ref,
QWidget *  area 
)
static

Adds the specified tool window to the specified window area according to the specified anchor type (RefType).

Parameters
widgetTool window to be added.
refAnchor type to define the layout relative to the specified area.
areaWindow area to which the specified tool window is to be added.

◆ add() [3/4]

static void Editor::WindowManager::add ( const QVector< QWidget * > &  widgets,
AreaType  area = LAST_USED_AREA 
)
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.

Parameters
widgetsList of tool windows to be added.
areaMain window area to which the specified tool windows are to be added.

◆ add() [4/4]

static void Editor::WindowManager::add ( const QVector< QWidget * > &  widgets,
RefType  ref,
QWidget *  area 
)
static

Adds the specified set of tool windows to the specified area according to the specified anchor type (RefType).

Parameters
widgetsList of tool windows to be added.
refAnchor type to define the layout relative to the specified area.
areaWindow area to which the specified tool windows are to be added.

To get a window area use getArea()

◆ addCornerWidget()

static void Editor::WindowManager::addCornerWidget ( QWidget *  parent,
QWidget *  child 
)
static

◆ allWindows()

static QVector<QWidget *> Editor::WindowManager::allWindows ( )
static

Returns the list of all existing tool windows.

Returns
Vector containing all existing tool windows.

◆ beforeHide

void Editor::WindowManager::beforeHide ( QWidget *  widget)
signal

This signal is emitted when before a tool window is hidden, with the tool window as an argument.

◆ findMenu()

static QMenu* Editor::WindowManager::findMenu ( const QString &  name)
static

Searches for a submenu of the main menu bar with the specified name.

Parameters
nameName of the submenu to be found.
Returns
Menu with the specified name; otherwise nullptr.

◆ getArea()

static QWidget* Editor::WindowManager::getArea ( QWidget *  child)
static

Returns the area to which the specified tool window belongs.

Parameters
childTool window for which the area is to be obtained.
Returns
The area to which the specified tool window belongs; otherwise nullptr.

◆ has()

static bool Editor::WindowManager::has ( QWidget *  widget)
static

Checks if the specified tool window exists.

Parameters
widgetTool window to be checked.

◆ hide()

static void Editor::WindowManager::hide ( QWidget *  widget)
static

Hides the specified tool window.

Parameters
widgetTool window to be hidden.

◆ instance()

static WindowManager* Editor::WindowManager::instance ( )
static

Returns the instance of the WindowManager class. This method is used to subscribe to signals.

Returns
WindowManager class instance.

Example:

,this , [this](QWidget *widget)
{
if (widget == this)
{
clear();
}
});

◆ isHidden()

static bool Editor::WindowManager::isHidden ( QWidget *  widget)
static

Checks whether the specified tool window is hidden.

Parameters
widgetTool window to be checked.

◆ isVisible()

static bool Editor::WindowManager::isVisible ( QWidget *  widget)
static

Checks whether the specified tool window is visible.

Parameters
widgetTool window to be checked.

◆ move() [1/4]

static void Editor::WindowManager::move ( QWidget *  widget,
AreaType  area = LAST_USED_AREA 
)
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.

Parameters
widgetTool window to be moved.
areaMain window area to which the specified tool window is to be moved.

To get a window area use getArea()

◆ move() [2/4]

static void Editor::WindowManager::move ( QWidget *  widget,
RefType  ref,
QWidget *  area 
)
static

Moves the specified tool window to the specified window area according to the specified anchor type (RefType).

Parameters
widgetTool window to be moved.
refAnchor type to define the layout relative to the specified area.
areaWindow area to which the specified tool window is to be moved.

◆ move() [3/4]

static void Editor::WindowManager::move ( const QVector< QWidget * > &  widgets,
AreaType  area = LAST_USED_AREA 
)
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.

Parameters
widgetsList of tool windows to be moved.
areaMain window area to which the specified tool windows are to be moved.

◆ move() [4/4]

static void Editor::WindowManager::move ( const QVector< QWidget * > &  widgets,
RefType  ref,
QWidget *  area 
)
static

Moves the specified set of tool windows to the specified area according to the specified anchor type (RefType).

Parameters
widgetsList of tool windows to be moved.
refAnchor type to define the layout relative to the specified area.
areaWindow area to which the specified tool windows are to be moved.

To get a window area use getArea()

◆ remove()

static void Editor::WindowManager::remove ( QWidget *  widget)
static

Removes the specified tool window.

Parameters
widgetTool window to be removed.

◆ resize()

static void Editor::WindowManager::resize ( QWidget *  widget,
int  width,
int  height 
)
static

Resizes the specified tool window.

Parameters
widgetTool window to be resized.
widthNew tool window width, in pixels.
heightNew tool window height, in pixels.

◆ show()

static void Editor::WindowManager::show ( QWidget *  widget)
static

Shows the specified tool window.

Parameters
widgetTool window to be shown.

◆ stateRestored

void Editor::WindowManager::stateRestored ( )
signal

This signal is emitted when the state of the Tool Window Manager is restored.

◆ windowHidden

void Editor::WindowManager::windowHidden ( QWidget *  widget)
signal

This signal is emitted when a tool window is hidden, with the tool window as an argument.

◆ windowShown

void Editor::WindowManager::windowShown ( QWidget *  widget)
signal

This signal is emitted when a tool window is shown, with the tool window as an argument.

Friends And Related Function Documentation

◆ Editor::Presenter

friend class Editor::Presenter
friend