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. Last debug does not print anything :/
QtWS25 Last Chance

Last debug does not print anything :/

Scheduled Pinned Locked Moved Unsolved General and Desktop
qapplicationqdebugconsole
5 Posts 3 Posters 1.8k Views
  • 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.
  • S Offline
    S Offline
    sami1592
    wrote on 30 Jan 2016, 18:21 last edited by sami1592
    #1

    The last debug (qDebug() << QTime::currentTime()) of the program is not printing anything :/ Can anyone shed some light on this matter?

    #include <QtWidgets>
    #include <QString>
    #include <QDebug>
    #include <QTime>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QWindow window;
        window.show();
    
        qDebug() << "BEFORE: Double click interval : " << QApplication::doubleClickInterval();
        qDebug() << QTime::currentTime();
    
        QApplication::setDoubleClickInterval(300);
    
        qDebug() << "AFTER: Double click interval : " << QApplication::doubleClickInterval();
        qDebug() << QTime::currentTime();
    
        int i = app.exec();
    
        qDebug() << "Returen value of QApplication: " << i;
        qDebug() << QTime::currentTime();
    
    
        return i;
    }
    
    

    Output:

    Starting C:\Qt\Qt5.5.1\Examples\Qt-5.5\widgets\tutorials\widgets\build-toplevel-Desktop_Qt_5_5_1_MSVC2013_64bit-Debug\debug\toplevel.exe...
    BEFORE: Double click interval :  500
    QTime("00:15:30.090")
    AFTER: Double click interval :  300
    QTime("00:15:30.201")
    Returen value of QApplication:  0
    C:\Qt\Qt5.5.1\Examples\Qt-5.5\widgets\tutorials\widgets\build-toplevel-Desktop_Qt_5_5_1_MSVC2013_64bit-Debug\debug\toplevel.exe exited with code 0
    

    PS: Cannot find any option to include any screenshot, it would have made my problem a bit clearer :(

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Joel Bodenmann
      wrote on 30 Jan 2016, 18:29 last edited by Joel Bodenmann
      #2

      I just copy-pasted your code and it works as expected here:

      BEFORE: Double click interval :  500
      QTime("19:28:45.178")
      AFTER: Double click interval :  300
      QTime("19:28:45.240")
      Returen value of QApplication:  0
      QTime("19:28:47.181")
      

      I am using Qt 5.4.2 on a Windows 10 64-Bit machine. Compiler is MinGW.
      Sadly I can't provide anything more useful than that information :(

      Industrial process automation software: https://simulton.com
      Embedded Graphics & GUI library: https://ugfx.io

      S 1 Reply Last reply 31 Jan 2016, 04:24
      1
      • H Offline
        H Offline
        hskoglund
        wrote on 30 Jan 2016, 19:04 last edited by
        #3

        Hi, once you call app.exec(); all bets are off on how much qDebug() output that will survive (I think it's platform dependent).
        When compiling with 32b-bit Visual Studio 2013, I get the same behavior as you, i.e. that last QTime::currentTime() is thrown awat because the app is exiting. Using MingGW (@Joel-Bodenmann above) it seems you are a bit more lucky.

        S 1 Reply Last reply 31 Jan 2016, 05:04
        1
        • J Joel Bodenmann
          30 Jan 2016, 18:29

          I just copy-pasted your code and it works as expected here:

          BEFORE: Double click interval :  500
          QTime("19:28:45.178")
          AFTER: Double click interval :  300
          QTime("19:28:45.240")
          Returen value of QApplication:  0
          QTime("19:28:47.181")
          

          I am using Qt 5.4.2 on a Windows 10 64-Bit machine. Compiler is MinGW.
          Sadly I can't provide anything more useful than that information :(

          S Offline
          S Offline
          sami1592
          wrote on 31 Jan 2016, 04:24 last edited by
          #4

          @Joel-Bodenmann Behavior in my machine is a bit random. Thanks for the effort, it's much appreciated :)

          1 Reply Last reply
          0
          • H hskoglund
            30 Jan 2016, 19:04

            Hi, once you call app.exec(); all bets are off on how much qDebug() output that will survive (I think it's platform dependent).
            When compiling with 32b-bit Visual Studio 2013, I get the same behavior as you, i.e. that last QTime::currentTime() is thrown awat because the app is exiting. Using MingGW (@Joel-Bodenmann above) it seems you are a bit more lucky.

            S Offline
            S Offline
            sami1592
            wrote on 31 Jan 2016, 05:04 last edited by
            #5

            @hskoglund Thanks for the info

            1 Reply Last reply
            0

            5/5

            31 Jan 2016, 05:04

            • Login

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