How to programmatically resize QProgressDialog
-
wrote on 17 Feb 2015, 21:43 last edited by
I create QProgressDialog but from parent window but I would like the default size to be be little bigger than what it comes up with. How can I change that?
@ progress = (QSharedPointer<QProgressDialog>) new QProgressDialog("Creating files...", "Cancel", 1, numFiles, this, Qt::Dialog) ;
progress->setAutoClose( false );
progress->setMinimumDuration(0);
progress->setWindowModality(Qt::WindowModal);
progress->setModal( true );
progress->setAutoReset( false );@ -
@
progress->resize(progress->size() + QSize(20. 20));
@ -
wrote on 18 Feb 2015, 16:02 last edited by
That somehow doesn't compile! I had to do the following along similar lines as you did but I don't know why your line doesn't compile:
@ QSize size = progress->size(); //+ QSize(20. 20);
size.setWidth( size.width() + 180);
progress->resize( size );@ -
Hi,
What error did you got ?
-
wrote on 19 Feb 2015, 10:46 last edited by
The problem is the point in the QSize constructor.
Try using comma instead:
@progress->resize(progress->size() + QSize(20, 20));@ -
[quote author="euchkatzl" date="1424342793"]The problem is the point in the QSize constructor.[/quote]
Oops, indeed, a typo. My bad.
-
wrote on 20 Feb 2015, 17:58 last edited by
Yes that was it! I just copy/pasted it and didn't realize it should be comma but that fixed it.
6/7