OpenMS  2.8.0
Public Member Functions | Private Attributes | List of all members
GUILock Class Reference

RAII class to disable the GUI and set a busy cursor and go back to the orignal state when this class is destroyed. More...

#include <OpenMS/VISUAL/MISC/GUIHelpers.h>

Collaboration diagram for GUILock:
[legend]

Public Member Functions

 GUILock (QWidget *gui)
 
 GUILock (const GUILock &rhs)=delete
 no copy/assignment allowed More...
 
 GUILock (GUILock &&rhs)=delete
 
GUILockoperator= (const GUILock &rhs)=delete
 
 ~GUILock ()
 D'tor: unlocks the GUI (does nothing if already unlocked) More...
 
void lock ()
 manually lock the GUI (does nothing if already locked) More...
 
void unlock ()
 manually unlock the GUI (does nothing if already unlocked) More...
 

Private Attributes

QWidgetlocked_widget_ { nullptr }
 
bool currently_locked_ { false }
 
bool was_enabled_ { true }
 

Detailed Description

RAII class to disable the GUI and set a busy cursor and go back to the orignal state when this class is destroyed.

Constructor & Destructor Documentation

◆ GUILock() [1/3]

GUILock ( QWidget gui)

C'tor receives the widget to lock

Parameters
guiQWidget to lock(including all children); can be nullptr (nothing will be locked)

◆ GUILock() [2/3]

GUILock ( const GUILock rhs)
delete

no copy/assignment allowed

◆ GUILock() [3/3]

GUILock ( GUILock &&  rhs)
delete

◆ ~GUILock()

~GUILock ( )

D'tor: unlocks the GUI (does nothing if already unlocked)

Member Function Documentation

◆ lock()

void lock ( )

manually lock the GUI (does nothing if already locked)

◆ operator=()

GUILock& operator= ( const GUILock rhs)
delete

◆ unlock()

void unlock ( )

manually unlock the GUI (does nothing if already unlocked)

Referenced by TOPPViewBase::addDataFile().

Member Data Documentation

◆ currently_locked_

bool currently_locked_ { false }
private

◆ locked_widget_

QWidget* locked_widget_ { nullptr }
private

◆ was_enabled_

bool was_enabled_ { true }
private