Adds hotkey CTRL + F for both CaptureWin and main Capture menu. Resets the scaling of CaptureWin to fit frame size. Signed-off-by: Bård Eirik Winther <bwinther@xxxxxxxxx> --- utils/qv4l2/capture-win.cpp | 3 +++ utils/qv4l2/capture-win.h | 1 + utils/qv4l2/qv4l2.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/utils/qv4l2/capture-win.cpp b/utils/qv4l2/capture-win.cpp index 3bd6549..3abb6cb 100644 --- a/utils/qv4l2/capture-win.cpp +++ b/utils/qv4l2/capture-win.cpp @@ -38,6 +38,8 @@ CaptureWin::CaptureWin() : setWindowTitle("V4L2 Capture"); m_hotkeyClose = new QShortcut(Qt::CTRL+Qt::Key_W, this); connect(m_hotkeyClose, SIGNAL(activated()), this, SLOT(close())); + m_hotkeyScaleReset = new QShortcut(Qt::CTRL+Qt::Key_F, this); + connect(m_hotkeyScaleReset, SIGNAL(activated()), this, SLOT(resetSize())); } CaptureWin::~CaptureWin() @@ -48,6 +50,7 @@ CaptureWin::~CaptureWin() layout()->removeWidget(this); delete layout(); delete m_hotkeyClose; + delete m_hotkeyScaleReset; } void CaptureWin::buildWindow(QWidget *videoSurface) diff --git a/utils/qv4l2/capture-win.h b/utils/qv4l2/capture-win.h index eea0335..1bfb1e1 100644 --- a/utils/qv4l2/capture-win.h +++ b/utils/qv4l2/capture-win.h @@ -104,6 +104,7 @@ signals: private: QShortcut *m_hotkeyClose; + QShortcut *m_hotkeyScaleReset; int m_curWidth; int m_curHeight; }; diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp index 1a476f0..c94b0a8 100644 --- a/utils/qv4l2/qv4l2.cpp +++ b/utils/qv4l2/qv4l2.cpp @@ -144,6 +144,7 @@ ApplicationWindow::ApplicationWindow() : connect(m_scalingAct, SIGNAL(toggled(bool)), this, SLOT(enableScaling(bool))); m_resetScalingAct = new QAction("Resize to Frame Size", this); m_resetScalingAct->setStatusTip("Resizes the capture window to match frame size"); + m_resetScalingAct->setShortcut(Qt::CTRL+Qt::Key_F); QMenu *captureMenu = menuBar()->addMenu("&Capture"); captureMenu->addAction(m_capStartAct); -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html