Kstars

timedialog.h
1/*
2 SPDX-FileCopyrightText: 2001 Jason Harris <jharris@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kstarsdatetime.h"
10
11#include <QDialog>
12#include <QHBoxLayout>
13#include <QKeyEvent>
14#include <QLabel>
15#include <QVariant>
16#include <QVBoxLayout>
17
18class QHBoxLayout;
19class QVBoxLayout;
20class KDatePicker;
21class QTimeEdit;
22class QPushButton;
23class GeoLocation;
24
25/**
26 * @class TimeDialog
27 *
28 * A class for adjusting the Time and Date. Contains a KDatePicker widget
29 * for selecting the date, and a QTimeEdit for selecting the time. There
30 * is also a "Now" button for selecting the Time and Date from the system clock.
31 *
32 *
33 * @short Dialog for adjusting the Time and Date.
34 * @author Jason Harris
35 * @version 1.0
36 */
37class TimeDialog : public QDialog
38{
40 public:
41 /**
42 * Constructor. Creates widgets and packs them into QLayouts.
43 * Connects Signals and Slots.
44 */
46
47 ~TimeDialog() override = default;
48
49 /** @returns a QTime object with the selected time */
50 QTime selectedTime(void);
51
52 /** @returns a QDate object with the selected date */
53 QDate selectedDate(void);
54
55 /** @returns a KStarsDateTime object with the selected date and time */
57
58 public slots:
59 /**
60 * When the "Now" button is pressed, read the time and date from the system clock.
61 * Change the selected date in the KDatePicker to the system's date, and the displayed time
62 * to the system time.
63 */
64 void setNow(void);
65
66 protected:
67 void keyReleaseEvent(QKeyEvent *) override;
68
69 private:
70 bool UTCNow;
71 QHBoxLayout *hlay { nullptr };
72 QVBoxLayout *vlay { nullptr };
73 KDatePicker *dPicker { nullptr };
74 QTimeEdit *tEdit { nullptr };
75 QPushButton *NowButton { nullptr };
76 GeoLocation *geo { nullptr };
77};
Contains all relevant information for specifying a location on Earth: City Name, State/Province name,...
Definition geolocation.h:28
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
A class for adjusting the Time and Date.
Definition timedialog.h:38
TimeDialog(const KStarsDateTime &now, GeoLocation *_geo, QWidget *parent, bool UTCFrame=false)
Constructor.
QDate selectedDate(void)
void setNow(void)
When the "Now" button is pressed, read the time and date from the system clock.
QTime selectedTime(void)
KStarsDateTime selectedDateTime(void)
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:02 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.