diff options
author | Bernd Lamecker <bernd.lamecker@basyskom.de> | 2010-03-16 15:31:46 +0100 |
---|---|---|
committer | Bernd Lamecker <bernd.lamecker@basyskom.de> | 2010-03-16 15:32:50 +0100 |
commit | f2e50b662623b645d36f7f28c8ecaf394806ae84 (patch) | |
tree | c694711f04b31c3d7861a176192a30a5403506d2 /plainqt | |
parent | 48e33d5d67af0ba5dd6eeb8bf4a9c7310a1b7416 (diff) |
Changes: Do not install event filters for viewports in scrollareas
RevBy: Torsten Rahn
Diffstat (limited to 'plainqt')
-rw-r--r-- | plainqt/style/qtmaemo6style.cpp | 20 | ||||
-rw-r--r-- | plainqt/style/qtmaemo6style.h | 3 | ||||
-rw-r--r-- | plainqt/style/qtmaemo6styleeventfilter.cpp | 4 |
3 files changed, 17 insertions, 10 deletions
diff --git a/plainqt/style/qtmaemo6style.cpp b/plainqt/style/qtmaemo6style.cpp index 9420f4f4..ca98f019 100644 --- a/plainqt/style/qtmaemo6style.cpp +++ b/plainqt/style/qtmaemo6style.cpp @@ -749,7 +749,6 @@ Qt::Alignment QtMaemo6StylePrivate::invertAlignment(Qt::Alignment align) const return retAlign; } - QtMaemo6Style::QtMaemo6Style() : QtMaemo6TestStyle(*new QtMaemo6StylePrivate) { @@ -833,24 +832,34 @@ void QtMaemo6Style::polish(QWidget *widget) if(widget->dynamicPropertyNames().contains(Dui::NoDuiStyle)) return; - if(qobject_cast<DuiWindow*>(widget)) + if(qobject_cast<DuiWindow*>(widget)) { return; + } + /* //skip the scrollbar container widgets of QAbstractScrollAreas if( (widget->objectName().contains("qt_scrollarea_hcontainer") - || widget->objectName().contains("qt_scrollarea_vcontainer")) + || widget->objectName().contains("qt_scrollarea_vcontainer") + || widget->objectName().contains("qt_scrollarea_viewport")) && qobject_cast<DuiWindow*>(widget->parentWidget())) return; + */ + + //skip the viewports, they are done by the scrollarea + if( QAbstractScrollArea* sa = qobject_cast<QAbstractScrollArea*>(widget->parentWidget())) { + if(sa->viewport() == widget) //it's the viewport + return; + } #ifdef DUI_LOG_POLISH QString filename = QString("/home/duistyle_%1.log").arg( QCoreApplication::applicationFilePath().section('/', -1 ) ); - QFile file( filename ); if (file.open(QIODevice::Append | QIODevice::Text)) { QTextStream out(&file); - out << filename << " polish: " << widget->metaObject()->className() + out << filename << " polish: " << (int)(widget) << " " << widget->metaObject()->className() << ' ' << widget->objectName() << "\n"; + file.close(); } else { qCritical() << "unable to open" << filename; @@ -858,6 +867,7 @@ void QtMaemo6Style::polish(QWidget *widget) #endif Q_D(QtMaemo6Style); + // Lazy initialization of the DuiFramework. // This is needed to guarantee that actual DuiApplications will work as well. if (!d->m_isDuiInitialized) { diff --git a/plainqt/style/qtmaemo6style.h b/plainqt/style/qtmaemo6style.h index 7aa5b52b..f5e7746e 100644 --- a/plainqt/style/qtmaemo6style.h +++ b/plainqt/style/qtmaemo6style.h @@ -25,8 +25,6 @@ #include <QLabel> #include "qtmaemo6teststyle.h" - - #include <duiexport.h> class DuiComponentData; @@ -42,6 +40,7 @@ class QAbstractScrollArea; class QtMaemo6StylePrivate; + /*! * This global function adds opacity to a pixmap */ diff --git a/plainqt/style/qtmaemo6styleeventfilter.cpp b/plainqt/style/qtmaemo6styleeventfilter.cpp index 46d74c6a..675c6834 100644 --- a/plainqt/style/qtmaemo6styleeventfilter.cpp +++ b/plainqt/style/qtmaemo6styleeventfilter.cpp @@ -136,8 +136,6 @@ bool QtMaemo6StyleEventFilter::eventFilter(QObject *obj, QEvent *event) break; case QEvent::MouseButtonDblClick: case QEvent::MouseButtonPress: { - //qDebug( "eventFilter got mousePress" ); - // now send press feedback DuiFeedbackPlayer *feedbackPlayer = DuiComponentData::feedbackPlayer(); @@ -156,7 +154,7 @@ bool QtMaemo6StyleEventFilter::eventFilter(QObject *obj, QEvent *event) } break; case QEvent::MouseButtonRelease: { - //qDebug( "eventFilter got mouseRelease" ); + //qCritical( "eventFilter got mouseRelease" ); // now send release feedback DuiFeedbackPlayer *feedbackPlayer = DuiComponentData::feedbackPlayer(); |