Results 1 to 3 of 3

Thread: MouseEvent & QTextEdit

  1. #1
    Join Date
    Mar 2006
    Location
    Hyderabad
    Posts
    69
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default MouseEvent & QTextEdit

    Sir,
    Iam having a problem with mouseDoubleClickEvent. Iam showing you the part of my code:

    CPT::CPT(QWidget *parent):QWidget(parent)
    {
    //various child widgets are added
    QTextEdit *te=new QTextEdit(this);
    //some other widgets
    }

    Since te is the child widget of CPT, I cannot catch the mouseDoubleClickEvent on it , if I write the following:
    void CPT::mouseDoubleClickEvent(QMouseEvent *)
    { ... }

    How can I catch this event when mouse is double clicked on te. Kindly show the code part if possible.

    Thanks alot ,
    Sarma.

    Edit/Delete Message

  2. #2
    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: MouseEvent & QTextEdit

    Please do not double post, and use code-tags around your code postings to make it more readable..

  3. #3
    Join Date
    Feb 2006
    Posts
    31

    Post Re: MouseEvent & QTextEdit

    CPT::CPT(QWidget *parent)
    :QWidget(parent)
    {
    QTextEdit *te=new QTextEdit(this);
    connect(te, SIGNAL(doubleClicked(int, int)), SLOT(teDoubleClicked(int,int)));
    }

    void CPT::teDoubleClicked(int para, int pos)
    {
    //your code here
    }

Similar Threads

  1. QTextEdit Performance handling large paragraphs
    By netuno in forum Qt Programming
    Replies: 14
    Last Post: 1st September 2010, 22:58
  2. Drawing on QTextEdit
    By jgrauman in forum Qt Programming
    Replies: 3
    Last Post: 7th February 2009, 09:40
  3. QTextEdit and cursor
    By newplayer in forum Qt Programming
    Replies: 1
    Last Post: 30th July 2008, 23:24
  4. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  5. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03

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.