[maemo-developers] Diablo Qt: how to hook into zoomin / zoomout hw keys

From: Ville M. Vainio vivainio at gmail.com
Date: Wed Oct 21 16:36:47 EEST 2009
To quote

http://wiki.maemo.org/Qt4Hildon

QQQ

Hardcoded Keys:
 In the QMainWindow:
 - F6 - Toggle fullscreen the application
 - F4 - Shows/Hides the application context menu
 - Zoom in  - is a standard key sequence QKeySequence::ZoomIn
 - Zoom out - is a standard key sequence QKeySequence::ZoomOut

QQQ

I have (in my MainWindow)

QQQ

    QShortcut* zIn = new QShortcut(QKeySequence::ZoomIn, this);
    QShortcut* zOut = new QShortcut(QKeySequence::ZoomOut, this);

    connect(zIn, SIGNAL(activated()), this, SLOT(zoomInPressed()));
    connect(zOut, SIGNAL(activated()), this, SLOT(zoomOutPressed()));

QQQ


This works fine on desktop (ctrl +/-). However, on device it doesn't
work. Any ideas what I'm doing wrong?

I have also tried:

- Adding these as QActions on mainwindow, without menu items - this
doesn't work in desktop *or* device
- Adding these as QShortcuts on the "active" widget
- Looking at key press events in the active widget

I'm wondering, what am I doing wrong?

-- 
Ville M. Vainio
http://tinyurl.com/vainio
More information about the maemo-developers mailing list