2021-05-21 16:17:22 +02:00
|
|
|
|
/************************************************************************
|
2015-07-15 09:16:59 +02:00
|
|
|
|
**
|
|
|
|
|
** @file vcommonsettings.h
|
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
|
** @date 15 7, 2015
|
|
|
|
|
**
|
|
|
|
|
** @brief
|
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2015-07-15 09:16:59 +02:00
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
|
** Copyright (C) 2015 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2015-07-15 09:16:59 +02:00
|
|
|
|
**
|
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
** (at your option) any later version.
|
|
|
|
|
**
|
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
|
**
|
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
**
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef VCOMMONSETTINGS_H
|
|
|
|
|
#define VCOMMONSETTINGS_H
|
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include <QByteArray>
|
|
|
|
|
#include <QMetaObject>
|
|
|
|
|
#include <QObject>
|
2015-07-15 09:16:59 +02:00
|
|
|
|
#include <QSettings>
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include <QSize>
|
|
|
|
|
#include <QString>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
|
2020-12-23 14:29:55 +01:00
|
|
|
|
#include "../vlayout/vlayoutdef.h"
|
2023-05-16 18:20:49 +02:00
|
|
|
|
#include "../vmisc/def.h"
|
2023-10-31 08:42:09 +01:00
|
|
|
|
#include "quuid.h"
|
2020-12-23 14:29:55 +01:00
|
|
|
|
|
|
|
|
|
class QMarginsF;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
|
enum class VThemeMode
|
|
|
|
|
{
|
|
|
|
|
System = 0,
|
|
|
|
|
Dark = 1,
|
|
|
|
|
Light = 2
|
|
|
|
|
};
|
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
|
class VCommonSettings : public QSettings
|
|
|
|
|
{
|
2022-08-12 17:50:13 +02:00
|
|
|
|
Q_OBJECT // NOLINT
|
2023-05-22 16:27:15 +02:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
VCommonSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(),
|
|
|
|
|
QObject *parent = nullptr);
|
2020-03-25 14:28:23 +01:00
|
|
|
|
VCommonSettings(const QString &fileName, Format format, QObject *parent = nullptr);
|
2023-05-16 18:20:49 +02:00
|
|
|
|
~VCommonSettings() override = default;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
|
2023-05-03 15:23:54 +02:00
|
|
|
|
static auto CastToLayoutExportFormat(qint8 f) -> qint8;
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetPathIndividualMeasurements() const -> QString;
|
2015-07-18 14:39:33 +02:00
|
|
|
|
void SetPathIndividualMeasurements(const QString &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetPathMultisizeMeasurements() const -> QString;
|
2017-07-12 20:21:48 +02:00
|
|
|
|
void SetPathMultisizeMeasurements(const QString &value);
|
2015-07-18 14:39:33 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetPathPattern() const -> QString;
|
2019-01-06 01:46:31 +01:00
|
|
|
|
void SetPathPattern(const QString &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetPathManualLayouts() const -> QString;
|
2020-04-21 17:57:11 +02:00
|
|
|
|
void SetPathManualLayouts(const QString &value);
|
|
|
|
|
|
2023-10-19 16:35:29 +02:00
|
|
|
|
auto GetPathCustomImage() const -> QString;
|
|
|
|
|
void SetPathCustomImage(const QString &value);
|
|
|
|
|
|
2023-06-22 17:30:43 +02:00
|
|
|
|
static auto GetDefPathSVGFonts() -> QString;
|
|
|
|
|
auto GetPathSVGFonts() const -> QString;
|
|
|
|
|
void SetPathSVGFonts(const QString &value);
|
|
|
|
|
|
|
|
|
|
static auto GetDefPathFontCorrections() -> QString;
|
|
|
|
|
auto GetPathFontCorrections() const -> QString;
|
|
|
|
|
void SetPathFontCorrections(const QString &value);
|
2023-10-26 11:05:45 +02:00
|
|
|
|
|
|
|
|
|
static auto GetDefPathKnownMeasurements() -> QString;
|
|
|
|
|
auto GetPathKnownMeasurements() const -> QString;
|
|
|
|
|
void SetPathKnownMeasurements(const QString &value);
|
2023-06-22 17:30:43 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetOsSeparator() const -> bool;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetOsSeparator(const bool &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetAutosaveState() const -> bool;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetAutosaveState(const bool &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetAutosaveTime() const -> int;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetAutosaveTime(const int &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsLocaleSelected() const -> bool;
|
|
|
|
|
auto GetLocale() const -> QString;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetLocale(const QString &value);
|
|
|
|
|
|
2023-05-16 18:20:19 +02:00
|
|
|
|
static const QString defaultPieceLabelLocale;
|
|
|
|
|
auto GetPieceLabelLocale() const -> QString;
|
|
|
|
|
void SetPieceLabelLocale(const QString &value);
|
|
|
|
|
|
2023-10-31 08:42:09 +01:00
|
|
|
|
auto GetKnownMeasurementsId() const -> QUuid;
|
|
|
|
|
void SetKnownMeasurementsId(const QUuid &value);
|
2015-08-02 17:27:18 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetUnit() const -> QString;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetUnit(const QString &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetConfirmItemDelete() const -> bool;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetConfirmItemDelete(const bool &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetConfirmFormatRewriting() const -> bool;
|
2017-04-12 08:49:05 +02:00
|
|
|
|
void SetConfirmFormatRewriting(const bool &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetAskContinueIfLayoutStale() const -> bool;
|
2021-10-19 10:36:26 +02:00
|
|
|
|
void SetAskContinueIfLayoutStale(const bool &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetToolBarStyle() const -> bool;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetToolBarStyle(const bool &value);
|
|
|
|
|
|
2023-08-21 14:51:49 +02:00
|
|
|
|
auto GetToolboxIconSizeSmall() const -> bool;
|
|
|
|
|
void SetToolboxIconSizeSmall(bool value);
|
|
|
|
|
|
2023-07-24 12:41:42 +02:00
|
|
|
|
auto GetThemeMode() const -> VThemeMode;
|
|
|
|
|
void SetThemeMode(VThemeMode mode);
|
2018-10-29 13:05:49 +01:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsFreeCurveMode() const -> bool;
|
2017-10-03 12:01:56 +02:00
|
|
|
|
void SetFreeCurveMode(bool value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsDoubleClickZoomFitBestCurrentPP() const -> bool;
|
2018-05-10 13:12:41 +02:00
|
|
|
|
void SetDoubleClickZoomFitBestCurrentPP(bool value);
|
|
|
|
|
|
2022-11-17 15:42:03 +01:00
|
|
|
|
auto IsInteractiveTools() const -> bool;
|
|
|
|
|
void SetInteractiveTools(bool value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetUndoCount() const -> int;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetUndoCount(const int &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetRecentFileList() const -> QStringList;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetRecentFileList(const QStringList &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetRestoreFileList() const -> QStringList;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetRestoreFileList(const QStringList &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetGeometry() const -> QByteArray;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetGeometry(const QByteArray &value);
|
|
|
|
|
|
2023-11-07 10:20:31 +01:00
|
|
|
|
auto GetKMGeometry() const -> QByteArray;
|
|
|
|
|
void SetKMGeometry(const QByteArray &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetToolbarsState() const -> QByteArray;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
void SetToolbarsState(const QByteArray &value);
|
|
|
|
|
|
2023-11-07 10:20:31 +01:00
|
|
|
|
auto GetKMToolbarsState() const -> QByteArray;
|
|
|
|
|
void SetKMToolbarsState(const QByteArray &value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetPreferenceDialogSize() const -> QSize;
|
2023-05-16 18:20:49 +02:00
|
|
|
|
void SetPreferenceDialogSize(const QSize &sz);
|
2016-07-15 11:00:00 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetToolSeamAllowanceDialogSize() const -> QSize;
|
2023-05-16 18:20:49 +02:00
|
|
|
|
void SetToolSeamAllowanceDialogSize(const QSize &sz);
|
2017-05-30 10:47:27 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetFormulaWizardDialogSize() const -> QSize;
|
2023-05-16 18:20:49 +02:00
|
|
|
|
void SetFormulaWizardDialogSize(const QSize &sz);
|
2017-06-16 16:05:35 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetIncrementsDialogSize() const -> QSize;
|
2023-05-16 18:20:49 +02:00
|
|
|
|
void SetIncrementsDialogSize(const QSize &sz);
|
2017-07-26 08:13:29 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetFinalMeasurementsDialogSize() const -> QSize;
|
2023-05-16 18:20:49 +02:00
|
|
|
|
void SetFinalMeasurementsDialogSize(const QSize &sz);
|
2017-09-26 16:24:02 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetLayoutSettingsDialogSize() const -> QSize;
|
2023-05-16 18:20:49 +02:00
|
|
|
|
void SetLayoutSettingsDialogSize(const QSize &sz);
|
2022-02-03 16:05:52 +01:00
|
|
|
|
|
2022-09-05 13:38:26 +02:00
|
|
|
|
auto GetDialogSplinePathSize() const -> QSize;
|
2023-05-16 18:20:49 +02:00
|
|
|
|
void SetDialogSplinePathSize(const QSize &sz);
|
2022-09-05 13:38:26 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsAutomaticallyCheckUpdates() const -> bool;
|
2021-11-18 13:55:15 +01:00
|
|
|
|
void SetAutomaticallyCheckUpdates(bool value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetLatestSkippedVersion() const -> unsigned;
|
2021-09-24 13:57:30 +02:00
|
|
|
|
void SetLatestSkippedVersion(unsigned value);
|
2016-06-10 21:34:21 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetDateOfLastRemind() const -> QDate;
|
|
|
|
|
void SetDateOfLastRemind(const QDate &date);
|
2016-07-15 11:30:55 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetForbidWorkpieceFlipping() const -> bool;
|
2016-09-06 16:05:54 +02:00
|
|
|
|
void SetForbidWorkpieceFlipping(bool value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetForceWorkpieceFlipping() const -> bool;
|
2017-12-17 14:06:46 +01:00
|
|
|
|
void SetForceWorkpieceFlipping(bool value);
|
|
|
|
|
|
2022-11-04 16:16:50 +01:00
|
|
|
|
auto GetSewLineOnDrawing() const -> bool;
|
|
|
|
|
void SetSewLineOnDrawing(bool value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsHideMainPath() const -> bool;
|
2017-05-16 14:16:50 +02:00
|
|
|
|
void SetHideMainPath(bool value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsDoublePassmark() const -> bool;
|
2017-04-05 12:22:33 +02:00
|
|
|
|
void SetDoublePassmark(bool value);
|
|
|
|
|
|
2017-05-12 14:09:19 +02:00
|
|
|
|
void SetCSVWithHeader(bool withHeader);
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetCSVWithHeader() const -> bool;
|
|
|
|
|
static auto GetDefCSVWithHeader() -> bool;
|
2017-05-12 14:09:19 +02:00
|
|
|
|
|
|
|
|
|
void SetCSVCodec(int mib);
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetCSVCodec() const -> int;
|
|
|
|
|
static auto GetDefCSVCodec() -> int;
|
2017-05-12 14:09:19 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
void SetCSVSeparator(const QChar &separator);
|
|
|
|
|
auto GetCSVSeparator() const -> QChar;
|
|
|
|
|
static auto GetDefCSVSeparator() -> QChar;
|
2017-05-12 14:09:19 +02:00
|
|
|
|
|
2017-07-02 10:14:01 +02:00
|
|
|
|
void SetDefaultSeamAllowance(double value);
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetDefaultSeamAllowance() -> double;
|
2017-07-02 10:14:01 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetLabelFont() const -> QFont;
|
|
|
|
|
void SetLabelFont(const QFont &f);
|
2017-07-02 10:14:01 +02:00
|
|
|
|
|
2023-06-22 17:30:43 +02:00
|
|
|
|
auto GetLabelSVGFont() const -> QString;
|
|
|
|
|
void SetLabelSVGFont(const QString &family);
|
|
|
|
|
|
|
|
|
|
auto GetSingleStrokeOutlineFont() const -> bool;
|
|
|
|
|
void SetSingleStrokeOutlineFont(bool value);
|
|
|
|
|
|
|
|
|
|
auto GetSingleLineFonts() const -> bool;
|
|
|
|
|
void SetSingleLineFonts(bool value);
|
|
|
|
|
|
2023-05-22 16:30:18 +02:00
|
|
|
|
auto GetPieceLabelFontPointSize() const -> int;
|
|
|
|
|
void SetPieceLabelFontPointSize(int size);
|
|
|
|
|
static auto MinPieceLabelFontPointSize() -> int;
|
|
|
|
|
|
|
|
|
|
auto GetPatternLabelFontSize() const -> int;
|
|
|
|
|
void SetPatternLabelFontSize(int size);
|
|
|
|
|
static auto GetDefPatternLabelFontSize() -> int;
|
2019-05-08 18:22:55 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetHideLabels() const -> bool;
|
2019-05-08 18:22:55 +02:00
|
|
|
|
void SetHideLabels(bool value);
|
|
|
|
|
|
2022-11-14 16:28:51 +01:00
|
|
|
|
auto GetShowAccuracyRadius() const -> bool;
|
|
|
|
|
void SetShowAccuracyRadius(bool value);
|
|
|
|
|
|
2017-02-17 19:54:16 +01:00
|
|
|
|
#if !defined(Q_OS_WIN)
|
|
|
|
|
static const QString unixStandardSharePath;
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetLabelDateFormat() const -> QString;
|
|
|
|
|
void SetLabelDateFormat(const QString &format);
|
2017-08-19 18:10:57 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
static auto PredefinedDateFormats() -> QStringList;
|
|
|
|
|
auto GetUserDefinedDateFormats() const -> QStringList;
|
|
|
|
|
void SetUserDefinedDateFormats(const QStringList &formats);
|
2017-08-19 18:10:57 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetLabelTimeFormat() const -> QString;
|
|
|
|
|
void SetLabelTimeFormat(const QString &format);
|
2017-08-19 18:10:57 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
static auto PredefinedTimeFormats() -> QStringList;
|
|
|
|
|
auto GetUserDefinedTimeFormats() const -> QStringList;
|
|
|
|
|
void SetUserDefinedTimeFormats(const QStringList &formats);
|
2017-08-19 18:10:57 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetCurveApproximationScale() const -> qreal;
|
|
|
|
|
void SetCurveApproximationScale(qreal value);
|
2017-10-11 12:51:06 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsShowCurveDetails() const -> bool;
|
2017-10-29 14:13:13 +01:00
|
|
|
|
void SetShowCurveDetails(bool value);
|
2018-02-06 18:30:27 +01:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsPieceShowMainPath() const -> bool;
|
2019-07-23 15:01:39 +02:00
|
|
|
|
void SetPieceShowMainPath(bool value);
|
2019-07-18 19:18:48 +02:00
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsDontUseNativeDialog() const -> bool;
|
2020-12-17 17:43:15 +01:00
|
|
|
|
void SetDontUseNativeDialog(bool value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
static auto DefaultLineWidth() -> qreal;
|
|
|
|
|
static auto MinimalLineWidth() -> qreal;
|
|
|
|
|
static auto MaximalLineWidth() -> qreal;
|
|
|
|
|
auto GetLineWidth() const -> qreal;
|
|
|
|
|
void SetLineWidth(qreal width);
|
|
|
|
|
auto WidthMainLine() const -> qreal;
|
|
|
|
|
auto WidthHairLine() const -> qreal;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
|
2020-12-23 14:29:55 +01:00
|
|
|
|
// settings for the tiled PDFs
|
2020-12-23 17:40:33 +01:00
|
|
|
|
auto GetTiledPDFMargins(const Unit &unit) const -> QMarginsF;
|
|
|
|
|
void SetTiledPDFMargins(const QMarginsF &value, const Unit &unit);
|
|
|
|
|
|
|
|
|
|
auto GetTiledPDFOrientation() const -> PageOrientation;
|
|
|
|
|
void SetTiledPDFOrientation(PageOrientation value);
|
|
|
|
|
|
2020-05-10 17:32:14 +02:00
|
|
|
|
static const int defaultScrollingDuration;
|
|
|
|
|
static const int scrollingDurationMin;
|
|
|
|
|
static const int scrollingDurationMax;
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetScrollingDuration() const -> int;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void SetScrollingDuration(int duration);
|
|
|
|
|
|
|
|
|
|
static const int defaultScrollingUpdateInterval;
|
|
|
|
|
static const int scrollingUpdateIntervalMin;
|
|
|
|
|
static const int scrollingUpdateIntervalMax;
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetScrollingUpdateInterval() const -> int;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void SetScrollingUpdateInterval(int updateInterval);
|
|
|
|
|
|
|
|
|
|
static const qreal defaultSensorMouseScale;
|
|
|
|
|
static const qreal sensorMouseScaleMin;
|
|
|
|
|
static const qreal sensorMouseScaleMax;
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetSensorMouseScale() const -> qreal;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void SetSensorMouseScale(qreal scale);
|
|
|
|
|
|
|
|
|
|
static const qreal defaultWheelMouseScale;
|
|
|
|
|
static const qreal wheelMouseScaleMin;
|
|
|
|
|
static const qreal wheelMouseScaleMax;
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetWheelMouseScale() const -> qreal;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void SetWheelMouseScale(qreal scale);
|
|
|
|
|
|
|
|
|
|
static const qreal defaultScrollingAcceleration;
|
|
|
|
|
static const qreal scrollingAccelerationMin;
|
|
|
|
|
static const qreal scrollingAccelerationMax;
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetScrollingAcceleration() const -> qreal;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void SetScrollingAcceleration(qreal acceleration);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto IsOpenGLRender() const -> bool;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void SetOpenGLRender(bool value);
|
|
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto GetGraphicalOutput() const -> bool;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void SetGraphicalOutput(const bool &value);
|
|
|
|
|
|
2021-09-11 18:39:38 +02:00
|
|
|
|
auto GetWatermarkEditorSize() const -> QSize;
|
2023-05-16 18:20:49 +02:00
|
|
|
|
void SetWatermarkEditorSize(const QSize &sz);
|
2021-09-11 18:39:38 +02:00
|
|
|
|
|
|
|
|
|
auto GetWatermarkCustomColors() const -> QVector<QColor>;
|
|
|
|
|
void SetWatermarkCustomColors(QVector<QColor> colors);
|
|
|
|
|
|
2023-06-27 13:15:21 +02:00
|
|
|
|
auto IsAskCollectStatistic() const -> bool;
|
|
|
|
|
void SetAskCollectStatistic(bool value);
|
|
|
|
|
|
|
|
|
|
auto IsCollectStatistic() const -> bool;
|
|
|
|
|
void SetCollectStatistic(bool value);
|
|
|
|
|
|
|
|
|
|
auto GetClientID() const -> QString;
|
|
|
|
|
void SetClientID(const QString &clientID);
|
|
|
|
|
|
2023-10-06 09:57:46 +02:00
|
|
|
|
auto IsTranslateFormula() const -> bool;
|
|
|
|
|
void SetTranslateFormula(bool value);
|
|
|
|
|
|
2023-10-23 15:57:22 +02:00
|
|
|
|
auto GetActionShortcuts(const QString &name, const QStringList &defaultShortcuts) -> QStringList;
|
|
|
|
|
void SetActionShortcuts(const QString &name, const QStringList &shortcuts);
|
|
|
|
|
|
2023-06-22 17:30:43 +02:00
|
|
|
|
signals:
|
|
|
|
|
void SVGFontsPathChanged(const QString &oldPath, const QString &newPath);
|
2023-10-28 08:55:21 +02:00
|
|
|
|
void KnownMeasurementsPathChanged(const QString &oldPath, const QString &newPath);
|
2023-06-22 17:30:43 +02:00
|
|
|
|
|
2020-05-10 17:32:14 +02:00
|
|
|
|
protected:
|
|
|
|
|
template <typename T>
|
2022-08-12 17:50:13 +02:00
|
|
|
|
static auto GetCachedValue(const QSettings &settings, T &cache, const QString &setting, T defValue, T valueMin,
|
|
|
|
|
T valueMax) -> T;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
|
|
|
|
|
template <class T>
|
2022-08-12 17:50:13 +02:00
|
|
|
|
static auto ValueOrDef(const QSettings &settings, const QString &setting, const T &defValue) -> T;
|
2020-05-10 17:32:14 +02:00
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
|
private:
|
2022-08-12 17:50:13 +02:00
|
|
|
|
Q_DISABLE_COPY_MOVE(VCommonSettings) // NOLINT
|
2015-07-15 09:16:59 +02:00
|
|
|
|
};
|
|
|
|
|
|
2018-02-06 18:30:27 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2022-08-12 17:50:13 +02:00
|
|
|
|
inline auto VCommonSettings::DefaultLineWidth() -> qreal
|
2018-02-06 18:30:27 +01:00
|
|
|
|
{
|
|
|
|
|
return 1.2; // mm
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2022-08-12 17:50:13 +02:00
|
|
|
|
inline auto VCommonSettings::MinimalLineWidth() -> qreal
|
2018-02-06 18:30:27 +01:00
|
|
|
|
{
|
|
|
|
|
return 0.5; // mm
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2022-08-12 17:50:13 +02:00
|
|
|
|
inline auto VCommonSettings::MaximalLineWidth() -> qreal
|
2018-02-06 18:30:27 +01:00
|
|
|
|
{
|
|
|
|
|
return 5.0; // mm
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-10 17:32:14 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-16 18:20:49 +02:00
|
|
|
|
template <typename T>
|
2022-08-12 17:50:13 +02:00
|
|
|
|
auto VCommonSettings::GetCachedValue(const QSettings &settings, T &cache, const QString &setting, T defValue,
|
|
|
|
|
T valueMin, T valueMax) -> T
|
2020-05-10 17:32:14 +02:00
|
|
|
|
{
|
|
|
|
|
if (cache < 0)
|
|
|
|
|
{
|
|
|
|
|
cache = qBound(valueMin, ValueOrDef(settings, setting, defValue), valueMax);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return cache;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
template <class T>
|
2022-08-12 17:50:13 +02:00
|
|
|
|
inline auto VCommonSettings::ValueOrDef(const QSettings &settings, const QString &setting, const T &defValue) -> T
|
2020-05-10 17:32:14 +02:00
|
|
|
|
{
|
|
|
|
|
const QVariant val = settings.value(setting, QVariant::fromValue(defValue));
|
|
|
|
|
return val.canConvert<T>() ? val.value<T>() : defValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
template <>
|
2023-05-16 18:20:49 +02:00
|
|
|
|
inline auto VCommonSettings::ValueOrDef<Cases>(const QSettings &settings, const QString &setting, const Cases &defValue)
|
|
|
|
|
-> Cases
|
2020-05-10 17:32:14 +02:00
|
|
|
|
{
|
|
|
|
|
const QVariant val = settings.value(setting, QVariant::fromValue(static_cast<int>(defValue)));
|
2022-08-12 17:50:13 +02:00
|
|
|
|
const int g = val.canConvert<int>() ? val.toInt() : static_cast<int>(defValue);
|
2020-05-10 17:32:14 +02:00
|
|
|
|
if (g < static_cast<int>(Cases::CaseThreeGroup) || g >= static_cast<int>(Cases::UnknownCase))
|
|
|
|
|
{
|
|
|
|
|
return defValue;
|
|
|
|
|
}
|
2022-08-12 17:50:13 +02:00
|
|
|
|
return static_cast<Cases>(g);
|
2020-05-10 17:32:14 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
|
#endif // VCOMMONSETTINGS_H
|