23class QStyleOptionViewItem;
87 const QList<QPalette::ColorRole>& roles = { QPalette::ColorRole::Text, QPalette::ColorRole::WindowText });
109 QByteArray infosData;
110 QDataStream ostr { &infosData, QIODevice::WriteOnly };
113 mimeData->setData (name, infosData);
120 constexpr QColor
operator"" _rgb (
const char *str, std::size_t size)
123 throw std::runtime_error {
"invalid color size" };
125 constexpr auto digit = [] (
char digit)
127 if (digit >=
'0' && digit <=
'9')
129 if (digit >=
'a' && digit <=
'f')
130 return digit -
'a' + 0xa;
131 if (digit >=
'A' && digit <=
'F')
132 return digit -
'A' + 0xa;
134 throw std::runtime_error {
"unable to parse" };
137 constexpr auto group = [digit] (
const char *str)
139 return digit (str [0]) * 16 + digit (str [1]);
142 return QColor { group (str + 1), group (str + 3), group (str + 5) };
QLabel * ShowPixmapLabel(const QPixmap &srcPx, const QPoint ¢erPos)
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)