Make tool's dialog modal.

--HG--
branch : develop
This commit is contained in:
dismine 2014-07-04 14:55:36 +03:00
parent 8ab19ced93
commit f82364e53b
29 changed files with 63 additions and 5 deletions

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>DialogAboutApp</class> <class>DialogAboutApp</class>
<widget class="QDialog" name="DialogAboutApp"> <widget class="QDialog" name="DialogAboutApp">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>DialogIndividualMeasurements</class> <class>DialogIndividualMeasurements</class>
<widget class="QDialog" name="DialogIndividualMeasurements"> <widget class="QDialog" name="DialogIndividualMeasurements">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -17,6 +20,9 @@
<iconset resource="../../share/resources/icon.qrc"> <iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset> <normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property> </property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>DialogMeasurements</class> <class>DialogMeasurements</class>
<widget class="QDialog" name="DialogMeasurements"> <widget class="QDialog" name="DialogMeasurements">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -29,6 +32,9 @@
<iconset resource="../../share/resources/icon.qrc"> <iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset> <normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property> </property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>DialogStandardMeasurements</class> <class>DialogStandardMeasurements</class>
<widget class="QDialog" name="DialogStandardMeasurements"> <widget class="QDialog" name="DialogStandardMeasurements">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -17,6 +20,9 @@
<iconset resource="../../share/resources/icon.qrc"> <iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset> <normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property> </property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">

View File

@ -108,6 +108,7 @@ void DialogAlongLine::ChoosedObject(quint32 id, const SceneObject &type)
number = 0; number = 0;
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -184,6 +184,7 @@ void DialogArc::ChoosedObject(quint32 id, const SceneObject &type)
ChangeCurrentText(ui->comboBoxBasePoint, point->name()); ChangeCurrentText(ui->comboBoxBasePoint, point->name());
emit ToolTip(""); emit ToolTip("");
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -130,6 +130,7 @@ void DialogBisector::ChoosedObject(quint32 id, const SceneObject &type)
} }
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -95,6 +95,7 @@ void DialogCutArc::ChoosedObject(quint32 id, const SceneObject &type)
const VArc *arc = data->GeometricObject<const VArc *>(id); const VArc *arc = data->GeometricObject<const VArc *>(id);
ChangeCurrentText(ui->comboBoxArc, arc->name()); ChangeCurrentText(ui->comboBoxArc, arc->name());
emit ToolTip(""); emit ToolTip("");
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -121,6 +121,7 @@ void DialogCutSpline::ChoosedObject(quint32 id, const SceneObject &type)
const VSpline *spl = data->GeometricObject<const VSpline *>(id); const VSpline *spl = data->GeometricObject<const VSpline *>(id);
ChangeCurrentText(ui->comboBoxSpline, spl->name()); ChangeCurrentText(ui->comboBoxSpline, spl->name());
emit ToolTip(""); emit ToolTip("");
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -121,6 +121,7 @@ void DialogCutSplinePath::ChoosedObject(quint32 id, const SceneObject &type)
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id); const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
ChangeCurrentText(ui->comboBoxSplinePath, splPath->name()); ChangeCurrentText(ui->comboBoxSplinePath, splPath->name());
emit ToolTip(""); emit ToolTip("");
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>DialogEditWrongFormula</class> <class>DialogEditWrongFormula</class>
<widget class="QDialog" name="DialogEditWrongFormula"> <widget class="QDialog" name="DialogEditWrongFormula">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -17,6 +20,9 @@
<iconset resource="../../share/resources/icon.qrc"> <iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset> <normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property> </property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">

View File

@ -91,6 +91,7 @@ void DialogEndLine::ChoosedObject(quint32 id, const SceneObject &type)
const VPointF *point = data->GeometricObject<const VPointF *>(id); const VPointF *point = data->GeometricObject<const VPointF *>(id);
ChangeCurrentText(ui->comboBoxBasePoint, point->name()); ChangeCurrentText(ui->comboBoxBasePoint, point->name());
emit ToolTip(""); emit ToolTip("");
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -148,6 +148,7 @@ void DialogHeight::ChoosedObject(quint32 id, const SceneObject &type)
emit ToolTip(tr("")); emit ToolTip(tr(""));
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
break; break;

View File

@ -106,6 +106,7 @@ void DialogLine::setFirstPoint(const quint32 &value)
*/ */
void DialogLine::DialogAccepted() void DialogLine::DialogAccepted()
{ {
//TODO check if points different
qint32 index = ui->comboBoxFirstPoint->currentIndex(); qint32 index = ui->comboBoxFirstPoint->currentIndex();
firstPoint = qvariant_cast<quint32>(ui->comboBoxFirstPoint->itemData(index)); firstPoint = qvariant_cast<quint32>(ui->comboBoxFirstPoint->itemData(index));
index = ui->comboBoxSecondPoint->currentIndex(); index = ui->comboBoxSecondPoint->currentIndex();
@ -147,6 +148,7 @@ void DialogLine::ChoosedObject(quint32 id, const SceneObject &type)
} }
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>DialogLine</class> <class>DialogLine</class>
<widget class="QDialog" name="DialogLine"> <widget class="QDialog" name="DialogLine">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -20,7 +23,10 @@
<property name="locale"> <property name="locale">
<locale language="English" country="UnitedStates"/> <locale language="English" country="UnitedStates"/>
</property> </property>
<widget class="QWidget" name=""> <property name="modal">
<bool>true</bool>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>9</x> <x>9</x>

View File

@ -123,6 +123,7 @@ void DialogLineIntersect::ChoosedObject(quint32 id, const SceneObject &type)
{ {
flagPoint = CheckIntersecion(); flagPoint = CheckIntersecion();
CheckState(); CheckState();
this->setModal(true);
this->show(); this->show();
connect(ui->comboBoxP1Line1, connect(ui->comboBoxP1Line1,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,

View File

@ -107,6 +107,7 @@ void DialogNormal::ChoosedObject(quint32 id, const SceneObject &type)
number = 0; number = 0;
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -137,6 +137,7 @@ void DialogPointOfContact::ChoosedObject(quint32 id, const SceneObject &type)
} }
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -106,6 +106,7 @@ void DialogPointOfIntersection::ChoosedObject(quint32 id, const SceneObject &typ
} }
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -128,6 +128,7 @@ void DialogShoulderPoint::ChoosedObject(quint32 id, const SceneObject &type)
} }
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -3,7 +3,7 @@
<class>DialogSinglePoint</class> <class>DialogSinglePoint</class>
<widget class="QDialog" name="DialogSinglePoint"> <widget class="QDialog" name="DialogSinglePoint">
<property name="windowModality"> <property name="windowModality">
<enum>Qt::WindowModal</enum> <enum>Qt::ApplicationModal</enum>
</property> </property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -24,7 +24,7 @@
<locale language="English" country="UnitedStates"/> <locale language="English" country="UnitedStates"/>
</property> </property>
<property name="modal"> <property name="modal">
<bool>false</bool> <bool>true</bool>
</property> </property>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="geometry"> <property name="geometry">

View File

@ -106,6 +106,7 @@ void DialogSpline::ChoosedObject(quint32 id, const SceneObject &type)
} }
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
} }

View File

@ -72,8 +72,6 @@ DialogTool::DialogTool(const VContainer *data, QWidget *parent)
//Keep synchronize with VAbstractTool styles list!!! //Keep synchronize with VAbstractTool styles list!!!
lineStyles<<tr("No line")<<tr("Line")<<tr("Dash Line")<<tr("Dot Line")<<tr("Dash Dot Line") lineStyles<<tr("No line")<<tr("Line")<<tr("Dash Line")<<tr("Dot Line")<<tr("Dash Dot Line")
<<tr("Dash Dot Dot Line"); <<tr("Dash Dot Dot Line");
Qt::WindowFlags flags = windowFlags();
setWindowFlags(flags | Qt::WindowStaysOnTopHint);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -96,6 +96,7 @@ void DialogTriangle::ChoosedObject(quint32 id, const SceneObject &type)
emit ToolTip(tr("")); emit ToolTip(tr(""));
if (isInitialized == false) if (isInitialized == false)
{ {
this->setModal(true);
this->show(); this->show();
} }
break; break;

View File

@ -145,6 +145,7 @@ void DialogUnionDetails::ChoosedDetail(const quint32 &id, const SceneObject &typ
{ {
++numberP; ++numberP;
emit ToolTip(""); emit ToolTip("");
this->setModal(true);
this->show(); this->show();
return; return;
} }

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>DialogUnionDetails</class> <class>DialogUnionDetails</class>
<widget class="QDialog" name="DialogUnionDetails"> <widget class="QDialog" name="DialogUnionDetails">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -29,6 +32,9 @@
<iconset resource="../../share/resources/icon.qrc"> <iconset resource="../../share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset> <normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property> </property>
<property name="modal">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">

View File

@ -121,6 +121,7 @@ protected:
QGraphicsScene *scene = tool->scene(); QGraphicsScene *scene = tool->scene();
QList<QGraphicsView *> list = scene->views(); QList<QGraphicsView *> list = scene->views();
dialog = new Dialog(getData(), list.first()); dialog = new Dialog(getData(), list.first());
dialog->setModal(true);
connect(qobject_cast< VMainGraphicsScene * >(tool->scene()), connect(qobject_cast< VMainGraphicsScene * >(tool->scene()),
&VMainGraphicsScene::ChoosedObject, dialog, &DialogTool::ChoosedObject); &VMainGraphicsScene::ChoosedObject, dialog, &DialogTool::ChoosedObject);

View File

@ -71,6 +71,7 @@ VToolEndLine::VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id,
void VToolEndLine::setDialog() void VToolEndLine::setDialog()
{ {
SCASSERT(dialog != nullptr); SCASSERT(dialog != nullptr);
dialog->setModal(true);
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog); DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
SCASSERT(dialogTool != nullptr); SCASSERT(dialogTool != nullptr);
const VPointF *p = VAbstractTool::data.GeometricObject<const VPointF *>(id); const VPointF *p = VAbstractTool::data.GeometricObject<const VPointF *>(id);

View File

@ -408,6 +408,7 @@ void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
QGraphicsScene *scene = this->scene(); QGraphicsScene *scene = this->scene();
QList<QGraphicsView *> list = scene->views(); QList<QGraphicsView *> list = scene->views();
dialog = new DialogDetail(getData(), list.first()); dialog = new DialogDetail(getData(), list.first());
dialog->setModal(true);
connect(qobject_cast< VMainGraphicsScene * >(this->scene()), &VMainGraphicsScene::ChoosedObject, connect(qobject_cast< VMainGraphicsScene * >(this->scene()), &VMainGraphicsScene::ChoosedObject,
dialog, &DialogTool::ChoosedObject); dialog, &DialogTool::ChoosedObject);
connect(dialog, &DialogTool::DialogClosed, this, &VToolDetail::FullUpdateFromGuiOk); connect(dialog, &DialogTool::DialogClosed, this, &VToolDetail::FullUpdateFromGuiOk);