Hello,

I want to create an invisible, frameless, dragable window with two visible buttons.
Frameless an invisible works fine when I use:
Qt Code:
  1. setWindowFlags(Qt::FramelessWindowHint);
  2. setAttribute(Qt::WA_TranslucentBackground);
To copy to clipboard, switch view to plain text mode 
Added Buttons are visible.

But if I click around the buttons, where the invisible mainWindow should be, the click goes right through to whatever application there behind is.
I reimplemented the mouseMoveEvent and mousePressEvent, to drag the main window. When the window is visible this works great:
Qt Code:
  1. void MainWindow::mouseMoveEvent(QMouseEvent *event)
  2. {
  3. move(event->globalX()-m_nMouseClick_X_Coordinate,event->globalY()-m_nMouseClick_Y_Coordinate);
  4. }
  5.  
  6. void MainWindow::mousePressEvent(QMouseEvent *event)
  7. {
  8. m_nMouseClick_X_Coordinate = event->x();
  9. m_nMouseClick_Y_Coordinate = event->y();
  10. qDebug() << "mouse press event" << endl;
  11. }
To copy to clipboard, switch view to plain text mode 

If it is invisible nothing happens.

How can I make the invisible area of the mainwindow clickable, so i can drag it?

Regards

Redar

Edit: This program should run on windows