Qt Code:
  1. createDialog();
  2. ...
  3. Dialog->show();
  4. startProcess();
  5. ...
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void CreateDialog(){
  2. Dialog = new QDialog(this);
  3.  
  4. QVBoxLayout *verticalLayout = new QVBoxLayout;
  5. QLabel *DialogLabel = new QLabel;
  6. QPushButton *stopButton = new QPushButton("Stop");
  7. QProgressBar *DialogBar = new QProgressBar;
  8.  
  9. DialogBar->setRange(0,0);
  10. DialogBar->setTextVisible(false);
  11.  
  12. connect(stopButton,SIGNAL(clicked()),this,SLOT(stop()));
  13.  
  14. verticalLayout->addWidget(DialogLabel);
  15. verticalLayout->addWidget(DialogBar);
  16. verticalLayout->addWidget(stopButton);
  17.  
  18. Dialog->setWindowTitle(tr("Bitte Warten"));
  19. DialogLabel->setText(tr("Starten Sie das Gerät neu. \nEs wird nach einem Gerät gesucht..."));
  20.  
  21. Dialog->setLayout(verticalLayout);
  22. Dialog->window()->layout()->setSizeConstraint(QLayout::SetFixedSize);
  23. Dialog->setModal(true);
  24.  
  25. Dialog->installEventFilter(this);
To copy to clipboard, switch view to plain text mode 

I have a Dialog which i show while I search for my Device (sending Data to port, if there is no answer: send again, if there is an answer: close the dialog, a button can interrupt the search).

While this Search I want the user to see the Progressbar so he knows that something is happening. It was working but then i changed the code and too late I realised that it isn't working anymore.

The progressbar is empty and does nothing, only when I click on the dialog and move it I can wake it up but then of course the process does not go on.
I would call QApplication:rocessEvents() to wake up the progressbar but I am not setting the value of the progressbar or anything like that, so i do not know where I should call it.