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. Help with QDialog
Qt 6.11 is out! See what's new in the release blog

Help with QDialog

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 832 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.
  • E Offline
    E Offline
    Epileftric
    wrote on last edited by
    #1

    I did the post originally in the Mobile and Embedded section but there isn't much people going there, so I'll just ask it here again since it's not entirely embedded related.

    "Original Post":http://qt-project.org/forums/viewthread/53431/

    So far I've realised that the main reason I'm not having events in the QDialog is because I manually generate them with a QSerialPort and send them. Since QDialog stops the main event-loop, and runs a "parallel" one I can't afford to do so, since I'm generating keyboards events there, and also receiving some other data so plot in a QwtPlot, and saving those bytes to a log.

    So i've come up with the Idea of leaving the QDialog heritage because of that, since I can't leave the event loop. So I instead created a plain widget

    @int QSelectionDialog::getSelection(void){
    setModal(false);
    show();
    isDone=false;
    while ( !isDone ){
    qApp->processEvents();
    }
    int ret_val;
    ret_val = eleccion->text().toInt();
    if ( ret_val > last->count() )
    ret_val = 0;

            hide();
            return ret_val;
    }
    

    @

    So in the main-loop I create this widget, and instead of runing "exec()" as a normal QDialog, I run getSelection() . I wait for the condition of accepting this "dialog" and still I attend for all signals and events.

    The problem is that still doing it this way, I can't attend the QSerialPort since there's something else blocking that loop.

    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