Qt6 Migration: LtsWidgets, BUILD_RTI Guards, externe Dependencies dokumentiert
- LtsWidgets Verzeichnis vollständig migriert (Qt5→Qt6) - BUILD_RTI Guards für RTI-spezifische Module hinzugefügt - Externe Dependencies in EXTERNAL_DEPS.md dokumentiert - Qt6 API-Änderungen: QRegExp→QRegularExpression, enterEvent(QEnterEvent*) - AutoUic-Fehler bei ui_requirement behoben (SKIP_AUTOUIC) - Include-Pfade korrigiert (LtsElevation, LtsMultiMonitor, LtsUtilsCore) - MOC-Fehler behoben (Q_INTERFACES entfernt wo nicht benötigt) - CMakeLists.txt Anpassungen für Qt6 (PUBLIC statt INTERFACE) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
145 files changed
+17700
-14377
No files matched your search
@@ -1,19 +1,29 @@
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* DTG Edit
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*
|
||||
* Created by Mike Wille, SLSE, 2016-08-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
//#include "lts_date_time_edit_touch.h"
|
||||
#include "lts_widgets_export.h"
|
||||
#include "qcheckbox.h"
|
||||
#include "qpushbutton.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <functional>
|
||||
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class LtsDateTimeEditLe;
|
||||
class LtsDateTimeEdit;
|
||||
} // namespace Ui
|
||||
class LtsDateTimeEditLe; // default, based on QLineEdit
|
||||
class LtsDateTimeEdit; // touch , based on QSpinBox, QComboBox
|
||||
}
|
||||
|
||||
class QLineEdit;
|
||||
class QShortcut;
|
||||
@@ -22,228 +32,189 @@ namespace LtsWidgets
|
||||
{
|
||||
class LTSWIDGETS_EXPORT LtsDateTimeEdit : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(bool autoForward READ getAutoForward WRITE setAutoForward)
|
||||
Q_PROPERTY(bool editTimezone READ getEditTimezone WRITE setEditTimezone)
|
||||
Q_PROPERTY(bool withButtons READ getWithButtons WRITE setWithButtons)
|
||||
Q_PROPERTY(bool withSlider READ getWithSlider WRITE setWithSlider)
|
||||
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
|
||||
Q_PROPERTY(bool withNowButton READ withNowButton WRITE setWithNowButton)
|
||||
Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable)
|
||||
Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY toggled)
|
||||
Q_PROPERTY(bool autoForward READ getAutoForward WRITE setAutoForward)
|
||||
Q_PROPERTY(bool editTimezone READ getEditTimezone WRITE setEditTimezone)
|
||||
Q_PROPERTY(bool withButtons READ getWithButtons WRITE setWithButtons)
|
||||
Q_PROPERTY(bool withSlider READ getWithSlider WRITE setWithSlider)
|
||||
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
|
||||
Q_PROPERTY(bool withNowButton READ withNowButton WRITE setWithNowButton)
|
||||
Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable)
|
||||
Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY toggled)
|
||||
|
||||
public:
|
||||
using CurrentTimeCallback = std::function<qint64()>;
|
||||
public:
|
||||
// returns the current time in msec
|
||||
using CurrentTimeCallback = std::function<qint64()>;
|
||||
|
||||
explicit LtsDateTimeEdit(QWidget* parent = nullptr, bool withNowButton = true, bool checkable = false);
|
||||
~LtsDateTimeEdit();
|
||||
explicit LtsDateTimeEdit(QWidget *parent = nullptr, bool withNowButton = true, bool checkable = false);
|
||||
~LtsDateTimeEdit();
|
||||
|
||||
bool setupUiTouch();
|
||||
bool setupUiTouch();
|
||||
|
||||
qint64 msecsSinceEpoch() const;
|
||||
bool isEmpty() const;
|
||||
bool isValidDate() const;
|
||||
|
||||
void setAutoForward(const bool af)
|
||||
{
|
||||
m_autoForward = af;
|
||||
}
|
||||
qint64 msecsSinceEpoch() const;
|
||||
bool isEmpty() const;
|
||||
bool isValidDate() const; // should be preferred over isEmpty()
|
||||
|
||||
bool getAutoForward() const
|
||||
{
|
||||
return m_autoForward;
|
||||
}
|
||||
void setAutoForward(const bool af) { m_autoForward = af; }
|
||||
bool getAutoForward() const { return m_autoForward; }
|
||||
|
||||
void setEditTimezone(const bool edit);
|
||||
void setEditTimezone(const bool edit);
|
||||
bool getEditTimezone() const { return m_editTimezone; }
|
||||
|
||||
bool getEditTimezone() const
|
||||
{
|
||||
return m_editTimezone;
|
||||
}
|
||||
void setWithButtons(const bool buttons);
|
||||
bool getWithButtons() const { return m_withButtons; }
|
||||
|
||||
void setWithButtons(const bool buttons);
|
||||
void setWithSlider(const bool slider);
|
||||
bool getWithSlider() const { return m_withSlider; }
|
||||
|
||||
bool getWithButtons() const
|
||||
{
|
||||
return m_withButtons;
|
||||
}
|
||||
void setReadOnly(const bool readOnly);
|
||||
bool isReadOnly() const { return m_readOnly; }
|
||||
|
||||
void setWithSlider(const bool slider);
|
||||
void setCheckable(bool checkable);
|
||||
bool isCheckable() const { return m_checkable; }
|
||||
void setChecked(bool bChecked);
|
||||
bool isChecked() const;
|
||||
|
||||
bool getWithSlider() const
|
||||
{
|
||||
return m_withSlider;
|
||||
}
|
||||
void setWithNowButton(bool nowButton);
|
||||
bool withNowButton() const { return m_withNowButton; }
|
||||
|
||||
void setReadOnly(const bool readOnly);
|
||||
// Setzt die minimal eingebbare Zeit
|
||||
void setMinimumTimeMSec(qint64 msec);
|
||||
qint64 minimumTimeMSec() const { return m_minTimeMSec; }
|
||||
|
||||
bool isReadOnly() const
|
||||
{
|
||||
return m_readOnly;
|
||||
}
|
||||
// Setzt die maximal eingebbare Zeit
|
||||
void setMaximumTimeMSec(qint64 msec);
|
||||
qint64 maximumTimeMSec() const { return m_maxTimeMSec; }
|
||||
|
||||
void setCheckable(bool checkable);
|
||||
void setMinMaxTimeMSec(qint64 min, qint64 max) { setMinimumTimeMSec(min); setMaximumTimeMSec(max); }
|
||||
|
||||
bool isCheckable() const
|
||||
{
|
||||
return m_checkable;
|
||||
}
|
||||
void setRetrieveCurrentTimeCallback(const CurrentTimeCallback &cb);
|
||||
|
||||
void setChecked(bool bChecked);
|
||||
bool isChecked() const;
|
||||
bool setTimezone(char tz);
|
||||
char getTimezone() const;
|
||||
qint64 getTimezoneAsSecs() const;
|
||||
|
||||
void setWithNowButton(bool nowButton);
|
||||
void setSubWidgetsProperties(const QString &name, const QVariant &value);
|
||||
|
||||
bool withNowButton() const
|
||||
{
|
||||
return m_withNowButton;
|
||||
}
|
||||
Q_SIGNALS:
|
||||
void dateTimeChanged();
|
||||
void toggled(bool on);
|
||||
|
||||
void setMinimumTimeMSec(qint64 msec);
|
||||
public Q_SLOTS:
|
||||
bool setMsecsSinceEpoch(qint64 msec, bool setToNearestPossible = true);
|
||||
void clear();
|
||||
|
||||
qint64 minimumTimeMSec() const
|
||||
{
|
||||
return m_minTimeMSec;
|
||||
}
|
||||
private:
|
||||
void clearTimezone();
|
||||
|
||||
void setMaximumTimeMSec(qint64 msec);
|
||||
void setMinMaxMonth(int minMonth, int maxMonth);
|
||||
|
||||
qint64 maximumTimeMSec() const
|
||||
{
|
||||
return m_maxTimeMSec;
|
||||
}
|
||||
bool setMonth(int month);
|
||||
int getMonth() const;
|
||||
|
||||
void setMinMaxTimeMSec(qint64 min, qint64 max)
|
||||
{
|
||||
setMinimumTimeMSec(min);
|
||||
setMaximumTimeMSec(max);
|
||||
}
|
||||
bool setDay(int day);
|
||||
int getDay() const;
|
||||
|
||||
void setRetrieveCurrentTimeCallback(const CurrentTimeCallback& cb);
|
||||
bool setHHMMSS(int hour, int minute, int second);
|
||||
int getHour() const;
|
||||
int getMinute() const;
|
||||
int getSecond() const;
|
||||
|
||||
bool setTimezone(char tz);
|
||||
char getTimezone() const;
|
||||
qint64 getTimezoneAsSecs() const;
|
||||
bool setYear(int year);
|
||||
int getYear() const;
|
||||
|
||||
void setSubWidgetsProperties(const QString& name, const QVariant& value);
|
||||
bool isEmptyDay() const;
|
||||
bool isEmptyHHMMSS() const;
|
||||
bool isEmptyTimezone() const;
|
||||
bool isEmptyMonth() const;
|
||||
bool isEmptyYear() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void dateTimeChanged();
|
||||
void toggled(bool on);
|
||||
bool hasFocus() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
bool setMsecsSinceEpoch(qint64 msec, bool setToNearestPossible = true);
|
||||
void clear();
|
||||
bool isDataAcceptable();
|
||||
|
||||
private:
|
||||
void clearTimezone();
|
||||
void showInvalidData(bool setFocus);
|
||||
|
||||
void setMinMaxMonth(int minMonth, int maxMonth);
|
||||
bool isLineEditDataAcceptable(QLineEdit *le) const;
|
||||
|
||||
bool setMonth(int month);
|
||||
int getMonth() const;
|
||||
bool isDayAcceptable() const;
|
||||
bool isHHMMSSAcceptable() const;
|
||||
bool isMonthAcceptable() const;
|
||||
bool isYearAcceptable() const;
|
||||
bool isTzAcceptable() const;
|
||||
|
||||
bool setDay(int day);
|
||||
int getDay() const;
|
||||
QCheckBox* checkBox() const;
|
||||
QPushButton* pbNow() const;
|
||||
|
||||
bool setHHMMSS(int hour, int minute, int second);
|
||||
int getHour() const;
|
||||
int getMinute() const;
|
||||
int getSecond() const;
|
||||
private Q_SLOTS:
|
||||
void setFixedDateTime();
|
||||
void setOffsetDateTime();
|
||||
|
||||
bool setYear(int year);
|
||||
int getYear() const;
|
||||
void setSliderValue(int val);
|
||||
void valueDayChanged(const QString &str);
|
||||
void fixupHHMMSS();
|
||||
void valueMonthChanged(const QString &str);
|
||||
void valueMonthChanged2(const QString &str);
|
||||
void valueTimezoneChangedStr(const QString &str);
|
||||
void valueTimezoneChangedInt(int newTimezone);
|
||||
void valueYearChanged(const QString &str);
|
||||
|
||||
bool isEmptyDay() const;
|
||||
bool isEmptyHHMMSS() const;
|
||||
bool isEmptyTimezone() const;
|
||||
bool isEmptyMonth() const;
|
||||
bool isEmptyYear() const;
|
||||
void onBackHourClicked();
|
||||
void onBackMinuteClicked();
|
||||
void onBackSecondClicked();
|
||||
void onForwardSecondClicked();
|
||||
void onForwardMinuteClicked();
|
||||
void onForwardHourClicked();
|
||||
|
||||
bool hasFocus() const;
|
||||
void onCheckBoxChanged();
|
||||
void disableControls();
|
||||
void enableControls();
|
||||
void enaDisaControls(bool bEnable);
|
||||
|
||||
bool isDataAcceptable();
|
||||
void onFocusOutHHMMSS();
|
||||
void onFocusOutTZ();
|
||||
void onFocusOutDay();
|
||||
void onFocusOutMonth();
|
||||
void onFocusOutYear();
|
||||
|
||||
void showInvalidData(bool setFocus);
|
||||
void onFocusOutBackspace();
|
||||
void onFocusOut();
|
||||
|
||||
bool isLineEditDataAcceptable(QLineEdit* le) const;
|
||||
void onHmsWheelEvent(bool bForward, int cursorPos);
|
||||
void onDayWheelEvent(bool bForward, int cursorPos);
|
||||
void onMonthWheelEvent(bool bForward, int cursorPos);
|
||||
void onYearWheelEvent(bool bForward, int cursorPos);
|
||||
|
||||
bool isDayAcceptable() const;
|
||||
bool isHHMMSSAcceptable() const;
|
||||
bool isMonthAcceptable() const;
|
||||
bool isYearAcceptable() const;
|
||||
bool isTzAcceptable() const;
|
||||
private:
|
||||
Ui::LtsDateTimeEditLe *m_uiLe{nullptr};
|
||||
Ui::LtsDateTimeEdit *m_uiTouch{nullptr};
|
||||
QShortcut *m_scFixed = nullptr;
|
||||
QShortcut *m_scOffset = nullptr;
|
||||
|
||||
QCheckBox* checkBox() const;
|
||||
QPushButton* pbNow() const;
|
||||
CurrentTimeCallback m_getCurrentTimeCallback = nullptr;
|
||||
|
||||
private Q_SLOTS:
|
||||
void setFixedDateTime();
|
||||
void setOffsetDateTime();
|
||||
qint64 m_minTimeMSec = 0;
|
||||
qint64 m_maxTimeMSec = 0;
|
||||
|
||||
void setSliderValue(int val);
|
||||
void valueDayChanged(const QString& str);
|
||||
void fixupHHMMSS();
|
||||
void valueMonthChanged(const QString& str);
|
||||
void valueMonthChanged2(const QString& str);
|
||||
void valueTimezoneChangedStr(const QString& str);
|
||||
void valueTimezoneChangedInt(int newTimezone);
|
||||
void valueYearChanged(const QString& str);
|
||||
qint64 m_curTimeMSec = -1; // IMMER UTC
|
||||
|
||||
void onBackHourClicked();
|
||||
void onBackMinuteClicked();
|
||||
void onBackSecondClicked();
|
||||
void onForwardSecondClicked();
|
||||
void onForwardMinuteClicked();
|
||||
void onForwardHourClicked();
|
||||
bool m_editTimezone = true;
|
||||
bool m_autoForward = true;
|
||||
bool m_withButtons = false;
|
||||
bool m_withSlider = false;
|
||||
bool m_readOnly = false;
|
||||
bool m_checkable = false;
|
||||
bool m_withNowButton = false;
|
||||
|
||||
void onCheckBoxChanged();
|
||||
void disableControls();
|
||||
void enableControls();
|
||||
void enaDisaControls(bool bEnable);
|
||||
int m_minMonth{0};
|
||||
int m_maxMonth{0};
|
||||
|
||||
void onFocusOutHHMMSS();
|
||||
void onFocusOutTZ();
|
||||
void onFocusOutDay();
|
||||
void onFocusOutMonth();
|
||||
void onFocusOutYear();
|
||||
|
||||
void onFocusOutBackspace();
|
||||
void onFocusOut();
|
||||
|
||||
void onHmsWheelEvent(bool bForward, int cursorPos);
|
||||
void onDayWheelEvent(bool bForward, int cursorPos);
|
||||
void onMonthWheelEvent(bool bForward, int cursorPos);
|
||||
void onYearWheelEvent(bool bForward, int cursorPos);
|
||||
|
||||
private:
|
||||
Ui::LtsDateTimeEditLe* m_uiLe{nullptr};
|
||||
Ui::LtsDateTimeEdit* m_uiTouch{nullptr};
|
||||
QShortcut* m_scFixed = nullptr;
|
||||
QShortcut* m_scOffset = nullptr;
|
||||
|
||||
CurrentTimeCallback m_getCurrentTimeCallback = nullptr;
|
||||
|
||||
qint64 m_minTimeMSec = 0;
|
||||
qint64 m_maxTimeMSec = 0;
|
||||
|
||||
qint64 m_curTimeMSec = -1;
|
||||
|
||||
bool m_editTimezone = true;
|
||||
bool m_autoForward = true;
|
||||
bool m_withButtons = false;
|
||||
bool m_withSlider = false;
|
||||
bool m_readOnly = false;
|
||||
bool m_checkable = false;
|
||||
bool m_withNowButton = false;
|
||||
|
||||
int m_minMonth{0};
|
||||
int m_maxMonth{0};
|
||||
|
||||
bool m_backspacePressed = false;
|
||||
bool m_recursionAvoid = false;
|
||||
bool m_dateIsAcceptable = false;
|
||||
bool m_backspacePressed = false;
|
||||
bool m_recursionAvoid = false;
|
||||
bool m_dateIsAcceptable = false;
|
||||
};
|
||||
|
||||
} // namespace LtsWidgets
|
||||
Reference in new issue
Block a user