Qt6 port:
Fix deprecation warnings with version 6.3 or 6.4
This commit is contained in:
@@ -73,13 +73,9 @@ QT_TRANSLATE_NOOP("SketcherGui::ConstraintView", "Select Elements");
|
||||
/// ACTSONSELECTION is a true/false value to activate the command only if a selection is made
|
||||
#define CONTEXT_ITEM(ICONSTR, NAMESTR, CMDSTR, FUNC, ACTSONSELECTION) \
|
||||
QIcon icon_##FUNC(Gui::BitmapFactory().pixmap(ICONSTR)); \
|
||||
QAction* constr_##FUNC = menu.addAction( \
|
||||
icon_##FUNC, \
|
||||
tr(NAMESTR), \
|
||||
this, \
|
||||
SLOT(FUNC()), \
|
||||
QKeySequence(QString::fromUtf8( \
|
||||
Gui::Application::Instance->commandManager().getCommandByName(CMDSTR)->getAccel()))); \
|
||||
QAction* constr_##FUNC = menu.addAction(icon_##FUNC, tr(NAMESTR), this, SLOT(FUNC())); \
|
||||
constr_##FUNC->setShortcut(QKeySequence(QString::fromUtf8( \
|
||||
Gui::Application::Instance->commandManager().getCommandByName(CMDSTR)->getAccel()))); \
|
||||
if (ACTSONSELECTION) \
|
||||
constr_##FUNC->setEnabled(!items.isEmpty()); \
|
||||
else \
|
||||
@@ -586,24 +582,18 @@ void ConstraintView::contextMenuEvent(QContextMenuEvent* event)
|
||||
doSelectConstraints,
|
||||
true)
|
||||
|
||||
QAction* rename = menu.addAction(tr("Rename"),
|
||||
this,
|
||||
&ConstraintView::renameCurrentItem
|
||||
QAction* rename = menu.addAction(tr("Rename"), this, &ConstraintView::renameCurrentItem);
|
||||
#ifndef Q_OS_MAC// on Mac F2 doesn't seem to trigger an edit signal
|
||||
,
|
||||
QKeySequence(Qt::Key_F2)
|
||||
rename->setShortcut(QKeySequence(Qt::Key_F2));
|
||||
#endif
|
||||
);
|
||||
rename->setEnabled(item != nullptr);
|
||||
|
||||
QAction* center =
|
||||
menu.addAction(tr("Center sketch"), this, &ConstraintView::centerSelectedItems);
|
||||
center->setEnabled(item != nullptr);
|
||||
|
||||
QAction* remove = menu.addAction(tr("Delete"),
|
||||
this,
|
||||
&ConstraintView::deleteSelectedItems,
|
||||
QKeySequence(QKeySequence::Delete));
|
||||
QAction* remove = menu.addAction(tr("Delete"), this, &ConstraintView::deleteSelectedItems);
|
||||
remove->setShortcut(QKeySequence(QKeySequence::Delete));
|
||||
remove->setEnabled(!items.isEmpty());
|
||||
|
||||
QAction* swap = menu.addAction(
|
||||
|
||||
@@ -91,13 +91,9 @@ QT_TRANSLATE_NOOP("SketcherGui::ElementView", "Select Vertical Axis");
|
||||
/// ACTSONSELECTION is a true/false value to activate the command only if a selection is made
|
||||
#define CONTEXT_ITEM(ICONSTR, NAMESTR, CMDSTR, FUNC, ACTSONSELECTION) \
|
||||
QIcon icon_##FUNC(Gui::BitmapFactory().pixmap(ICONSTR)); \
|
||||
QAction* constr_##FUNC = menu.addAction( \
|
||||
icon_##FUNC, \
|
||||
tr(NAMESTR), \
|
||||
this, \
|
||||
SLOT(FUNC()), \
|
||||
QKeySequence(QString::fromUtf8( \
|
||||
Gui::Application::Instance->commandManager().getCommandByName(CMDSTR)->getAccel()))); \
|
||||
QAction* constr_##FUNC = menu.addAction(icon_##FUNC, tr(NAMESTR), this, SLOT(FUNC())); \
|
||||
constr_##FUNC->setShortcut(QKeySequence(QString::fromUtf8( \
|
||||
Gui::Application::Instance->commandManager().getCommandByName(CMDSTR)->getAccel()))); \
|
||||
if (ACTSONSELECTION) \
|
||||
constr_##FUNC->setEnabled(!items.isEmpty()); \
|
||||
else \
|
||||
@@ -686,8 +682,8 @@ void ElementView::contextMenuEvent(QContextMenuEvent* event)
|
||||
|
||||
menu.addSeparator();
|
||||
|
||||
QAction* remove = menu.addAction(
|
||||
tr("Delete"), this, &ElementView::deleteSelectedItems, QKeySequence(QKeySequence::Delete));
|
||||
QAction* remove = menu.addAction(tr("Delete"), this, &ElementView::deleteSelectedItems);
|
||||
remove->setShortcut(QKeySequence(QKeySequence::Delete));
|
||||
remove->setEnabled(!items.isEmpty());
|
||||
|
||||
menu.menuAction()->setIconVisibleInMenu(true);
|
||||
|
||||
Reference in New Issue
Block a user