QCAD
Open Source 2D CAD
RSettings Class Reference

#include <RSettings.h>

Static Public Member Functions

static void addRecentFile (const QString &fileName)
 Adds a recent file to the list of recent files. More...
 
static void clearRecentFiles ()
 Clears the list of recent files. More...
 
static QStringList getAllKeys (const QString &group)
 
static bool getAllowMouseMoveInterruptions ()
 
static QString getAppId ()
 App ID used for DXF/DWG exports / imports to identify app XData. More...
 
static QString getApplicationPath ()
 
static double getArcAngleLengthThreshold ()
 
static bool getAutoScaleGrid ()
 
static bool getAutoScaleLinetypePatterns ()
 
static bool getAutoScaleMetaGrid ()
 
static bool getAutoScalePatterns ()
 
static bool getAutoZoomOnLoad ()
 
static bool getBoolValue (const QString &key, bool defaultValue)
 
static int getBuildVersion ()
 
static QString getCacheLocation ()
 
static RColor getColor (const QString &key, const RColor &defaultValue=RDEFAULT_RCOLOR)
 
static bool getColorCorrection ()
 
static int getColorThreshold ()
 
static RColor getColorValue (const QString &key, const RColor &defaultValue)
 
static QString getCompilerVersion ()
 
static bool getConcurrentDrawing ()
 
static int getCurrentVersion ()
 
static int getDashThreshold ()
 
static QString getDataLocation ()
 
static QString getDefaultPrinterName ()
 
static QString getDesktopLocation ()
 
static double getDevicePixelRatio ()
 
static QString getDocumentsLocation ()
 
static double getDoubleValue (const QString &key, double defaultValue)
 
static QString getFileName ()
 
static bool getHideAttributeWithBlock ()
 
static bool getHighResolutionGraphicsView ()
 
static QString getHomeLocation ()
 
static bool getIgnoreAllReferencePoints ()
 
static bool getIgnoreBlockReferencePoint ()
 
static bool getImportRecomputedDimBlocks ()
 
static QFont getInfoLabelFont ()
 
static int getIntValue (const QString &key, int defaultValue)
 
static QString getLaunchPath ()
 
static bool getLimitZoomAndScroll ()
 
static QString getLocale ()
 
static int getMajorVersion ()
 
static double getMinArcAngleStep ()
 
static int getMinorVersion ()
 
static int getMouseThreshold ()
 
static QLocale getNumberLocale ()
 
static QString getNumericalVersionString ()
 
static QStringList getOriginalArguments ()
 
static QString getOSVersion ()
 
static QString getPath ()
 
static int getPickRange ()
 
static QString getPluginPath ()
 
static QStringList getPluginPaths ()
 
static bool getPositionByMousePress ()
 
static int getPreviewEntities ()
 
static int getPreviousVersion ()
 
static QStringList getPrinterNames ()
 
static QSettings * getQSettings ()
 
static int getQtVersion ()
 
static QString getQtVersionString ()
 
static QStringList getRecentFiles ()
 
static RColor getReferencePointColor ()
 
static QString getReleaseDate ()
 
static QString getRevisionString ()
 
static int getRevisionVersion ()
 
static QFont getRulerFont ()
 
static RColor getSecondaryReferencePointColor ()
 
static bool getSelectBlockWithAttribute ()
 
static RColor getSelectionColor ()
 
static bool getShowCrosshair ()
 
static bool getShowLargeCrosshair ()
 
static bool getShowLargeOriginAxis ()
 
static QFont getSnapLabelFont ()
 
static int getSnapRange ()
 
static QString getStandardLocation (int sl)
 
static QFont getStatusBarFont ()
 
static QStringList getStringListValue (const QString &key, const QStringList &defaultValue)
 
static QString getStringValue (const QString &key, const QString &defaultValue)
 
static QString getTempLocation ()
 
static int getTextHeightThreshold ()
 
static bool getUseSecondarySelectionColor ()
 
static bool getUseSolidLineSelection ()
 
static QVariant getValue (const QString &key, const QVariant &defaultValue=RDEFAULT_QVARIANT)
 
static QString getVersionString ()
 
static int getZeroWeightWeight ()
 
static bool hasApplicationNameOverride ()
 
static bool hasCustomStyleSheet ()
 
static bool hasDarkGuiBackground ()
 
static bool hasQuitFlag ()
 
static bool hasValue (const QString &key)
 
static void initRecentFiles ()
 Initializes the recent files list (recentFiles). More...
 
static bool isDebuggerEnabled ()
 
static bool isDeployed ()
 
