Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how do you make the internet check not make the application delay opening
Forum Updated to NodeBB v4.3 + New Features

how do you make the internet check not make the application delay opening

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 242 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Blackzero
    wrote on last edited by
    #1

    How do I make this internet check not interfere when opening the application, or make this internet check run behind the scenes so as not to make the application delay opening? I enlarge the delay so that if the internet is available and unstable it will still get the status that it is connected to the internet.

    int main(int argc, char *argv[])
    {
    
        QApplication a(argc, argv);
       
        socket.connectToHost(googleurl, 80);
        if (socket.waitForConnected(10000))
    	{
    		
    	}
        MainWindow w;
        w.show();
    
        return a.exec();
    }
    
    JoeCFDJ 1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Use signals and slots - connec to https://doc.qt.io/qt-6/qabstractsocket.html#connected and the respective error signals to see if the connection is ok or not.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      4
      • B Blackzero

        How do I make this internet check not interfere when opening the application, or make this internet check run behind the scenes so as not to make the application delay opening? I enlarge the delay so that if the internet is available and unstable it will still get the status that it is connected to the internet.

        int main(int argc, char *argv[])
        {
        
            QApplication a(argc, argv);
           
            socket.connectToHost(googleurl, 80);
            if (socket.waitForConnected(10000))
        	{
        		
        	}
            MainWindow w;
            w.show();
        
            return a.exec();
        }
        
        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by
        #3

        @Blackzero create a splash widget.

        Pl45m4P 1 Reply Last reply
        1
        • JoeCFDJ JoeCFD

          @Blackzero create a splash widget.

          Pl45m4P Online
          Pl45m4P Online
          Pl45m4
          wrote on last edited by Pl45m4
          #4

          @JoeCFD

          @Blackzero i.e. a Welcome screen with a progress bar which says something like "Checking for Internet connection..." and then you continue once you know that the computer is connected to the Internet.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved