Open Reality Reference Guide
 
Loading...
Searching...
No Matches
fbuiutil.h File Reference

Contains a few user-interface utilities. More...

#include <kaydaradef.h>
#include <fbcontrols/fbcontrols.h>

Go to the source code of this file.

Classes

class  FBPropertyInspector
 Property inspector class. More...
 

Macros

#define FBSDK_DLL   K_DLLIMPORT
 Be sure that FBSDK_DLL is defined only once...
 

Functions

 __FB_FORWARD (FBPropertyInspector)
 
K_DLLIMPORT QMainWindow * FBGetMainWindow ()
 Return the MotionBuilder main window.
 
K_DLLIMPORT void * FBGetNativeWindowHandle (QWidget *pWidget)
 Return a platform-specific native window handle for the specified widget.
 

Detailed Description

Contains a few user-interface utilities.

Definition in file fbuiutil.h.

Macro Definition Documentation

◆ FBSDK_DLL

#define FBSDK_DLL   K_DLLIMPORT

Be sure that FBSDK_DLL is defined only once...

Definition at line 48 of file fbuiutil.h.

Function Documentation

◆ FBGetMainWindow()

K_DLLIMPORT QMainWindow * FBGetMainWindow ( )

Return the MotionBuilder main window.

Returns
The MotionBuilder main window.

The following Python snippet shows how to get the MotionBuilder main window.

try:
from PySide6 import QtWidgets
from shiboken6 import wrapInstance
except:
from PySide2 import QtWidgets
from shiboken2 import wrapInstance
def getMainWindow():
if ptr is not None:
return wrapInstance(ptr, QtWidgets.QWidget)
mainWindow = getMainWindow()
if mainWindow is not None:
print( mainWindow.windowTitle() )
else:
print( "MotionBuilder main window not found!" )
K_DLLIMPORT QMainWindow * FBGetMainWindow()
Return the MotionBuilder main window.

◆ FBGetNativeWindowHandle()

K_DLLIMPORT void * FBGetNativeWindowHandle ( QWidget *  pWidget)

Return a platform-specific native window handle for the specified widget.

It is similar of calling QWidget::effectiveWinId().

Parameters
pWidgetWidget whose native window handle is to be returned.
Returns
The native window handle of the specified widget. On Linux this will be an Xlib 'Window'. On Microsoft Windows it will be an 'HWND'.

The following C++ snippet shows how to get the MotionBuilder main window native window handle.

QMainWindow* lMainWindow = FBGetMainWindow();
#ifdef KARCH_ENV_WIN
HWND lMainWindowHWND = (HWND)FBGetNativeWindowHandle( lMainWindow );
#else
// typedef unsigned long XID;
// typedef XID Window;
Window lMainWindowHWND = (Window)FBGetNativeWindowHandle( lMainWindow );
#endif
K_DLLIMPORT void * FBGetNativeWindowHandle(QWidget *pWidget)
Return a platform-specific native window handle for the specified widget.