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.removeDirButton->setIcon(KIcon("list-remove"));
imageUi.slideShowDelay->setTimeRange(
QTime(0, 0, 1), // minimum to 1 second
imageUi.slideShowDelay->maximumTime()
);
imageUi.slideShowDelay->setMinimumTime(QTime(0, 0, 1)); // minimum to 1 second
QString monitorPath = KStandardDirs::locate("data", "kcontrol/pics/monitor.png");
// Size of monitor image: 200x186

View file

@ -136,7 +136,7 @@
</widget>
</item>
<item>
<widget class="QTimeEdit" name="autoUpdateTime">
<widget class="KTimeEdit" name="autoUpdateTime">
<property name="toolTip">
<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>
@ -293,17 +293,7 @@ Useful if you want a live cam or weather data to be up to date.</string>
</widget>
</item>
<item row="2" column="1">
<widget class="QTimeEdit" 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>
<widget class="KTimeEdit" name="slideShowDelay">
<property name="time">
<time>
<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>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KTimeEdit</class>
<extends>QWidget</extends>
<header>ktimeedit.h</header>
</customwidget>
</customwidgets>
<connections>
<connection>

View file

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

View file

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