Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8544803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:38:52+00:00 2026-06-11T12:38:52+00:00

My program uses QtNetwork to download stuff from internet. in int main() I call

  • 0

My program uses QtNetwork to download stuff from internet.

in int main() I call

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QmlApplicationViewer viewer;

    QNetworkConfigurationManager manager;
    QNetworkConfiguration cfg = manager.defaultConfiguration();
    QNetworkSession* session = new QNetworkSession(cfg);
    session->setSessionProperty("ConnectInBackground", true);
    session->open();

    /*some registering types*/

    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/maelyrica/main.qml"));
    viewer.showFullScreen();

    return app.exec();
}

Then, in one member function, a lot of encapsulation, a lot of calling other member functions which call other member functions, such code is used:

QNetworkReply::NetworkError lyricsDownloader::download(const QString& a, const QString& t)
{
QNetworkAccessManager nam;
QNetworkReply * reply;
QUrl url = toProviderCode(a, t);
forever
{
    reply = nam.get(QNetworkRequest(url));
    QEventLoop downloadLoop;
    connect(reply, SIGNAL(finished()), &downloadLoop, SLOT(quit()));
    downloadLoop.exec();
    url = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
    if (url.isEmpty()) break; // break when no redirect, when redirect do it again with new url
}

lyrics_qstr = reply->readAll();

//qDebug() << lyrics_qstr;

return reply->error();
}

This should show an internet popup on mobile devices such as Nokia N9 or Nokia N900, i.e. user has to choose the internet connection unless he’s already connected. But it isn’t shown.

What am I doing wrong?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:38:54+00:00Added an answer on June 11, 2026 at 12:38 pm

    You have set “ConnectInBackground” to true.

    “Setting this property to true before calling open() implies that the connection attempt is made but if no connection can be established, the user is not connsulted and asked to select a suitable connection. This property is not set by default and support for it depends on the platform.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My main program uses a variable that stores the pointer to a byte. How
I have various constants that my program uses... string 's, int 's, double 's,
I have a program that defines a variable int data The program uses scanf(%d,&data)
I'm writing a DLL which a java program uses to call the WinAPI in
I have a java program using an external library. The main program uses log4j
My Program uses EF to access data from a SQL CE database. When debug
My program uses the CUDA Radix Sort Class. After an update from CUDA 4.0
My program uses wx.ProgressDialog to give feedback on a process that is in multiple
My program uses some external programs that i included in the Files folder. In
My program uses sqlite3 plus python. It works fine with python 2.6.2 I moved

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.