view include/gui/widgets/optional_date.h @ 55:d10b6c6b432e

add xml lib, we will need to use it eventually
author Paper <mrpapersonic@gmail.com>
date Tue, 26 Sep 2023 12:37:08 -0400
parents 75c804f713b2
children 3d2decf093bb
line wrap: on
line source

#ifndef __gui__widgets__optional_date_h
#define __gui__widgets__optional_date_h
#include <QWidget>
#include "core/date.h"

class QCheckBox;
class QDateEdit;
class QDate;

class OptionalDate : public QWidget {
	Q_OBJECT

	public:
		OptionalDate(QWidget* parent = nullptr);
		OptionalDate(bool enabled, QWidget* parent = nullptr);
		QDateEdit* GetDateEdit();
		QCheckBox* GetCheckBox();
		void SetDate(QDate date);
		void SetDate(Date date);
		Date GetDate();
		void SetEnabled(bool enabled);
		bool IsEnabled();

	signals:
		void DataChanged(bool checked, Date date);

	private:
		QDateEdit* _dateedit;
		QCheckBox* _checkbox;
};

#endif // __gui__widgets__optional_date_h