add command to show/hide several constraints at once
This commit is contained in:
@@ -419,6 +419,12 @@ void ConstraintView::contextMenuEvent (QContextMenuEvent* event)
|
||||
QAction* driven = menu.addAction(tr("Toggle to/from reference"), this, SLOT(updateDrivingStatus()));
|
||||
driven->setEnabled(isToggleDriving);
|
||||
|
||||
menu.addSeparator();
|
||||
QAction* show = menu.addAction(tr("Show constraints"), this, SLOT(showConstraints()));
|
||||
show->setEnabled(!items.isEmpty());
|
||||
QAction* hide = menu.addAction(tr("Hide constraints"), this, SLOT(hideConstraints()));
|
||||
hide->setEnabled(!items.isEmpty());
|
||||
|
||||
menu.addSeparator();
|
||||
CONTEXT_ITEM("Sketcher_SelectElementsAssociatedWithConstraints","Select Elements","Sketcher_SelectElementsAssociatedWithConstraints",doSelectConstraints,true)
|
||||
|
||||
@@ -454,6 +460,24 @@ void ConstraintView::updateDrivingStatus()
|
||||
}
|
||||
}
|
||||
|
||||
void ConstraintView::showConstraints()
|
||||
{
|
||||
QList<QListWidgetItem *> items = selectedItems();
|
||||
for (auto it : items) {
|
||||
if (it->checkState() != Qt::Checked)
|
||||
it->setCheckState(Qt::Checked);
|
||||
}
|
||||
}
|
||||
|
||||
void ConstraintView::hideConstraints()
|
||||
{
|
||||
QList<QListWidgetItem *> items = selectedItems();
|
||||
for (auto it : items) {
|
||||
if (it->checkState() != Qt::Unchecked)
|
||||
it->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
}
|
||||
|
||||
void ConstraintView::modifyCurrentItem()
|
||||
{
|
||||
/*emit*/itemActivated(currentItem());
|
||||
|
||||
@@ -61,6 +61,8 @@ protected Q_SLOTS:
|
||||
void doSelectConstraints();
|
||||
void updateDrivingStatus();
|
||||
void swapNamedOfSelectedItems();
|
||||
void showConstraints();
|
||||
void hideConstraints();
|
||||
};
|
||||
|
||||
class TaskSketcherConstrains : public Gui::TaskView::TaskBox, public Gui::SelectionObserver
|
||||
|
||||
Reference in New Issue
Block a user