8#include "helperqttypes.h"
10#include <QtCore/qsharedpointer.h>
13#include <qcontainerfwd.h>
14#include <qcoreapplication.h>
20#include <qmetaobject.h>
24#include <qstringliteral.h>
46void drawQWidgetStyleSheetAware(
QWidget *widget);
50ColorSchemeType guessColorSchemeTypeFromWidget(
QWidget *widget);
65template<
typename First,
typename... T>
66bool isIn(First &&first, T &&...t)
69 return ((first == t) || ...);
72[[nodiscard]] qreal standardWheelStepCount(QWheelEvent *event);
74[[nodiscard]] QImage transparencyBackground(qreal devicePixelRatioF);
98 Array2D(QListSizeType iCount, QListSizeType jCount)
108 const auto elementCount = m_iCount * m_jCount;
109 m_data.reserve(elementCount);
110 for (QListSizeType i = 0; i < elementCount; ++i) {
121 Array2D(QListSizeType iCount, QListSizeType jCount, QList<T> init)
131 const auto elementCount = m_iCount * m_jCount;
132 m_data.reserve(elementCount);
133 for (QListSizeType i = 0; i < elementCount; ++i) {
134 if (i <
init.count()) {
135 m_data.append(
init.value(i));
146 Array2D &operator=(
const Array2D &other) =
default;
152 Array2D &operator=(Array2D &&other) =
default;
155 Array2D(
const Array2D &other) =
default;
158 Array2D(Array2D &&other) =
default;
165 bool operator==(
const Array2D &other)
const
168 (m_data == other.m_data)
169 && (m_iCount == other.m_iCount)
170 && (m_jCount == other.m_jCount)
179 bool operator!=(
const Array2D &other)
const
181 return !(*
this == other);
189 void setValue(QListSizeType i, QListSizeType j,
const T &value)
191 if (isInRange<QListSizeType>(0, i, m_iCount - 1)
192 && isInRange<QListSizeType>(0, j, m_jCount - 1)
194 m_data[i + m_iCount * j] = value;
209 QList<T> toQList()
const
220 T value(QListSizeType i, QListSizeType j)
const
222 if (isInRange<QListSizeType>(0, i, m_iCount - 1)
223 && isInRange<QListSizeType>(0, j, m_jCount - 1)
225 return m_data[i + m_iCount * j];
233 QListSizeType iCount()
const
241 QListSizeType jCount()
const
250 QListSizeType m_iCount;
252 QListSizeType m_jCount;
285template<
typename T =
void>
286void delayedEventProcessing(
unsigned long msecWaitInitially = 50,
unsigned long msecWaitBetweenEventLoopPasses = 50,
int numberEventLoopPasses = 3)
290 msecWaitInitially = qMax<unsigned long>(
293 msecWaitBetweenEventLoopPasses =
294 qMax<unsigned long>(msecWaitBetweenEventLoopPasses, 15);
298 for (
int i = 0; i < numberEventLoopPasses; ++i) {
309[[nodiscard]] QPair<QString, QString> getPrefixSuffix(
const QString &formatString);
327 return QStringLiteral(
"%1::%2").arg(scope, name);
353 const auto value =
static_cast<int>(enumerator);
362 if (!myMeta.valueToKey(value)) {
369 return QStringLiteral(
"%1::%2::%3(%4)").arg(scope, name, keys).arg(value);
395 const auto value =
static_cast<int>(enumerator);
404 if (!myMeta.valueToKey(value)) {
409 return QStringLiteral(
"%1(%2)").arg(keys).arg(value);
The namespace of this library.
QString enumerationToFullString()
The full-qualified C++ identifier as QString.
Array2D< QColor > Swatches
Swatches organized in a grid.
QString enumeratorToString(const T &enumerator)
The C++ identifier as QString.
QString enumeratorToFullString(const T &enumerator)
The full-qualified C++ identifier as QString.
ColorSchemeType
Represents the appearance of a theme.
Swatches wcsBasicColors(const QSharedPointer< PerceptualColor::RgbColorSpace > &colorSpace)
Swatch grid derived from the basic colors as by WCS (World color survey).
QMap< cmsUInt32Number, QString > lcmsIntentList()
The rendering intents supported by the LittleCMS library.
void processEvents(QEventLoop::ProcessEventsFlags flags)
QString fromUtf8(QByteArrayView str)
void msleep(unsigned long msecs)