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
CustomMessageBox Class Reference

Custom message boxes. More...

#include <custommessagebox.h>

Collaboration diagram for CustomMessageBox:
Collaboration graph

Public Member Functions

 CustomMessageBox (QWidget *parent=0)
 Constructor.
 
void setIcon (Icon icon)
 Custom icon setting. More...
 

Static Public Member Functions

static void iconify (QDialogButtonBox *button_box)
 Performs icon replacements for given button box. More...
 
static QMessageBox::StandardButton show (QWidget *parent, QMessageBox::Icon icon, const QString &title, const QString &text, const QString &informative_text=QString(), const QString &detailed_text=QString(), QMessageBox::StandardButtons buttons=QMessageBox::Ok, QMessageBox::StandardButton default_button=QMessageBox::Ok)
 Displays custom message box. More...
 

Detailed Description

Custom message boxes.

Definition at line 39 of file custommessagebox.h.

Member Function Documentation

void CustomMessageBox::iconify ( QDialogButtonBox *  button_box)
static

Performs icon replacements for given button box.

Parameters
button_boxButton box to work with.

Definition at line 56 of file custommessagebox.cpp.

56  {
57  foreach (QAbstractButton *button, button_box->buttons()) {
58  button->setIcon(iconForRole(button_box->standardButton(button)));
59  }
60 }

Here is the caller graph for this function:

void CustomMessageBox::setIcon ( Icon  icon)

Custom icon setting.

Parameters
iconIcon to set.

Definition at line 49 of file custommessagebox.cpp.

49  {
50  // Determine correct status icon size.
51  int icon_size = qApp->style()->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, this);
52  // Setup status icon.
53  setIconPixmap(iconForStatus(icon).pixmap(icon_size, icon_size));
54 }

Here is the caller graph for this function:

QMessageBox::StandardButton CustomMessageBox::show ( QWidget *  parent,
QMessageBox::Icon  icon,
const QString &  title,
const QString &  text,
const QString &  informative_text = QString(),
const QString &  detailed_text = QString(),
QMessageBox::StandardButtons  buttons = QMessageBox::Ok,
QMessageBox::StandardButton  default_button = QMessageBox::Ok 
)
static

Displays custom message box.

Parameters
parentParent object.
iconIcon of message box.
titleTitle of message box.
textText of message box.
informative_textInformative text of message box.
detailed_textDetailed text of message box.
buttonsWhich buttons to display?
default_buttonWhich button highlight as default one?
Returns
Returns the status of message box (e.g. which button was pressed.

Definition at line 107 of file custommessagebox.cpp.

114  {
115  // Create and find needed components.
116  CustomMessageBox msg_box(parent);
117 
118  // Initialize message box properties.
119  msg_box.setWindowTitle(title);
120  msg_box.setText(text);
121  msg_box.setInformativeText(informative_text);
122  msg_box.setDetailedText(detailed_text);
123  msg_box.setIcon(icon);
124  msg_box.setStandardButtons(buttons);
125  msg_box.setDefaultButton(default_button);
126 
127  // Setup button box icons.
128 #if defined(Q_OS_OS2)
129  QDialogButtonBox *button_box = msg_box.findChild<QDialogButtonBox*>();
130  iconify(button_box);
131 #endif
132 
133  // Display it.
134  if (msg_box.exec() == -1) {
135  return QMessageBox::Cancel;
136  }
137  else {
138  return msg_box.standardButton(msg_box.clickedButton());
139  }
140 }
static void iconify(QDialogButtonBox *button_box)
Performs icon replacements for given button box.
Custom message boxes.

Here is the call graph for this function:

Here is the caller graph for this function:


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