29 appendCursor(Qt::ArrowCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Arrow"),
30 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-arrow.png"_L1));
31 appendCursor(Qt::UpArrowCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Up Arrow"),
32 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-uparrow.png"_L1));
33 appendCursor(Qt::CrossCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Cross"),
34 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-cross.png"_L1));
35 appendCursor(Qt::WaitCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Wait"),
36 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-wait.png"_L1));
37 appendCursor(Qt::IBeamCursor, QCoreApplication::translate(
"QtCursorDatabase",
"IBeam"),
38 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-ibeam.png"_L1));
39 appendCursor(Qt::SizeVerCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Size Vertical"),
40 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-sizev.png"_L1));
41 appendCursor(Qt::SizeHorCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Size Horizontal"),
42 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-sizeh.png"_L1));
43 appendCursor(Qt::SizeFDiagCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Size Backslash"),
44 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-sizef.png"_L1));
45 appendCursor(Qt::SizeBDiagCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Size Slash"),
46 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-sizeb.png"_L1));
47 appendCursor(Qt::SizeAllCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Size All"),
48 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-sizeall.png"_L1));
49 appendCursor(Qt::BlankCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Blank"),
51 appendCursor(Qt::SplitVCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Split Vertical"),
52 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-vsplit.png"_L1));
53 appendCursor(Qt::SplitHCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Split Horizontal"),
54 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-hsplit.png"_L1));
55 appendCursor(Qt::PointingHandCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Pointing Hand"),
56 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-hand.png"_L1));
57 appendCursor(Qt::ForbiddenCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Forbidden"),
58 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-forbidden.png"_L1));
59 appendCursor(Qt::OpenHandCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Open Hand"),
60 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-openhand.png"_L1));
61 appendCursor(Qt::ClosedHandCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Closed Hand"),
62 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-closedhand.png"_L1));
63 appendCursor(Qt::WhatsThisCursor, QCoreApplication::translate(
"QtCursorDatabase",
"What's This"),
64 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-whatsthis.png"_L1));
65 appendCursor(Qt::BusyCursor, QCoreApplication::translate(
"QtCursorDatabase",
"Busy"),
66 QIcon(
":/qt-project.org/qtpropertybrowser/images/cursor-busy.png"_L1));
140 QImage img(16, 16, QImage::Format_ARGB32_Premultiplied);
143 QPainter painter(&img);
144 painter.setCompositionMode(QPainter::CompositionMode_Source);
145 painter.fillRect(0, 0, img.width(), img.height(), b);
146 QColor color = b.color();
147 if (color.alpha() != 255) {
148 QBrush opaqueBrush = b;
150 opaqueBrush.setColor(color);
151 painter.fillRect(img.width() / 4, img.height() / 4,
152 img.width() / 2, img.height() / 2, opaqueBrush);
155 return QPixmap::fromImage(img);
172 QImage img(16, 16, QImage::Format_ARGB32_Premultiplied);
175 p.setRenderHint(QPainter::TextAntialiasing,
true);
176 p.setRenderHint(QPainter::Antialiasing,
true);
180 t.setAlignment(Qt::AlignCenter);
181 p.drawText(QRect(0, 0, 16, 16), QString(QLatin1Char(
'A')), t);
182 return QPixmap::fromImage(img);
223 m_checkBox(
new QCheckBox(
this)),
226 auto *lt =
new QHBoxLayout;
227 if (QApplication::layoutDirection() == Qt::LeftToRight)
228 lt->setContentsMargins(4, 0, 0, 0);
230 lt->setContentsMargins(0, 0, 4, 0);
231 lt->addWidget(m_checkBox);
233 connect(m_checkBox, &QAbstractButton::toggled,
this, &QtBoolEdit::toggled);
234 setFocusProxy(m_checkBox);
235 m_checkBox->setText(tr(
"True"));