[Interest] Move Frameless QQuickView in Qt 5.0

Praveena_Padarthi Praveena_Padarthi at mahindrasatyam.com
Thu Apr 18 17:14:56 CEST 2013


Hello Team,

I have done the Move Frameless QWidget in Qt 5.0

Code is in below,

code using QMainWindow:


#include <QtGui>

class myMainWindow:public QMainWindow
{
    public:
    myMainWindow():QMainWindow(),m_nMouseClick_X_Coordinate(0),m_nMouseClick_Y_Coordinate(0)
    {
      setWindowFlags(Qt::FramelessWindowHint);
      resize(250, 220);
    };

    ~myMainWindow(){};

    void mousePressEvent(QMouseEvent* event)
    {
        m_nMouseClick_X_Coordinate = event->x();
        m_nMouseClick_Y_Coordinate = event->y();
    };

    void mouseMoveEvent(QMouseEvent* event)
    {
        move(event->globalX()-m_nMouseClick_X_Coordinate,event->globalY()-m_nMouseClick_Y_Coordinate);
    };

  private:
    int  m_nMouseClick_X_Coordinate;
    int  m_nMouseClick_Y_Coordinate;
};


the above code is working fine when using QMainWindow class.

but when using QQuickView class in Qt 5.0, it is giving the error with
"cannot call memberfunction 'void QWidget::move(int,int)' without object

Please guide me how can i move the frameless window by using QQuickView when

mouseMoveEvent(QMouseEvent* event)


Thanks in advance.

Regards,
praveena.

________________________________

DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130418/ee8051b5/attachment.html>


More information about the Interest mailing list