QMessageBox too small.

--HG--
branch : develop
This commit is contained in:
dismine 2014-01-20 21:01:20 +02:00
parent 847f91410b
commit d88ed1d6e0
2 changed files with 11 additions and 0 deletions

View File

@ -28,6 +28,8 @@
#include "vexception.h"
#include <QMessageBox>
#include <QSpacerItem>
#include <QGridLayout>
VException::VException(const QString &what):QException(), what(what)
{
@ -53,5 +55,10 @@ void VException::CriticalMessageBox(const QString &situation) const
msgBox.setDetailedText(DetailedInformation());
}
msgBox.setIcon(QMessageBox::Critical);
QSpacerItem* horizontalSpacer = new QSpacerItem(500, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
Q_ASSERT(horizontalSpacer != 0);
QGridLayout* layout = static_cast<QGridLayout*>(msgBox.layout());
Q_ASSERT(layout != 0);
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
msgBox.exec();
}

View File

@ -74,6 +74,10 @@ public:
* @return string with error
*/
inline QString What() const {return what;}
/**
* @brief CriticalMessageBox show Critical Message Box.
* @param situation main text message box.
*/
virtual void CriticalMessageBox(const QString &situation) const;
protected:
/**