Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. How to debug / verify running Qt code ?
Forum Update on Monday, May 27th 2025

How to debug / verify running Qt code ?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
2 Posts 2 Posters 231 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on 15 May 2024, 23:45 last edited by
    #1

    The attached snippet of code has three tasks, performed in sequence
    close QMdiSubwindow
    Cascade all QMdiSubwindows
    Tile all QMdiSubwindows

    I can observe, in real time,
    event->accept(); - subwindow closes
    if I skip processAction(3,"actionTile");
    by commenting it out
    I can also observe
    processAction(3,"actionCascade");

    however
    if I uncomment
    processAction(3,"actionTile");
    I can observe
    event->accept();
    and
    processAction(3,"actionTile");

    BUT

    it is NOT what I expect
    it still have place of the original closed subwindow.
    At thus point I do not know why the result is not what was expected
    and need an easier way to debug the process.

    My questions
    is there a SIMPLE way to let the running code display each step as it happen?
    Ideally adding a delay between each step - for debugging purpose.

    Adding this delay just delays the entire code completion
    QObject().thread()->usleep(100010005);

    What I like to have is this

    '```
    // Accept the event to allow the window to close
    event->accept(); // TOK
    delay /show the above
    processAction(3,"actionCascade"); // TOK
    delay /show the above
    // debug real time
    // QObject().thread()->usleep(100010005);
    processAction(3,"actionTile"); // ???
    delay /show the above

    I suspect QProcess is the answer, but that is not what I would 
    call a simple solution.
    I am open to reasonable suggestions.
    
    Thanks 
    
    '```
               // Accept the event to allow the window to close
                event->accept();  // TOK
                processAction(3,"actionCascade");  // TOK 
                // debug real time
                QObject().thread()->usleep(1000*1000*5);
                processAction(3,"actionTile");    // ???
    
    1 Reply Last reply
    0
    • A Offline
      A Offline
      amanda2369weaver
      wrote on 21 May 2024, 05:05 last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0

      1/2

      15 May 2024, 23:45

      • Login

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