Salome HOME
projects
/
modules
/
shaper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d1fce4b
)
Provide activation of the widget in edit mode
author
vsv
<vitaly.smetannikov@opencascade.com>
Fri, 25 Nov 2016 11:21:52 +0000
(14:21 +0300)
committer
vsv
<vitaly.smetannikov@opencascade.com>
Fri, 25 Nov 2016 11:21:52 +0000
(14:21 +0300)
src/CollectionPlugin/CMakeLists.txt
patch
|
blob
|
history
src/CollectionPlugin/CollectionPlugin_WidgetField.cpp
patch
|
blob
|
history
src/CollectionPlugin/CollectionPlugin_WidgetField.h
patch
|
blob
|
history
diff --git
a/src/CollectionPlugin/CMakeLists.txt
b/src/CollectionPlugin/CMakeLists.txt
index c1b22136e81a2ee841c4aa599481ed01095a0f5c..31bd93d10052182dedcc20077f9e4c7bbfcd692a 100644
(file)
--- a/
src/CollectionPlugin/CMakeLists.txt
+++ b/
src/CollectionPlugin/CMakeLists.txt
@@
-41,6
+41,7
@@
INCLUDE_DIRECTORIES(
../Events
../ModuleBase
../Config
../Events
../ModuleBase
../Config
+ ../XGUI
${CAS_INCLUDE_DIRS}
)
${CAS_INCLUDE_DIRS}
)
@@
-51,6
+52,7
@@
SET(PROJECT_LIBRARIES
GeomAlgoAPI
GeomValidators
ModuleBase
GeomAlgoAPI
GeomValidators
ModuleBase
+ XGUI
)
ADD_DEFINITIONS(-DCOLLECTIONPLUGIN_EXPORTS ${CAS_DEFINITIONS})
)
ADD_DEFINITIONS(-DCOLLECTIONPLUGIN_EXPORTS ${CAS_DEFINITIONS})
diff --git
a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp
b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp
index b410a3c65f92dd8377d1f6e0668947703c702342..273683e26a911775bb18f9e8ac5a50d419c0a9ac 100644
(file)
--- a/
src/CollectionPlugin/CollectionPlugin_WidgetField.cpp
+++ b/
src/CollectionPlugin/CollectionPlugin_WidgetField.cpp
@@
-11,6
+11,10
@@
#include <ModuleBase_IWorkshop.h>
#include <ModuleBase_ISelection.h>
#include <ModuleBase_IWorkshop.h>
#include <ModuleBase_ISelection.h>
+#include <XGUI_Tools.h>
+#include <XGUI_Workshop.h>
+#include <XGUI_PropertyPanel.h>
+
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeStringArray.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeStringArray.h>
#include <ModelAPI_AttributeInteger.h>
@@
-112,7
+116,7
@@
CollectionPlugin_WidgetField::
ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData):
ModuleBase_WidgetSelector(theParent, theWorkshop, theData), myHeaderEditor(0),
ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData):
ModuleBase_WidgetSelector(theParent, theWorkshop, theData), myHeaderEditor(0),
- myIsEditing(false)
+ myIsEditing(false)
, myActivation(false)
{
QVBoxLayout* aMainLayout = new QVBoxLayout(this);
{
QVBoxLayout* aMainLayout = new QVBoxLayout(this);
@@
-223,6
+227,7
@@
void CollectionPlugin_WidgetField::appendStepControls()
// Data table
QTableWidget* aDataTbl = new QTableWidget(1, myCompNamesList.count() + 1, aWidget);
// Data table
QTableWidget* aDataTbl = new QTableWidget(1, myCompNamesList.count() + 1, aWidget);
+ aDataTbl->installEventFilter(this);
DataTableItemDelegate* aDelegate = 0;
if (myDataTblList.isEmpty())
aDelegate = new DataTableItemDelegate(
DataTableItemDelegate* aDelegate = 0;
if (myDataTblList.isEmpty())
aDelegate = new DataTableItemDelegate(
@@
-330,6
+335,16
@@
bool CollectionPlugin_WidgetField::eventFilter(QObject* theObject, QEvent* theEv
foreach(QTableWidget* aTable, myDataTblList) {
updateHeaders(aTable);
}
foreach(QTableWidget* aTable, myDataTblList) {
updateHeaders(aTable);
}
+ } else if (theEvent->type() == QEvent::FocusIn) {
+ QTableWidget* aTable = dynamic_cast<QTableWidget*>(theObject);
+ if (aTable) {
+ XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
+ XGUI_PropertyPanel* aPanel = aWorkshop->propertyPanel();
+ if (aPanel->activeWidget() != this) {
+ myActivation = true;
+ aPanel->activateWidget(this, false);
+ }
+ }
}
return ModuleBase_WidgetSelector::eventFilter(theObject, theEvent);
}
}
return ModuleBase_WidgetSelector::eventFilter(theObject, theEvent);
}
@@
-397,9
+412,9
@@
QList<QWidget*> CollectionPlugin_WidgetField::getControls() const
{
QList<QWidget*> aControls;
// this control will accept focus and will be highlighted in the Property Panel
{
QList<QWidget*> aControls;
// this control will accept focus and will be highlighted in the Property Panel
- aControls.push_back(myS
tepWgt
);
-
//
aControls.push_back(myFieldTypeCombo);
-
//
aControls.push_back(myNbComponentsSpn);
+ aControls.push_back(myS
hapeTypeCombo
);
+ aControls.push_back(myFieldTypeCombo);
+ aControls.push_back(myNbComponentsSpn);
return aControls;
}
return aControls;
}
@@
-730,6
+745,10
@@
bool CollectionPlugin_WidgetField::
//**********************************************************************************
void CollectionPlugin_WidgetField::onSelectionChanged()
{
//**********************************************************************************
void CollectionPlugin_WidgetField::onSelectionChanged()
{
+ if (myActivation) {
+ myActivation = false;
+ return;
+ }
// Ignore selection for Parts mode
if (myShapeTypeCombo->currentIndex() == 5)
return;
// Ignore selection for Parts mode
if (myShapeTypeCombo->currentIndex() == 5)
return;
diff --git
a/src/CollectionPlugin/CollectionPlugin_WidgetField.h
b/src/CollectionPlugin/CollectionPlugin_WidgetField.h
index 27085c393028970ef1877eab36934f27014c27e9..8466877d84c09a6d20f9d3e070242f20fee2ba3d 100644
(file)
--- a/
src/CollectionPlugin/CollectionPlugin_WidgetField.h
+++ b/
src/CollectionPlugin/CollectionPlugin_WidgetField.h
@@
-193,6
+193,8
@@
private:
/// Stae of a table editing
bool myIsEditing;
/// Stae of a table editing
bool myIsEditing;
+
+ bool myActivation;
};
#endif
\ No newline at end of file
};
#endif
\ No newline at end of file