Commit 6ff419ec authored by Olivier CHURLAUD's avatar Olivier CHURLAUD

Port away from KButtonGroup

parent 327b560e
......@@ -73,16 +73,13 @@
</widget>
</item>
<item>
<widget class="KButtonGroup" name="kcfg_DisplayDocumentNameOrPath">
<widget class="QGroupBox" name="kcfg_DisplayDocumentNameOrPath">
<property name="styleSheet">
<string notr="true">KButtonGroup {border:0; }</string>
<string notr="true">QGroupBox {border:0; }</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="current" stdset="0">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>8</number>
......@@ -385,14 +382,6 @@ For files which were opened before the previous zoom is applied.</string>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KButtonGroup</class>
<extends>QGroupBox</extends>
<header>kbuttongroup.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<includes>
<include location="global">kiconloader.h</include>
</includes>
......
......@@ -9,14 +9,19 @@
#include "dlgperformance.h"
#include <qfont.h>
#include <kiconloader.h>
#include <QButtonGroup>
#include <QFont>
#include <KConfigDialogManager>
#include <KIconLoader>
#include "settings_core.h"
#include "ui_dlgperformancebase.h"
DlgPerformance::DlgPerformance( QWidget * parent )
: QWidget( parent )
{
Q_PROPERTY( QButtonGroup checkedId READ checkedId USER true );
m_dlg = new Ui_DlgPerformanceBase();
m_dlg->setupUi( this );
......@@ -25,9 +30,16 @@ DlgPerformance::DlgPerformance( QWidget * parent )
m_dlg->descLabel->setFont( labelFont );
m_dlg->cpuLabel->setPixmap( BarIcon( QStringLiteral("cpu"), 32 ) );
// m_dlg->memoryLabel->setPixmap( BarIcon( "kcmmemory", 32 ) ); // TODO: enable again when proper icon is available
// m_dlg->memoryLabel->setPixmap( BarIcon( "kcmmemory", 32 ) ); // TODO: enable again when proper icon is available
m_dlg->memoryLevelGroup->setId(m_dlg->lowRadio, 0);
m_dlg->memoryLevelGroup->setId(m_dlg->normalRadio, 1);
m_dlg->memoryLevelGroup->setId(m_dlg->aggressiveRadio, 2);
m_dlg->memoryLevelGroup->setId(m_dlg->greedyRadio, 3);
connect(m_dlg->kcfg_MemoryLevel, &KButtonGroup::changed, this, &DlgPerformance::radioGroup_changed);
connect(m_dlg->memoryLevelGroup, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
this, &DlgPerformance::radioGroup_changed);
}
DlgPerformance::~DlgPerformance()
......
......@@ -10,9 +10,10 @@
#ifndef _DLGPERFORMANCE_H
#define _DLGPERFORMANCE_H
#include <qwidget.h>
#include <QWidget>
class Ui_DlgPerformanceBase;
class QButtonGroup;
class DlgPerformance : public QWidget
{
......@@ -27,6 +28,7 @@ class DlgPerformance : public QWidget
protected:
Ui_DlgPerformanceBase * m_dlg;
QButtonGroup *kcfg_MemoryLevel;
};
#endif
......@@ -7,14 +7,23 @@
<x>0</x>
<y>0</y>
<width>316</width>
<height>344</height>
<height>397</height>
</rect>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -26,7 +35,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
......@@ -34,7 +52,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -42,7 +69,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -59,7 +95,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -96,7 +141,7 @@
</widget>
</item>
<item>
<widget class="KButtonGroup" name="kcfg_MemoryLevel">
<widget class="KButtonGroup" name="groupbox">
<property name="title">
<string>Memory Usage</string>
</property>
......@@ -104,7 +149,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
......@@ -112,53 +166,85 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
<widget class="QGroupBox" name="kcfg_MemoryLevel">
<property name="title">
<string/>
</property>
<property name="margin">
<number>0</number>
<property name="flat">
<bool>true</bool>
</property>
<item>
<widget class="QRadioButton" name="lowRadio">
<property name="text">
<string>&amp;Low</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="normalRadio">
<property name="text">
<string>&amp;Normal (default)</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="aggressiveRadio">
<property name="text">
<string>&amp;Aggressive</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="greedyRadio">
<property name="text">
<string>&amp;Greedy</string>
</property>
</widget>
</item>
</layout>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="lowRadio">
<property name="text">
<string>&amp;Low</string>
</property>
<attribute name="buttonGroup">
<string notr="true">memoryLevelGroup</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="normalRadio">
<property name="text">
<string>Nor&amp;mal (default)</string>
</property>
<attribute name="buttonGroup">
<string notr="true">memoryLevelGroup</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="aggressiveRadio">
<property name="text">
<string>Aggr&amp;essive</string>
</property>
<attribute name="buttonGroup">
<string notr="true">memoryLevelGroup</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="greedyRadio">
<property name="text">
<string>G&amp;reedy</string>
</property>
<attribute name="buttonGroup">
<string notr="true">memoryLevelGroup</string>
</attribute>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -271,4 +357,7 @@
</includes>
<resources/>
<connections/>
<buttongroups>
<buttongroup name="memoryLevelGroup"/>
</buttongroups>
</ui>
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