Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

New Contributor
Posts: 7
Registered: ‎12-02-2012
My Device: Playbook
My Carrier: T-mobile

Playbook + Qt: how to catch event when changing to thumbnail

[ Edited ]



I'm developing applications for Playbook using Qt libraries and I'm facing up with a problem. I can't catch the event when my application is switched into thumbnail size (swipe up from the bottom) or minimized. I read many forums and I found workarounds but still not working.


The basic idea was that I should install an event filter for the main QT Event Dispatcher.


if (BPS_SUCCESS != navigator_request_events(0)) {
// This will display the log message with the source file name + index of code line
LogModule::getInstance().Display(AT, "Cannot initialize navigator requests"); } QAbstractEventDispatcher::EventFilter previousEventFilter = QAbstractEventDispatcher::instance()->setEventFilter(EventFilter); bool EventFilter(void *message) { bps_event_t * const event1 = static_cast<bps_event_t *>(message); if (event1) { LogModule::getInstance().Display(AT, "Event received"); if (event1 && bps_event_get_domain(event1) == navigator_get_domain()) { const int id = bps_event_get_code(event1); switch (id) { NAVIGATOR_SWIPE_DOWN:
LogModule::getInstance().Display(AT, "Swipe down");
LogModule::getInstance().Display(AT, "Thumbnail");
break; } } }
// previousEventFilter should be handled here return false; }

With this code I can catch events like swipe down from the top, gestures, mouse clicks, timers etc. But not thumbnail resizing.


Overriding resizeEvent of main window is not working too, because thumbnail and minimizing will not change its size.


If you have any idea what I'm doing wrong or how to solve this problem it is much appreciated.

Thank you.


I forgot to metinoned that I know that Qt catches all the playbook events but this is not working either in the main window:

bool MainWindow::event(QEvent *event1) {
  switch (event1->type()) {
  case QEvent::Leave:
  case QEvent::WindowDeactivate:
    LogModule::getInstance().Display(AT, "Window deactivated");
  case QEvent::Enter:
  case QEvent::WindowActivate:
    LogModule::getInstance().Display(AT, "Window activated");
  return false;

 Sometimes I receive Window Activate event, but no deactivation.


Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Playbook + Qt: how to catch event when changing to thumbnail

I use this in your EventFilter:

    bps_event_t *activation_event = NULL;
    switch (bps_event_get_code(event)) {
case NAVIGATOR_WINDOW_INACTIVE: //Wait for NAVIGATOR_WINDOW_ACTIVE event for (;;) { rc = bps_get_event(&activation_event, -1); assert(rc == BPS_SUCCESS); if (bps_event_get_code(activation_event) == NAVIGATOR_WINDOW_ACTIVE) break; } break;


New Contributor
Posts: 7
Registered: ‎12-02-2012
My Device: Playbook
My Carrier: T-mobile

Re: Playbook + Qt: how to catch event when changing to thumbnail

Thank you. Now it is working.


The root problem was that I have used an old build from qt 4.8.1. Now I have recompiled the 4.8.3 using the "How to" and everything is working.