Results 1 to 2 of 2

Thread: Mouse Double click problemm

  1. #1
    Join Date
    Sep 2014
    Posts
    94
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Mouse Double click problemm

    hi,

    i had taken to classes


    QMianwindow and Qwidget..

    Qmainwindow is mainApplication and Qwidget is another class....

    Qwidget is framesless widget ...showing top on main application....



    m_pCameraWidget = new CameraWidget(this); // was declared in main application constructuor // Qwidget class name as m_pCameraWidget i has given.....


    // in camera Qwidget i has given
    void CameraWidget::mouseDoubleClickEvent(QMouseEvent *event)
    {
    if(!isMaximized())
    {
    showMaximized();
    }
    else
    {
    showNormal();
    }

    }

    m_pCameraWidget = new CameraWidget(this); // when i declare in mainwindow constructor it is not working

    m_pCameraWidget = new CameraWidget(); // when i declare in mainwindow constructor it is working

    why can anybody give solution with code ....

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Mouse Double click problemm

    Quote Originally Posted by mouni View Post
    m_pCameraWidget = new CameraWidget(this); // when i declare in mainwindow constructor it is not working

    m_pCameraWidget = new CameraWidget(); // when i declare in mainwindow constructor it is working
    A QWidget without a parent (second case) becomes a top level window, if you pass a parent (first case) it is part of the parent's window.

    Only widgets that are window types (e.g. QMainWindow, QDialog, QMenu) show as a separate window even when they have a parent.

    Cheers,
    _

Similar Threads

  1. Mouse double click on QwtScaleDraw
    By wagmare in forum Qwt
    Replies: 2
    Last Post: 11th April 2016, 16:55
  2. Replies: 2
    Last Post: 16th July 2012, 12:40
  3. Replies: 1
    Last Post: 30th October 2011, 23:50
  4. can not get mouse double click event for QGraphicsItem
    By learning_qt in forum Qt Programming
    Replies: 2
    Last Post: 14th September 2009, 20:36
  5. Replies: 1
    Last Post: 9th February 2007, 09:41

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.