MeVisLab Scripting Reference
MLABWindowControl Class Reference

#include <mlabWindowControl.h>

Inherits MLABWidgetControl.

Public Member Functions

void setMinHeight (int s) override
 
void setMinWidth (int s) override
 
Special methods for dialog access.


void accept ()
 
void reject ()
 
void done (int result)
 
int exec ()
 
Special methods for background images and borderless windows.


void setBackgroundImage (const QString &image, bool automask=false, bool resizeWindowToImage=false)
 
void setEnableMouseMoving (int button)
 
void startMouseMove ()
 
void stopMouseMove ()
 
void setMouseMoveField (MLABVector2Field *field)
 

Friends

class MLABWidgetControl
 

Scripting access.


void setTitle (const QString &title) override
 
QString title ()
 
void setGeometry (QRect rect)
 
QRect geometry () const
 
void resize (const QSize &size)
 
void resize (int w, int h)
 
void setWidth (int w)
 
void setHeight (int h)
 
void resizeToMin ()
 
void resizeToHint ()
 
void resizeToPreferred ()
 
void updateFrame (bool minimum=false, bool center=false)
 
QRect screenGeometry () const
 
void show ()
 
void hide ()
 
bool close ()
 
void setCloseAllowed (bool flag)
 
void center ()
 
void moveTo (MLABWidgetControl *w, int align, int xdistance, int ydistance)
 
void move (int x, int y)
 
void showNormal ()
 
void showFullscreen ()
 
void setCanGoFullscreen (bool flag)
 
bool canGoFullscreen ()
 
void showMinimized ()
 
bool isMinimized ()
 
void showMaximized ()
 
void raise ()
 
void raiseWindow ()
 

Additional Inherited Members

- Public Slots inherited from MLABWidgetControl
void adjustSize ()
 
virtual void setEnabled (bool flag)
 
virtual void setVisible (bool flag)
 
virtual bool isVisible ()
 
virtual void setFocus ()
 
virtual bool hasFocus ()
 
virtual void setToolTip (const QString &string)
 
virtual void setWhatsThis (const QString &string)
 
void displayWhatsThis ()
 
void displayWhatsThis (const QString &text)
 
QWidget * widget ()
 
QLayout * layout ()
 
virtual QString windowHandle ()
 
virtual bool createScreenshot (const QString &filename, bool grabFromScreen=true, bool scaleToLowRes=false)
 
bool isReloadable () const
 
void reload (MLABTree *tree)
 
QString createGlobalScreenshot ()
 
QString applicationName ()
 
QSize size ()
 
int width ()
 
int height ()
 
int minWidth ()
 
int minHeight ()
 
int maxWidth ()
 
int maxHeight ()
 
void setMaxWidth (int s)
 
void setMaxHeight (int s)
 
QSize sizeHint ()
 
QSize minSize ()
 
QSize maxSize ()
 
void setMinSize (QSize size)
 
void setMaxSize (QSize size)
 
void updateLayout ()
 
int windowID ()
 
MLABWidgetControlcontrol (const QString &name)
 
float scaleFactor ()
 
MLABModulemodule ()
 
QString getType ()
 
QString getName ()
 
bool acceptDrops ()
 
void setAcceptDrops (bool flag)
 
void raiseWidget ()
 
void setStyleSheetFromString (const QString &styleSheetText)
 
void setStyleSheetFromFile (const QString &styleSheetFileName)
 
MLABTreetree ()
 
void updateMaxSize ()
 
bool expandX ()
 
bool expandY ()
 
MLABTreePtr getDefaultTagValues () const
 
virtual bool hasUncommittedChanges () const
 
virtual void applyUncommittedChanges ()
 
virtual void revertUncommittedChanges ()
 
MLABFieldfield () const
 

Detailed Description

Window control.

This control shows a window.

Member Function Documentation

◆ accept()

void MLABWindowControl::accept ( )

Accepts and closes the dialog (result 1).

◆ canGoFullscreen

bool MLABWindowControl::canGoFullscreen ( )
slot

Returns whether the window can go fullscreen (Mac OS X only currently).

◆ center

void MLABWindowControl::center ( )
slot

Centers the window on the screen it's on.

◆ close

bool MLABWindowControl::close ( )
slot

Closes the window.

◆ done()

void MLABWindowControl::done ( int result)

Closes the dialog and returns the result.

◆ exec()

int MLABWindowControl::exec ( )

Show the dialog in a modal loop (when it was created with createModalDialog).

Returns the result given by accept(), reject(), or done(int).

◆ geometry

QRect MLABWindowControl::geometry ( ) const
slot

Returns the geometry of the window.

◆ hide

void MLABWindowControl::hide ( )
slot

Hides the window.

◆ isMinimized

bool MLABWindowControl::isMinimized ( )
slot

Returns whether the panel window is minimized.

◆ move

void MLABWindowControl::move ( int x,
int y )
slot

Moves the window to the given position.

◆ moveTo

void MLABWindowControl::moveTo ( MLABWidgetControl * w,
int align,
int xdistance,
int ydistance )
slot

