[Interest] Move Frameless QQuickView in Qt 5.0

Thomas Senyk thomas.senyk at pelagicore.com
Thu Apr 18 18:22:42 CEST 2013


On Thu, April 18, 2013 03:14:56 PM Praveena_Padarthi wrote:
> 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_nMouseC
> lick_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.

QQuickView isN'T a QWidget! :)
QQuickView is a QWindow, which has:
http://qt-project.org/doc/qt-5.0/qtgui/qwindow.html#setPosition

> 
> ________________________________
> 
> 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.



More information about the Interest mailing list