3ds Max C++ API Reference
Loading...
Searching...
No Matches
QmaxMainWindow Class Reference

This class is used by 3ds Max for its docking UI and should be used as replacement for the standard QMainWindow. More...

#include <C:/adskgit/3dsmax/3dsmax/3dswin/src/maxsdk/include/Qt/QmaxMainWindow.h>

Inheritance diagram for QmaxMainWindow:

Public Types

enum  QmaxDockFlag {
  DontSaveCUIContent = 0x1 , SystemWindow = 0x2 , HideInVisiblityMenu = 0x4 , ShowInExpertMode = 0x8 ,
  DestroyOnCUIChange = 0x10 , NoDockFlags = 0
}
enum  QmaxDockType { Window , Toolbar , Menu }

Public Slots

void setDockingLocked (bool state)
 Changes the dockingLocked state.

Public Member Functions

 QmaxMainWindow (QWidget *parent=nullptr, Qt::WindowFlags flags={})
virtual ~QmaxMainWindow () override
void loadLayout (const QString &fileName)
 Loads a docking layout from a specified file.
void saveLayout (const QString &fileName) const
 Saves the current docking layout to a specified file.
QList< QToolBar * > getToolBars () const
 Returns a list with the toolbars attached to this main window.
QList< QDockWidget * > getDockWidgets () const
 Returns a list with the dock widgets attached to this main window.
bool dockingLocked () const
 Determines whether the docked toolbars and dockwidgets can be moved around.
void expertMode (bool on)
 This method is for internal use only.
virtual QMenu * createPopupMenu () override

Static Public Member Functions

static QString layoutFileExtension ()
 Returns the file extension for a 3ds Max docking layout file.
static void setMaxDockType (QWidget *widget, QmaxDockType dockType)
 Sets the 3ds Max dock type on a QToolBar or QDockWidget.
static QmaxDockType maxDockType (const QWidget *widget)
 Returns the 3ds Max dock type for a QToolBar or QDockWidget.
static void setMaxDockFlags (QWidget *widget, QmaxDockFlags dockFlags)
 Sets the 3ds Max specific dock flags on a QToolBar or QDockWidget.
static QmaxDockFlags maxDockFlags (const QWidget *widget)
 Returns the 3ds Max specific dock flags for a QToolBar or QDockWidget.
static void addMaxDockFlags (QWidget *widget, QmaxDockFlags dockFlags)
 Adds the 3ds Max specific dock flags on a QToolBar or QDockWidget.
static void makeToolBarFloating (QToolBar *toolBar, const QPoint &pos=QPoint())
 Makes a docked toolbar floating at the specified screen position.
static Qt::ToolBarArea getToolBarArea (QToolBar *toolbar)
 Returns the toolbar area for a QToolBar.
static Qt::DockWidgetArea getDockWidgetArea (QDockWidget *dockwidget)
 Returns the docking area for a QDockWidget.
static QmaxDockingWinHostgetDockingWinHost (QToolBar *toolbar)
 Retrieves the QmaxDockingWinHost if the given toolbar hosts a legacy win32 control.
static ICustToolbargetICustToolbar (QToolBar *toolbar)
 Retrieves the legacy 3ds Max toolbar if the given QToolBar hosts one.

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *evt) override
void childEvent (QChildEvent *evt) override
bool event (QEvent *evt) override
bool nativeEvent (const QByteArray &eventType, void *message, qintptr *result) override
bool addDefaultDockOptions (QWidget *dockWidget, QMenu *menu) const
 Adds the default docking options for a given toolbar or dock widget to the specified menu.
QWidget * dockWidgetUnderMouse () const
 Returns the child toolbar or dock widget which is currently under the mouse.

Properties

bool dockingLocked
 Determines whether the docked toolbars and dockwidgets can be moved around and/or made floating.

Detailed Description

This class is used by 3ds Max for its docking UI and should be used as replacement for the standard QMainWindow.

Member Enumeration Documentation

◆ QmaxDockFlag

Enumerator
DontSaveCUIContent 
SystemWindow 
HideInVisiblityMenu 
ShowInExpertMode 
DestroyOnCUIChange 
NoDockFlags 
51 {
52 DontSaveCUIContent = 0x1,
53 SystemWindow = 0x2,
54 HideInVisiblityMenu = 0x4, // hides toggle visibility menu entry in main window popup
55 ShowInExpertMode = 0x8,
56 DestroyOnCUIChange = 0x10, // indicates if a dockwidget should be destroyed when a new CUI scheme is loaded, only makes sense for content that can change dynamically in different workspaces
57 NoDockFlags = 0
58 };

◆ QmaxDockType

Enumerator
Window 
Toolbar 
Menu 
63 {
64 Window,
65 Toolbar,
66 Menu
67 };

Constructor & Destructor Documentation

◆ QmaxMainWindow()

QmaxMainWindow ( QWidget * parent = nullptr,
Qt::WindowFlags flags = {} )
explicit

◆ ~QmaxMainWindow()

virtual ~QmaxMainWindow ( )
overridevirtual

Member Function Documentation

◆ loadLayout()

void loadLayout ( const QString & fileName)

Loads a docking layout from a specified file.

Parameters
fileNameThe full path to a docking layout file that should be loaded.
See also
saveLayout()

◆ saveLayout()

void saveLayout ( const QString & fileName) const

Saves the current docking layout to a specified file.

Parameters
fileNameThe full path to the docking layout file that should be saved.
See also
loadLayout()

◆ layoutFileExtension()

QString layoutFileExtension ( )
inlinestatic

Returns the file extension for a 3ds Max docking layout file.

See also
loadLayout(), saveLayout()
84{ return ".layout"; }

◆ getToolBars()

