36 static const ShapeNames result =
37 {{Qt::ArrowCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Arrow")},
38 {Qt::UpArrowCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Up Arrow")},
39 {Qt::CrossCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Cross")},
40 {Qt::WaitCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Wait")},
41 {Qt::IBeamCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"IBeam")},
42 {Qt::SizeVerCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Size Vertical")},
43 {Qt::SizeHorCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Size Horizontal")},
44 {Qt::SizeFDiagCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Size Backslash")},
45 {Qt::SizeBDiagCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Size Slash")},
46 {Qt::SizeAllCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Size All")},
47 {Qt::BlankCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Blank")},
48 {Qt::SplitVCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Split Vertical")},
49 {Qt::SplitHCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Split Horizontal")},
50 {Qt::PointingHandCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Pointing Hand")},
51 {Qt::ForbiddenCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Forbidden")},
52 {Qt::OpenHandCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Open Hand")},
53 {Qt::ClosedHandCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Closed Hand")},
54 {Qt::WhatsThisCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"What's This")},
55 {Qt::BusyCursor, QT_TRANSLATE_NOOP(
"QtCursorDatabase",
"Busy")}};
163 if constexpr (QOperatingSystemVersion::currentType() == QOperatingSystemVersion::Windows) {
164 appendCursor(Qt::ClosedHandCursor, getWindowsCursorIcon(
"closedhandcursor"_L1));
165 appendCursor(Qt::OpenHandCursor, getWindowsCursorIcon(
"openhandcursor"_L1));
166 appendCursor(Qt::SplitHCursor, getWindowsCursorIcon(
"splithcursor"_L1));
167 appendCursor(Qt::SplitVCursor, getWindowsCursorIcon(
"splitvcursor"_L1));
170 if constexpr (QOperatingSystemVersion::currentType() == QOperatingSystemVersion::MacOS) {
171 appendCursor(Qt::BusyCursor, getCocoaCursorIcon(
"spincursor.png"_L1));
172 appendCursor(Qt::WaitCursor, getCocoaCursorIcon(
"waitcursor.png"_L1));
175 appendCursor(Qt::BlankCursor, QIcon{});
177 for (
const auto &cursorResource : cursorResources) {
178 if (!hasCursor(cursorResource.first))
179 appendCursor(cursorResource.first, getResourceCursorIcon(cursorResource.second));
375 m_checkBox(
new QCheckBox(
this)),
378 auto *lt =
new QHBoxLayout;
379 if (QApplication::layoutDirection() == Qt::LeftToRight)
380 lt->setContentsMargins(4, 0, 0, 0);
382 lt->setContentsMargins(0, 0, 4, 0);
383 lt->addWidget(m_checkBox);
385 connect(m_checkBox, &QAbstractButton::toggled,
this, &QtBoolEdit::toggled);
386 setFocusProxy(m_checkBox);
387 m_checkBox->setText(tr(
"True"));
455 QPixmap result = createEmptyPixmap(size, scale);
456 QPainter painter(&result);
457 paint(&painter, QRect(0, 0, size.width(), size.height()), mode, state);