Fluid
Loading...
Searching...
No Matches
timepicker.h
Go to the documentation of this file.
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2018 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 *
6 * $BEGIN_LICENSE:MPL2$
7 *
8 * This Source Code Form is subject to the terms of the Mozilla Public
9 * License, v. 2.0. If a copy of the MPL was not distributed with this
10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 *
12 * $END_LICENSE$
13 */
14
15#pragma once
16
17#include <QTime>
18#include <QQmlEngine>
19
20#include "picker.h"
21
47class TimePicker : public Picker
48{
49 Q_OBJECT
53 Q_PROPERTY(bool prefer24Hour READ prefer24Hour WRITE setPrefer24Hour NOTIFY prefer24HourChanged FINAL)
58 Q_PROPERTY(QTime selectedTime READ selectedTime WRITE setSelectedTime NOTIFY selectedTimeChanged FINAL)
59 QML_ELEMENT
60public:
61 explicit TimePicker(QQuickItem *parent = nullptr);
62
63 bool prefer24Hour() const;
64 void setPrefer24Hour(bool value);
65
66 QTime selectedTime() const;
67 void setSelectedTime(const QTime &time);
68
69Q_SIGNALS:
72
73private:
74 bool m_prefer24Hour = true;
75 QTime m_selectedTime;
76};
77
78QML_DECLARE_TYPE(TimePicker)
79
Definition picker.h:21
Control to select a time.
Definition TimePicker.qml:22
void setSelectedTime(const QTime &time)
Definition timepicker.cpp:42
void prefer24HourChanged()
void selectedTimeChanged()
bool prefer24Hour
Definition timepicker.h:53
QTime selectedTime
Definition timepicker.h:58
void setPrefer24Hour(bool value)
Definition timepicker.cpp:28