Lts/Common: drop the 17 submodules excluded from the RELEASE_BUILD branch of Lts/Common/CMakeLists.txt (CodeGen, LtsAppManager, LtsBotan, LtsCoordinate, LtsElevation, LtsLogin, LtsMultiMonitor, LtsPluginManager, LtsPrinting, LtsProjectionWorkstation, LtsScriptTimeline, LtsSession, LtsTimeline, LtsTimelineClassic, LtsVirtualKeyboard, LtsWidgets, TopicEditorBase). Only the 13 subdirectories actually built remain. TrainingAreaBase: drop sources of targets excluded by IF(NOT RELEASE_BUILD) / IF(BUILD_RTI) (svcTabClient, svcTabServer, svcTrainingAreaBase exe, RecordReplayPlugin customization) and the 7 plugin directories not added in the release path (AdlerJson, ApacheHlaJson, DebugJsonDir, HlaJson, Nmea, UAS, WlsTetra). Only tabTelegrams, svcTabCommon and the TetraJson plugin are compiled. Cross-checked: no kept compiled source includes headers from the removed modules (GuiPluginInterface - the only LtsWidgets consumer - is itself NOT RELEASE_BUILD-guarded).
68 lines
1.6 KiB
C++
68 lines
1.6 KiB
C++
/**
|
|
* @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 <QtWidgets/QSpinBox>
|
|
|
|
namespace LtsWidgets
|
|
{
|
|
|
|
class LTSWIDGETS_EXPORT LtsSpinBox : public QSpinBox
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit LtsSpinBox(QWidget *parent = nullptr);
|
|
~LtsSpinBox() = default;
|
|
|
|
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();
|
|
|
|
protected:
|
|
QValidator::State validate(QString &input, int &pos) const override;
|
|
void fixup(QString &str) const override;
|
|
|
|
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...
|
|
|
|
};
|
|
|
|
class LTSWIDGETS_EXPORT LtsDoubleSpinBox : public QDoubleSpinBox
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit LtsDoubleSpinBox(QWidget *parent = nullptr);
|
|
~LtsDoubleSpinBox() = default;
|
|
|
|
public slots:
|
|
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;
|
|
|
|
};
|
|
|
|
}
|