summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CHURLAUD <olivier@churlaud.com>2016-07-16 22:56:11 (GMT)
committerOlivier CHURLAUD <olivier@churlaud.com>2016-07-16 22:56:11 (GMT)
commit6ff419ecba3a98f4460cbcdcf3c2185d4c965eaf (patch)
tree0092f718f6e13f66cf45d7a89a130f8b4aa9c716
parent327b560e4e6aa6e889111ae26131d3cb672bf770 (diff)
Port away from KButtonGroup
-rw-r--r--conf/dlggeneralbase.ui15
-rw-r--r--conf/dlgperformance.cpp20
-rw-r--r--conf/dlgperformance.h4
-rw-r--r--conf/dlgperformancebase.ui177
4 files changed, 154 insertions, 62 deletions
diff --git a/conf/dlggeneralbase.ui b/conf/dlggeneralbase.ui
index 03d5d5d..c180533 100644
--- a/conf/dlggeneralbase.ui
+++ b/conf/dlggeneralbase.ui
@@ -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>
diff --git a/conf/dlgperformance.cpp b/conf/dlgperformance.cpp
index 557a1ab..b86af6f 100644
--- a/conf/dlgperformance.cpp
+++ b/conf/dlgperformance.cpp
@@ -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()
diff --git a/conf/dlgperformance.h b/conf/dlgperformance.h
index f28ee90..3b4ef07 100644
--- a/conf/dlgperformance.h
+++ b/conf/dlgperformance.h
@@ -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
diff --git a/conf/dlgperformancebase.ui b/conf/dlgperformancebase.ui
index 3909654..2e5c1cc 100644
--- a/conf/dlgperformancebase.ui
+++ b/conf/dlgperformancebase.ui
@@ -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>