OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::Dialog Class Reference

#include "Dialog.h"

Inheritance diagram for ot::Dialog:
ot::QWidgetInterface AddGroupDialog ConnectToLoggerDialog CopyProjectDialog GraphicsItemDesignerExportDialog GraphicsItemDesignerImageExportDialog LogInDialog LogInGSSEditDialog LogVisualizationItemViewDialog ManageAccess ManageGroups ManageOwner QuickLogExport RandomizerDialog RenameGroupDialog RenameProjectDialog SelectEntitiesDialog ot::CreateProjectDialog ot::OnePropertyDialog ot::Painter2DEditDialog ot::PropertyDialog

Public Types

enum  DialogResult {
  Ok , Yes , No , Retry ,
  Cancel
}
 
enum  ShowFlag { DefaultShow = 0 << 0 , CenterOnParent = 1 << 0 , FitOnScreen = 1 << 1 , IdealFit = CenterOnParent | FitOnScreen }
 
enum class  DialogState { NoState = 0 << 0 , MousePressed = 1 << 0 , Closing = 1 << 1 }
 
typedef Flags< ShowFlagShowFlags
 
typedef Flags< DialogStateDialogStateFlags
 

Public Slots

void close (DialogResult _result)
 
void closeOk (void)
 
void closeYes (void)
 
void closeNo (void)
 
void closeRetry (void)
 
void closeCancel (void)
 

Public Member Functions

 Dialog (QWidget *_parent=(QWidget *) nullptr)
 
 Dialog (const DialogCfg &_config, QWidget *_parent=(QWidget *) nullptr)
 
virtual ~Dialog ()
 
virtual QWidget * getQWidget (void) override
 Returns a pointer to the root widget of this object.
 
virtual const QWidget * getQWidget (void) const override
 
DialogResult showDialog (const ShowFlags &_showFlags=ShowFlags(IdealFit))
 Center the dialog on parent and call exec.
 
void setDialogFlag (DialogCfg::DialogFlag _flag, bool _active=true)
 
void setDialogFlags (DialogCfg::DialogFlags _flags)
 
DialogCfg::DialogFlags dialogFlags (void) const
 
DialogResult dialogResult (void) const
 
void setDialogName (const std::string &_name)
 
const std::string & dialogName (void) const
 
const DialogStateFlagsgetDialogState (void) const
 
- Public Member Functions inherited from ot::QWidgetInterface
 QWidgetInterface ()
 
virtual ~QWidgetInterface ()
 
void setOTWidgetFlags (const WidgetFlags &_flags)
 
const WidgetFlagsotWidgetFlags (void) const
 

Protected Member Functions

virtual void keyPressEvent (QKeyEvent *_event) override
 
virtual void mousePressEvent (QMouseEvent *_event) override
 
virtual void mouseMoveEvent (QMouseEvent *_event) override
 
virtual void mouseReleaseEvent (QMouseEvent *_event) override
 
virtual void closeEvent (QCloseEvent *_event) override
 
virtual bool mayCloseDialogWindow (void) const
 
- Protected Member Functions inherited from ot::QWidgetInterface
virtual void otWidgetFlagsChanged (const WidgetFlags &_flags)
 

Member Typedef Documentation

◆ DialogStateFlags

◆ ShowFlags

Member Enumeration Documentation

◆ DialogResult

Enumerator
Ok 
Yes 
No 
Retry 
Cancel 

◆ DialogState

enum class ot::Dialog::DialogState
strong
Enumerator
NoState 
MousePressed 
Closing 

◆ ShowFlag

Enumerator
DefaultShow 
CenterOnParent 
FitOnScreen 

Positions this dialog in the middle of the parent widget.

IdealFit 

Ensures the dialog fits on any screen.

Constructor & Destructor Documentation

◆ Dialog() [1/2]

ot::Dialog::Dialog ( QWidget * _parent = (QWidget*)nullptr)

◆ Dialog() [2/2]

ot::Dialog::Dialog ( const DialogCfg & _config,
QWidget * _parent = (QWidget*)nullptr )

◆ ~Dialog()

ot::Dialog::~Dialog ( )
virtual

Member Function Documentation

◆ close

void ot::Dialog::close ( DialogResult _result)
slot

◆ closeCancel

void ot::Dialog::closeCancel ( void )
slot

◆ closeEvent()

void ot::Dialog::closeEvent ( QCloseEvent * _event)
overrideprotectedvirtual

Reimplemented in LogVisualizationItemViewDialog.

◆ closeNo

void ot::Dialog::closeNo ( void )
slot

◆ closeOk

void ot::Dialog::closeOk ( void )
slot

◆ closeRetry

void ot::Dialog::closeRetry ( void )
slot

◆ closeYes

void ot::Dialog::closeYes ( void )
slot

◆ dialogFlags()

DialogCfg::DialogFlags ot::Dialog::dialogFlags ( void ) const
inline

◆ dialogName()

const std::string & ot::Dialog::dialogName ( void ) const
inline

◆ dialogResult()

DialogResult ot::Dialog::dialogResult ( void ) const
inline

◆ getDialogState()

const DialogStateFlags & ot::Dialog::getDialogState ( void ) const
inline

◆ getQWidget() [1/2]

virtual const QWidget * ot::Dialog::getQWidget ( void ) const
inlineoverridevirtual

Implements ot::QWidgetInterface.

◆ getQWidget() [2/2]

virtual QWidget * ot::Dialog::getQWidget ( void )
inlineoverridevirtual

Returns a pointer to the root widget of this object.

Implements ot::QWidgetInterface.

◆ keyPressEvent()

void ot::Dialog::keyPressEvent ( QKeyEvent * _event)
overrideprotectedvirtual

◆ mayCloseDialogWindow()

virtual bool ot::Dialog::mayCloseDialogWindow ( void ) const
inlineprotectedvirtual

Reimplemented in LogInDialog, and ConnectToLoggerDialog.

◆ mouseMoveEvent()

void ot::Dialog::mouseMoveEvent ( QMouseEvent * _event)
overrideprotectedvirtual

◆ mousePressEvent()

void ot::Dialog::mousePressEvent ( QMouseEvent * _event)
overrideprotectedvirtual

Reimplemented in LogVisualizationItemViewDialog.

◆ mouseReleaseEvent()

void ot::Dialog::mouseReleaseEvent ( QMouseEvent * _event)
overrideprotectedvirtual

◆ setDialogFlag()

void ot::Dialog::setDialogFlag ( DialogCfg::DialogFlag _flag,
bool _active = true )
inline

◆ setDialogFlags()

void ot::Dialog::setDialogFlags ( DialogCfg::DialogFlags _flags)
inline

◆ setDialogName()

void ot::Dialog::setDialogName ( const std::string & _name)
inline

◆ showDialog()

ot::Dialog::DialogResult ot::Dialog::showDialog ( const ShowFlags & _showFlags = ShowFlags(IdealFit))

Center the dialog on parent and call exec.


The documentation for this class was generated from the following files: