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