[Qt-interest] QProgressDialog and Cancel and Window Flags

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Thu Feb 10 10:51:31 CET 2011


On 2011-02-10 Alex Alex Strickland wrote:

> ...I see you can pass Qt::WindowFlags to the
> constructor, but I can't figure out if there is a combo that will disable the cross?

There exists a Qt::WindowCloseButtonHint with which you can *request* a close button, but I don't see any flag with which you could explicitly request *not* to have a close button.

So if you *really* want to have a dialog with a progress bar and which the user cannot "cancel" (IMHO that denies the whole purpose of a progress dialog, but anyway...) you could do a frameless dialog (with no close button and no nothing around it) with the flag Qt::FramelessWindowHint. Off course you are then responsible for drawing a title bar yourself (if needed), handle the resize of the dialog etc.

But if you just want to display a "informative progress bar which the user can just look at and say 'ahhhh... nice!'" then this might exactly meet your requirements. ;)

Note that these flags are really just "hints" to the underlying window manager, just as the Pirate Code is more what you'd call "guidelines" than actual rules... 

Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22





More information about the Qt-interest-old mailing list