Bennett Helm wrote:

>> Jean-Marc Lasgouttes wrote:
>>> Angus> Good. Note that this focus thing is not confined to the
>>> Mac. Angus> The change worked also under linux. I take it that qt
>>> 3.3.x Angus> does the right thing for all supported OSes?
>>>
>>> Did you notice a difference with your patch? I did not see any.
>>
>> Yes. I followed the prescription outlined in the bug report.
>> Without the patch, keyboard input went to the lyx screen. With the
>> patch, it went to the index dialog.
> 
> I've tried the patch on LyX/Mac. While it doesn't seem to affect the
> focus issue (which, as Jean-Marc noted, is not a problem with
> qt-3.3.x), it does change dialogs to be always on top -- to be modal
> -- which is not desirable on the Mac, at least.

I'm not disputing your observations, but I do find them surprising. 
The Qt docs for Qt 3.2 state:


Member Function Documentation

explicit QDialog::QDialog ( QWidget * parent = 0, const char * name = 
0, bool modal = FALSE, WFlags f = 0 ) Constructs a dialog called 
name, with parent parent. 

A dialog is always a top-level widget, but if it has a parent, its 
default location is centered on top of the parent. It will also share 
the parent's taskbar entry. 

The widget flags f are passed on to the QWidget constructor. If, for 
example, you don't want a What's This button in the titlebar of the 
dialog, pass WStyle_Customize | WStyle_NormalBorder | WStyle_Title | 
WStyle_SysMenu in f. 

Warning: In Qt 3.2, the modal flag is obsolete. There is now a 
setModal() function that can be used for obtaining a modal behavior 
when calling show(). This is rarely needed, because modal dialogs are 
usually invoked using exec(), which ignores the modal flag. 


So, it seems to me that the parent thingy is meant to be orthogonal 
to the modal thingy. What happens if you change QDialogView::show():

void QDialogView::show()
{
        if (!form()) {
                build();
        }

        form()->setMinimumSize(form()->sizeHint());

        update();  // make sure its up-to-date

        form()->setCaption(toqstr(getTitle()));

        if (form()->isVisible()) {
                form()->raise();
        } else {
+               if (form()->isModal()) {
+                       lyxerr << "Wow! Modal dialog!" << std::endl;
+                       form()->setModal(false);
+               }
                form()->show();
        }
}

-- 
Angus

Reply via email to