Results 1 to 17 of 17

Thread: qpushbutton setfocus signal

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qpushbutton setfocus signal

    Quote Originally Posted by skuda View Post
    wow jpn i have compiled your test and i have the same problem with it that with my pyqt code, if i set the spinbox above 50 and press enter i get the messagebox of the emitted signal from the button, hmmm can be any problem with my qt compilation?
    Ahh, that's it! I didn't realize to press enter but only switched focus to other widget (which causes editingFinished() to be emitted as well).. Anyway, the "emit button" is the default button of the dialog so that's why it gets clicked by pressing enter. In C++, you would add
    Qt Code:
    1. emitButton->setAutoDefault(false);
    To copy to clipboard, switch view to plain text mode 
    and the problem is gone. Refer to QPushButton docs for more information about "default buttons" and "auto default buttons".
    J-P Nurmi

  2. The following user says thank you to jpn for this useful post:

    skuda (23rd November 2007)

Similar Threads

  1. Replies: 2
    Last Post: 17th May 2006, 21:01
  2. no such signal QListBox::currentChanged()
    By jopie bakker in forum Newbie
    Replies: 2
    Last Post: 2nd March 2006, 15:17
  3. Mouseover event on QPushButton
    By Twey in forum Newbie
    Replies: 2
    Last Post: 13th January 2006, 18:45

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
  •  
Qt is a trademark of The Qt Company.