Moves to the given control and aligns this window relative to the given align position.

Available align flags (or'ed together) are, if not given centering is default:

  • MLAB.AlignLeft
  • MLAB.AlignRight
  • MLAB.AlignTop
  • MLAB.AlignBottom

◆ raise

void MLABWindowControl::raise ( )
slot

Raises this window to top of all windows.

◆ raiseWindow

void MLABWindowControl::raiseWindow ( )
inlineslot

Raises this window to top of all windows (this forwards to raise() but was necessary because "raise" is a reserved keyword in Python).

◆ reject()

void MLABWindowControl::reject ( )

Rejects and closes the dialog (result 0).

◆ resize [1/2]

void MLABWindowControl::resize ( const QSize & size)
slot

Sets the size of the window.

◆ resize [2/2]

void MLABWindowControl::resize ( int w,
int h )
slot

Sets a new size of the window.

◆ resizeToHint

void MLABWindowControl::resizeToHint ( )
slot

Resizes the window to the size hint, see also updateFrame().

◆ resizeToMin

void MLABWindowControl::resizeToMin ( )
slot

Resizes the window to the minimum size, see also updateFrame().

this call might require a

ctx.window().updateLayout()
ctx.window().resizeToMin()
Access to all global functions and objects of MLAB.
Definition mlabGlobalScriptAccess.h:79
void processEvents()
Processes events (user events are filtered, just redrawing and timers are processed).

◆ resizeToPreferred

void MLABWindowControl::resizeToPreferred ( )
slot

Resizes the window to the preferred size (taking into account pw and ph window tags if they are greater than the minimumSize).

◆ screenGeometry

QRect MLABWindowControl::screenGeometry ( ) const
slot

Returns the screen geometry of the screen this widget is on, see MLABDesktop for more methods on screens and geometries.

◆ setBackgroundImage()

void MLABWindowControl::setBackgroundImage ( const QString & image,
bool automask = false,
bool resizeWindowToImage = false )

Sets a background image for the window (which may also have a 0/255 alpha channel).

◆ setCanGoFullscreen

void MLABWindowControl::setCanGoFullscreen ( bool flag)
slot

Enables/disables the button to go fullscreen (Mac OS X only currently).

◆ setCloseAllowed

void MLABWindowControl::setCloseAllowed ( bool flag)
inlineslot

Sets whether the window can be closed (default is true).

◆ setEnableMouseMoving()

void MLABWindowControl::setEnableMouseMoving ( int button)

Enables mouse moving by clicking inside of the window and dragging.

Default is off, only recommended for borderless windows, button = -1 switches it off, 0 = left, 1 = middle, 2 = right button.

◆ setGeometry

void MLABWindowControl::setGeometry ( QRect rect)
slot

Sets the geometry of the window.

◆ setHeight

void MLABWindowControl::setHeight ( int h)
slot

Sets the height of the window.

◆ setMinHeight()

void MLABWindowControl::setMinHeight ( int s)
overridevirtual

Sets the minimum height of the widget.

Reimplemented from MLABWidgetControl.

◆ setMinWidth()

void MLABWindowControl::setMinWidth ( int s)
overridevirtual

Sets the minimum width of the widget.

Reimplemented from MLABWidgetControl.

◆ setMouseMoveField()

void MLABWindowControl::setMouseMoveField ( MLABVector2Field * field)

Set a move field that is notified on changes of the moved window (x,y screen position).

◆ setTitle()

void MLABWindowControl::setTitle ( const QString & title)
overridevirtual

Sets the title of the window.

Reimplemented from MLABWidgetControl.

◆ setWidth

void MLABWindowControl::setWidth ( int w)
slot

Sets the width of the window.

◆ show

void MLABWindowControl::show ( )
slot

Shows the window.

◆ showFullscreen

void MLABWindowControl::showFullscreen ( )
slot

Shows the window fullscreen (with no menu bar decoration and quit buttons).

◆ showMaximized

void MLABWindowControl::showMaximized ( )
slot

Shows the window maximized to fullscreen (with menu bar and close buttons).

◆ showMinimized

void MLABWindowControl::showMinimized ( )
slot

Shows the window minimized, as an icon.

◆ showNormal

void MLABWindowControl::showNormal ( )
slot

Shows the window normally.

◆ startMouseMove()

void MLABWindowControl::startMouseMove ( )

Starts the mouse move manually.

◆ stopMouseMove()

void MLABWindowControl::stopMouseMove ( )

Stops the mouse move manually.

◆ title()

QString MLABWindowControl::title ( )

Returns the current title caption (for window lists, etc.).

◆ updateFrame

void MLABWindowControl::updateFrame ( bool minimum = false,
bool center = false )
slot

Updates window size and position, guarantees that the layout is updated correctly.

Parameters
minimumresizes to minimum size, otherwise to size hint
centeralso centers the window

This method updates the layout, processes the Qt events and then resizes the window. If center is set to true, the window is hidden, resized, centered, and shown again to avoid flickering.