Welcome!

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.


Reply
New Developer
Posts: 19
Registered: ‎02-24-2012
My Device: Developer
My Carrier: -

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac


jheron wrote:

In my opinion, there is no need for the Momentics IDE.


I guess this is just a matter of habit. I'm used to having autocompletion, source code formating, managed build etc.

New Developer
Posts: 19
Registered: ‎02-24-2012
My Device: Developer
My Carrier: -

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac


BGmot wrote:

This is how I react to swipedown event. (Mainwindow is a descendant of QMainMindow)

void MainWindow::keyPressEvent(QKeyEvent *event)
{
	if (event->key() == Qt::Key_Menu){
	  ui->widgetMenu->show();
	}
	QMainWindow::keyPressEvent(event);
}

 


Great, thanks! I've just tried it for the Calculator app, which is just a QWidget, and it works:

 

void Calculator::keyPressEvent(QKeyEvent *event) {
	if (event->key() == Qt::Key_Menu) {
		qDebug("KeyMenu");
	}
	QWidget::keyPressEvent(event);
}

 

Is there a way to have a one-to-one correspondence between the navigator events and Qt events? From the navigator events there are some we should respond to, for example NAVIGATOR_LOW_MEMORY.

 

enum {
    /**
     * Indicates that the application is a registered URL handler, and the
     * navigator is invoking a URL type on the application. For example, a web
     * browser might need to handle http://... invoke request from another
     * application, and load the website that is associated with the request.
     */
    NAVIGATOR_INVOKE              = 0x01,

    /**
     * Indicates that the user has quit the application, the device is
     * rebooting, or some other event has occurred that results in the
     * application needing to terminate. After this type of event is received,
     * the application has a short amount of time (about 500 ms) to terminate
     * itself. If the application has not terminated after this time has
     * elapsed, the navigator terminates the application.
     */
    NAVIGATOR_EXIT                = 0x02,

    /**
     * Indicates that the state of the application window has changed. For
     * example, the application window might have changed to full screen from a
     * thumbnail. The @c navigator_window_state_t enumeration defines the
     * possible states that an application window can be in.
     */
    NAVIGATOR_WINDOW_STATE        = 0x03,

    /**
     * Indicates that the user has performed a downward swipe gesture from the
     * top of the device screen. By convention, this gesture displays a menu.
     */
    NAVIGATOR_SWIPE_DOWN          = 0x04,

    /**
     * Indicates that the user has started a swipe gesture. This type of event
     * is generated if the application has requested swipe start events by
     * calling @c navigator_request_swipe_start(). For example, if an
     * application calls @c navigator_request_swipe_start() and the user
     * performs a downward swipe gesture from the top of the device screen, the
     * application receives a @c NAVIGATOR_SWIPE_START event followed by a
     * series of touch events. This functionality can be useful if the
     * application wants to respond more appropriately to swipe gestures (for
     * example, by displaying the menu in sync with the user's downward swipe
     * gesture).
     */
    NAVIGATOR_SWIPE_START         = 0x05,

    /**
     * Indicates that the device is low on memory. To prevent degraded
     * performance and a potentially poor user experience, an application should
     * respond to this event by freeing any memory that it isn't using.
     */
    NAVIGATOR_LOW_MEMORY          = 0x06,

    /**
     * Indicates that the device has rotated. An application should respond to
     * this event by calling @c navigator_orientation_check_response() and
     * indicating whether it intends to rotate along with the device rotation.
     * If the application indicates that it intends to rotate, the navigator
     * sends a follow-up @c NAVIGATOR_ORIENTATION event when it is time for the
     * application to resize its screen.
     */
    NAVIGATOR_ORIENTATION_CHECK   = 0x07,

    /**
     * Indicates that an application should resize its screen in response to the
     * rotation of the device. This event is generated if the application has
     * called @c navigator_orientation_check_response() and indicated that it
     * intends to rotate. After the application is finished resizing its screen,
     * the application should call @c navigator_done_orientation() to let the
     * navigator know that the application is finished rotating.
     */
    NAVIGATOR_ORIENTATION         = 0x08,

    /**
     * Indicates that the user has performed a swipe gesture from the bottom
     * left of the device screen towards the top right.
     */
    NAVIGATOR_BACK                = 0x09,

    /**
     * Indicates that the application window has become active (for example, if
     * the application window changes to full screen from being hidden).
     */
    NAVIGATOR_WINDOW_ACTIVE       = 0x0a,

    /**
     * Indicates that the application window has become inactive (for example,
     * if the application window changes to hidden from being full screen).
     */
    NAVIGATOR_WINDOW_INACTIVE     = 0x0b,

    /**
     * Indicates that the device has finished rotating.
     */
    NAVIGATOR_ORIENTATION_DONE    = 0x0c,

    /**
     * Indicates that a request to change the orientation with @c
     * navigator_set_orientation() has completed.
     */
    NAVIGATOR_ORIENTATION_RESULT  = 0x0d,

    /**
     * Indicates that the corporate or enterprise application is locked.  When
     * locked, the window changes to a lock icon and cannot be used. To use the
     * window again, the user must unlock it by touching the window and then
     * typing a password.
     */
    NAVIGATOR_WINDOW_LOCK         = 0x0e,

    /**
     * Indicates that the corporate or enterprise application is unlocked.  When
     * an application is first launched, it is considered unlocked.  No message
     * is sent whe the application starts.
     */
    NAVIGATOR_WINDOW_UNLOCK       = 0x0f
};

 

Dumi.

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

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac

This is very good question I am currently working on (there is no documentation).

Though I have more serious problem with Qt on Playbook, will probably post here if can't resolve -(((((

New Developer
Posts: 19
Registered: ‎02-24-2012
My Device: Developer
My Carrier: -

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac

For me at this point is just research and learning. I'm trying to think of different scenarios and problems and their solutions. If we decide to go further with BlackBerry 10 and Native SDK I want to be sure we will not have major problems in the future.

 

If there is anything I can help with don't hesitate to post here.

 

Dumi.

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

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac

Yes, I'll start new thread.

Thanks.

Developer
Posts: 188
Registered: ‎01-27-2012
My Device: playbook
My Carrier: ...

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac

[quote]I guess this is just a matter of habit. I'm used to having autocompletion, source code formatting, managed build etc.[/quote]

Yes that is exactly the point of using the Qt SDK. I don't think momentics will ever perform as well as Qt creator when it comes to Qt code completion, built in Qt documentation, formatting, debugging, etc, etc. When I started coding for Symbian with Qt it was using eclipse with a Qt plugin, it was not even comparable to using the Qt SDK once it was released.

The nice thing about using the sdk is you can use the speedy nokia simulator too. I find using the n900 skin in the sim is the closest to what you will see on the playbook since it uses no style plugin like the other sim skins. I am sure eventually someone with more time than me will script a playbook skin for the Qt simulator... Or you can also just build for desktop on mac, windows or linux with the click of a button from the SDK, very nice for general, off device debugging...

Give it a try, you wont be disappointed!

Cheers,

Jon

Developer
Posts: 61
Registered: ‎06-28-2011
My Device: 9700+PB
My Carrier: sfr

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac

John,
I think I agree with you regarding not using Momentics IDE (at all).

My goal, for now, is simply to adopt and use the QT IDE (creator, designer, mingw gcc, qmake, etc...) on windows completely to design, write, build and test my first app.
I do not want to use the momentics IDE (I understand that it works more smoothly on linux than on windows).

So,
Where could I find instructions on how to configure QT IDE suite to be able to produce ready to deploy playbook native app ?

Then how would I package/sign/deploy such an app directly to to my real device ?

Thanks in advance !!
Cheers
---------<={##}=>---------
I.Ravelo; Renault S.A.S. Corporate BBOS Java Apps Lead Conceptor/Coder; Qt learner
Developer
Posts: 188
Registered: ‎01-27-2012
My Device: playbook
My Carrier: ...

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac

Hi iravelo,

Everything runs smoother on Linux! Smiley Wink

Sorry, I deleted windows from my life about a year ago and have not looked back. I will not be of any help to you with building and deploying to playbook on windows because of that...

As far as the Qt IDE goes, it works fine from windows and is ready to go, as is, for designing and coding your apps. When it comes time to build, sign and deploy the bar file you will have to look into if there are any command line tools for the playbook that run on windows. I am using the blackberry.tools.SDK for linux to sign and deploy my playbook apps currently.

IIRC I read a post on here somewhere where somebody had successfully configured the Qt blackberry port to run on windows to successfully 'make' the bar file...

Good Luck!

Cheers,

Jon

Developer
Posts: 61
Registered: ‎06-28-2011
My Device: 9700+PB
My Carrier: sfr

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac

[ Edited ]

John,
I can understand your deletion of everything windows related once you've found your hapiness in another OS.
I also think QT IDE can run as smoothly (as linux) on windows, but it will never be like in a native unix even with the help of something like mingw.
I also have a mac (mini) once devoted to iOS dev, but stuck at the xcode or lion licence payment step :-(
I've tried to install QT SDK on snow leopard there but after too many undocumented and unresolved errors during the install process, I was forced to abandon the idea and then headed to windows.

Regarding the bar file production on windows, I want to translate/port what's describded here (http://wiki.qt-project.org/QNX#A_Hello_World_using_the_NDK_CLI_tools) to windows.

I'm looking for someone who can help and/or is interested in sharing the effort to do that !

Tks

---------<={##}=>---------
I.Ravelo; Renault S.A.S. Corporate BBOS Java Apps Lead Conceptor/Coder; Qt learner
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: "How to Learn Qt" with Qt integrated in QNX Momentics IDE on Mac

What step is failing on Windows?