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 8987061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:42:01+00:00 2026-06-15T21:42:01+00:00

I am customizing vlc source code and needed to use QNetworkAccessManager from Qt OpenDialog

  • 0

I am customizing vlc source code and needed to use QNetworkAccessManager from Qt OpenDialog (part of QT UI dialogs for vlc).

I am trying to use following code sample

void MainWindow::requestShowPage(){
    QNetworkAccessManager *manager = new QNetworkAccessManager(this);
    connect(manager,SIGNAL(finished(QNetworkReply*)),this,SLOT(requestReceived(QNetworkReply*)));
manager->get(QNetworkRequest(QUrl("http://google.com")));
}

void MainWindow::requestReceived(QNetworkReply* reply){
    QString replyText;
    replyText.fromAscii(reply->readAll());
    ui->txt_debug->appendPlainText(replyText);
}

My primary problem is that vlc fails to load UI even if there is a single call as follows:

QNetworkAccessManager *manager = new QNetworkAccessManager(this);

Following is the output produced on vlc console

./vlc
[0x19c9388] main libvlc: Running app with the default interface. 
[0x1f82988] main interface error: corrupt module: /VLC/vlc-2.0.4/modules/gui/qt4/.libs/libqt4_plugin.so
[0x2586748] main generic error: corrupt module: /VLC/vlc-2.0.4/modules/gui/qt4/.libs/libqt4_plugin.so
[0x1f82988] skins2 interface error: no suitable dialogs provider found (hint: compile the qt4 plugin, and make sure it is loaded properly)
[0x1f82988] skins2 interface error: cannot instantiate qt4 dialogs provider
[0x1f82988] [cli] lua interface: Listening on host "*console".

Simply omitting the QNetworkAccessManager brings the UI back again.

a. Is there any thing special regarding QNetworkAccessManager usage scenarios i.e. should it be created globally or something? I went through its documentation, but didn’t find any thing.

b. Are there any special conventions with respect to Qt or it’s use with VLC that i am missing? I am significantly experienced in c/c++ and Linux but new to QT.

UPDATE1: I saw this SO question too which basically is trying to do the same httpget using QNetworkAccessManager. However, i believe calling this one simple api is not required to be done as a separate module (the question attempts writing a new module)? Or is there any such restriction in qt / vlc

UPDATE2: What i suspect so far is that it has something to do with adding a new class to vlc qt ui section. I tried including http example that comes with qt installation with vlc, but see the same behavior. Any guidelines on including a .cpp and .h in vlc ui components would be helpful.

UPDATE 3: I followed as suggested in the answer below and can’t seem to make sense out of the following compilation errors. Can any one help?

/usr/include/qt4/QtCore/qobject.h: In copy constructor ‘QNetworkAccessManager::QNetworkAccessManager(const QNetworkAccessManager&)’:
/usr/include/qt4/QtCore/qobject.h:333:5: error: ‘QObject::QObject(const QObject&)’ is private
In file included from /usr/include/qt4/QtNetwork/QNetworkAccessManager:1:0,
                 from qt4.hpp:39,
                 from qt4.cpp:37:
/usr/include/qt4/QtNetwork/qnetworkaccessmanager.h:72:24: error: within this context
qt4.cpp: At global scope:
qt4.cpp:192:63: note: synthesized method ‘QNetworkAccessManager::QNetworkAccessManager(const QNetworkAccessManager&)’ first required here 
In file included from qt4.cpp:54:0:

============

qt4.hpp contains following added at global scope

#include <QNetworkAccessManager>
extern QNetworkAccessManager NETWORK_MANAGER;

qt4.cpp contains this at global scope

QNetworkAccessManager NETWORK_MANAGER = QNetworkAccessManager();

and then i am accessing in one of the sub classes of qt4

QNetworkAccessManager * qnam = &NETWORK_MANAGER;

UPDATE 4 I also discovered that manually including QtNetwork to the make file was also problematic (although it it didn’t complain in compilation for the headers) and vlc ui failed to load. However, when i added it to main vlc configuration file, even the basic local creation of QNetworkAccessManager worked. See this vlc mailing list thread for details

  • 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-15T21:42:02+00:00Added an answer on June 15, 2026 at 9:42 pm

    The QNetworkAccessManager should be created globally. If you create it in a class or in a method, it will be destroyed with the object (or the method) and the requests that you sent will be lost. Moreover, I have already encounter problems with several QNetworkAccessManagers in a program So I recommend you to do somethng like this :

    a_module.hpp :

    // ...
    
    #ifndef THE_MODULE
    #define THE_MODULE
    
    // ...
    
    #include <QNetworkAccessManager>
    
    // ...
    
    extern QNetworkAccessManager NETWORK_MANAGER;
    
    // ...
    
    #endif    // THE_MODULE
    

    a_module.cpp :

    // ...
    
    #include "a_module.hpp"
    
    // ...
    
    QNetworkAccessManager NETWORK_MANAGER = QNetworkAccessManager();
    
    // ...
    

    In your code :

    // ...
    
    #include "a_module.hpp"
    
    // ...
    
    QNetworkAccessManager * qnam = &NETWORK_MANAGER;
    
    // ...
    

    EDIT : if it does not work (cf. update 3 in the question), try QNetworkAccessManager NETWORK_MANAGER; instead of QNetworkAccessManager NETWORK_MANAGER = QNetworkAccessManager(); in a_module.cpp. It is due to the compiler. Unlike MSVC, g++ compiles with QNetworkAccessManager NETWORK_MANAGER; but not QNetworkAccessManager NETWORK_MANAGER = QNetworkAccessManager();.

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

Sidebar

Related Questions

I was trying to customizing the UIBarButtonItem in Navigation Bar I found that there
I'm working on customizing a couple of open source projects in ways that are
I am working on customizing a closed source client application. It has a tree
I am customizing an ExapndableListView,, I am trying to add a Button to the
I'm customizing a plugin that uses css3's rgba throughout, I'm trying to figure out
I am customizing the softkeyboard sample of android SDK. The resolution of this keyboard
I am customizing the jquery weekcalendar to use json to read/write data to a
I'm customizing my bash prompt (I use iTerm on OS X Lion), and have
I am customizing my table cells. I have this code (simplified) which is giving
I'm customizing my father-in-law's Orchard site and trying to create a .cshtml file to

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.