Qt6 port:

Fix deprecation warnings with version 6.3 or 6.4
This commit is contained in:
wmayer
2023-07-23 17:23:23 +02:00
committed by Chris Hennes
parent 68101ac933
commit 7d0926d0b3
9 changed files with 51 additions and 40 deletions

View File

@@ -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(

View File

@@ -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);