Add default QDateTime delegate editor

This commit is contained in:
Bill Somerville 2019-05-04 01:02:16 +01:00
parent 2e5152ad08
commit bd07a6e755

23
widgets/DateTimeEdit.hpp Normal file
View File

@ -0,0 +1,23 @@
#ifndef DATE_TIME_EDIT_HPP_
#define DATE_TIME_EDIT_HPP_
#include <QDateTimeEdit>
class QWidget;
//
// DateTimeEdit - format includes seconds
//
class DateTimeEdit final
: public QDateTimeEdit
{
public:
explicit DateTimeEdit (QWidget * parent = nullptr)
: QDateTimeEdit {parent}
{
setDisplayFormat (locale ().dateFormat (QLocale::ShortFormat) + " hh:mm:ss");
setTimeSpec (Qt::UTC);
}
};
#endif