Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. network
    Log in to post

    • UNSOLVED networkauth not found in qt c++
      General and Desktop • network google api networkauth • • MEsc  

      2
      0
      Votes
      2
      Posts
      14
      Views

      Hi, Which version of Qt are you using ? How did you install it ? Depending on that, you may have to build and install the module before being able to use it.
    • SOLVED QNetworkReply* ownership
      General and Desktop • network qnetworkreply qtnetwork deletelater • • mistralegna  

      5
      0
      Votes
      5
      Posts
      128
      Views

      AFAIK, if this does happen you likely have other bigger issues. The signal is not related to the success of the request.
    • UNSOLVED QNetworkAccessManager::setNetworkAccessible useful but DEPRECATED
      General and Desktop • qt5 network access accessmanager networkaccess • • sangioQtDev  

      5
      0
      Votes
      5
      Posts
      494
      Views

      @SGaist I didn't in fact ( and I can't in the short term). Just to clarify I'll mention the documentation related to this 'bearer stack removal' : Qt Network in Qt 6. It also leads to QTBUG-86966 where QNetworkInformation is presented as solution for "Reachability" device state checks!! However I still can't find anything that tells me how to overcome my "NoInternetAccess" device state related problem. But that's great news!! Maybe my problem has already been taken care of. Thanks!!
    • UNSOLVED Remote Objects: Can't register Clients to Registry using a TCP-connection
      General and Desktop • network tcp qtremoteobject remoteobject remoteobjects • • STheVoid  

      4
      1
      Votes
      4
      Posts
      266
      Views

      Basically you missed to add addHostSideConnection on server side. Here is below code snippet. // server side void onNewServerConnection() { qDebug() << "onNewServerConnection"; bool newConn = false; if(auto tcpServer = qobject_cast<QTcpServer*>(sender())) { while(tcpServer->hasPendingConnections()) { newConn = true; m_pHost->addHostSideConnection(tcpServer->nextPendingConnection()); } } } // Use standard tcp url for the registry const QUrl registryUrl = QUrl(QStringLiteral("tcp://127.0.0.1:65212")); // Use "exttcp" for the "external" interface const QUrl extUrl = QUrl(QStringLiteral("exttcp://127.0.0.1:65213")); // Create the server and listen outside of QtRO // QTcpServer tcpServer; auto tcpServer = new QTcpServer(this); auto host = extUrl.host(); // We only know how to handle tcp:// and local: bool res = false; res = tcpServer->listen(QHostAddress(extUrl.host()), extUrl.port()); if(res) { // m_servers.insert(url, server); connect(tcpServer, &QTcpServer::newConnection, this, &YourClass::onNewServerConnection); } else { qWarning().nospace() << "server could not listen on URL: " << extUrl.toString() << ". Error type: " << tcpServer->serverError() << ", message: " << tcpServer->errorString(); delete tcpServer; } // We need a registry for everyone to connect to QRemoteObjectRegistryHost registry(registryUrl); // Finally, we create our host node and register "exttcp" as our schema. // We need the AllowExternalRegistration parameter to prevent the node from // setting a hostUrlInvalid error. m_pHost = new QRemoteObjectHost(extUrl, registryUrl, QRemoteObjectHost::AllowExternalRegistration); // From now on, when we call enableRemoting() from this node, the registry // will be updated to show the Source object at extUrl. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// OnClient side // Use standard tcp url for the registry const QUrl registryUrl = QUrl(QStringLiteral("tcp://127.0.0.1:65212")); // This time create the node connected to the registry QRemoteObjectNode repNode(registryUrl); // Create the RemoteObjectSchemaHandler callback QRemoteObjectNode::RemoteObjectSchemaHandler setupTcp = [&repNode](QUrl url) -> void { QTcpSocket *socket = new QTcpSocket(&repNode); connect(socket, &QTcpSocket::connected, [socket, &repNode]() { qDebug() << "Added client side connection"; repNode.addClientSideConnection(socket); }); connect(socket, &QSslSocket::errorOccurred, [socket](QAbstractSocket::SocketError error) { qDebug() << "Deleted socket"; delete socket; }); qDebug() << "Connected to host with URL: " << url.host() <<":" << url.port(); socket->connectToHost(url.host(), url.port()); }; // Once we call registerExternalSchema, the above method will be called // whenever the registry sees an object we are interested in on "exttcp" repNode.registerExternalSchema(QStringLiteral("exttcp"), setupTcp); // local replica // QRemoteObjectNode repNode; // create remote object node // m_pHost = new QRemoteObjectHost(QUrl(ss.str().c_str())); // repNode.connectToNode(QUrl(ss.str().c_str())); //QUrl(QStringLiteral("local:replica"))); auto ptr = repNode.acquireDynamic("something");
    • SOLVED Problems with Adding Oauth2 Implicit Flow Class to NetworkAuth Module
      General and Desktop • network oauth2.0 networkauth • • basyskom-dege  

      8
      0
      Votes
      8
      Posts
      446
      Views

      Great ! The patch submission is a really good idea. Do not hesitate :-)
    • UNSOLVED inet_pton 443: error: 'inet_pton' was not declared in this scope
      General and Desktop • windows 10 network • • Imran Hassan  

      17
      0
      Votes
      17
      Posts
      3713
      Views

      @Christian-Ehrlicher Thanks dear. I will use this
    • SOLVED Does QNetworkAccessManager::post() work in QMainWindow::closeEvent()?
      General and Desktop • network macos http • • Sprezzatura  

      18
      0
      Votes
      18
      Posts
      625
      Views

      @Sprezzatura I think this looks better :) Your code as it stands presumably leaks QNetworkRequest *request = new QNetworkRequest(url); and QNetworkAccessManager *nam = new QNetworkAccessManager;. You could put these on the stack (no pointers, no new). And I think you're supposed to deleteLater() the QNetworkReply *reply = nam->post(*request, content);. You can get away without, but one day when you want examine your code for memory leaks with e.g. valgrind it will be better.
    • UNSOLVED QUdpSocket receiveDatagram fails on Linux (ubuntu 18.04)
      General and Desktop • network udp • • Tyras  

      1
      1
      Votes
      1
      Posts
      308
      Views

      No one has replied

    • SOLVED Display device's IP address
      QML and Qt Quick • qml qtquick network • • lopeztel  

      3
      0
      Votes
      3
      Posts
      742
      Views

      @sierdzio thanks a lot for the pointer and example document, I will look into this
    • UNSOLVED QFileSystemModel doesn't support the network paths and external drives?
      General and Desktop • network filesystem drive explorer • • jeanmilost  

      4
      0
      Votes
      4
      Posts
      691
      Views

      @beecksche said in QFileSystemModel doesn't support the network paths and external drives?: I think the easiest way is to write your own file system model. Or, presumably extend QFileSystemModel by subclassing it. @jeanmilost I just don't think you can access network, as per https://stackoverflow.com/a/33856139/489865 and @beecksche's comment above.
    • UNSOLVED Connecting to wifi in raspberry pi
      Mobile and Embedded • linux network raspberry pi 3 raspbian wifi connection • • payman  

      1
      0
      Votes
      1
      Posts
      492
      Views

      No one has replied

    • SOLVED Error : "Protocol \"https\" is unknown"
      General and Desktop • network openssl ssl qtnetwork error qt • • Qjay  

      9
      0
      Votes
      9
      Posts
      2102
      Views

      hey i didn't fixed it . i downloaded Qt5.12.4 and then upgraded my openssl lib to 1.1.1b so i am good now thanks !!
    • SOLVED Connecting to secondary WLAN interface
      General and Desktop • network wifi connection qnetworksession • • NeuroSamuel  

      10
      0
      Votes
      10
      Posts
      1169
      Views

      @NeuroSamuel said in Connecting to secondary WLAN interface: My problem is that I see no way to open a QNetworkSession from one of those configurations choosing the hardware interface. Is not something you (or your sysadmin) did already when configuring the networking devices for your system? Not that I have that much experience with QNetworkSession, but it looks that behavior to be fine, given that you are setting one WLAN interface to one SSID at OS level. Thinking of wpa_supplicant on Linux for instance: wpa_supplicant.conf network={ ssid="home" scan_ssid=1 key_mgmt=WPA-PSK psk="very secret passphrase" } and then command line: wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d Because at the end it'll be a question of OS routing, won't it?
    • SOLVED QUdpSocket disconnects after data writing
      General and Desktop • network qudpsocket • • ClingerWinger  

      4
      0
      Votes
      4
      Posts
      690
      Views

      @ClingerWinger Glad you figured it out and thanks for the feedback :)
    • UNSOLVED QOAuth2AuthorizationCodeFlow and problem with redirect_uri
      General and Desktop • network oauth2.0 redirecturi • • shav  

      6
      0
      Votes
      6
      Posts
      38235
      Views

      In our efforts trying to authenticate our Qt app with Google SSO, we had to use http://127.0.0.1:1234/ as our redirect URI, ignoring the documented advice. If we pick the first URL that Google provides, our app never hears back from the login flow.
    • SOLVED Need Help with getting a slot executed in the correct thread
      General and Desktop • qtcpsocket network qtcpserver server - client qthreadpool • • Curtwagner1984  

      8
      0
      Votes
      8
      Posts
      2294
      Views

      @VRonin said in Need Help with getting a slot executed in the correct thread: the default implementation of QThread::run starts an event loop so if you use the method described in that link everything will work out of the box Indeed it does! Thanks!
    • SOLVED QTcpSocket/QMQTT - Strange Error Codes
      General and Desktop • network qtcpsocket mqtt • • g.hirsch  

      8
      0
      Votes
      8
      Posts
      2452
      Views

      @Pablo-J-Rogina yes, and it doesn't say much more than what can be gleaned from the function signature. What is missing is any discussion of why one might want to call it (in normal circumstances that is, not to work around what apparently is a bug). Also, as I asked, whether calling it might have any adverse effects.
    • SOLVED How to make a UDP server to sent and recieve data?
      General and Desktop • network server udp sockets • • ChristianMontero  

      4
      0
      Votes
      4
      Posts
      1346
      Views

      @ambershark Thank you very much for your help, now it's working, it seems like I was passing the IP argument incorrectly, now I know that I have to send this parameter inside a QT function. thanks!
    • UNSOLVED Conexión UDP para enviar y recibir mensajes
      Spanish • network socket server udp • • ChristianMontero  

      3
      0
      Votes
      3
      Posts
      1383
      Views

      @juanki sí, de hecho al final encontre que mi error era porque la IP la tenia que mandar dentro de un método de la librería, igual gracias por tu post :)
    • UNSOLVED (QHttp QT5.7+) Qualcuno potrebbe aiutarmi a trovare il bacco
      Italian • network backward compat qhttp qobjectprivate • • patrik08  

      2
      0
      Votes
      2
      Posts
      954
      Views

      QHttp cosi' come il tuo modulo non puo' gestire l'http moderno, in particolare SSL. Mentre mi devo congratulare per lo sforzo profuso, suggerirei un passo indietro, perche' non puoi usare QNetworkAccessManager (o un wrapper attorno a esso)? Se la risposta alla precedente domanda e' "perche' alcune cose che mi servono non sono implementate" (di solito questo e' un problema quando si sostituisce QFtp, non QHttp), potresti considerare un wrapper attorno a libcurl? magari fruttando curlpp?
    • UNSOLVED how can i create a chat app like telegram in Qt for mobiles
      Brainstorm • c++ android network socket mobile app deve • • Qjay  

      14
      0
      Votes
      14
      Posts
      5030
      Views

      Thanks everyone for insight . I have some idea now from where i should start .
    • SOLVED QNetworkConfigurationManager onlineStateChanged SIGNAL && Android, iOS ApplicationState Suspended
      Mobile and Embedded • android ios network • • ekkescorner  

      5
      0
      Votes
      5
      Posts
      1813
      Views

      @SGaist thx - have thought the same. would work well if Active and bad coverage or coming back from suspended when multi signals are received
    • UNSOLVED QAbstractSocket::UnknownSocketError provides errorString of "UnknownError"
      General and Desktop • network socket network socket qabstractsocket socketerror • • CybeX  

      4
      0
      Votes
      4
      Posts
      4296
      Views

      Don't get this the wrong way, but are you coming from Java? I'm asking because this: QHostAddress().AnyIPv4 Doesn't make any sense in C++. What you probably want is to use the scope operator - :: to access one of the enum values. As for the error, please provide the full implementation of your TCP server and mention if you use threading, if so how. Also as mentioned by @koahnig new QTcpSocket(new QObject()); This leaks 2 objects one socket and one generic QObject. You need to provide a valid pointer from the object tree to make use of the automatic deletion Qt supplies for child objects.
    • SOLVED QML Sandboxing
      General and Desktop • qml network security networkaccessma • • romsharkov  

      2
      0
      Votes
      2
      Posts
      1115
      Views

      I have now found this thread posted 2 years ago which seems very similar to what I was looking for. The solution was to create a new QML component which create a new QML engine instance and isolates the untrusted QML code inside it. That does isolate the execution context, it does't however monitor the network traffic generated by the component. In my case network communication must be restricted to a certain set of domains, so I need to intercept network going in and out of the component, any idea how?
    • UNSOLVED Why does QHostAddress::protocol() always return QAbstractSocket::IPv6Protocol
      General and Desktop • network socket ipv6 • • yvbbrjdr  

      7
      0
      Votes
      7
      Posts
      2217
      Views

      It's a bug in Qt. Appears everytime. Even if disable IPv6 stack.
    • UNSOLVED How to send QString to server in Qt 5.6?
      QtWebEngine • network qnetworkaccessm qnetworkreply qnetworkrequest • • d1.psy  

      7
      0
      Votes
      7
      Posts
      2289
      Views

      @d1.psy so you want the cookies from the requests you already made with QtWebEngine? If so take a look at QWebEngineCookieStore (see it's signals) and "sync" the cookies into your QNAM.
    • UNSOLVED Qml image SSL error
      QML and Qt Quick • qml network ssl • • Mkowalik-Mimesis  

      2
      0
      Votes
      2
      Posts
      1217
      Views

      @Mkowalik-Mimesis and why does it crash? What is the value of incoming QNetworkReply* ? Are you doing any fancy deletes? in your CustomNetworkManagerFactory::create() you get a QObject* passed as a parent for the QNAM to create. But you set the parent to the this pointer instead. it would be cleaner not to couple the created QNAM with your factory class by connecting signals and slots of them. Instead you should subclass QNAM, move the onIgnoreSSLErrors() slot to it and connect it to itself instead. you are overwriting your local m_networkManager member variable everytime create() is called. Which doesn't go along with a factory implementation ;) I don't know if this already solves your crash, it may be.
    • UNSOLVED UDPSocket Stopped Working
      General and Desktop • error network udp • • M4RZB4Ni  

      6
      0
      Votes
      6
      Posts
      1527
      Views

      @M4RZB4Ni said: Hi When you dont have uSocket = new QUdpSocket(this) ; then uSocket->writeDatagram(xx will crash. as uSocket just point to random location. (dangling pointer) Next: QByteArray *priPackNuser; <<< also just a pointer. You should do ( as @SGaist mention) QByteArray priPackNuser; ( no *, means its real bytearray, not a pointer to one) So you change it from heap allocation to stack allocation. If you dont change to non pointer then you need QByteArray *priPackNuser = new QByteArray ; as else its a dangling pointer too! But no need for pointer to QByteArray here.
    • UNSOLVED How to find complete information about the file to be downloaded using QNetworkAccessManager HTTP Qt
      General and Desktop • network qnetworkaccessm file http download • • Farhan  

      2
      0
      Votes
      2
      Posts
      1437
      Views

      The server is not returning anything useful in the HTTP headers (I wouldn't expect it to): ~/tmp$ wget -S 'http://u801.wapkafile.com//g03/video/1253022/7940/c8f9a32ef15648bfa6f693102de27835/DARNA-ZAROORI-HAI-3(Movies7.In).avi?md5=TU7ibYa85byjzJyJcH_LXQ&expires=1458916610' --2016-07-27 18:21:15-- http://u801.wapkafile.com//g03/video/1253022/7940/c8f9a32ef15648bfa6f693102de27835/DARNA-ZAROORI-HAI-3(Movies7.In).avi?md5=TU7ibYa85byjzJyJcH_LXQ&expires=1458916610 Resolving u801.wapkafile.com (u801.wapkafile.com)... 8.37.229.38 Connecting to u801.wapkafile.com (u801.wapkafile.com)|8.37.229.38|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Server: nginx Date: Wed, 27 Jul 2016 08:21:15 GMT Content-Type: video/x-msvideo Content-Length: 65707724 Connection: keep-alive Last-Modified: Wed, 31 Dec 2014 06:15:08 GMT Content-Disposition: attachment; filename="DARNA-ZAROORI-HAI-3(Movies7.In).avi" Accept-Ranges: bytes Expires: Wed, 03 Aug 2016 06:34:10 GMT Cache-Control: max-age=604800 Cache-Control: s-maxage=604800,max-age=604800 Age: 6425 X-Cache: HIT TCP_MEM_HIT dirn:0:1402323922 X-Swift-SaveTime: Wed, 27 Jul 2016 06:34:10 GMT X-Swift-CacheTime: 604800 Via: 440d210b[0,206-0,H] Length: 65707724 (63M) [video/x-msvideo] Saving to: 'DARNA-ZAROORI-HAI-3(Movies7.In).avi?md5=TU7ibYa85byjzJyJcH_LXQ&expires=1458916610.1’ So Download Manager must be getting the info from the metadata at the start of the file. For example, I only downloaded the first 70KB of the file, and: ~/tmp$ file DARNA-ZAROORI-HAI-3\(Movies7.In\).avi\?md5=TU7ibYa85byjzJyJcH_LXQ\&expires=1458916610 DARNA-ZAROORI-HAI-3(Movies7.In).avi?md5=TU7ibYa85byjzJyJcH_LXQ&expires=1458916610: RIFF (little-endian) data, AVI, 640 x 360, ~30 fps, video: H.264 X.264 or H.264, audio: MPEG-1 Layer 3 (stereo, 22050 Hz) So the info is there at the start. I expect you'll want to use a library to parse it out. I'm not sure if Qt has such functionality built-in. Perhaps have a look through the Qt Multimedia docs. Cheers.
    • SOLVED Running Qt Example client/server not working
      General and Desktop • network qtnetwork server client • • marlenet15  

      17
      0
      Votes
      17
      Posts
      6115
      Views

      @marlenet15 Hi, Here you can find a threaded TCP server example. You can ignore the module specific classes QDaemonApplication (think of it as QCoreApplication) and QDaemonLog you can substitute with QDebug. Enjoy! Kind regards.
    • UNSOLVED not able to download file from URL
      General and Desktop • network file qnetworkrequest • • Qjay  

      4
      0
      Votes
      4
      Posts
      1277
      Views

      QNetworkRequest req(url); reply=qnam.get(req); QObject::connect(reply,SIGNAL(finished()),this,SLOT(slotFinished()));
    • SOLVED trouble using the Qt provided ftp example
      General and Desktop • network ftp • • mar0029  

      9
      0
      Votes
      9
      Posts
      2143
      Views

      @mrjj I could never figure out what was calling progressDialog. So after progress dialog was created, I did timer = new QTimer(this); timer->setSingleShot(true); timer->start(5000); connect(timer, SIGNAL(timeout()), this, SLOT(testing())); and void FtpWindow::testing() { progressDialog->hide(); } crude but it works. If there were a QDialog signal for isActiveWindow or hasAppeared, it would be better. But this works. Edit: ended up using progressDialog->setAttreibute(Qt::WidgetAttribute::WA_DontShowOnScreen, true);
    • QNetworkAccessManager - first GET very slow
      General and Desktop • network qnetworkaccessm qnetworkrequest http get • • Aerius  

      15
      0
      Votes
      15
      Posts
      8734
      Views

      @djee In My Way connectToHost To Http Server Not Working, So I Call QSslConfiguration::defaultConfiguration(); Instead.
    • UNSOLVED QTcpServer - different behvaior in debug & release
      General and Desktop • network qtcpserver release mode • • reezeus  

      17
      0
      Votes
      17
      Posts
      4186
      Views

      It could be. Although it was working fine in previous release with Qt 5.5.1.
    • UNSOLVED QGraphicsScene dynamically adding shapes in specific coordinates
      QML and Qt Quick • qgraphicsscene layout network coordinate • • AthanD  

      1
      0
      Votes
      1
      Posts
      789
      Views

      No one has replied

    • SOLVED Wrong hardware MAC
      Mobile and Embedded • linux network hardware mac • • McLion  

      9
      0
      Votes
      9
      Posts
      1895
      Views

      @Wieland Thanks for confirming.
    • UNSOLVED QNetworkConfiguration with wrong bearer type
      General and Desktop • network bearer type • • ttuna  

      2
      0
      Votes
      2
      Posts
      1094
      Views

      just a push ...
    • UNSOLVED Remote object sharing (OO RPC)
      General and Desktop • network serialization server - client network socket rpc • • Hamed.Masafi  

      3
      1
      Votes
      3
      Posts
      2235
      Views

      @SGaist Hi, However is in my plan.