Results 1 to 2 of 2

Thread: QMessageBox with Enter key

  1. #1
    Join Date
    Mar 2009
    Location
    Israel
    Posts
    20
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Post QMessageBox with Enter key

    Hi all,

    I have code :

    QMessageBox k(parent);
    k.setText(msg);
    k.setStandardButtons(QMessageBox::Ok);
    k.setDefaultButton(QMessageBox::Ok);
    int r = k.exec();

    1.If I press mouse on Ok button , message box close and parent application become enable.

    2.If I press Enter from keyboard message box closed but parent application is DISABLE ??!!!

    r value in both scenario is 1024.

    WHY ?

  2. #2
    Join Date
    Sep 2008
    Location
    Poland
    Posts
    80
    Thanks
    4
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QMessageBox with Enter key

    beacuse your application seems to have some behavior 'disable on press enter'.And while you are closing QMessageBox by enter key,the first one closes the msg,but next ones provided by autorepeat will be sent to your application.
    Please show all your code,then maybe I'll be able to help you better.

Similar Threads

  1. How to disable enter
    By phillip_Qt in forum Qt Programming
    Replies: 11
    Last Post: 23rd August 2012, 07:52
  2. QMessageBox If not enter all the variables
    By NewLegend in forum Qt Programming
    Replies: 9
    Last Post: 19th November 2010, 14:18
  3. How to use ENTER key on QListWidget
    By sanket.mehta in forum Qt Programming
    Replies: 3
    Last Post: 13th September 2010, 13:05
  4. QTextBrowser and ENTER key
    By szarek in forum Qt Programming
    Replies: 5
    Last Post: 10th July 2010, 20:47
  5. Replies: 1
    Last Post: 14th September 2008, 23:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.