make sure that action is created when calling updateAction
This commit is contained in:
parent
3b1c9b512e
commit
8f0ea2082a
|
@ -829,10 +829,12 @@ void CmdSketcherConstrainLock::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Reference:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_ConstrainLock_Driven"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_ConstrainLock_Driven"));
|
||||
break;
|
||||
case Driving:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_ConstrainLock"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_ConstrainLock"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1100,10 +1102,12 @@ void CmdSketcherConstrainDistance::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Reference:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_Length_Driven"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_Length_Driven"));
|
||||
break;
|
||||
case Driving:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_Length"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_Length"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1342,10 +1346,12 @@ void CmdSketcherConstrainDistanceX::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Reference:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_HorizontalDistance_Driven"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_HorizontalDistance_Driven"));
|
||||
break;
|
||||
case Driving:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_HorizontalDistance"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_HorizontalDistance"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1497,10 +1503,12 @@ void CmdSketcherConstrainDistanceY::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Reference:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_VerticalDistance_Driven"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_VerticalDistance_Driven"));
|
||||
break;
|
||||
case Driving:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_VerticalDistance"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_VerticalDistance"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2493,10 +2501,12 @@ void CmdSketcherConstrainRadius::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Reference:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_Radius_Driven"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_Radius_Driven"));
|
||||
break;
|
||||
case Driving:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_Radius"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_Radius"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2765,10 +2775,12 @@ void CmdSketcherConstrainAngle::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Reference:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_InternalAngle_Driven"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_InternalAngle_Driven"));
|
||||
break;
|
||||
case Driving:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_InternalAngle"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Constraint_InternalAngle"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -331,10 +331,12 @@ void CmdSketcherCreateLine::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Normal:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateLine"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateLine"));
|
||||
break;
|
||||
case Construction:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateLine_Constr"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateLine_Constr"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -572,10 +574,12 @@ void CmdSketcherCreateRectangle::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Normal:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateRectangle"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateRectangle"));
|
||||
break;
|
||||
case Construction:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateRectangle_Constr"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateRectangle_Constr"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1187,10 +1191,12 @@ void CmdSketcherCreatePolyline::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Normal:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreatePolyline"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreatePolyline"));
|
||||
break;
|
||||
case Construction:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreatePolyline_Constr"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreatePolyline_Constr"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1829,6 +1835,9 @@ Gui::Action * CmdSketcherCompCreateArc::createAction(void)
|
|||
void CmdSketcherCompCreateArc::updateAction(int mode)
|
||||
{
|
||||
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(getAction());
|
||||
if (!pcAction)
|
||||
return;
|
||||
|
||||
QList<QAction*> a = pcAction->actions();
|
||||
int index = pcAction->property("defaultAction").toInt();
|
||||
switch (mode) {
|
||||
|
@ -3402,6 +3411,9 @@ Gui::Action * CmdSketcherCompCreateConic::createAction(void)
|
|||
void CmdSketcherCompCreateConic::updateAction(int mode)
|
||||
{
|
||||
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(getAction());
|
||||
if (!pcAction)
|
||||
return;
|
||||
|
||||
QList<QAction*> a = pcAction->actions();
|
||||
int index = pcAction->property("defaultAction").toInt();
|
||||
switch (mode) {
|
||||
|
@ -3755,6 +3767,9 @@ Gui::Action * CmdSketcherCompCreateCircle::createAction(void)
|
|||
void CmdSketcherCompCreateCircle::updateAction(int mode)
|
||||
{
|
||||
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(getAction());
|
||||
if (!pcAction)
|
||||
return;
|
||||
|
||||
QList<QAction*> a = pcAction->actions();
|
||||
int index = pcAction->property("defaultAction").toInt();
|
||||
switch (mode) {
|
||||
|
@ -4955,10 +4970,12 @@ void CmdSketcherCreateSlot::updateAction(int mode)
|
|||
{
|
||||
switch (mode) {
|
||||
case Normal:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateSlot"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateSlot"));
|
||||
break;
|
||||
case Construction:
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateSlot_Constr"));
|
||||
if (getAction())
|
||||
getAction()->setIcon(Gui::BitmapFactory().pixmap("Sketcher_CreateSlot_Constr"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -5395,6 +5412,9 @@ Gui::Action * CmdSketcherCompCreateRegularPolygon::createAction(void)
|
|||
void CmdSketcherCompCreateRegularPolygon::updateAction(int mode)
|
||||
{
|
||||
Gui::ActionGroup* pcAction = qobject_cast<Gui::ActionGroup*>(getAction());
|
||||
if (!pcAction)
|
||||
return;
|
||||
|
||||
QList<QAction*> a = pcAction->actions();
|
||||
int index = pcAction->property("defaultAction").toInt();
|
||||
switch (mode) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user