Results 1 to 2 of 2

Thread: Quite weird. mouseDoubleClickEvent doesn't work

  1. #1
    Join Date
    Aug 2010
    Posts
    1
    Qt products
    Qt4

    Unhappy Quite weird. mouseDoubleClickEvent doesn't work

    Hi all. I'm using Qt4 Jambi 4.5.x and new to it . I want to override mouseDoubleClickEvent in QTextEdit widget but failed. I cannot see the log. I had searched many samples and I think my code should be OK. I don't know why my code cannot work.

    Would someone kindly enough to have a look at it? Thanks in advance.

    Qt Code:
    1. package org.langpartner.nword.view;
    2.  
    3. import com.trolltech.qt.gui.QApplication;
    4. import com.trolltech.qt.gui.QMainWindow;
    5. import com.trolltech.qt.gui.QMouseEvent;
    6. import com.trolltech.qt.gui.QTextEdit;
    7.  
    8. public class TextEditTest extends QMainWindow {
    9.  
    10. private QTextEdit textEdit;
    11.  
    12. public TextEditTest() {
    13. textEdit = new QTextEdit(this);
    14. }
    15.  
    16. @Override
    17. protected void mouseDoubleClickEvent(QMouseEvent arg__1) {
    18. System.out.println("Entered contextMenuEvent...");
    19. }
    20.  
    21. static public void main(String args[]) {
    22. QApplication.initialize(args);
    23. TextEditTest mw = new TextEditTest();
    24. mw.show();
    25. QApplication.exec();
    26. }
    27.  
    28. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Quite weird. mouseDoubleClickEvent doesn't work

    The mouse click event is catched by the text edit and probably not forwarded to your main window. So in that design you have to use an event filter. But that is only a guess since I don't use Jambi.

Similar Threads

  1. macdeployqt doesn't work at all.
    By pherthyl in forum Installation and Deployment
    Replies: 1
    Last Post: 10th July 2009, 00:42
  2. Q_PROPERTY: the example doesn't work!
    By YaK in forum Qt Programming
    Replies: 3
    Last Post: 7th July 2009, 11:28
  3. Shortcut doesn't work
    By stella1016 in forum Qt Programming
    Replies: 1
    Last Post: 28th May 2009, 02:37
  4. setFont doesn't work
    By DadaLee in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 11th August 2008, 06:29
  5. setWindowOpacity doesn't work!
    By nupul in forum Qt Programming
    Replies: 5
    Last Post: 21st April 2006, 18:28

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.