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,9 +1,17 @@
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* SpinBox, that corrects values to a valid value that fits minimum() + n * singleStep() = value
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*
|
||||
* Created by Malte Diers, NLSE, 2018-05-07
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "lts_widgets_export.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QSpinBox>
|
||||
|
||||
namespace LtsWidgets
|
||||
@@ -11,62 +19,49 @@ namespace LtsWidgets
|
||||
|
||||
class LTSWIDGETS_EXPORT LtsSpinBox : public QSpinBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LtsSpinBox(QWidget* parent = nullptr);
|
||||
~LtsSpinBox() = default;
|
||||
public:
|
||||
explicit LtsSpinBox(QWidget *parent = nullptr);
|
||||
~LtsSpinBox() = default;
|
||||
|
||||
public slots:
|
||||
public slots:
|
||||
void setValue(int val) { QString valStr = QString::number(val); fixup(valStr); QSpinBox::setValue(valStr.toInt()); }
|
||||
bool setExclusionRanges(const QVector<QPair<int,int> > &exclusionRanges, bool preserveCurrentValues = false);
|
||||
bool addExclusionRange(int min, int max);
|
||||
void clearExclusionRanges();
|
||||
|
||||
void setValue(int val)
|
||||
{
|
||||
QString valStr = QString::number(val);
|
||||
fixup(valStr);
|
||||
QSpinBox::setValue(valStr.toInt());
|
||||
}
|
||||
protected:
|
||||
QValidator::State validate(QString &input, int &pos) const override;
|
||||
void fixup(QString &str) const override;
|
||||
|
||||
bool setExclusionRanges(const QVector<QPair<int, int>>& exclusionRanges, bool preserveCurrentValues = false);
|
||||
bool addExclusionRange(int min, int max);
|
||||
void clearExclusionRanges();
|
||||
private:
|
||||
|
||||
protected:
|
||||
QValidator::State validate(QString& input, int& pos) const override;
|
||||
void fixup(QString& str) const override;
|
||||
struct
|
||||
{
|
||||
bool operator()(const QPair<int,int> &a, const QPair<int,int> &b) const { return a.first < b.first; }
|
||||
} customless;
|
||||
|
||||
private:
|
||||
struct
|
||||
{
|
||||
bool operator()(const QPair<int, int>& a, const QPair<int, int>& b) const
|
||||
{
|
||||
return a.first < b.first;
|
||||
}
|
||||
} customless;
|
||||
QVector<QPair<int,int> > m_exclusions;
|
||||
QVector<QPair<int,int> > m_validRanges; // Doubles the information. However, it saves calculation...
|
||||
|
||||
QVector<QPair<int, int>> m_exclusions;
|
||||
QVector<QPair<int, int>> m_validRanges;
|
||||
};
|
||||
|
||||
class LTSWIDGETS_EXPORT LtsDoubleSpinBox : public QDoubleSpinBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LtsDoubleSpinBox(QWidget* parent = nullptr);
|
||||
~LtsDoubleSpinBox() = default;
|
||||
public:
|
||||
explicit LtsDoubleSpinBox(QWidget *parent = nullptr);
|
||||
~LtsDoubleSpinBox() = default;
|
||||
|
||||
public slots:
|
||||
public slots:
|
||||
void setValue(double val) { QString valStr = QString::number(val); fixup(valStr); QDoubleSpinBox::setValue(valStr.toDouble()); }
|
||||
|
||||
void setValue(double val)
|
||||
{
|
||||
QString valStr = QString::number(val);
|
||||
fixup(valStr);
|
||||
QDoubleSpinBox::setValue(valStr.toDouble());
|
||||
}
|
||||
protected:
|
||||
QValidator::State validate(QString &input, int &pos) const override;
|
||||
void fixup(QString &str) const override;
|
||||
|
||||
protected:
|
||||
QValidator::State validate(QString& input, int& pos) const override;
|
||||
void fixup(QString& str) const override;
|
||||
};
|
||||
|
||||
} // namespace LtsWidgets
|
||||
}
|
||||
Reference in new issue
Block a user