I create a modal gui just to show a list with a QListWidget.
This is the class:

Qt Code:
  1. class CShowRolesModalGui : public QDialog
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. CShowRolesModalGui(const QStringList& items, QWidget* parent);
  7.  
  8. private slots:
  9. void Close () { done(0); }
  10. };
To copy to clipboard, switch view to plain text mode 

and this is the code:
Qt Code:
  1. CShowRolesModalGui::CShowRolesModalGui(const QStringList& items, QWidget* parent) : QDialog(parent)
  2. {
  3. setGeometry(QRect(QPoint(205, 430), QSize(400, 300)));
  4. setFixedSize(400, 300);
  5. setStyleSheet(ROLES_WIDGET_STYLE);
  6. setWindowFlags(Qt::FramelessWindowHint);
  7.  
  8. QListWidget* listView = new QListWidget(this);
  9. listView->setGeometry(2, 2, 396, 260);
  10. listView->setStyleSheet(LIST_SHOW_ROLE_STYLE);
  11. listView->addItems(items);
  12.  
  13. QPushButton* btn = new QPushButton(tr("Ok"), this);
  14. btn->setGeometry(175, 265, 50, 30);
  15. btn->setStyleSheet(FREQ_MODAL_BTN_STYLE);
  16. connect(btn, SIGNAL(clicked()), this, SLOT(Close()));
  17. }
To copy to clipboard, switch view to plain text mode 

If I call the function setWindowFlags (and I have to call it as I don't want a gui with a border), the QListWidget's scrollbar is visible but doesn't work with the mouse buttons, only with the wheel and the keyboard.

How can I solve the problem ? I really need a GUI without a border.
Thanks.

PS: I doesn't work also with:
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
setWindowFlags(Qt::FramelessWindowHint);
setWindowFlags(Qt::CustomizeWindowHint);
and so on ...