Results 1 to 2 of 2

Thread: How to keep the mouse event?

  1. #1

    Default How to keep the mouse event?

    I have a QMainWindow, its center widget is used to draw figures(with mouse) , and one toolbar which has a QLineEdit.

    The perfect behavior is that if Tab pressed, the focus will jump to the lineEdit in the toolbar, the lineEdit will have the focus, but the center widget will still receivee the mouse event.

    The situation is that the lineEdit do have foucs after the tab is pressed,
    but the center widget will not receive mouse event( because it lost the focus)

    I think this is a very hard problem, Is there any way to solve this problem?

    Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to keep the mouse event?

    You could make the line edit a focus proxy of the canvas. Mouse input is not really related to focus but rather with activation. On some systems this is the same, on others this differs. Try the focus proxy or set the focus policy of the canvas to NoFocus.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Mouse over event on qwtmarker?
    By shud in forum Qwt
    Replies: 2
    Last Post: 20th September 2009, 15:12
  2. Replies: 4
    Last Post: 19th February 2009, 11:10
  3. how to send a emulated mouse event to QListWidget
    By yxmaomao in forum Qt Programming
    Replies: 4
    Last Post: 22nd July 2008, 02:49
  4. pass mouse event information to another widget
    By Rooster in forum Qt Programming
    Replies: 5
    Last Post: 12th July 2008, 04:23
  5. The event fired by the mouse click on the frame
    By Placido Currò in forum Qt Programming
    Replies: 8
    Last Post: 3rd March 2007, 09:05

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.