Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Can't send events to a Modal QDialog!
Forum Updated to NodeBB v4.3 + New Features

Can't send events to a Modal QDialog!

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 594 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 have class that generates QKeyEvent and sends them to the qApp->activeWidget(), but when I'm in a modal QDialog qApp->activeWidget() returns only 0!

    I've tried to do qApp->activeModalWidget() but I also get 0, so I can't send "fake" keyboard events to my Dialog, so I just stays there. I can't even close it ¬¬

    1 Reply Last reply
    0
    • E Offline
      E Offline
      Epileftric
      wrote on last edited by
      #2

      I've implemented an "exec()" like function, that doesn't leaves the main event-loop, but still it does!

      @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;
      

      }@

      What am I doing wrong?

      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