33 qDebug(log) << Q_FUNC_INFO;
37 Q_ASSERT(!(m_pFrmViewer && m_pScroll));
41 QMenu* pMenuZoom =
new QMenu(&m_Menu);
42 pMenuZoom->setTitle(tr(
"Zoom"));
43 pMenuZoom->setIcon(QIcon::fromTheme(
"zoom"));
44 m_pMenuZoom = m_Menu.addMenu(pMenuZoom);
45 m_pZoomToWindow = pMenuZoom->addAction(
46 QIcon::fromTheme(
"zoom-fit-best"), tr(
"Zoom to window"));
47 m_pZoomToWindow->setCheckable(
true);
48 check = connect(m_pZoomToWindow, &QAction::toggled,
this,
50 m_pScroll->slotSetAdaptWindows(
54 m_pZoomAspectRatio = pMenuZoom->addAction(
55 QIcon::fromTheme(
"zoom-aspect-ratio"),
56 tr(
"Keep aspect ration to windows"));
57 m_pZoomAspectRatio->setCheckable(
true);
58 check = connect(m_pZoomAspectRatio, &QAction::toggled,
this,
60 m_pScroll->slotSetAdaptWindows(
64 m_pZoomOriginal = pMenuZoom->addAction(
65 QIcon::fromTheme(
"zoom-original"), tr(
"Original"));
66 m_pZoomOriginal->setCheckable(
true);
67 check = connect(m_pZoomOriginal, &QAction::toggled,
this,
69 m_pScroll->slotSetAdaptWindows(
73 m_pZoomIn = pMenuZoom->addAction(QIcon::fromTheme(
"zoom-in"), tr(
"Zoom in"));
74 m_pZoomIn->setCheckable(
true);
76 m_pZoomIn, &QAction::toggled,
this,
79 m_psbZoomFactor->setValue((m_pFrmViewer->
GetZoomFactor() + 0.1) * 100);
82 m_pZoomOut = pMenuZoom->addAction(
83 QIcon::fromTheme(
"zoom-out"), tr(
"Zoom out"));
84 m_pZoomOut->setCheckable(
true);
86 m_pZoomOut, &QAction::toggled,
this,
89 m_psbZoomFactor->setValue((m_pFrmViewer->
GetZoomFactor() - 0.1) * 100);
92 QActionGroup* pGBViewZoom =
new QActionGroup(
this);
94 pGBViewZoom->addAction(m_pZoomToWindow);
95 pGBViewZoom->addAction(m_pZoomAspectRatio);
96 pGBViewZoom->addAction(m_pZoomOriginal);
97 pGBViewZoom->addAction(m_pZoomIn);
98 pGBViewZoom->addAction(m_pZoomOut);
100 m_psbZoomFactor =
new QSpinBox(pMenuZoom);
101 m_psbZoomFactor->setRange(0, 9999999);
102 m_psbZoomFactor->setValue(100);
103 m_psbZoomFactor->setSuffix(
"%");
104 m_psbZoomFactor->setEnabled(
false);
105 m_psbZoomFactor->setFocusPolicy(Qt::NoFocus);
107 m_psbZoomFactor, SIGNAL(valueChanged(
int)),
110 QWidgetAction* pFactor =
new QWidgetAction(pMenuZoom);
111 pFactor->setDefaultWidget(m_psbZoomFactor);
112 pMenuZoom->insertAction(m_pZoomOut, pFactor);
114 m_Menu.addSeparator();
115 m_pScreenShot =
new QAction(QIcon::fromTheme(
"camera-photo"),
117 check = connect(m_pScreenShot, SIGNAL(triggered()),
118 this, SLOT(slotScreenShot()));
120 m_Menu.addAction(m_pScreenShot);
122 m_pRecord =
new QAction(QIcon::fromTheme(
"media-record"), tr(
"Record"),
this);
123 m_pRecord->setCheckable(
true);
124 check = connect(m_pRecord, SIGNAL(toggled(
bool)),
125 this, SLOT(slotRecord(
bool)));
127 m_Menu.addAction(m_pRecord);
128 m_pRecordPause =
new QAction(QIcon::fromTheme(
"media-playback-pause"),
129 tr(
"Record pause"),
this);
130 m_pRecordPause->setCheckable(
true);
131 m_pRecordPause->setEnabled(
false);
132 check = connect(m_pRecordPause, SIGNAL(toggled(
bool)),
133 this, SIGNAL(sigRecordPause(
bool)));
135 m_Menu.addAction(m_pRecordPause);
138 m_Menu.addSeparator();
140 m_Menu.addAction(m_pSettings);