BuildmLearn Toolkit  2.0.4
BuildmLearn Toolkit is an easy-to-use program that helps users make mobile apps without any knowledge of application development.
 All Classes Functions Enumerations Groups Pages
WidgetWithStatus Class Reference

Base class for custom widgets with status icons. More...

#include <widgetwithstatus.h>

Collaboration diagram for WidgetWithStatus:
Collaboration graph

Public Types

enum  StatusType { Information, Warning, Error, Ok }
 Specifies type of status icon.
 

Public Member Functions

 WidgetWithStatus (QWidget *parent)
 
void setStatus (StatusType status, const QString &tooltip_text)
 Sets custom status for this control. More...
 
StatusType status () const
 Access to current status of the widget. More...
 

Protected Attributes

StatusType m_status
 
QWidget * m_wdgInput
 
PlainToolButtonm_btnStatus
 
QHBoxLayout * m_layout
 
QIcon m_iconInformation
 
QIcon m_iconWarning
 
QIcon m_iconError
 
QIcon m_iconOk
 

Detailed Description

Base class for custom widgets with status icons.

See also
LabelWithStatus.

Definition at line 43 of file widgetwithstatus.h.

Member Function Documentation

void WidgetWithStatus::setStatus ( WidgetWithStatus::StatusType  status,
const QString &  tooltip_text 
)

Sets custom status for this control.

Parameters
statusStatus to set.
tooltip_textCustom tooltip text to display.

Definition at line 60 of file widgetwithstatus.cpp.

61  {
62  m_status = status;
63 
64  switch (status) {
65  case Information:
66  m_btnStatus->setIcon(m_iconInformation);
67  break;
68 
69  case Warning:
70  m_btnStatus->setIcon(m_iconWarning);
71  break;
72 
73  case Error:
74  m_btnStatus->setIcon(m_iconError);
75  break;
76 
77  case Ok:
78  m_btnStatus->setIcon(m_iconOk);
79  break;
80 
81  default:
82  break;
83  }
84 
85  // Setup the tooltip text.
86  m_btnStatus->setToolTip(tooltip_text);
87 }
StatusType status() const
Access to current status of the widget.

Here is the call graph for this function:

Here is the caller graph for this function:

StatusType WidgetWithStatus::status ( ) const
inline

Access to current status of the widget.

Returns
Return status of widget.

Definition at line 66 of file widgetwithstatus.h.

66  {
67  return m_status;
68  }

Here is the caller graph for this function:


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