I have no problems with moving my window, I want to
have an opportunity to resize it!
Here is my code:
myprog.h
Qt Code:
  1. #include <QtGui>
  2. #include <QtDeclarative>
  3.  
  4.  
  5. class MyProg : public QDeclarativeView
  6. {
  7. Q_OBJECT
  8.  
  9. public:
  10. MyProg(QWidget *parent = 0);
  11. ~MyProg();
  12.  
  13. Q_INVOKABLE void moveWindow(int x,int y, int, int);
  14.  
  15.  
  16. };
To copy to clipboard, switch view to plain text mode 

myprog.cpp

Qt Code:
  1. #include "myprog.h"
  2.  
  3. MyProg::MyProg(QWidget *parent)
  4. // : QWidget(parent,0)
  5. : QDeclarativeView(parent)
  6. {
  7.  
  8.  
  9. rootContext()->setContextProperty("mainwnd",this);
  10. setResizeMode(QDeclarativeView::SizeRootObjectToView);
  11. setSource(QUrl("qml/main.qml"));
  12.  
  13.  
  14.  
  15. }
  16.  
  17. MyProg::~MyProg()
  18. {
  19.  
  20. }
  21.  
  22. void MyProg::moveWindow(int x,int y, int lx, int ly)
  23. {
  24. QPoint p = mapToGlobal(QPoint(x,y));
  25. p.setX(p.x() - lx);
  26. p.setY(p.y() - ly);
  27. this->move(p);
  28. }
To copy to clipboard, switch view to plain text mode 

main.cpp

Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "myprog.h"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.  
  7. QApplication a(argc, argv);
  8.  
  9.  
  10. MyProg w;
  11.  
  12.  
  13. w.setWindowFlags(Qt::FramelessWindowHint) ;
  14. w.setAttribute(Qt::WA_TranslucentBackground);
  15. w.setStyleSheet("background:transparent");
  16.  
  17.  
  18.  
  19.  
  20.  
  21. w.show();
  22.  
  23. return a.exec();
  24. }
To copy to clipboard, switch view to plain text mode 

It seems to me, that I must catch the press button event in qml code first, and then calculate QDeclarativeView window geometry in my cpp code...
something like that,I think.