I have a widget with these flags and attributes:
Qt Code:
  1. setWindowFlags(Qt::SubWindow | Qt::FramelessWindowHint );
  2. setTransformationAnchor(QGraphicsView::AnchorViewCenter);
  3.  
  4. this->setAttribute(Qt::WA_TranslucentBackground);
  5. this->setAttribute(Qt::WA_TransparentForMouseEvents);
To copy to clipboard, switch view to plain text mode 
To make the window always on top:
Qt Code:
  1. setWindowFlags(Qt::FramelessWindowHint | Qt::SubWindow | Qt::WindowStaysOnTopHint);
To copy to clipboard, switch view to plain text mode 
So when the app runs, the window is on top of every other window, but as soon as I click any other window it goes behind the windowI clicked.
Why this behaviour?