Remove modal child widget buttons from tests/manual/windowmodality
This functionality does not work anymore. Modality is tied to top-level windows, not to any arbirtrary QWidget. Change-Id: Ie7545cbcfbf4021850b215f014bb0f7274971327 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
parent
5185a28139
commit
19109a7697
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>565</width>
|
<width>574</width>
|
||||||
<height>361</height>
|
<height>300</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -20,10 +20,10 @@
|
|||||||
<string>Select the type of dialog to create:</string>
|
<string>Select the type of dialog to create:</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="5" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QPushButton" name="siblingApplicationModalButton">
|
<widget class="QPushButton" name="siblingApplicationModalButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Sibling Application Modal Dialog</string>
|
<string>Application Modal Dialog (sibling)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -34,28 +34,14 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QPushButton" name="applicationModalChildButton">
|
<widget class="QPushButton" name="applicationModalNoParentButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Application Modal Child Widget</string>
|
<string>Application Modal Dialog (no parent)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QPushButton" name="siblingWindowModalButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Sibling Window Modal Dialog</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QPushButton" name="modelessNoParentButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Modeless Dialog (no parent)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QPushButton" name="applicationModalButton">
|
<widget class="QPushButton" name="applicationModalButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Application Modal</string>
|
<string>Application Modal</string>
|
||||||
@ -69,46 +55,14 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="0" column="1">
|
||||||
<widget class="QPushButton" name="windowModalChildButton">
|
<widget class="QPushButton" name="modelessNoParentButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Window Modal Child Widget</string>
|
<string>Modeless Dialog (no parent)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="4" column="0">
|
||||||
<widget class="QPushButton" name="applicationModalNoParentButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Application Modal Dialog (no parent)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="modalChildWidgetInfoLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>11</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Note: Modal Child Widgets are invisible and hidden after 5 seconds.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QPushButton" name="modelessButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Modeless Dialog</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QCheckBox" name="applicationModalUseExecCheckBox">
|
<widget class="QCheckBox" name="applicationModalUseExecCheckBox">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@ -123,6 +77,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QPushButton" name="modelessButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Modeless Dialog</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QPushButton" name="siblingWindowModalButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Window Modal Dialog (sibling)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -67,16 +67,12 @@ private slots:
|
|||||||
{ newDialog(Qt::WindowModal, this); }
|
{ newDialog(Qt::WindowModal, this); }
|
||||||
void on_windowModalNoParentButton_clicked()
|
void on_windowModalNoParentButton_clicked()
|
||||||
{ newDialog(Qt::WindowModal, 0); }
|
{ newDialog(Qt::WindowModal, 0); }
|
||||||
void on_windowModalChildButton_clicked()
|
|
||||||
{ newChildWidget(Qt::WindowModal); }
|
|
||||||
void on_siblingWindowModalButton_clicked()
|
void on_siblingWindowModalButton_clicked()
|
||||||
{ newDialog(Qt::WindowModal, parentWidget()); }
|
{ newDialog(Qt::WindowModal, parentWidget()); }
|
||||||
void on_applicationModalButton_clicked()
|
void on_applicationModalButton_clicked()
|
||||||
{ newDialog(Qt::ApplicationModal, this); }
|
{ newDialog(Qt::ApplicationModal, this); }
|
||||||
void on_applicationModalNoParentButton_clicked()
|
void on_applicationModalNoParentButton_clicked()
|
||||||
{ newDialog(Qt::ApplicationModal, 0); }
|
{ newDialog(Qt::ApplicationModal, 0); }
|
||||||
void on_applicationModalChildButton_clicked()
|
|
||||||
{ newChildWidget(Qt::ApplicationModal); }
|
|
||||||
void on_siblingApplicationModalButton_clicked()
|
void on_siblingApplicationModalButton_clicked()
|
||||||
{ newDialog(Qt::ApplicationModal, parentWidget()); }
|
{ newDialog(Qt::ApplicationModal, parentWidget()); }
|
||||||
|
|
||||||
@ -98,15 +94,6 @@ private:
|
|||||||
else
|
else
|
||||||
dialog->show();
|
dialog->show();
|
||||||
}
|
}
|
||||||
void newChildWidget(Qt::WindowModality windowModality)
|
|
||||||
{
|
|
||||||
QWidget *w = new QWidget(this);
|
|
||||||
w->setAttribute(Qt::WA_DeleteOnClose);
|
|
||||||
w->setWindowModality(windowModality);
|
|
||||||
w->setGeometry(0, 0, 0, 0);
|
|
||||||
w->show();
|
|
||||||
QTimer::singleShot(5000, w, SLOT(close()));
|
|
||||||
}
|
|
||||||
bool event(QEvent *event)
|
bool event(QEvent *event)
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::WindowBlocked)
|
if (event->type() == QEvent::WindowBlocked)
|
||||||
@ -144,14 +131,10 @@ private slots:
|
|||||||
{ newDialog(Qt::WindowModal); }
|
{ newDialog(Qt::WindowModal); }
|
||||||
void on_windowModalNoParentButton_clicked()
|
void on_windowModalNoParentButton_clicked()
|
||||||
{ newDialog(Qt::WindowModal, false); }
|
{ newDialog(Qt::WindowModal, false); }
|
||||||
void on_windowModalChildButton_clicked()
|
|
||||||
{ newChildWidget(Qt::WindowModal); }
|
|
||||||
void on_applicationModalButton_clicked()
|
void on_applicationModalButton_clicked()
|
||||||
{ newDialog(Qt::ApplicationModal); }
|
{ newDialog(Qt::ApplicationModal); }
|
||||||
void on_applicationModalNoParentButton_clicked()
|
void on_applicationModalNoParentButton_clicked()
|
||||||
{ newDialog(Qt::ApplicationModal, false); }
|
{ newDialog(Qt::ApplicationModal, false); }
|
||||||
void on_applicationModalChildButton_clicked()
|
|
||||||
{ newChildWidget(Qt::ApplicationModal); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void newDialog(Qt::WindowModality windowModality, bool withParent = true)
|
void newDialog(Qt::WindowModality windowModality, bool withParent = true)
|
||||||
@ -164,15 +147,6 @@ private:
|
|||||||
else
|
else
|
||||||
dialog->show();
|
dialog->show();
|
||||||
}
|
}
|
||||||
void newChildWidget(Qt::WindowModality windowModality)
|
|
||||||
{
|
|
||||||
QWidget *w = new QWidget(this);
|
|
||||||
w->setAttribute(Qt::WA_DeleteOnClose);
|
|
||||||
w->setWindowModality(windowModality);
|
|
||||||
w->setGeometry(0, 0, 0, 0);
|
|
||||||
w->show();
|
|
||||||
QTimer::singleShot(5000, w, SLOT(close()));
|
|
||||||
}
|
|
||||||
bool event(QEvent *event)
|
bool event(QEvent *event)
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::WindowBlocked)
|
if (event->type() == QEvent::WindowBlocked)
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>558</width>
|
<width>519</width>
|
||||||
<height>268</height>
|
<height>207</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -20,31 +20,10 @@
|
|||||||
<string>Select the type of window to create:</string>
|
<string>Select the type of window to create:</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="2" column="1">
|
||||||
<widget class="QPushButton" name="windowButton">
|
<widget class="QPushButton" name="windowModalNoParentButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Window</string>
|
<string>Window Modal Dialog (no parent)</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QPushButton" name="groupLeaderButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Window (Group Leader)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QPushButton" name="modelessButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Modeless Dialog</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QPushButton" name="modelessNoParentButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Modeless Dialog (no parent)</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -55,10 +34,24 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QPushButton" name="windowModalNoParentButton">
|
<widget class="QPushButton" name="modelessNoParentButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Window Modal Dialog (no parent)</string>
|
<string>Modeless Dialog (no parent)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QPushButton" name="modelessButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Modeless Dialog</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QPushButton" name="applicationModalButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Application Modal Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -77,13 +70,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QPushButton" name="applicationModalButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Application Modal Dialog</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="QPushButton" name="applicationModalNoParentButton">
|
<widget class="QPushButton" name="applicationModalNoParentButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -91,35 +77,17 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" colspan="2">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="modalChildWidgetInfoLabel">
|
<widget class="QPushButton" name="groupLeaderButton">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>11</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Note: Modal Child Widgets are invisible and hidden after 5 seconds.</string>
|
<string>Window (Group Leader)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QPushButton" name="applicationModalChildButton">
|
<widget class="QPushButton" name="windowButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Application Modal Child Widget</string>
|
<string>Window</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QPushButton" name="windowModalChildButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Window Modal Child Widget</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user