diff options
author | Boris Moiseev <cyberbobs@gmail.com> | 2010-10-06 13:51:39 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-10-06 13:51:39 (GMT) |
commit | 9e2ad8173868fad7b31c1d249a5a816b40a65cfe (patch) | |
tree | 70d264a232d466aa3d3469b8a1ded66cb59cb24f /tools | |
parent | 5aeda02c1b34ee0534390872f2ae400baab7baed (diff) | |
download | Qt-9e2ad8173868fad7b31c1d249a5a816b40a65cfe.zip Qt-9e2ad8173868fad7b31c1d249a5a816b40a65cfe.tar.gz Qt-9e2ad8173868fad7b31c1d249a5a816b40a65cfe.tar.bz2 |
Fixed some problems in qtconfig's PreviewWidget
One problem was introduced by the convertion of widget from Qt3:
there is no such field as "text" in QTextEdit.
Also, widget now is not direct ancestor of UI file.
Merge-request: 2286
Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qtconfig/previewwidget.cpp | 16 | ||||
-rw-r--r-- | tools/qtconfig/previewwidget.h | 13 | ||||
-rw-r--r-- | tools/qtconfig/previewwidget.ui | 32 |
3 files changed, 28 insertions, 33 deletions
diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp index 4a4a580..0573846 100644 --- a/tools/qtconfig/previewwidget.cpp +++ b/tools/qtconfig/previewwidget.cpp @@ -40,14 +40,15 @@ ****************************************************************************/ #include "previewwidget.h" +#include "ui_previewwidget.h" #include <QtEvents> QT_BEGIN_NAMESPACE PreviewWidget::PreviewWidget(QWidget *parent) - : QWidget(parent) + : QWidget(parent), ui(new Ui::PreviewWidget) { - setupUi(this); + ui->setupUi(this); // install event filter on child widgets QList<QWidget *> l = findChildren<QWidget *>(); @@ -57,13 +58,11 @@ PreviewWidget::PreviewWidget(QWidget *parent) } } - -void PreviewWidget::closeEvent(QCloseEvent *e) +PreviewWidget::~PreviewWidget() { - e->ignore(); + delete ui; } - bool PreviewWidget::eventFilter(QObject *, QEvent *e) { switch (e->type()) { @@ -82,4 +81,9 @@ bool PreviewWidget::eventFilter(QObject *, QEvent *e) return false; } +void PreviewWidget::closeEvent(QCloseEvent *e) +{ + e->ignore(); +} + QT_END_NAMESPACE diff --git a/tools/qtconfig/previewwidget.h b/tools/qtconfig/previewwidget.h index 1452932..ee3513d 100644 --- a/tools/qtconfig/previewwidget.h +++ b/tools/qtconfig/previewwidget.h @@ -42,19 +42,26 @@ #ifndef PREVIEWWIDGET_H #define PREVIEWWIDGET_H -#include "ui_previewwidget.h" +#include <QtGui/QWidget> + +namespace Ui { + class PreviewWidget; +} QT_BEGIN_NAMESPACE -class PreviewWidget : public QWidget, public Ui::PreviewWidget +class PreviewWidget : public QWidget { Q_OBJECT public: PreviewWidget(QWidget *parent = 0); + ~PreviewWidget(); - void closeEvent(QCloseEvent *); bool eventFilter(QObject *, QEvent *); +private: + void closeEvent(QCloseEvent *); + Ui::PreviewWidget* ui; }; QT_END_NAMESPACE diff --git a/tools/qtconfig/previewwidget.ui b/tools/qtconfig/previewwidget.ui index 9d86a1f..2e0789f 100644 --- a/tools/qtconfig/previewwidget.ui +++ b/tools/qtconfig/previewwidget.ui @@ -46,8 +46,8 @@ <rect> <x>0</x> <y>0</y> - <width>414</width> - <height>318</height> + <width>398</width> + <height>282</height> </rect> </property> <property name="sizePolicy"> @@ -59,21 +59,9 @@ <property name="windowTitle"> <string>Preview Window</string> </property> - <layout class="QVBoxLayout" name="unnamed"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>11</number> - </property> + <layout class="QVBoxLayout" name="verticalLayout_5"> <item> <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>0</number> - </property> <item> <layout class="QVBoxLayout" name="verticalLayout_2"> <property name="spacing"> @@ -225,19 +213,15 @@ <property name="maximumSize"> <size> <width>32767</width> - <height>50</height> + <height>55</height> </size> </property> <property name="readOnly"> <bool>true</bool> </property> - <property name="text" stdset="0"> - <string><p> -<a href="http://qt.nokia.com">http://qt.nokia.com</a> -</p> -<p> -<a href="http://www.kde.org">http://www.kde.org</a> -</p></string> + <property name="html"> + <string><p><a href="http://qt.nokia.com">http://qt.nokia.com</a></p> +<p><a href="http://www.kde.org">http://www.kde.org</a></p></string> </property> </widget> </item> @@ -256,7 +240,7 @@ <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>20</height> + <height>0</height> </size> </property> </spacer> |