MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / PieMenu

Method PieMenu

src/gui/widgets/pie_menu.cpp:38–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36namespace OpenOrienteering {
37
38PieMenu::PieMenu(QWidget* parent)
39: QWidget(parent, Qt::Popup | Qt::FramelessWindowHint), // NOTE: use Qt::Window for debugging to avoid mouse grab
40 minimum_action_count(3),
41 icon_size(24),
42 active_action(nullptr),
43 actions_changed(true),
44 clicked(false)
45{
46 setCursor(QCursor(Qt::ArrowCursor));
47 setAttribute(Qt::WA_OpaquePaintEvent);
48 setAttribute(Qt::WA_ShowWithoutActivating);
49 setAutoFillBackground(false);
50 setMouseTracking(true);
51
52 auto scale = Settings::getInstance().getSetting(Settings::General_PixelsPerInch).toReal() / 96.0;
53 if (scale > 1.5)
54 {
55 icon_size = qRound(icon_size * scale);
56 }
57
58 updateCachedState();
59}
60
61int PieMenu::minimumActionCount() const
62{

Callers

nothing calls this directly

Calls 2

QCursorClass · 0.50
getSettingMethod · 0.45

Tested by

no test coverage detected