Commit fcb6580e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

operator+/- is disabled for QFlags in qt6

parent 6d418e22
Pipeline #43377 passed with stage
in 14 minutes
......@@ -85,7 +85,7 @@ KNotesApp::KNotesApp(QWidget *parent)
QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("document-new")),
i18n("New Note"), this);
actionCollection()->addAction(QStringLiteral("new_note"), action);
KGlobalAccel::setGlobalShortcut(action, QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_N));
KGlobalAccel::setGlobalShortcut(action, QKeySequence(Qt::ALT | Qt::SHIFT | Qt::Key_N));
connect(action, &QAction::triggered, this, [this]() {
newNote();
});
......@@ -93,7 +93,7 @@ KNotesApp::KNotesApp(QWidget *parent)
action = new QAction(QIcon::fromTheme(QStringLiteral("edit-paste")),
i18n("New Note From Clipboard"), this);
actionCollection()->addAction(QStringLiteral("new_note_clipboard"), action);
KGlobalAccel::setGlobalShortcut(action, QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_C));
KGlobalAccel::setGlobalShortcut(action, QKeySequence(Qt::ALT | Qt::SHIFT | Qt::Key_C));
connect(action, &QAction::triggered, this, &KNotesApp::newNoteFromClipboard);
action = new QAction(QIcon::fromTheme(QStringLiteral("document-open")),
......@@ -103,13 +103,13 @@ KNotesApp::KNotesApp(QWidget *parent)
action = new QAction(QIcon::fromTheme(QStringLiteral("knotes")), i18n("Show All Notes"), this);
actionCollection()->addAction(QStringLiteral("show_all_notes"), action);
KGlobalAccel::setGlobalShortcut(action, QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_S));
KGlobalAccel::setGlobalShortcut(action, QKeySequence(Qt::ALT | Qt::SHIFT | Qt::Key_S));
connect(action, &QAction::triggered, this, &KNotesApp::showAllNotes);
action = new QAction(QIcon::fromTheme(QStringLiteral("window-close")),
i18n("Hide All Notes"), this);
actionCollection()->addAction(QStringLiteral("hide_all_notes"), action);
KGlobalAccel::setGlobalShortcut(action, QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_H));
KGlobalAccel::setGlobalShortcut(action, QKeySequence(Qt::ALT | Qt::SHIFT | Qt::Key_H));
connect(action, &QAction::triggered, this, &KNotesApp::hideAllNotes);
action = new QAction(QIcon::fromTheme(QStringLiteral("document-print")),
......
......@@ -44,19 +44,19 @@ KNoteEdit::KNoteEdit(KActionCollection *actions, QWidget *parent)
m_textBold = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-bold")), i18n("Bold"),
this);
actions->addAction(QStringLiteral("format_bold"), m_textBold);
actions->setDefaultShortcut(m_textBold, QKeySequence(Qt::CTRL + Qt::Key_B));
actions->setDefaultShortcut(m_textBold, QKeySequence(Qt::CTRL | Qt::Key_B));
m_textItalic = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-italic")),
i18n("Italic"), this);
actions->addAction(QStringLiteral("format_italic"), m_textItalic);
actions->setDefaultShortcut(m_textItalic, QKeySequence(Qt::CTRL + Qt::Key_I));
actions->setDefaultShortcut(m_textItalic, QKeySequence(Qt::CTRL | Qt::Key_I));
m_textUnderline = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-underline")),
i18n("Underline"), this);
actions->addAction(QStringLiteral("format_underline"), m_textUnderline);
actions->setDefaultShortcut(m_textUnderline, QKeySequence(Qt::CTRL + Qt::Key_U));
actions->setDefaultShortcut(m_textUnderline, QKeySequence(Qt::CTRL | Qt::Key_U));
m_textStrikeOut = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-strikethrough")),
i18n("Strike Out"), this);
actions->addAction(QStringLiteral("format_strikeout"), m_textStrikeOut);
actions->setDefaultShortcut(m_textStrikeOut, QKeySequence(Qt::CTRL + Qt::Key_S));
actions->setDefaultShortcut(m_textStrikeOut, QKeySequence(Qt::CTRL | Qt::Key_S));
connect(m_textBold, &KToggleAction::toggled, this, &KNoteEdit::textBold);
connect(m_textItalic, &KToggleAction::toggled, this, &KNoteEdit::setFontItalic);
......@@ -67,23 +67,23 @@ KNoteEdit::KNoteEdit(KActionCollection *actions, QWidget *parent)
i18n("Align Left"), this);
actions->addAction(QStringLiteral("format_alignleft"), m_textAlignLeft);
connect(m_textAlignLeft, &KToggleAction::triggered, this, &KNoteEdit::textAlignLeft);
actions->setDefaultShortcut(m_textAlignLeft, QKeySequence(Qt::ALT + Qt::Key_L));
actions->setDefaultShortcut(m_textAlignLeft, QKeySequence(Qt::ALT | Qt::Key_L));
m_textAlignLeft->setChecked(true); // just a dummy, will be updated later
m_textAlignCenter = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-center")),
i18n("Align Center"), this);
actions->addAction(QStringLiteral("format_aligncenter"), m_textAlignCenter);
connect(m_textAlignCenter, &KToggleAction::triggered, this, &KNoteEdit::textAlignCenter);
actions->setDefaultShortcut(m_textAlignCenter, QKeySequence(Qt::ALT + Qt::Key_C));
actions->setDefaultShortcut(m_textAlignCenter, QKeySequence(Qt::ALT | Qt::Key_C));
m_textAlignRight = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-right")),
i18n("Align Right"), this);
actions->addAction(QStringLiteral("format_alignright"), m_textAlignRight);
connect(m_textAlignRight, &KToggleAction::triggered, this, &KNoteEdit::textAlignRight);
actions->setDefaultShortcut(m_textAlignRight, QKeySequence(Qt::ALT + Qt::Key_R));
actions->setDefaultShortcut(m_textAlignRight, QKeySequence(Qt::ALT | Qt::Key_R));
m_textAlignBlock = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-fill")),
i18n("Align Block"), this);
actions->addAction(QStringLiteral("format_alignblock"), m_textAlignBlock);
connect(m_textAlignBlock, &KToggleAction::triggered, this, &KNoteEdit::textAlignBlock);
actions->setDefaultShortcut(m_textAlignBlock, QKeySequence(Qt::ALT + Qt::Key_B));
actions->setDefaultShortcut(m_textAlignBlock, QKeySequence(Qt::ALT | Qt::Key_B));
auto *group = new QActionGroup(this);
group->addAction(m_textAlignLeft);
......@@ -107,13 +107,13 @@ KNoteEdit::KNoteEdit(KActionCollection *actions, QWidget *parent)
m_textIncreaseIndent = new QAction(QIcon::fromTheme(QStringLiteral("format-indent-more")),
i18n("Increase Indent"), this);
actions->addAction(QStringLiteral("format_increaseindent"), m_textIncreaseIndent);
actions->setDefaultShortcut(m_textIncreaseIndent, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_I));
actions->setDefaultShortcut(m_textIncreaseIndent, QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
connect(m_textIncreaseIndent, &QAction::triggered, this, &KNoteEdit::textIncreaseIndent);
m_textDecreaseIndent = new QAction(QIcon::fromTheme(QStringLiteral("format-indent-less")),
i18n("Decrease Indent"), this);
actions->addAction(QStringLiteral("format_decreaseindent"), m_textDecreaseIndent);
actions->setDefaultShortcut(m_textDecreaseIndent, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_D));
actions->setDefaultShortcut(m_textDecreaseIndent, QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_D));
connect(m_textDecreaseIndent, &QAction::triggered, this, &KNoteEdit::textDecreaseIndent);
group = new QActionGroup(this);
......
......@@ -87,7 +87,7 @@ KNotesPart::KNotesPart(QObject *parent)
connect(mNewNote, &QAction::triggered, this, [this]() {
newNote();
});
actionCollection()->setDefaultShortcut(mNewNote, QKeySequence(Qt::CTRL + Qt::Key_N));
actionCollection()->setDefaultShortcut(mNewNote, QKeySequence(Qt::CTRL | Qt::Key_N));
//mNewNote->setHelpText(
// i18nc( "@info:status", "Create a new popup note" ) );
mNewNote->setWhatsThis(
......@@ -224,7 +224,7 @@ KNotesPart::KNotesPart(QObject *parent)
mQuickSearchAction = new QAction(i18n("Set Focus to Quick Search"), this);
//If change shortcut change in quicksearchwidget->lineedit->setPlaceholderText
actionCollection()->setDefaultShortcut(mQuickSearchAction, QKeySequence(Qt::ALT + Qt::Key_Q));
actionCollection()->setDefaultShortcut(mQuickSearchAction, QKeySequence(Qt::ALT | Qt::Key_Q));
actionCollection()->addAction(QStringLiteral("focus_to_quickseach"), mQuickSearchAction);
connect(mQuickSearchAction, &QAction::triggered, mNotesWidget, &KNotesWidget::slotFocusQuickSearch);
......
......@@ -46,7 +46,7 @@ KNotesPlugin::KNotesPlugin(KontactInterface::Core *core, const QVariantList &)
i18nc("@action:inmenu", "New Popup Note..."), this);
actionCollection()->addAction(QStringLiteral("new_note"), action);
connect(action, &QAction::triggered, this, &KNotesPlugin::slotNewNote);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_N));
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_N));
//action->setHelpText(
// i18nc( "@info:status", "Create new popup note" ) );
action->setWhatsThis(
......
......@@ -732,7 +732,7 @@ void KNote::createActions()
action = new QAction(i18n("Walk Through Notes"), this);
actionCollection()->addAction(QStringLiteral("walk_notes"), action);
connect(action, &QAction::triggered, this, &KNote::sigShowNextNote);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::SHIFT + Qt::Key_Backtab));
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::SHIFT | Qt::Key_Backtab));
actionCollection()->addAssociatedWidget(this);
const auto lst = actionCollection()->actions();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment