22class QStyleOptionViewItem;
108 QByteArray infosData;
109 QDataStream ostr { &infosData, QIODevice::WriteOnly };
112 mimeData->setData (name, infosData);
119 constexpr QColor
operator"" _rgb (
const char *str, std::size_t size)
122 throw std::runtime_error {
"invalid color size" };
124 constexpr auto digit = [] (
char digit)
126 if (digit >=
'0' && digit <=
'9')
128 if (digit >=
'a' && digit <=
'f')
129 return digit -
'a' + 0xa;
130 if (digit >=
'A' && digit <=
'F')
131 return digit -
'A' + 0xa;
133 throw std::runtime_error {
"unable to parse" };
136 constexpr auto group = [digit] (
const char *str)
138 return digit (str [0]) * 16 + digit (str [1]);
141 return QColor { group (str + 1), group (str + 3), group (str + 5) };
QLabel * ShowPixmapLabel(const QPixmap &srcPx, const QPoint &pos)
Shows a pixmap at the given pos.
QColor TintColors(const QColor &c1, const QColor &c2, double alpha)
Mixes two colors with the given weights.
void TintPalette(QWidget *widget, const QColor &color, double alpha, const QList< QPalette::ColorRole > &roles)
Mixes some of the widget's palette roles with the given color.
QString ElideProgressBarText(const QString &text, const QStyleOptionViewItem &option)
QPixmap DrawOverlayText(QPixmap px, const QString &text, QFont font, const QPen &pen, const QBrush &brush)
QIcon FixupTrayIcon(const QIcon &icon)
QString FormatName(const QString &name)
HTML-formats the name to let the user know it is not a part of the fixed dialog text.
void Save2MimeData(QMimeData *mimeData, const QString &name, const T &t)