QList< QToolBar * > getToolBars ( ) const

Returns a list with the toolbars attached to this main window.

See also
getDockWidgets()

◆ getDockWidgets()

QList< QDockWidget * > getDockWidgets ( ) const

Returns a list with the dock widgets attached to this main window.

See also
getToolBars()

◆ dockingLocked()

bool dockingLocked ( ) const

Determines whether the docked toolbars and dockwidgets can be moved around.

The basic idea of having the docking locked mode is to prevent all docked toolbars and dockwidgets to be moved or made floating. Already floating toolbars and dockwidgets can be moved around but not be docked back into the main window.

Note that docking locked does not prevent the user from resize the UI.

◆ setMaxDockType()

void setMaxDockType ( QWidget * widget,
QmaxDockType dockType )
static

Sets the 3ds Max dock type on a QToolBar or QDockWidget.

Parameters
[in]widgetThe QToolBar or QDockWidget on which the dock type should be set.
[in]dockTypeThe dock type of the actual docking content.
See also
maxDockType()

◆ maxDockType()

QmaxDockType maxDockType ( const QWidget * widget)
static

Returns the 3ds Max dock type for a QToolBar or QDockWidget.

Parameters
[in]widgetThe QToolBar or QDockWidget for which the dock type should be returned.
See also
setMaxDockType()

◆ setMaxDockFlags()

void setMaxDockFlags ( QWidget * widget,
QmaxDockFlags dockFlags )
static

Sets the 3ds Max specific dock flags on a QToolBar or QDockWidget.

Parameters
[in]widgetThe QToolBar or QDockWidget on which the dock flags should be set.
[in]dockFlagsThe 3ds Max specific dock flags.
See also
maxDockFlags(), addMaxDockFlags()

◆ maxDockFlags()

QmaxDockFlags maxDockFlags ( const QWidget * widget)
static

Returns the 3ds Max specific dock flags for a QToolBar or QDockWidget.

Parameters
[in]widgetThe QToolBar or QDockWidget for which the dock flags should be returned.
See also
setMaxDockFlags(), addMaxDockFlags()

◆ addMaxDockFlags()

void addMaxDockFlags ( QWidget * widget,
QmaxDockFlags dockFlags )
inlinestatic

Adds the 3ds Max specific dock flags on a QToolBar or QDockWidget.

Parameters
[in]widgetThe QToolBar or QDockWidget on which the dock flags should be added.
[in]dockFlagsThe 3ds Max specific dock flags.
See also
maxDockFlags(), setMaxDockFlags()
134{ setMaxDockFlags( widget, maxDockFlags( widget ) | dockFlags ); }

◆ makeToolBarFloating()

void makeToolBarFloating ( QToolBar * toolBar,
const QPoint & pos = QPoint() )
static

Makes a docked toolbar floating at the specified screen position.

Parameters
[in]toolBarThe QToolBar that should float.
[in]posThe screen position at which the toolbar should float.
Note
The toolbar needs to be added once to the main window toolbar layout, before you can't float it.

◆ getToolBarArea()

Qt::ToolBarArea getToolBarArea ( QToolBar * toolbar)
static

Returns the toolbar area for a QToolBar.

Parameters
[in]toolbarThe QToolBar for which the toolbar area should be returned.
See also
getDockWidgetArea()

◆ getDockWidgetArea()

Qt::DockWidgetArea getDockWidgetArea ( QDockWidget * dockwidget)
static

Returns the docking area for a QDockWidget.

Parameters
[in]dockwidgetThe QDockWidget for which the docking area should be returned.
See also
getToolBarArea()

◆ getDockingWinHost()

QmaxDockingWinHost * getDockingWinHost ( QToolBar * toolbar)
static

Retrieves the QmaxDockingWinHost if the given toolbar hosts a legacy win32 control.

Parameters
[in]toolbarThe QToolBar for which the QmaxDockingWinHost should be retrieved.
See also
getICustToolbar()

◆ getICustToolbar()

ICustToolbar * getICustToolbar ( QToolBar * toolbar)
static

Retrieves the legacy 3ds Max toolbar if the given QToolBar hosts one.

Note
The function calls internally GetICustToolbar( HWND ), so you need to call ReleaseICustToolbar after usage.
See also
GetICustToolbar(), ReleaseICustToolbar(), getDockingWinHost()

◆ expertMode()

void expertMode ( bool on)

This method is for internal use only.

Calling this method alone will not put 3ds Max in Expert mode.

◆ createPopupMenu()

virtual QMenu * createPopupMenu ( )
overridevirtual

◆ setDockingLocked

void setDockingLocked ( bool state)
slot

Changes the dockingLocked state.

Parameters
[in]stateThe new dockingLocked state.
See also
dockingLocked()

◆ eventFilter()

bool eventFilter ( QObject * obj,
QEvent * evt )
overrideprotected

◆ childEvent()

void childEvent ( QChildEvent * evt)
overrideprotected

◆ event()

bool event ( QEvent * evt)
overrideprotected

◆ nativeEvent()

bool nativeEvent ( const QByteArray & eventType,
void * message,
qintptr * result )
overrideprotected

◆ addDefaultDockOptions()

bool addDefaultDockOptions ( QWidget * dockWidget,
QMenu * menu ) const
protected

Adds the default docking options for a given toolbar or dock widget to the specified menu.

◆ dockWidgetUnderMouse()

QWidget * dockWidgetUnderMouse ( ) const
protected

Returns the child toolbar or dock widget which is currently under the mouse.

Property Documentation

◆ dockingLocked

bool dockingLocked
readwrite

Determines whether the docked toolbars and dockwidgets can be moved around and/or made floating.

See also
dockingLocked(), setDockingLocked(), dockingLockedChanged()