From d88ed1d6e08b54dc55d6252ec0f74cb4413c2d5e Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 20 Jan 2014 21:01:20 +0200 Subject: [PATCH] QMessageBox too small. --HG-- branch : develop --- src/exception/vexception.cpp | 7 +++++++ src/exception/vexception.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/exception/vexception.cpp b/src/exception/vexception.cpp index 3778f3341..05557662f 100644 --- a/src/exception/vexception.cpp +++ b/src/exception/vexception.cpp @@ -28,6 +28,8 @@ #include "vexception.h" #include +#include +#include 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(msgBox.layout()); + Q_ASSERT(layout != 0); + layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount()); msgBox.exec(); } diff --git a/src/exception/vexception.h b/src/exception/vexception.h index 06e939891..6fb8b5f53 100644 --- a/src/exception/vexception.h +++ b/src/exception/vexception.h @@ -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: /**