Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Refs #5596. Convert from Q3ButtonGroup to QButtonGroup in libmyth

git-svn-id: http://svn.mythtv.org/svn/trunk@18610 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
commit e07d30eaa888195e08d0424319e53f51e0e6de94 1 parent 76e0628
daniel-kristjansson authored October 08, 2008
19  mythtv/libs/libmyth/dialogbox.cpp
@@ -9,7 +9,7 @@ using namespace std;
9 9
 #undef DialogBox
10 10
 #endif
11 11
 
12  
-#include <Q3ButtonGroup>
  12
+#include <QButtonGroup>
13 13
 #include <QBoxLayout>
14 14
 
15 15
 DialogBox::DialogBox(MythMainWindow *parent, const QString &text, 
@@ -35,30 +35,33 @@ DialogBox::DialogBox(MythMainWindow *parent, const QString &text,
35 35
         box->addWidget(checkbox, 0);
36 36
     }
37 37
 
38  
-    buttongroup = new Q3ButtonGroup(0);
  38
+    buttongroup = new QButtonGroup();
39 39
   
40 40
     if (checkbox)
41  
-        buttongroup->insert(checkbox);
42  
-    connect(buttongroup, SIGNAL(clicked(int)), this, SLOT(buttonPressed(int)));
  41
+        buttongroup->addButton(checkbox, -2);
  42
+    connect(buttongroup, SIGNAL(buttonClicked(int)),
  43
+            this,        SLOT(  buttonPressed(int)));
43 44
 }
44 45
 
45 46
 void DialogBox::AddButton(const QString &title)
46 47
 {
47 48
     MythPushButton *button = new MythPushButton(title, this);
48 49
 
49  
-    if (buttongroup->count() == 0 ||
50  
-        (checkbox && buttongroup->count() == 1))
  50
+    if (buttongroup->buttons().empty() ||
  51
+        (checkbox && buttongroup->buttons().size() == 1))
51 52
     {
52 53
         button->setFocus();
53 54
     }
54 55
 
55  
-    buttongroup->insert(button);
  56
+    int id = buttongroup->buttons().size();
  57
+    id = (checkbox) ? id - 1 : id;
  58
+    buttongroup->addButton(button, id);
56 59
 
57 60
     box->addWidget(button, 0);
58 61
 }
59 62
 
60 63
 void DialogBox::buttonPressed(int which)
61 64
 {
62  
-    if (buttongroup->find(which) != checkbox)
  65
+    if (buttongroup->button(which) != checkbox)
63 66
         AcceptItem(which);
64 67
 }
4  mythtv/libs/libmyth/dialogbox.h
@@ -3,11 +3,11 @@
3 3
 
4 4
 #include <QObject>
5 5
 #include <QCheckBox>
6  
-#include <Q3ButtonGroup>
7 6
 
8 7
 #include "mythdialogs.h"
9 8
 #include "compat.h" // to undef DialogBox
10 9
 class QVBoxLayout;
  10
+class QButtonGroup;
11 11
 
12 12
 class MPUBLIC DialogBox : public MythDialog
13 13
 {
@@ -29,7 +29,7 @@ class MPUBLIC DialogBox : public MythDialog
29 29
 
30 30
   private:
31 31
     QVBoxLayout *box;
32  
-    Q3ButtonGroup *buttongroup;
  32
+    QButtonGroup *buttongroup;
33 33
 
34 34
     QCheckBox *checkbox;
35 35
 };
8  mythtv/libs/libmyth/settings.cpp
@@ -13,7 +13,6 @@ using namespace std;
13 13
 #include <QButtonGroup>
14 14
 #include <QRadioButton>
15 15
 #include <QProgressBar>
16  
-#include <Q3ButtonGroup>
17 16
 
18 17
 // Qt utils
19 18
 #include <QFile>
@@ -831,9 +830,10 @@ void DateSetting::setValue(const QDate& newValue) {
831 830
     Setting::setValue(newValue.toString(Qt::ISODate));
832 831
 }
833 832
 
834  
-QWidget* RadioSetting::configWidget(ConfigurationGroup *cg, QWidget* parent,
835  
-                                    const char* widgetName) {
836  
-    Q3ButtonGroup* widget = new Q3ButtonGroup(parent, widgetName);
  833
+QWidget *RadioSetting::configWidget(ConfigurationGroup *cg, QWidget* parent,
  834
+                                    const char* widgetName)
  835
+{
  836
+    QGroupBox* widget = new QGroupBox(parent, widgetName);
837 837
     widget->setTitle(getLabel());
838 838
 
839 839
     for( unsigned i = 0 ; i < labels.size() ; ++i ) {
2  mythtv/libs/libmythdb/mythversion.h
@@ -8,7 +8,7 @@
8 8
 /// Update this whenever the plug-in API changes.
9 9
 /// Including changes in the libmyth, libmythtv and libmythui class methods
10 10
 /// used by plug-ins.
11  
-#define MYTH_BINARY_VERSION "0.22.20081008-4"
  11
+#define MYTH_BINARY_VERSION "0.22.20081008-5"
12 12
 
13 13
 /** \brief Increment this whenever the MythTV network protocol changes.
14 14
  *

0 notes on commit e07d30e

Please sign in to comment.
Something went wrong with that request. Please try again.