- #include <QObject> zu 106+ Header-Dateien hinzugefügt (Qt6 benötigt explizites Include) - ui_requirement.h/cpp zu requirement_widget.h/cpp umbenannt (vermeidet AutoUIC-Scan) - CMakeLists.txt aktualisiert - Qt6Positioning-Dependency in Dockerfile hinzugefügt Fixes: - AutoUIC-Fehler bei AesBaseGui (requirement.ui nicht gefunden) - QObject-Missing-Include-Fehler in Qt6 - Qt6Location-Modul nicht gefunden (qtpositioning fehlte)
54 lines
1.2 KiB
C++
Executable File
54 lines
1.2 KiB
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
#include <QObject>
|
|
|
|
#include "lts_widgets_export.h"
|
|
#include <QSet>
|
|
#include <QSpinBox>
|
|
|
|
namespace LtsWidgets
|
|
{
|
|
|
|
class LTSWIDGETS_EXPORT LtsMultiRangeSpinBox : public QSpinBox
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit LtsMultiRangeSpinBox(QWidget *parent = nullptr);
|
|
~LtsMultiRangeSpinBox() = default;
|
|
|
|
|
|
public slots:
|
|
void setRanges(const QVector<QPair<int, int>> &ranges);
|
|
void setRange(int min, int max);
|
|
void setMinimum(int min);
|
|
void setMaximum(int max);
|
|
|
|
protected:
|
|
QValidator::State validate(QString &input, int &pos) const override;
|
|
void fixup(QString &str) const override;
|
|
void focusOutEvent(QFocusEvent *event) override;
|
|
void wheelEvent(QWheelEvent *event) override;
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
void keyPressEvent(QKeyEvent *event) override;
|
|
|
|
private:
|
|
static QVector<QPair<int,int>> sortRanges(const QVector<QPair<int, int> > &ranges);
|
|
|
|
QValidator::State validateAll(QString &input, int &pos);
|
|
|
|
int fixupValue(int value) const;
|
|
int fixupValue(int value, bool higher) const;
|
|
private:
|
|
QVector<QPair<int, int>> m_rangesList;
|
|
|
|
int m_curVal = minimum();
|
|
QRegExp m_regex;
|
|
};
|
|
|
|
|
|
|
|
}
|