All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
QGpGuiTools::MessageBox Class Reference

#include <MessageBox.h>

Inheritance diagram for QGpGuiTools::MessageBox:
QGpGuiTools::Dialog QGpGuiTools::FrameGrabber

List of all members.

Public Member Functions

void addAgainOption ()
Message::Answer answer ()
 MessageBox (QWidget *parent=0)
void setButton (int index, QString but)
void setMessage (QString t)
void setSeverity (Message::Severity sev)
bool showAgain ()
 ~MessageBox ()

Constructor & Destructor Documentation

QGpGuiTools::MessageBox::MessageBox ( QWidget *  parent = 0)

References TRACE.

    : Dialog(parent)
{
  TRACE;
  setupUi(this);
  _answer=Message::Answer0;
  _buttons[0]=0;
  _buttons[1]=0;
  _buttons[2]=0;
  again=0;
}
{}

Member Function Documentation

References QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  QHBoxLayout * hboxLayout=new QHBoxLayout();
  hboxLayout->setSpacing(6);
  hboxLayout->setMargin(0);
  hboxLayout->addItem(new QSpacerItem(93, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
  again=new QCheckBox(this);
  again->setText(tr("Show this message again"));
  again->setChecked(true);
  hboxLayout->addWidget(again);
  hboxLayout->addItem(new QSpacerItem(93, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
  QVBoxLayout * vboxLayout=qobject_cast<QVBoxLayout *>(layout());
  ASSERT(vboxLayout);
  vboxLayout->addLayout(hboxLayout);
}
{return _answer;}
void QGpGuiTools::MessageBox::setButton ( int  index,
QString  but 
)

References QGpGuiTools::qtStandardButton(), and TRACE.

{
  TRACE;
  if(!but.isEmpty()) {
    QDialogButtonBox::StandardButton qtBut=qtStandardButton(but);
    if(qtBut!=QDialogButtonBox::NoButton) {
      _buttons[index]=buttons->addButton(qtStandardButton(but));
    } else {
      _buttons[index]=buttons->addButton(but, QDialogButtonBox::AcceptRole);
    }
    if(index==0) _buttons[index]->setDefault(true);
  } else if(index==0) {
    _buttons[index]=buttons->addButton(QDialogButtonBox::Ok);
    _buttons[index]->setDefault(true);
  }
}

References TRACE.

{
  TRACE;
  if(t.startsWith("<html>")) {
    message->setHtml(t);
  } else {
    message->setPlainText(t);
  }
}

References TRACE.

{
  TRACE;
  switch (sev) {
  case Message::Information:
    iconLabel->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
    break;
  case Message::Warning:
    iconLabel->setPixmap(QMessageBox::standardIcon(QMessageBox::Warning));
    break;
  case Message::Critical:
  case Message::Fatal:
    iconLabel->setPixmap(QMessageBox::standardIcon(QMessageBox::Critical));
    break;
  case Message::Question:
    iconLabel->setPixmap(QMessageBox::standardIcon(QMessageBox::Question));
    break;
  }
}

References TRACE.

{
  TRACE;
  return again->isChecked();
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines