8#include <QtCore/qlist.h>
9#include <QtCore/qstring.h>
10#include <QtCore/qvariant.h>
11#include <QtCore/qmap.h>
13#include <QtGui/qevent.h>
14#include <QtGui/qpainter.h>
16#include <QtWidgets/qwidget.h>
31 static inline void valueToVariantMap(T value, T defaultValue,
const QString &key, QVariantMap &v,
bool forceKey) {
32 if (forceKey || value != defaultValue)
33 v.insert(key, QVariant(value));
39 const auto it = v.constFind(key);
40 const bool found = it != v.constEnd();
42 value = qvariant_cast<T>(it.value());
69 qWarning(
"Attempt to set invalid grid with a spacing of 0.");
static const bool defaultVisible
static const char * KEY_DELTAY
static const int DEFAULT_GRID
static const char * KEY_SNAPX
static void valueToVariantMap(T value, T defaultValue, const QString &key, QVariantMap &v, bool forceKey)
static const char * KEY_DELTAX
static QT_BEGIN_NAMESPACE const bool defaultSnap
static const char * KEY_SNAPY
static const char * KEY_VISIBLE
static bool valueFromVariantMap(const QVariantMap &v, const QString &key, T &value)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.