YQPkgDiskUsageList QT3_SUPPORT
authordmacvicar <dmacvicar@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Sat, 8 Dec 2007 01:02:37 +0000 (01:02 +0000)
committerdmacvicar <dmacvicar@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Sat, 8 Dec 2007 01:02:37 +0000 (01:02 +0000)
git-svn-id: http://svn.opensuse.org/svn/yast/trunk/qt4@42837 e0cc52ee-31ee-0310-8b87-e83c4596d67c

src/pkg/YQPkgDiskUsageList.cc

index 439ee8e..a997332 100644 (file)
 
 /-*/
 
-#define QT3_SUPPORT 1
-
 #define y2log_component "qt-pkg"
 #include <ycp/y2log.h>
 
-#include <q3header.h>
-#include <qstyle.h>
+#include <QStyle>
 #include <QHeaderView>
-//Added by qt3to4:
-#include <qevent.h>
+#include <QEvent>
 
 #include <zypp/ZYppFactory.h>
 
@@ -171,9 +167,9 @@ YQPkgDiskUsageList::keyPressEvent( QKeyEvent * event )
 
     if ( event )
     {
-       unsigned special_combo = ( Qt::ControlButton | Qt::ShiftButton | Qt::AltButton );
+       unsigned special_combo = ( Qt::ControlModifier| Qt::ShiftModifier | Qt::AltModifier );
 
-       if ( ( event->state() & special_combo ) == special_combo )
+       if ( ( event->modifiers() & special_combo ) == special_combo )
        {
            if ( event->key() == Qt::Key_Q )
            {
@@ -192,20 +188,20 @@ YQPkgDiskUsageList::keyPressEvent( QKeyEvent * event )
                {
                    int percent = item->usedPercent();
 
-                   switch ( event->ascii() )
+                   switch ( event->key() )
                    {
-                       case '1':       percent = 10;   break;
-                       case '2':       percent = 20;   break;
-                       case '3':       percent = 30;   break;
-                       case '4':       percent = 40;   break;
-                       case '5':       percent = 50;   break;
-                       case '6':       percent = 60;   break;
-                       case '7':       percent = 70;   break;
-                       case '8':       percent = 80;   break;
-                       case '9':       percent = 90;   break;
-                       case '0':       percent = 100;  break;
-                       case '+':       percent += 3;   break;
-                       case '-':       percent -= 3;   break;
+                       case Qt::Key_1: percent = 10;   break;
+                       case Qt::Key_2: percent = 20;   break;
+                       case Qt::Key_3: percent = 30;   break;
+                       case Qt::Key_4: percent = 40;   break;
+                       case Qt::Key_5: percent = 50;   break;
+                       case Qt::Key_6: percent = 60;   break;
+                       case Qt::Key_7: percent = 70;   break;
+                       case Qt::Key_8: percent = 80;   break;
+                       case Qt::Key_9: percent = 90;   break;
+                       case Qt::Key_0: percent = 100;  break;
+                       case Qt::Key_Plus:      percent += 3;   break;
+                       case Qt::Key_Minus:     percent -= 3;   break;
 
                        case 'w':
                            // Only for testing, thus intentionally using no translations