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

Reply
New Contributor
zhenleow
Posts: 5
Registered: ‎07-04-2012
My Device: 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?

BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: 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
zhenleow
Posts: 5
Registered: ‎07-04-2012
My Device: 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
zhenleow
Posts: 5
Registered: ‎07-04-2012
My Device: 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?

BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: 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

BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: 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
zhenleow
Posts: 5
Registered: ‎07-04-2012
My Device: 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...

BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: 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
marioboikov
Posts: 30
Registered: ‎05-24-2012
My Device: Developer

Re: using standard qml components

BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: 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