createDialog();
...
Dialog->show();
startProcess();
...
createDialog();
...
Dialog->show();
startProcess();
...
To copy to clipboard, switch view to plain text mode
void CreateDialog(){
DialogBar->setRange(0,0);
DialogBar->setTextVisible(false);
connect(stopButton,SIGNAL(clicked()),this,SLOT(stop()));
verticalLayout->addWidget(DialogLabel);
verticalLayout->addWidget(DialogBar);
verticalLayout->addWidget(stopButton);
Dialog->setWindowTitle(tr("Bitte Warten"));
DialogLabel->setText(tr("Starten Sie das Gerät neu. \nEs wird nach einem Gerät gesucht..."));
Dialog->setLayout(verticalLayout);
Dialog
->window
()->layout
()->setSizeConstraint
(QLayout::SetFixedSize);
Dialog->setModal(true);
Dialog->installEventFilter(this);
void CreateDialog(){
Dialog = new QDialog(this);
QVBoxLayout *verticalLayout = new QVBoxLayout;
QLabel *DialogLabel = new QLabel;
QPushButton *stopButton = new QPushButton("Stop");
QProgressBar *DialogBar = new QProgressBar;
DialogBar->setRange(0,0);
DialogBar->setTextVisible(false);
connect(stopButton,SIGNAL(clicked()),this,SLOT(stop()));
verticalLayout->addWidget(DialogLabel);
verticalLayout->addWidget(DialogBar);
verticalLayout->addWidget(stopButton);
Dialog->setWindowTitle(tr("Bitte Warten"));
DialogLabel->setText(tr("Starten Sie das Gerät neu. \nEs wird nach einem Gerät gesucht..."));
Dialog->setLayout(verticalLayout);
Dialog->window()->layout()->setSizeConstraint(QLayout::SetFixedSize);
Dialog->setModal(true);
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.
Bookmarks