static bool isFirstStart ()
 
static bool isGuiEnabled ()
 
static bool isLayer0CompatibilityOn ()
 
static bool isNewVersion ()
 
static bool isNextVersionEnabled ()
 
static bool isQt (int majorVersion)
 
static bool isTextRenderedAsText ()
 
static bool isXDataEnabled ()
 
static void loadTranslations (const QString &module, const QStringList &dirs=RDEFAULT_QSTRINGLIST)
 Loads the translations for the given module. More...
 
static void removeRecentFile (const QString &fileName)
 Removes the given file from the list of recent files. More...
 
static void removeValue (const QString &key)
 Removes the value for the given key. More...
 
static void resetCache ()
 
static void setApplicationNameOverride (const QString &n)
 Sets the application name override used for the configuration file name (e.g. More...
 
static void setConcurrentDrawing (bool on)
 
static void setFirstStart (bool on)
 
static void setLaunchPath (const QString &launchPath)
 
static void setNewVersion (bool on)
 
static void setNextVersionEnabled (bool on)
 
static void setNoWrite (bool on=true)
 
static void setOriginalArguments (const QStringList &a)
 
static void setPreviousVersion (int pv)
 
static void setQuitFlag ()
 
static void setRulerFont (const QFont &font)
 
static void setShowCrosshair (bool on)
 
static void setShowLargeCrosshair (bool on)
 
static void setShowLargeOriginAxis (bool on)
 
static void setSnapLabelFont (const QFont &font)
 
static void setValue (const QString &key, const QVariant &value, bool overwrite=true)
 Sets the variable with the given key and value, overwriting an existing value if overwrite is true (default). More...
 
static void setXDataEnabled (bool on)
 
static QString translate (const QString &context, const QString &str)
 Translates the given string for the given context. More...
 
static void uninit ()
 

Static Private Member Functions

static bool isInitialized ()
 
static void shortenRecentFiles ()
 Purges recent files that exceed the RecentFiles/RecentFilesSize limit. More...
 

Static Private Attributes

static int allowMouseMoveInterruptions = -1
 
static QString applicationNameOverride
 
static double arcAngleLengthThreshold = -1
 
static int autoScaleLinetypePattern = -1
 
static QVariantMap cache
 
static int concurrentDrawing = -1
 
static int darkGuiBackground = -1
 
static int dashThreshold = -1
 
static bool firstStart = false
 
static int hideAttributeWithBlock = -1
 
static int highResolutionGraphicsView = -1
 
static int ignoreAllReferencePoints = -1
 
static int ignoreBlockReferencePoint = -1
 
static int importRecomputedDimBlocks = -1
 
static QFont * infoLabelFont = NULL
 
static QString launchPath
 
static int layer0CompatibilityOn = -1
 
static int limitZoomAndScroll = -1
 
static double minArcAngleStep = -1
 
static int mouseThreshold = -1
 
static bool newVersion = false
 
static bool nextVersionEnabled = false
 
static bool noWrite = false
 Copyright (c) 2011-2016 by Andrew Mustun. More...
 
static QLocale * numberLocale = NULL
 
static QStringList originalArguments
 
static int pickRange = -1
 
static int positionByMousePress = -1
 
static int previewEntities = -1
 
static int previousVersion = 0
 
static QSettings * qSettings = NULL
 
static bool quitFlag = false
 
static QStringList recentFiles
 
static RColorreferencePointColor = NULL
 
static QFont * rulerFont = NULL
 
static RColorsecondaryReferencePointColor = NULL
 
static int selectBlockWithAttribute = -1
 
static RColorselectionColor = NULL
 
static int showCrosshair = -1
 
static int showLargeCrosshair = -1
 
static int showLargeOriginAxis = -1
 
static QFont * snapLabelFont = NULL
 
static int snapRange = -1
 
static QFont * statusBarFont = NULL
 
static int textRenderedAsText = -1
 
static int useSecondarySelectionColor = -1
 
static int useSolidLineSelection = -1
 
static bool xDataEnabled = false
 
static int zeroWeightWeight = -1
 

Detailed Description

Scriptable:
This class is available in script environments.

Member Function Documentation

void RSettings::addRecentFile ( const QString &  fileName)
static

Adds a recent file to the list of recent files.

The newest file is always at the end of the list.

void RSettings::clearRecentFiles ( )
static

Clears the list of recent files.

QStringList RSettings::getAllKeys ( const QString &  group)
static
Returns
List of all keys stored in the application settings file.
bool RSettings::getAllowMouseMoveInterruptions ( )
static
QString RSettings::getAppId ( )
static

App ID used for DXF/DWG exports / imports to identify app XData.

QString RSettings::getApplicationPath ( )
static
Returns
Path where all application resources are stored ('scripts', 'patterns', 'ts', 'doc', 'linetypes', ...)
double RSettings::getArcAngleLengthThreshold ( )
static
bool RSettings::getAutoScaleGrid ( )
static
bool RSettings::getAutoScaleLinetypePatterns ( )
static
bool RSettings::getAutoScaleMetaGrid ( )
static
bool RSettings::getAutoScalePatterns ( )
static
bool RSettings::getAutoZoomOnLoad ( )
static
bool RSettings::getBoolValue ( const QString &  key,
bool  defaultValue 
)
static
Returns
Value of the given setting as boolean or defaultValue.
int RSettings::getBuildVersion ( )
static
QString RSettings::getCacheLocation ( )
static
Returns
Standard path for caches.
RColor RSettings::getColor ( const QString &  key,
const RColor defaultValue = RDEFAULT_RCOLOR 
)
static
Returns
Value of the given setting as color or defaultValue.
bool RSettings::getColorCorrection ( )
static
int RSettings::getColorThreshold ( )
static
RColor RSettings::getColorValue ( const QString &  key,
const RColor defaultValue 
)
static
Returns
Value of the given setting as color or defaultValue.
QString RSettings::getCompilerVersion ( )
static
Returns
Compiler name and version as human readable string.
bool RSettings::getConcurrentDrawing ( )
static
static int RSettings::getCurrentVersion ( )
inlinestatic
Returns
Current version as int in format 11223344 where 11 is the major version, 22 the minor version, 33 the revision and 44 the build version.
int RSettings::getDashThreshold ( )
static
QString RSettings::getDataLocation ( )
static
Returns
Standard path for user data.
QString RSettings::getDefaultPrinterName ( )
static
QString RSettings::getDesktopLocation ( )
static
Returns
Standard path for user desktop files.
double RSettings::getDevicePixelRatio ( )
static
Returns
Device pixel ratio of the display. Usually 1 or 2 (for retina/high res displays).
QString RSettings::getDocumentsLocation ( )
static
Returns
Standard path for user documents.
double RSettings::getDoubleValue ( const QString &  key,
double  defaultValue 
)
static
Returns
Value of the given setting as double or defaultValue.
QString RSettings::getFileName ( )
static
Returns
File name of the application settings file (.ini or .conf).
bool RSettings::getHideAttributeWithBlock ( )
static
bool RSettings::getHighResolutionGraphicsView ( )
static
QString RSettings::getHomeLocation ( )
static
Returns
Standard path for user home.
bool RSettings::getIgnoreAllReferencePoints ( )
static
Returns
True if dragging reference points should be treated like dragging the whole selection.
bool RSettings::getIgnoreBlockReferencePoint ( )
static
Returns
True if dragging the reference points of selected block references should be treated like dragging the whole selection.
bool RSettings::getImportRecomputedDimBlocks ( )
static
QFont RSettings::getInfoLabelFont ( )
static
int RSettings::getIntValue ( const QString &  key,
int  defaultValue 
)
static
Returns
Value of the given setting as int or defaultValue.
QString RSettings::getLaunchPath ( )
static
Returns
Path from where the application was launched (can be any path).
bool RSettings::getLimitZoomAndScroll ( )
static
QString RSettings::getLocale ( )
static
Returns
Locale to be used for translations ('en', 'de', 'de_DE', ...)
int RSettings::getMajorVersion ( )
static
double RSettings::getMinArcAngleStep ( )
static
int RSettings::getMinorVersion ( )
static
int RSettings::getMouseThreshold ( )
static
QLocale RSettings::getNumberLocale ( )
static
QString RSettings::getNumericalVersionString ( )
static
Returns
Application version as 01020304 for 1.2.3.4
QStringList RSettings::getOriginalArguments ( )
static
Returns
List of arguments passed to the application binary.
QString RSettings::getOSVersion ( )
static
Returns
OS name and version as human readable string.
QString RSettings::getPath ( )
static
Returns
Path where the configuration file is stored.
int RSettings::getPickRange ( )
static
QString RSettings::getPluginPath ( )
static
Returns
Path to the application plugins folder.
QStringList RSettings::getPluginPaths ( )
static
Returns
List of all plugin paths for application plugins and add on plugins in the application data location (for user specific plugins).
bool RSettings::getPositionByMousePress ( )
static
int RSettings::getPreviewEntities ( )
static
static int RSettings::getPreviousVersion ( )
inlinestatic
QStringList RSettings::getPrinterNames ( )
static
QSettings * RSettings::getQSettings ( )
static
Returns
Pointer to underlying QSettings object.
int RSettings::getQtVersion ( )
static
Returns
Qt version as int (Qt 1.2.3 -> 0x010203).
QString RSettings::getQtVersionString ( )
static
Returns
Qt version as human readable string ("1.2.3").
QStringList RSettings::getRecentFiles ( )
static
Returns
List of recent files.
RColor RSettings::getReferencePointColor ( )
static
QString RSettings::getReleaseDate ( )
static
QString RSettings::getRevisionString ( )
static
Returns
Git revision number, stored in file revision.txt for deployed applications.
int RSettings::getRevisionVersion ( )
static
QFont RSettings::getRulerFont ( )
static
RColor RSettings::getSecondaryReferencePointColor ( )
static
bool RSettings::getSelectBlockWithAttribute ( )
static
RColor RSettings::getSelectionColor ( )
static
bool RSettings::getShowCrosshair ( )
static
bool RSettings::getShowLargeCrosshair ( )
static
bool RSettings::getShowLargeOriginAxis ( )
static
QFont RSettings::getSnapLabelFont ( )
static
int RSettings::getSnapRange ( )
static
QString RSettings::getStandardLocation ( int  sl)
static
Returns
Standard path for the given standard location.
Parameters
slQStandardPaths::StandardLocation or QDesktopServices::StandardLocation
QFont RSettings::getStatusBarFont ( )
static
QStringList RSettings::getStringListValue ( const QString &  key,
const QStringList &  defaultValue 
)
static
Returns
Value of the given setting as string list or defaultValue.
QString RSettings::getStringValue ( const QString &  key,
const QString &  defaultValue 
)
static
Returns
Value of the given setting as string or defaultValue.
QString RSettings::getTempLocation ( )
static
Returns
Standard path for temporary files.
int RSettings::getTextHeightThreshold ( )
static
bool RSettings::getUseSecondarySelectionColor ( )
static
bool RSettings::getUseSolidLineSelection ( )
static
QVariant RSettings::getValue ( const QString &  key,
const QVariant &  defaultValue = RDEFAULT_QVARIANT 
)
static
Returns
Value of the given setting as variant or defaultValue.
QString RSettings::getVersionString ( )
static
Returns
Application version as human readable string.
int RSettings::getZeroWeightWeight ( )
static
bool RSettings::hasApplicationNameOverride ( )
static
bool RSettings::hasCustomStyleSheet ( )
static
bool RSettings::hasDarkGuiBackground ( )
static
bool RSettings::hasQuitFlag ( )
static
Returns
True if -quit was passed to the application binary.
bool RSettings::hasValue ( const QString &  key)
static
Returns
True if the given key is available in the application settings file.
void RSettings::initRecentFiles ( )
static

Initializes the recent files list (recentFiles).

bool RSettings::isDebuggerEnabled ( )
static
Returns
True if the script debugger is enabled.
bool RSettings::isDeployed ( )
static
Returns
True if the application is deployed and all resources are inside the App bundle. This always returns true if the OS is not a Mac OS.
static bool RSettings::isFirstStart ( )
inlinestatic
bool RSettings::isGuiEnabled ( )
static
Returns
True if the GUI is enabled (no -no-gui switch present). The GUI is typically disabled for command line tools.
bool RSettings::isInitialized ( )
staticprivate
bool RSettings::isLayer0CompatibilityOn ( )
static
static bool RSettings::isNewVersion ( )
inlinestatic
bool RSettings::isNextVersionEnabled ( )
static
bool RSettings::isQt ( int  majorVersion)
static
Returns
True if application was compiled against the given major Qt version.
bool RSettings::isTextRenderedAsText ( )
static
bool RSettings::isXDataEnabled ( )
static
void RSettings::loadTranslations ( const QString &  module,
const QStringList &  dirs = RDEFAULT_QSTRINGLIST 
)
static

Loads the translations for the given module.

Parameters
moduleModule name ('qcadcore', 'qcadentity', ...)
dirsList of directories to look for translation files or empty to check default directories.
void RSettings::removeRecentFile ( const QString &  fileName)
static

Removes the given file from the list of recent files.

void RSettings::removeValue ( const QString &  key)
static

Removes the value for the given key.

void RSettings::resetCache ( )
static
void RSettings::setApplicationNameOverride ( const QString &  n)
static

Sets the application name override used for the configuration file name (e.g.

QCAD3).

void RSettings::setConcurrentDrawing ( bool  on)
static
static void RSettings::setFirstStart ( bool  on)
inlinestatic
void RSettings::setLaunchPath ( const QString &  launchPath)
static
static void RSettings::setNewVersion ( bool  on)
inlinestatic
void RSettings::setNextVersionEnabled ( bool  on)
static
void RSettings::setNoWrite ( bool  on = true)
static
void RSettings::setOriginalArguments ( const QStringList &  a)
static
static void RSettings::setPreviousVersion ( int  pv)
inlinestatic
void RSettings::setQuitFlag ( )
static
void RSettings::setRulerFont ( const QFont &  font)
static
void RSettings::setShowCrosshair ( bool  on)
static
void RSettings::setShowLargeCrosshair ( bool  on)
static
void RSettings::setShowLargeOriginAxis ( bool  on)
static
void RSettings::setSnapLabelFont ( const QFont &  font)
static
void RSettings::setValue ( const QString &  key,
const QVariant &  value,
bool  overwrite = true 
)
static

Sets the variable with the given key and value, overwriting an existing value if overwrite is true (default).

void RSettings::setXDataEnabled ( bool  on)
static
void RSettings::shortenRecentFiles ( )
staticprivate

Purges recent files that exceed the RecentFiles/RecentFilesSize limit.

QString RSettings::translate ( const QString &  context,
const QString &  str 
)
static

Translates the given string for the given context.

void RSettings::uninit ( )
static

Member Data Documentation

int RSettings::allowMouseMoveInterruptions = -1
staticprivate
QString RSettings::applicationNameOverride
staticprivate
double RSettings::arcAngleLengthThreshold = -1
staticprivate
int RSettings::autoScaleLinetypePattern = -1
staticprivate
QVariantMap RSettings::cache
staticprivate
int RSettings::concurrentDrawing = -1
staticprivate
int RSettings::darkGuiBackground = -1
staticprivate
int RSettings::dashThreshold = -1
staticprivate
bool RSettings::firstStart = false
staticprivate
int RSettings::hideAttributeWithBlock = -1
staticprivate
int RSettings::highResolutionGraphicsView = -1
staticprivate
int RSettings::ignoreAllReferencePoints = -1
staticprivate
int RSettings::ignoreBlockReferencePoint = -1
staticprivate
int RSettings::importRecomputedDimBlocks = -1
staticprivate
QFont * RSettings::infoLabelFont = NULL
staticprivate
QString RSettings::launchPath
staticprivate
int RSettings::layer0CompatibilityOn = -1
staticprivate
int RSettings::limitZoomAndScroll = -1
staticprivate
double RSettings::minArcAngleStep = -1
staticprivate
int RSettings::mouseThreshold = -1
staticprivate
bool RSettings::newVersion = false
staticprivate
bool RSettings::nextVersionEnabled = false
staticprivate
bool RSettings::noWrite = false
staticprivate

Copyright (c) 2011-2016 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD 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.

QCAD 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 QCAD.

QLocale * RSettings::numberLocale = NULL
staticprivate
QStringList RSettings::originalArguments
staticprivate
int RSettings::pickRange = -1
staticprivate
int RSettings::positionByMousePress = -1
staticprivate
int RSettings::previewEntities = -1
staticprivate
int RSettings::previousVersion = 0
staticprivate
QSettings * RSettings::qSettings = NULL
staticprivate
bool RSettings::quitFlag = false
staticprivate
QStringList RSettings::recentFiles
staticprivate
RColor * RSettings::referencePointColor = NULL
staticprivate
QFont * RSettings::rulerFont = NULL
staticprivate
RColor * RSettings::secondaryReferencePointColor = NULL
staticprivate
int RSettings::selectBlockWithAttribute = -1
staticprivate
RColor * RSettings::selectionColor = NULL
staticprivate
int RSettings::showCrosshair = -1
staticprivate
int RSettings::showLargeCrosshair = -1
staticprivate
int RSettings::showLargeOriginAxis = -1
staticprivate
QFont * RSettings::snapLabelFont = NULL
staticprivate
int RSettings::snapRange = -1
staticprivate
QFont * RSettings::statusBarFont = NULL
staticprivate
int RSettings::textRenderedAsText = -1
staticprivate
int RSettings::useSecondarySelectionColor = -1
staticprivate
int RSettings::useSolidLineSelection = -1
staticprivate
bool RSettings::xDataEnabled = false
staticprivate
int RSettings::zeroWeightWeight = -1
staticprivate

The documentation for this class was generated from the following files: