PDA

View Full Version : AcceptDrops ?



ct
23rd July 2007, 16:13
I am using the designer for Qt 4.3. Isn't setting the acceptDrops for a dialog to true supposed to remove that stupid "?" button beside "X" close button and replace it with a "_" minimized button that works ?

Well my Dialog is of Qt::ApplicationModal, I have set acceptDrops to true but guess I am missing something. In designer I get the Minimized Button but when I compile the dialog has the ? button.

in the ui_myDialog.h file , it has set the "setAcceptDrops(true)" but still no effect ? Why ??

fullmetalcoder
23rd July 2007, 16:19
Isn't setting the acceptDrops for a dialog to true supposed to remove that stupid "?" button beside "X" close button and replace it with a "_" minimized button that works ?
I don't think so... Where did you get such an idea BTW? :rolleyes: Accept drops has no effect on title bar and buttons, it only change the behavior of a widget toward the internal event-driven drag and drop mechanism of Qt...
The application has no real control over the buttons you're talking about since the frame is handled by the window manager. All one can do is using window flags (http://doc.trolltech.com/4.3/qt.html#WindowType-enum) to pass hints to the WM and, if unsatisfied, override the WM to draw its own frame and control buttons (there's been a thread about this and you can find the result of it in the Qt software section (head for "skins")...).

ct
23rd July 2007, 16:27
Well, in the designer when I set the acceptDrops to true the button changed so obviously I thought thats what it is supposed to do .. I am new to Qt 4.3 by the way and a bit rusty in the whole Qt environment :D

http://www.qtcentre.org/forum/attachment.php?attachmentid=1391&stc=1&d=1185203698

fullmetalcoder
23rd July 2007, 16:36
I guess that's an effect of the preview window... Not even really a change unless I'm missing something (can't know as your attachment is someway corrupted (talking about the link here...))

ct
23rd July 2007, 16:48
The link is fine. You saw the [_][X] didn't you ? thats the part of the dialog. Shouldn't the preview give an overview of what the dialog is likely to be.

Instead of [_][X] I still get [?][X] on the upper side of the dialog after compiling.

fullmetalcoder
23rd July 2007, 17:15
The link is fine. You saw the [_][X] didn't you ?
I saw nothing but a page telling me something akin to : "Invalid Attachment specified. If you followed a valid link, please notify the administrator (http://www.qtcentre.org/forum/sendmessage.php)"


Instead of [_][X] I still get [?][X] on the upper side of the dialog after compiling.Then the preview is not to blame but the window flags I've been talking about already ,or your Window Manager though I really doubt it... As these flags cannot be modified within Qt Designer you got to add a few lines of code within your source, e.g. :

setWindowFlags((windowFlags() & (~Qt::WindowContextHelpButtonHint)) | Qt::WindowMinimizeButtonHint);

ct
23rd July 2007, 17:27
Thanks, thats a neat piece of code, it worked. I guess I am not used to attachments, I will see to it that I will get it right next time.
Thanx again.