Permalink
Browse files

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...
1 parent 76e0628 commit e07d30eaa888195e08d0424319e53f51e0e6de94 @daniel-kristjansson daniel-kristjansson committed Oct 8, 2008
View
19 mythtv/libs/libmyth/dialogbox.cpp
@@ -9,7 +9,7 @@ using namespace std;
#undef DialogBox
#endif
-#include <Q3ButtonGroup>
+#include <QButtonGroup>
#include <QBoxLayout>
DialogBox::DialogBox(MythMainWindow *parent, const QString &text,
@@ -35,30 +35,33 @@ DialogBox::DialogBox(MythMainWindow *parent, const QString &text,
box->addWidget(checkbox, 0);
}
- buttongroup = new Q3ButtonGroup(0);
+ buttongroup = new QButtonGroup();
if (checkbox)
- buttongroup->insert(checkbox);
- connect(buttongroup, SIGNAL(clicked(int)), this, SLOT(buttonPressed(int)));
+ buttongroup->addButton(checkbox, -2);
+ connect(buttongroup, SIGNAL(buttonClicked(int)),
+ this, SLOT( buttonPressed(int)));
}
void DialogBox::AddButton(const QString &title)
{
MythPushButton *button = new MythPushButton(title, this);
- if (buttongroup->count() == 0 ||
- (checkbox && buttongroup->count() == 1))
+ if (buttongroup->buttons().empty() ||
+ (checkbox && buttongroup->buttons().size() == 1))
{
button->setFocus();
}
- buttongroup->insert(button);
+ int id = buttongroup->buttons().size();
+ id = (checkbox) ? id - 1 : id;
+ buttongroup->addButton(button, id);
box->addWidget(button, 0);
}
void DialogBox::buttonPressed(int which)
{
- if (buttongroup->find(which) != checkbox)
+ if (buttongroup->button(which) != checkbox)
AcceptItem(which);
}
View
4 mythtv/libs/libmyth/dialogbox.h
@@ -3,11 +3,11 @@
#include <QObject>
#include <QCheckBox>
-#include <Q3ButtonGroup>
#include "mythdialogs.h"
#include "compat.h" // to undef DialogBox
class QVBoxLayout;
+class QButtonGroup;
class MPUBLIC DialogBox : public MythDialog
{
@@ -29,7 +29,7 @@ class MPUBLIC DialogBox : public MythDialog
private:
QVBoxLayout *box;
- Q3ButtonGroup *buttongroup;
+ QButtonGroup *buttongroup;
QCheckBox *checkbox;
};
View
8 mythtv/libs/libmyth/settings.cpp
@@ -13,7 +13,6 @@ using namespace std;
#include <QButtonGroup>
#include <QRadioButton>
#include <QProgressBar>
-#include <Q3ButtonGroup>
// Qt utils
#include <QFile>
@@ -831,9 +830,10 @@ void DateSetting::setValue(const QDate& newValue) {
Setting::setValue(newValue.toString(Qt::ISODate));
}
-QWidget* RadioSetting::configWidget(ConfigurationGroup *cg, QWidget* parent,
- const char* widgetName) {
- Q3ButtonGroup* widget = new Q3ButtonGroup(parent, widgetName);
+QWidget *RadioSetting::configWidget(ConfigurationGroup *cg, QWidget* parent,
+ const char* widgetName)
+{
+ QGroupBox* widget = new QGroupBox(parent, widgetName);
widget->setTitle(getLabel());
for( unsigned i = 0 ; i < labels.size() ; ++i ) {
View
2 mythtv/libs/libmythdb/mythversion.h
@@ -8,7 +8,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmyth, libmythtv and libmythui class methods
/// used by plug-ins.
-#define MYTH_BINARY_VERSION "0.22.20081008-4"
+#define MYTH_BINARY_VERSION "0.22.20081008-5"
/** \brief Increment this whenever the MythTV network protocol changes.
*

0 comments on commit e07d30e

Please sign in to comment.