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
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor
Accepted Solution

#include <QtNetwork> fails

http://developer.blackberry.com/cascades/documentation/device_comm/networking/index.html

 

HTTP Networking sample.

 

The include  #include <QtNetwork>  gets error message  "No such file or directory"

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Please use plain text.
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: blau.de

Re: #include <QtNetwork> fails

[ Edited ]

Did you add

QT += network

 to your .pro file?

--
With best regards,
Oleksii Serdiuk
Please use plain text.
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: #include <QtNetwork> fails

When going back to check the sample I can see  it is being changed!


Include statement in applicationui.cpp  says

#include "applicationui.hpp"

 

but the hpp file is named named "application.hpp"

 

And other changes.

 

I sure hope that the person now doing the changes also really test the code. I will do nothing more until tomorrow

 

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Please use plain text.
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: #include <QtNetwork> fails

thanks  leppa.

 

Did not see that mentioned in the article.

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Please use plain text.
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: blau.de

Re: #include <QtNetwork> fails

As a rule of thumb, to include Qt<Module> in your app you should always add QT += <module> to your .pro file (unless it was implicitly included by another module).

 

PS: If my first reply helped, you can perss "Accept as Solution" on it. This will add "Go to Solution" link at the end of your original post so other people can quickly find it.

--
With best regards,
Oleksii Serdiuk
Please use plain text.
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: #include <QtNetwork> fails

Still having problems

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Please use plain text.
Developer
jalue
Posts: 196
Registered: ‎03-04-2013
My Device: BB Z10
My Carrier: Rogers

Re: #include <QtNetwork> fails

[ Edited ]

Hey there...

 

Try adding the individual header files within the QtNetwork folder that you need for your app...

 

Example:

#include <QtNetwork/qnetworkaccessmanager.h>
#include <QtNetwork/qnetworkconfigmanager.h>

 

As reference it's located at:

\bbndk\<target OS>\qnx6\usr\include\qt4\QtNetwork

 

Please use plain text.
BlackBerry Development Advisor (Retired)
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: #include <QtNetwork> fails

You can't

#include <QtNetwork>

because it doesn't exist.

 

Have a look under your NDK's target_10_x_y_z/qnx6/usr/include directory.

 

One way to get what you want is use the path relative to there. eg:

 

#include <qt4/QtNetwork/QNetworkAccessManager>

 

--
Rob is no longer associated with BlackBerry.
Please use plain text.
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

Re: #include <QtNetwork> fails

I made a try with the new code after correcting the discrepancy on   application.hpp/applicationui.hpp

 

Regardless if I set the

 

QT += network

 

or not

 

I get question maqrks on almost everything related to "Q"  Must be a library missing??

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Please use plain text.
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: blau.de

Re: #include <QtNetwork> fails

[ Edited ]


robbieDubya wrote:

You can't

#include <QtNetwork>

because it doesn't exist.

 


It should. Else, it's a bug. Qt always ships Qt<Module> header which, basically, conatins a bunch of includes of all the headers from the module. This saves you from including each class's header explicitly but may increase compilation time due to bloating the number of included files.

--
With best regards,
Oleksii Serdiuk
Please use plain text.