OpenWalnut  1.5.0dev
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
WQtMessagePopup Class Reference

Nice looking message popup. More...

#include <WQtMessagePopup.h>

+ Inheritance diagram for WQtMessagePopup:
+ Collaboration diagram for WQtMessagePopup:

Public Types

typedef LogLevel MessageType
 Describe the kind of message. More...
 

Public Slots

void showMessage ()
 Shows the message. More...
 
void closePopup ()
 Cloes this popup. More...
 

Signals

void onClose (WQtMessagePopup *me)
 Called when closing the popup. More...
 

Public Member Functions

 WQtMessagePopup (QWidget *parent, const QString &title, const QString &message, MessageType type)
 Constructor. More...
 
virtual ~WQtMessagePopup ()
 Destructor. More...
 
void setAutoClose (bool autoClose=true)
 When set to true, the widget gets closed when loosing focus or when clicking the detail button. More...
 
void setShowCloseButton (bool showCloseButton=true)
 Show or hide the close button. More...
 
void setAutoPosition (bool autoPosition=true)
 If true, the widget moves itself to the bottom of its parent widget. More...
 
MessageType getType () const
 Get this popups message type. More...
 
void show ()
 Reimplement show from QWidget to be able to auto-close it. More...
 

Protected Member Functions

virtual void showEvent (QShowEvent *event)
 On show. More...
 

Private Attributes

QString m_title
 Title Text. More...
 
QString m_message
 The message text. More...
 
MessageType m_type
 What kind of message is this. More...
 
QPushButton * m_closeBtn
 Close button. More...
 
bool m_autoClose
 See setAutoClose. More...
 
bool m_autoMove
 See setAutoPosition. More...
 

Detailed Description

Nice looking message popup.

Definition at line 38 of file WQtMessagePopup.h.

Member Typedef Documentation

◆ MessageType

typedef LogLevel WQtMessagePopup::MessageType

Describe the kind of message.

Definition at line 45 of file WQtMessagePopup.h.

Constructor & Destructor Documentation

◆ WQtMessagePopup()

WQtMessagePopup::WQtMessagePopup ( QWidget *  parent,
const QString &  title,
const QString &  message,
MessageType  type 
)

Constructor.

Parameters
parentparent widget
titletitle
messagemessage
typethe message type

Definition at line 49 of file WQtMessagePopup.cpp.

References closePopup(), WQtGui::getMainWindow(), m_closeBtn, m_type, setAutoClose(), WScaleLabel::setText(), and showMessage().

+ Here is the call graph for this function:

◆ ~WQtMessagePopup()

WQtMessagePopup::~WQtMessagePopup ( )
virtual

Destructor.

Definition at line 203 of file WQtMessagePopup.cpp.

Member Function Documentation

◆ closePopup

void WQtMessagePopup::closePopup ( )
slot

Cloes this popup.

Use instead of close() slot.

Definition at line 251 of file WQtMessagePopup.cpp.

References onClose().

Referenced by showMessage(), and WQtMessagePopup().

+ Here is the caller graph for this function:

◆ getType()

WQtMessagePopup::MessageType WQtMessagePopup::getType ( ) const

Get this popups message type.

Returns
the type

Definition at line 267 of file WQtMessagePopup.cpp.

References m_type.

Referenced by WQtMessageDock::handleFilterUpdate().

+ Here is the caller graph for this function:

◆ onClose

void WQtMessagePopup::onClose ( WQtMessagePopup me)
signal

Called when closing the popup.

Parameters
methe pointer to the widget getting close

Referenced by closePopup().

+ Here is the caller graph for this function:

◆ setAutoClose()

void WQtMessagePopup::setAutoClose ( bool  autoClose = true)

When set to true, the widget gets closed when loosing focus or when clicking the detail button.

If not, the widget needs to be closed manually.

Parameters
autoCloseclose flag

Definition at line 236 of file WQtMessagePopup.cpp.

References m_autoClose.

Referenced by WQtMessageDock::addMessage(), and WQtMessagePopup().

+ Here is the caller graph for this function:

◆ setAutoPosition()

void WQtMessagePopup::setAutoPosition ( bool  autoPosition = true)

If true, the widget moves itself to the bottom of its parent widget.

As this is not useful sometimes, you can disable this by using false here.

Parameters
autoPositionfalse if widget should not move automatically

Definition at line 262 of file WQtMessagePopup.cpp.

References m_autoMove.

Referenced by WQtMessageDock::addMessage().

+ Here is the caller graph for this function:

◆ setShowCloseButton()

void WQtMessagePopup::setShowCloseButton ( bool  showCloseButton = true)

Show or hide the close button.

Parameters
showCloseButtontrue to show

Definition at line 257 of file WQtMessagePopup.cpp.

References m_closeBtn.

Referenced by WQtMessageDock::addMessage().

+ Here is the caller graph for this function:

◆ show()

void WQtMessagePopup::show ( )

Reimplement show from QWidget to be able to auto-close it.

Definition at line 230 of file WQtMessagePopup.cpp.

Referenced by WMainWindow::reportError(), WMainWindow::reportInfo(), and WMainWindow::reportWarning().

+ Here is the caller graph for this function:

◆ showEvent()

void WQtMessagePopup::showEvent ( QShowEvent *  event)
protectedvirtual

On show.

Called when opening the widget.

Parameters
event

Definition at line 188 of file WQtMessagePopup.cpp.

References m_autoMove.

◆ showMessage

void WQtMessagePopup::showMessage ( )
slot

Shows the message.

Definition at line 208 of file WQtMessagePopup.cpp.

References closePopup(), m_autoClose, m_message, m_title, and m_type.

Referenced by WQtMessagePopup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_autoClose

bool WQtMessagePopup::m_autoClose
private

See setAutoClose.

Definition at line 146 of file WQtMessagePopup.h.

Referenced by setAutoClose(), and showMessage().

◆ m_autoMove

bool WQtMessagePopup::m_autoMove
private

See setAutoPosition.

Definition at line 151 of file WQtMessagePopup.h.

Referenced by setAutoPosition(), and showEvent().

◆ m_closeBtn

QPushButton* WQtMessagePopup::m_closeBtn
private

Close button.

Definition at line 141 of file WQtMessagePopup.h.

Referenced by setShowCloseButton(), and WQtMessagePopup().

◆ m_message

QString WQtMessagePopup::m_message
private

The message text.

Definition at line 131 of file WQtMessagePopup.h.

Referenced by showMessage().

◆ m_title

QString WQtMessagePopup::m_title
private

Title Text.

Definition at line 126 of file WQtMessagePopup.h.

Referenced by showMessage().

◆ m_type

MessageType WQtMessagePopup::m_type
private

What kind of message is this.

Definition at line 136 of file WQtMessagePopup.h.

Referenced by getType(), showMessage(), and WQtMessagePopup().


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