kdeplasma-addons: port to the new KTimeEdit class

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-02 13:18:15 +03:00
parent e423875071
commit e4722c9617
4 changed files with 14 additions and 24 deletions

View file

@ -39,10 +39,7 @@ ConfigDialog::ConfigDialog(QWidget *parent)
imageUi.addDirButton->setIcon(KIcon("list-add")); imageUi.addDirButton->setIcon(KIcon("list-add"));
imageUi.removeDirButton->setIcon(KIcon("list-remove")); imageUi.removeDirButton->setIcon(KIcon("list-remove"));
imageUi.slideShowDelay->setTimeRange( imageUi.slideShowDelay->setMinimumTime(QTime(0, 0, 1)); // minimum to 1 second
QTime(0, 0, 1), // minimum to 1 second
imageUi.slideShowDelay->maximumTime()
);
QString monitorPath = KStandardDirs::locate("data", "kcontrol/pics/monitor.png"); QString monitorPath = KStandardDirs::locate("data", "kcontrol/pics/monitor.png");
// Size of monitor image: 200x186 // Size of monitor image: 200x186

View file

@ -136,7 +136,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="autoUpdateTime"> <widget class="KTimeEdit" name="autoUpdateTime">
<property name="toolTip"> <property name="toolTip">
<string>Updates the picture from the source in the given time. <string>Updates the picture from the source in the given time.
Useful if you want a live cam or weather data to be up to date.</string> Useful if you want a live cam or weather data to be up to date.</string>
@ -293,17 +293,7 @@ Useful if you want a live cam or weather data to be up to date.</string>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QTimeEdit" name="slideShowDelay"> <widget class="KTimeEdit" name="slideShowDelay">
<property name="dateTime">
<datetime>
<hour>0</hour>
<minute>0</minute>
<second>0</second>
<year>2000</year>
<month>1</month>
<day>1</day>
</datetime>
</property>
<property name="time"> <property name="time">
<time> <time>
<hour>0</hour> <hour>0</hour>
@ -386,6 +376,11 @@ Useful if you want a live cam or weather data to be up to date.</string>
<extends>QComboBox</extends> <extends>QComboBox</extends>
<header>kcombobox.h</header> <header>kcombobox.h</header>
</customwidget> </customwidget>
<customwidget>
<class>KTimeEdit</class>
<extends>QWidget</extends>
<header>ktimeedit.h</header>
</customwidget>
</customwidgets> </customwidgets>
<connections> <connections>
<connection> <connection>

View file

@ -18,7 +18,8 @@
***************************************************************************/ ***************************************************************************/
#include "customtimeeditor.h" #include "customtimeeditor.h"
#include <QtGui/qdatetimeedit.h>
#include <ktimeedit.h>
#include <klineedit.h> #include <klineedit.h>
#include <klocale.h> #include <klocale.h>
@ -27,7 +28,7 @@ const QString CustomTimeEditor::TIME_FORMAT("hh:mm:ss");
CustomTimeEditor::CustomTimeEditor() CustomTimeEditor::CustomTimeEditor()
: QObject() : QObject()
{ {
timeEdit=new QTimeEdit(); timeEdit=new KTimeEdit();
editor=new KLineEdit(); editor=new KLineEdit();
customEditor=new KEditListWidget::CustomEditor(timeEdit, editor); customEditor=new KEditListWidget::CustomEditor(timeEdit, editor);
connect(timeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(setEdit(QTime))); connect(timeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(setEdit(QTime)));

View file

@ -21,13 +21,10 @@
#define CUSTOMTIMEEDITOR_H #define CUSTOMTIMEEDITOR_H
#include <keditlistwidget.h> #include <keditlistwidget.h>
#include <QtCore/qdatetime.h>
#include <QTimeEdit> class KTimeEdit;
class KLineEdit; class KLineEdit;
/**
@author
*/
class CustomTimeEditor : public QObject class CustomTimeEditor : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -41,7 +38,7 @@ public:
static QString fromLocalizedTimer(const QString &timer); static QString fromLocalizedTimer(const QString &timer);
static const QString TIME_FORMAT; static const QString TIME_FORMAT;
private: private:
QTimeEdit* timeEdit; KTimeEdit* timeEdit;
KLineEdit* editor; KLineEdit* editor;
KEditListWidget::CustomEditor *customEditor; KEditListWidget::CustomEditor *customEditor;
protected slots: protected slots: