From 9e2ad8173868fad7b31c1d249a5a816b40a65cfe Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:39 +0200 Subject: 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 --- tools/qtconfig/previewwidget.cpp | 16 ++++++++++------ tools/qtconfig/previewwidget.h | 13 ++++++++++--- 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 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 l = findChildren(); @@ -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 + +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 @@ 0 0 - 414 - 318 + 398 + 282 @@ -59,21 +59,9 @@ Preview Window - - - 6 - - - 11 - + - - 6 - - - 0 - @@ -225,19 +213,15 @@ 32767 - 50 + 55 true - - <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> + + <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> @@ -256,7 +240,7 @@ 20 - 20 + 0 -- cgit v0.12