Commit 3bd4f9cc authored by Jonathan Marten's avatar Jonathan Marten

Port KVBox -> QWidget+QVBoxLayout

parent 2980072f
......@@ -83,8 +83,8 @@ DialogAddView::~DialogAddView()
*/
void DialogAddView::createWidgets(Mixer *ptr_mixer)
{
m_mainFrame = new QFrame( this );
setMainWidget( m_mainFrame );
m_mainFrame = new QWidget(this);
setMainWidget(m_mainFrame);
_layout = new QVBoxLayout(m_mainFrame);
_layout->setMargin(0);
......@@ -92,7 +92,7 @@ void DialogAddView::createWidgets(Mixer *ptr_mixer)
// More than one Mixer => show Combo-Box to select Mixer
// Mixer widget line
QHBoxLayout* mixerNameLayout = new QHBoxLayout();
_layout->addItem( mixerNameLayout );
_layout->addLayout(mixerNameLayout);
mixerNameLayout->setSpacing(KDialog::spacingHint());
QLabel *qlbl = new QLabel( i18n("Select mixer:"), m_mainFrame );
......@@ -175,8 +175,9 @@ void DialogAddView::createPage(Mixer *mixer)
m_scrollableChannelSelector = new QScrollArea(m_mainFrame);
_layout->addWidget(m_scrollableChannelSelector);
m_vboxForScrollView = new KVBox();
m_vboxForScrollView = new QWidget();
QVBoxLayout *vbl = new QVBoxLayout(m_vboxForScrollView);
vbl->setSpacing(0);
for( int i=0; i<viewNames.size(); ++i )
{
......@@ -192,6 +193,7 @@ void DialogAddView::createPage(Mixer *mixer)
QString name = viewNames.at(i);
name.replace('&', "&&"); // Quoting the '&' needed, to prevent QRadioButton creating an accelerator
QRadioButton* qrb = new QRadioButton( name, m_vboxForScrollView);
vbl->addWidget(qrb);
connect( qrb, SIGNAL(toggled(bool)), this, SLOT(profileRbtoggled(bool)) );
qrb->setObjectName(viewIds.at(i)); // The object name is used as ID here: see apply()
......
......@@ -26,7 +26,6 @@ class QButtonGroup;
class KComboBox;
#include <qradiobutton.h>
class QScrollArea;
#include <kvbox.h>
class QVBoxLayout;
#include <kdialog.h>
......@@ -52,9 +51,9 @@ class DialogAddView : public KDialog
QVBoxLayout* _layout;
KComboBox* m_cMixer;
QScrollArea* m_scrollableChannelSelector;
KVBox *m_vboxForScrollView;
QWidget *m_vboxForScrollView;
QButtonGroup *m_buttonGroupForScrollView;
QFrame *m_mainFrame;
QWidget *m_mainFrame;
static QStringList viewNames;
static QStringList viewIds;
......
......@@ -21,7 +21,6 @@
#include "gui/dialogchoosebackends.h"
#include <qbuttongroup.h>
#include <QCheckBox>
#include <QLabel>
#include <QSet>
......@@ -53,7 +52,6 @@ DialogChooseBackends::DialogChooseBackends(QWidget* parent, const QSet<QString>&
_layout = 0;
m_vboxForScrollView = 0;
m_scrollableChannelSelector = 0;
m_buttonGroupForScrollView = 0;
createWidgets(mixerIds);
}
......@@ -96,7 +94,6 @@ void DialogChooseBackends::createWidgets(const QSet<QString>& mixerIds)
*/
void DialogChooseBackends::createPage(const QSet<QString>& mixerIds)
{
m_buttonGroupForScrollView = new QButtonGroup(this); // invisible QButtonGroup
m_scrollableChannelSelector = new QScrollArea(m_mainFrame);
#ifndef QT_NO_ACCESSIBILITY
......@@ -105,7 +102,9 @@ void DialogChooseBackends::createPage(const QSet<QString>& mixerIds)
_layout->addWidget(m_scrollableChannelSelector);
m_vboxForScrollView = new KVBox();
m_vboxForScrollView = new QWidget();
QVBoxLayout *vbl = new QVBoxLayout(m_vboxForScrollView);
vbl->setSpacing(0);
bool hasMixerFilter = !mixerIds.isEmpty();
qCDebug(KMIX_LOG) << "MixerIds=" << mixerIds;
......@@ -114,6 +113,7 @@ void DialogChooseBackends::createPage(const QSet<QString>& mixerIds)
QCheckBox* qrb = new QCheckBox(mixer->readableName(true), m_vboxForScrollView);
qrb->setObjectName(mixer->id());// The object name is used as ID here: see getChosenBackends()
connect(qrb, SIGNAL(stateChanged(int)), SLOT(backendsModifiedSlot()));
vbl->addWidget(qrb);
checkboxes.append(qrb);
bool mixerShouldBeShown = !hasMixerFilter || mixerIds.contains(mixer->id());
qrb->setChecked(mixerShouldBeShown);
......
......@@ -21,8 +21,6 @@
#ifndef DIALOGCHOOSEBACKENDS_H
#define DIALOGCHOOSEBACKENDS_H
class QButtonGroup;
#include <qcheckbox.h>
#include <QList>
class QScrollArea;
......@@ -30,7 +28,6 @@ class QVBoxLayout;
class KComboBox;
#include <kdialog.h>
#include <kvbox.h>
class Mixer;
......@@ -53,8 +50,7 @@ private:
void createPage(const QSet<QString>& backends);
QVBoxLayout* _layout;
QScrollArea* m_scrollableChannelSelector;
KVBox *m_vboxForScrollView;
QButtonGroup *m_buttonGroupForScrollView;
QWidget *m_vboxForScrollView;
QList<QCheckBox*> checkboxes;
QWidget *m_mainFrame;
bool modified;
......
......@@ -34,7 +34,6 @@
#include <kdialog.h>
#include <KIconLoader>
#include <klocalizedstring.h>
#include <kvbox.h>
#include "gui/guiprofile.h"
#include "gui/mixdevicewidget.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment