[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/soc-parley/parley/practice
From:       Frederik Gladhorn <frederik.gladhorn () gmx ! de>
Date:       2008-06-12 22:26:15
Message-ID: 1213309575.270028.2511.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 820025 by gladhorn:

fix resize issue by subclassing the view

 M  +1 -0      CMakeLists.txt  
 M  +3 -2      kgametheme/kgamethemeselector.cpp  
 M  +4 -13     parleypracticemainwindow.cpp  
 M  +2 -3      parleypracticemainwindow.h  
 A             practiceview.cpp   [License: GPL (v2+)]
 A             practiceview.h   [License: GPL (v2+)]


--- branches/work/soc-parley/parley/practice/CMakeLists.txt #820024:820025
@@ -19,6 +19,7 @@
     ${kgametheme_SRCS}
     main.cpp
     parleypracticemainwindow.cpp
+    practiceview.cpp
     input.cpp
     prompt.cpp
     statistics.cpp
--- branches/work/soc-parley/parley/practice/kgametheme/kgamethemeselector.cpp #820024:820025
@@ -25,9 +25,10 @@
 #include <knewstuff2/engine.h>
 #include <KComponentData>
 
-#include "../ui_kgamethemeselector.h"
 #include "kgametheme.h"
+#include "ui_kgamethemeselector.h"
 
+
 class KGameThemeSelector::KGameThemeSelectorPrivate
 {
     public:
@@ -159,4 +160,4 @@
     qDeleteAll(entries);
 }
 
-#include "../kgamethemeselector.moc"
+#include "kgamethemeselector.moc"
--- branches/work/soc-parley/parley/practice/parleypracticemainwindow.cpp #820024:820025
@@ -36,6 +36,7 @@
 #include <KLocalizedString>
 #include <KConfigDialog>
 
+#include "practiceview.h"
 #include "input.h"
 #include "prompt.h"
 #include "statistics.h"
@@ -53,17 +54,18 @@
 #include <keduvoctranslation.h>
 #include <keduvocdocument.h>
 
+
 ParleyPracticeMainWindow::ParleyPracticeMainWindow(QWidget *parent)
         : KXmlGuiWindow(parent)
 {
 
     //// Basic setup ////
-    m_view = new QGraphicsView;
+    m_view = new PracticeView;
     setCentralWidget(m_view);
 
     QGraphicsScene* scene = new QGraphicsScene(this);
     m_view->setScene(scene);
-    m_view->installEventFilter(this);
+//     m_view->installEventFilter(this);
 
     m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -254,14 +256,3 @@
     }
 }
 
-bool ParleyPracticeMainWindow::eventFilter(QObject * obj, QEvent * event)
-{
-    if (event->type() == QEvent::Resize)
-    {
-        m_view->fitInView(m_backgroundRect, Qt::KeepAspectRatio);
-        return QObject::eventFilter(obj, event);
-    }
-    return QObject::eventFilter(obj, event);
-}
-
-
--- branches/work/soc-parley/parley/practice/parleypracticemainwindow.h #820024:820025
@@ -27,6 +27,7 @@
 
 
 class TestEntryManager;
+class PracticeView;
 
 class ParleyPracticeMainWindow : public KXmlGuiWindow
 {
@@ -38,13 +39,11 @@
             ~ParleyPracticeMainWindow();*/
 
     private:
-        QGraphicsView* m_view;
+        PracticeView* m_view;
         QGraphicsSvgItem* m_layout;
         TestEntryManager * m_manager;
 
         QRectF m_backgroundRect;
-        
-        bool eventFilter(QObject *obj, QEvent *event);
 
     public slots:
         void slotGetInput(const QString& input);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic