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 Contributor
Posts: 5
Registered: ‎07-04-2012
My Device: Dont have a device yet
My Carrier: Dont have a device yet

using standard qml components

How can I use a standard qml component such as a Rectangle in the cascade project? I tried something like this and it doesnt works..

 

import bb.cascades 1.0
import QtQuick 1.0

     
Rectangle {
        width: 360
        height: 360
        Text {
                   text: "Hello World"
                   anchors.centerIn: parent
              }
              MouseArea {
                           anchors.fill: parent
                           onClicked: {
                               Qt.quit();
                           }
                       }
}     

Nothing is shown in the simulator, and the console says something like...

QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used

 

how?

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: using standard qml components

[ Edited ]

Welcome to the forums!

 

As you've probably seen, Cascades is a rich environment, but still under construction.  You have cascades UI classes that give you a native look and feel, including a responsive UI that is not guaranteed in Qt applications.  To get this, you use cascades UI augmented by native calls and non-UI Qt classes.   You can use some Qt UI classes in some cases when they are helper classes not actively involved in the UI.  But you either use the cascades UI or the Qt UI, not a mix. This extends to the QML: in cascades you can use the cascades classes or your own components.

 

(You can write a fully Qt application, if you are willing to give up the deep integration with the OS and the signature Blackberry experience provided through Cascades.)

 

So: don't use QtQuick.  But do use classes documented here:

https://developer.blackberry.com/cascades/reference/cascades.html

(the documentation applies to both C++ and cascades QML)

 

What are you trying to achieve?  There may be another way to do what you are looking for.  I suspect you are looking for a Button, Label, TextArea or TextField.   Download the cascadescookbookqml sample and see if there is something there that does what you are looking for.

 

Stuart

New Contributor
Posts: 5
Registered: ‎07-04-2012
My Device: Dont have a device yet
My Carrier: Dont have a device yet

Re: using standard qml components

I just want to be able to use qt quick components so that it is cross platform, workable on windows,linux,symbian,etc as well..

 

Other platforms do allow us to use a mix....

 

I understand about the advantages of having deep integration with blackberry os and native look and feel through cascade.. but cross platform is also what developers look at nowadays..

New Contributor
Posts: 5
Registered: ‎07-04-2012
My Device: Dont have a device yet
My Carrier: Dont have a device yet

Re: using standard qml components

You also mentioned that we can have a fully cascade UI or Qt UI application, not a mix. Then can we have a fully Qt Quick application?

Highlighted
Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: using standard qml components

As far as I know this works fine but I have never tried it.  It is mentioned in a number of threads.   Fully Qt applications are supported.

 

Stuart

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: using standard qml components

Not sure if this is related to your question, but see: http://supportforums.blackberry.com/t5/Native-Development/qt-components-for-BB10/td-p/1798349

 

Stuart

New Contributor
Posts: 5
Registered: ‎07-04-2012
My Device: Dont have a device yet
My Carrier: Dont have a device yet

Re: using standard qml components

thanks for the info..

 

i have been trying various method and struggling till now..

 

what i want to do is very simple.. just create a blackberry project that I can use qt quick components in it....

 

but i still can't get it running on the simulator...

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: using standard qml components

Have you succeeded making a Qt Quick application yet?

There are several threads discussing how to make and deliver a Qt application.  Check both this forum and the native forum.

 

Do you still have a specific question not covered by one of the existing threads on Qt applications?

 

Stuart

Contributor
Posts: 30
Registered: ‎05-24-2012
My Device: Developer
My Carrier: Developer

Re: using standard qml components

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: using standard qml components

Are you up and running yet?

If one of the posts answered your question, please mark it as a solution.

Otherwise, perhaps you could word your question differently, perhaps with a simple HelloWorld (use the icon with the little clipboard with a C to include the code), and maybe with some lo-res pictures to illustrate what you are seeing.

 

Stuart