summaryrefslogtreecommitdiffstats
path: root/tools/qtconfig/previewwidget.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-28 17:42:06 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-28 18:07:41 (GMT)
commit5fe25728c0ebb04c3fd2958d902cc58d2064b84d (patch)
tree12623614b0c2fbbf483e842235731956dd649ad7 /tools/qtconfig/previewwidget.cpp
parent74c683c6879dea1cb4eaa99aaf61e16524b8a4a1 (diff)
downloadQt-5fe25728c0ebb04c3fd2958d902cc58d2064b84d.zip
Qt-5fe25728c0ebb04c3fd2958d902cc58d2064b84d.tar.gz
Qt-5fe25728c0ebb04c3fd2958d902cc58d2064b84d.tar.bz2
Remove qt3support dependency of qtconfig
Revert "Revert the integration of the merge request 2286." This reverts commit e3edad83a1e6e99a551d40d4118352435c6dd710. This had been submitted in the Qt 4.7, but reverted because the change was to intrusive to be pushed in a stable branch. Now re-apply the change in master. Conflicts: tools/qtconfig/mainwindowbase.cpp tools/qtconfig/mainwindowbase.h tools/qtconfig/paletteeditoradvancedbase.cpp tools/qtconfig/paletteeditoradvancedbase.h tools/qtconfig/paletteeditoradvancedbase.ui tools/qtconfig/previewwidgetbase.cpp tools/qtconfig/previewwidgetbase.h tools/qtconfig/previewwidgetbase.ui tools/tools.pro
Diffstat (limited to 'tools/qtconfig/previewwidget.cpp')
-rw-r--r--tools/qtconfig/previewwidget.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp
index 71cef23..66ebb92 100644
--- a/tools/qtconfig/previewwidget.cpp
+++ b/tools/qtconfig/previewwidget.cpp
@@ -40,32 +40,32 @@
****************************************************************************/
#include "previewwidget.h"
+#include "ui_previewwidget.h"
#include <QtEvents>
QT_BEGIN_NAMESPACE
-PreviewWidget::PreviewWidget( QWidget *parent, const char *name )
- : PreviewWidgetBase( parent, name )
+PreviewWidget::PreviewWidget(QWidget *parent)
+ : QWidget(parent), ui(new Ui::PreviewWidget)
{
+ ui->setupUi(this);
+
// install event filter on child widgets
- QObjectList l = queryList("QWidget");
- for (int i = 0; i < l.size(); ++i) {
- QObject * obj = l.at(i);
- obj->installEventFilter(this);
- ((QWidget*)obj)->setFocusPolicy(Qt::NoFocus);
+ QList<QWidget *> l = findChildren<QWidget *>();
+ foreach(QWidget *w, l) {
+ w->installEventFilter(this);
+ w->setFocusPolicy(Qt::NoFocus);
}
}
-
-void PreviewWidget::closeEvent(QCloseEvent *e)
+PreviewWidget::~PreviewWidget()
{
- e->ignore();
+ delete ui;
}
-
bool PreviewWidget::eventFilter(QObject *, QEvent *e)
{
- switch ( e->type() ) {
+ switch (e->type()) {
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseButtonDblClick:
@@ -81,4 +81,9 @@ bool PreviewWidget::eventFilter(QObject *, QEvent *e)
return false;
}
+void PreviewWidget::closeEvent(QCloseEvent *e)
+{
+ e->ignore();
+}
+
QT_END_NAMESPACE