QTfrontend/ui/page/AbstractPage.cpp
changeset 6477 ad5741c252b9
parent 6200 6a4ace88d85a
child 6572 0d0af531c1c7
--- a/QTfrontend/ui/page/AbstractPage.cpp	Sat Dec 03 12:00:32 2011 +0100
+++ b/QTfrontend/ui/page/AbstractPage.cpp	Sat Dec 03 14:36:36 2011 +0100
@@ -22,10 +22,14 @@
  */
 
 #include "AbstractPage.h"
+#include <QLabel>
+#include <QSize>
+#include <QFontMetricsF>
 
 AbstractPage::AbstractPage(QWidget* parent)
 {
     Q_UNUSED(parent);
+    defautDesc = new QString();
 
     font14 = new QFont("MS Shell Dlg", 14);
 }
@@ -45,12 +49,20 @@
     pageLayout->addWidget(btnBack, 1, 0, 1, 1, Qt::AlignLeft | Qt::AlignBottom);
 
     // add body layout as defined by the subclass
-    pageLayout->addLayout(bodyLayoutDefinition(), 0, 0, 1, 2);
+    pageLayout->addLayout(bodyLayoutDefinition(), 0, 0, 1, 3);
+
+    descLabel = new QLabel();
+    descLabel->setAlignment(Qt::AlignCenter);
+    descLabel->setWordWrap(true);
+    descLabel->setOpenExternalLinks(true);
+    descLabel->setFixedHeight(50);
+    descLabel->setStyleSheet("font-size: 16px");
+    pageLayout->addWidget(descLabel, 1, 1);
 
     // add footer layout
     QLayout * fld = footerLayoutDefinition();
     if (fld != NULL)
-        pageLayout->addLayout(fld, 1, 1);
+        pageLayout->addLayout(fld, 1, 2);
 
     // connect signals
     connect(btnBack, SIGNAL(clicked()), this, SIGNAL(goBack()));
@@ -97,3 +109,19 @@
 {
     btnBack->setVisible(visible);
 }
+
+void AbstractPage::setButtonDescription(QString desc)
+{
+    descLabel->setText(desc);
+}
+
+void AbstractPage::setDefautDescription(QString text)
+{
+    *defautDesc = text;
+    descLabel->setText(text);
+}
+
+QString * AbstractPage::getDefautDescription()
+{
+    return defautDesc;
+}