I forgot to mention that the widget you want to be translucent can't be the top widget, it has to be a child of something here is a working exemple:
Qt Code:
  1. m_widgetFrame= new QWidget(0, Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
  2. m_widgetFrame->setGeometry(0, 0, 100, 100);
  3. m_widgetFrame->setAttribute(Qt::WA_TranslucentBackground);
  4.  
  5. m_widgetContent = new QWidget(m_widgetFrame);
  6. m_widgetContent ->setStyleSheet(QString::fromUtf8("QWidget{background-color: qlineargradient(spread:reflect, x1:0, y1:1, x2:0,y2:0,stop:0 rgba(255, 255, 255, 255),stop:1 rgba(255, 255, 255, 0));}"));
  7. m_widgetContent ->setGeometry(0,0,m_widgetFrame->width(),m_widgetFrame->height());
  8.  
  9. m_widgetFrame->show();
To copy to clipboard, switch view to plain text mode