From a1b00956cfcc6d6dbdfa3490a050f1a1351df4ae Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 12 Apr 2020 14:49:59 +0200 Subject: [PATCH] GUI: compile without emit/signals/slots/foreach keywords Instead use the variants not clashing with keywords/function names current and future C++ standards introduce (Q_EMIT/Q_SIGNALS/Q_SLOTS). --- Rakefile | 1 + src/mkvtoolnix-gui/app.cpp | 12 +++---- src/mkvtoolnix-gui/app.h | 4 +-- .../generate_sub_chapters_parameters_dialog.h | 2 +- .../chapter_editor/mass_modification_dialog.h | 2 +- src/mkvtoolnix-gui/chapter_editor/tab.cpp | 34 +++++++++---------- src/mkvtoolnix-gui/chapter_editor/tab.h | 4 +-- src/mkvtoolnix-gui/chapter_editor/tool.h | 2 +- .../header_editor/attached_file_page.cpp | 2 +- .../header_editor/attached_file_page.h | 2 +- .../header_editor/attachments_page.cpp | 2 +- .../header_editor/attachments_page.h | 4 +-- .../header_editor/page_model.cpp | 2 +- src/mkvtoolnix-gui/header_editor/page_model.h | 2 +- src/mkvtoolnix-gui/header_editor/tab.cpp | 4 +-- src/mkvtoolnix-gui/header_editor/tab.h | 4 +-- src/mkvtoolnix-gui/header_editor/tool.h | 2 +- .../header_editor/track_name_page.h | 2 +- .../header_editor/track_type_page.h | 2 +- src/mkvtoolnix-gui/header_editor/value_page.h | 2 +- src/mkvtoolnix-gui/info/element_reader.cpp | 2 +- src/mkvtoolnix-gui/info/element_reader.h | 2 +- .../info/element_viewer_dialog.h | 2 +- src/mkvtoolnix-gui/info/job_settings_dialog.h | 2 +- .../info/job_settings_widget.cpp | 2 +- src/mkvtoolnix-gui/info/job_settings_widget.h | 4 +-- src/mkvtoolnix-gui/info/model.h | 2 +- src/mkvtoolnix-gui/info/tab.cpp | 8 ++--- src/mkvtoolnix-gui/info/tab.h | 4 +-- src/mkvtoolnix-gui/info/tool.h | 2 +- src/mkvtoolnix-gui/jobs/info_job.cpp | 6 ++-- src/mkvtoolnix-gui/jobs/info_job.h | 2 +- src/mkvtoolnix-gui/jobs/job.cpp | 6 ++-- src/mkvtoolnix-gui/jobs/job.h | 4 +-- src/mkvtoolnix-gui/jobs/model.cpp | 14 ++++---- src/mkvtoolnix-gui/jobs/model.h | 4 +-- src/mkvtoolnix-gui/jobs/mux_job.cpp | 12 +++---- src/mkvtoolnix-gui/jobs/mux_job.h | 4 +-- src/mkvtoolnix-gui/jobs/program_runner.h | 2 +- src/mkvtoolnix-gui/jobs/tool.h | 2 +- .../available_update_info_dialog.h | 2 +- .../main_window/main_window.cpp | 6 ++-- src/mkvtoolnix-gui/main_window/main_window.h | 4 +-- .../main_window/preferences_dialog.h | 2 +- .../main_window/prefs_run_program_widget.cpp | 12 +++---- .../main_window/prefs_run_program_widget.h | 4 +-- .../select_character_set_dialog.cpp | 2 +- .../main_window/select_character_set_dialog.h | 4 +-- .../main_window/status_bar_progress_widget.h | 2 +- .../main_window/taskbar_progress.h | 2 +- src/mkvtoolnix-gui/main_window/tool_base.h | 2 +- .../main_window/update_checker.cpp | 6 ++-- .../main_window/update_checker.h | 4 +-- .../merge/adding_appending_files_dialog.h | 2 +- .../additional_command_line_options_dialog.h | 2 +- src/mkvtoolnix-gui/merge/attachments.cpp | 2 +- .../merge/command_line_dialog.h | 2 +- .../merge/executable_location_dialog.h | 2 +- .../merge/file_identification_thread.cpp | 30 ++++++++-------- .../merge/file_identification_thread.h | 8 ++--- src/mkvtoolnix-gui/merge/input.cpp | 2 +- src/mkvtoolnix-gui/merge/output.cpp | 4 +-- .../merge/select_playlist_dialog.h | 2 +- src/mkvtoolnix-gui/merge/source_file_model.h | 2 +- src/mkvtoolnix-gui/merge/tab.cpp | 12 +++---- src/mkvtoolnix-gui/merge/tab.h | 4 +-- src/mkvtoolnix-gui/merge/tool.h | 2 +- src/mkvtoolnix-gui/merge/track_model.h | 2 +- src/mkvtoolnix-gui/util/basic_line_edit.cpp | 4 +-- src/mkvtoolnix-gui/util/basic_line_edit.h | 2 +- src/mkvtoolnix-gui/util/basic_tab_widget.cpp | 2 +- src/mkvtoolnix-gui/util/basic_tree_view.cpp | 12 +++---- src/mkvtoolnix-gui/util/basic_tree_view.h | 4 +-- src/mkvtoolnix-gui/util/combo_box_base.h | 2 +- src/mkvtoolnix-gui/util/elide_label.cpp | 2 +- src/mkvtoolnix-gui/util/elide_label.h | 4 +-- src/mkvtoolnix-gui/util/fancy_tab_widget.cpp | 8 ++--- src/mkvtoolnix-gui/util/fancy_tab_widget.h | 10 +++--- .../util/files_drag_drop_widget.cpp | 2 +- .../util/files_drag_drop_widget.h | 2 +- src/mkvtoolnix-gui/util/header_view_manager.h | 2 +- .../util/installation_checker.cpp | 4 +-- .../util/installation_checker.h | 4 +-- src/mkvtoolnix-gui/util/kax_info.cpp | 16 ++++----- src/mkvtoolnix-gui/util/kax_info.h | 4 +-- src/mkvtoolnix-gui/util/media_player.h | 2 +- .../util/network_access_manager.cpp | 2 +- .../util/network_access_manager.h | 6 ++-- src/mkvtoolnix-gui/util/process.h | 2 +- src/mkvtoolnix-gui/util/serial_worker_queue.h | 2 +- src/mkvtoolnix-gui/util/settings.h | 2 +- .../util/side_by_side_multi_select.cpp | 2 +- .../util/side_by_side_multi_select.h | 4 +-- .../util/string_list_configuration_widget.h | 2 +- src/mkvtoolnix-gui/util/style_helper.cpp | 2 +- src/mkvtoolnix-gui/util/text_display_dialog.h | 2 +- .../util/waiting_spinner_widget.h | 4 +-- src/mkvtoolnix-gui/watch_jobs/tab.cpp | 6 ++-- src/mkvtoolnix-gui/watch_jobs/tab.h | 4 +-- src/mkvtoolnix-gui/watch_jobs/tool.h | 2 +- 100 files changed, 218 insertions(+), 217 deletions(-) diff --git a/Rakefile b/Rakefile index 8293fbbe9..c584d4258 100644 --- a/Rakefile +++ b/Rakefile @@ -142,6 +142,7 @@ def setup_globals cflags_common += " -march=i686" if $building_for[:windows] && /i686/.match(c(:host)) cflags_common += " -fPIC " if c?(:USE_QT) && !$building_for[:windows] cflags_common += " -DQT_STATICPLUGIN" if c?(:USE_QT) && $building_for[:windows] + cflags_common += " -DQT_NO_KEYWORDS" if c?(:USE_QT) cflags_common += " -DUSE_DRMINGW -I#{c(:DRMINGW_PATH)}/include" if c?(:USE_DRMINGW) && $building_for[:windows] cflags_common += " -DMTX_APPIMAGE" if c?(:APPIMAGE_BUILD) && !$building_for[:windows] diff --git a/src/mkvtoolnix-gui/app.cpp b/src/mkvtoolnix-gui/app.cpp index c5bb1099d..703daf19d 100644 --- a/src/mkvtoolnix-gui/app.cpp +++ b/src/mkvtoolnix-gui/app.cpp @@ -469,21 +469,21 @@ App::handleCommandLineArgumentsLocally() { auto p = p_func(); if (!p->m_cliParser->configFiles().isEmpty()) - emit openConfigFilesRequested(p->m_cliParser->configFiles()); + Q_EMIT openConfigFilesRequested(p->m_cliParser->configFiles()); if (!p->m_cliParser->addToMerge().isEmpty()) - emit addingFilesToMergeRequested(p->m_cliParser->addToMerge()); + Q_EMIT addingFilesToMergeRequested(p->m_cliParser->addToMerge()); if (!p->m_cliParser->runInfoOn().isEmpty()) - emit runningInfoOnRequested(p->m_cliParser->runInfoOn()); + Q_EMIT runningInfoOnRequested(p->m_cliParser->runInfoOn()); if (!p->m_cliParser->editChapters().isEmpty()) - emit editingChaptersRequested(p->m_cliParser->editChapters()); + Q_EMIT editingChaptersRequested(p->m_cliParser->editChapters()); if (!p->m_cliParser->editHeaders().isEmpty()) - emit editingHeadersRequested(p->m_cliParser->editHeaders()); + Q_EMIT editingHeadersRequested(p->m_cliParser->editHeaders()); - emit toolRequested(p->m_cliParser->requestedTool()); + Q_EMIT toolRequested(p->m_cliParser->requestedTool()); } void diff --git a/src/mkvtoolnix-gui/app.h b/src/mkvtoolnix-gui/app.h index 7a2cd77e0..f11cd4d51 100644 --- a/src/mkvtoolnix-gui/app.h +++ b/src/mkvtoolnix-gui/app.h @@ -74,7 +74,7 @@ public: Util::NetworkAccessManager &networkAccessManager(); -signals: +Q_SIGNALS: void addingFilesToMergeRequested(QStringList const &fileNames); void editingChaptersRequested(QStringList const &fileNames); void editingHeadersRequested(QStringList const &fileNames); @@ -82,7 +82,7 @@ signals: void runningInfoOnRequested(QStringList const &fileNames); void toolRequested(ToolBase *tool); -public slots: +public Q_SLOTS: void saveSettings() const; void receiveInstanceCommunication(); void setupAppearance(); diff --git a/src/mkvtoolnix-gui/chapter_editor/generate_sub_chapters_parameters_dialog.h b/src/mkvtoolnix-gui/chapter_editor/generate_sub_chapters_parameters_dialog.h index 9bf85b646..7d1a3180e 100644 --- a/src/mkvtoolnix-gui/chapter_editor/generate_sub_chapters_parameters_dialog.h +++ b/src/mkvtoolnix-gui/chapter_editor/generate_sub_chapters_parameters_dialog.h @@ -29,7 +29,7 @@ public: QString language() const; OptQString country() const; -public slots: +public Q_SLOTS: void verifyStartTimestamp(); protected: diff --git a/src/mkvtoolnix-gui/chapter_editor/mass_modification_dialog.h b/src/mkvtoolnix-gui/chapter_editor/mass_modification_dialog.h index cf0a6198c..50a615264 100644 --- a/src/mkvtoolnix-gui/chapter_editor/mass_modification_dialog.h +++ b/src/mkvtoolnix-gui/chapter_editor/mass_modification_dialog.h @@ -45,7 +45,7 @@ public: void setupUi(QStringList const &additionalLanguages, QStringList const &additionalCountryCodes); void retranslateUi(); -public slots: +public Q_SLOTS: void verifyOptions(); protected: diff --git a/src/mkvtoolnix-gui/chapter_editor/tab.cpp b/src/mkvtoolnix-gui/chapter_editor/tab.cpp index 5126abf82..aee5c3e0b 100644 --- a/src/mkvtoolnix-gui/chapter_editor/tab.cpp +++ b/src/mkvtoolnix-gui/chapter_editor/tab.cpp @@ -220,7 +220,7 @@ Tab::retranslateUi() { p->chapterModel->retranslateUi(); p->nameModel->retranslateUi(); - emit titleChanged(); + Q_EMIT titleChanged(); } void @@ -370,12 +370,12 @@ Tab::loadFromMatroskaFile(QString const &fileName, Util::MessageBox::critical(this)->title(QY("File parsing failed")).text(text).exec(); if (!append) - emit removeThisTab(); + Q_EMIT removeThisTab(); return {}; } if (!append && !readFileEndTimestampForMatroska(*analyzer)) { - emit removeThisTab(); + Q_EMIT removeThisTab(); return {}; } @@ -393,7 +393,7 @@ Tab::loadFromMatroskaFile(QString const &fileName, if (!chapters) { Util::MessageBox::critical(this)->title(QY("File parsing failed")).text(QY("The file you tried to open (%1) could not be read successfully.").arg(fileName)).exec(); if (!append) - emit removeThisTab(); + Q_EMIT removeThisTab(); return {}; } @@ -461,14 +461,14 @@ Tab::loadFromChapterFile(QString const &fileName, Util::MessageBox::critical(this)->title(QY("File parsing failed")).text(message).exec(); if (!append) - emit removeThisTab(); + Q_EMIT removeThisTab(); } else if (format != mtx::chapters::format_e::xml) { auto result = checkSimpleFormatForBomAndNonAscii(chapters, fileName, append); if (!append) { p->fileName.clear(); - emit titleChanged(); + Q_EMIT titleChanged(); } return result; @@ -515,7 +515,7 @@ Tab::reloadOrAppendSimpleChaptersWithCharacterSet(QString const &characterSet, Util::MessageBox::critical(this)->title(QY("File parsing failed")).text(QY("Error message from the parser: %1").arg(error)).exec(); - emit removeThisTab(); + Q_EMIT removeThisTab(); } bool @@ -564,11 +564,11 @@ Tab::loadFromMplsFile(QString const &fileName, Util::MessageBox::critical(this)->title(QY("File parsing failed")).text(message).exec(); if (!append) - emit removeThisTab(); + Q_EMIT removeThisTab(); } else if (!append) { p->fileName.clear(); - emit titleChanged(); + Q_EMIT titleChanged(); } return { chapters, false }; @@ -680,7 +680,7 @@ Tab::saveAsImpl(bool requireNewFileName, settings.save(); updateFileNameDisplay(); - emit titleChanged(); + Q_EMIT titleChanged(); } MainWindow::get()->setStatusBarMessage(QY("The file has been saved successfully.")); @@ -1226,7 +1226,7 @@ Tab::addEdition(bool before) { p->chapterModel->insertEdition(row, edition); - emit numberOfEntriesChanged(); + Q_EMIT numberOfEntriesChanged(); return p->chapterModel->index(row, 0); } @@ -1292,7 +1292,7 @@ Tab::addChapter(bool before) { p->chapterModel->insertChapter(row, chapter, selectedIdx.parent()); - emit numberOfEntriesChanged(); + Q_EMIT numberOfEntriesChanged(); return p->chapterModel->index(row, 0, selectedIdx.parent()); } @@ -1312,7 +1312,7 @@ Tab::addSubChapter() { p->chapterModel->appendChapter(chapter, selectedIdx); expandCollapseAll(true, selectedIdx); - emit numberOfEntriesChanged(); + Q_EMIT numberOfEntriesChanged(); } void @@ -1320,7 +1320,7 @@ Tab::removeElement() { auto p = p_func(); p->chapterModel->removeTree(Util::selectedRowIdx(p->ui->elements)); - emit numberOfEntriesChanged(); + Q_EMIT numberOfEntriesChanged(); } void @@ -1623,7 +1623,7 @@ Tab::duplicateElement() { if (newElementIdx.isValid()) expandCollapseAll(true, newElementIdx); - emit numberOfEntriesChanged(); + Q_EMIT numberOfEntriesChanged(); } void @@ -1699,7 +1699,7 @@ Tab::generateSubChapters() { expandCollapseAll(true, selectedIdx); - emit numberOfEntriesChanged(); + Q_EMIT numberOfEntriesChanged(); } bool @@ -2046,7 +2046,7 @@ Tab::focusSameControlInNextChapterElement() { void Tab::closeTab() { - emit removeThisTab(); + Q_EMIT removeThisTab(); } void diff --git a/src/mkvtoolnix-gui/chapter_editor/tab.h b/src/mkvtoolnix-gui/chapter_editor/tab.h index c87212f88..df380c08b 100644 --- a/src/mkvtoolnix-gui/chapter_editor/tab.h +++ b/src/mkvtoolnix-gui/chapter_editor/tab.h @@ -78,12 +78,12 @@ public: virtual bool areWidgetsEnabled() const; virtual bool isSourceMatroska() const; -signals: +Q_SIGNALS: void removeThisTab(); void titleChanged(); void numberOfEntriesChanged(); -public slots: +public Q_SLOTS: virtual void newFile(); virtual void load(); virtual void append(QString const &fileName); diff --git a/src/mkvtoolnix-gui/chapter_editor/tool.h b/src/mkvtoolnix-gui/chapter_editor/tool.h index 768788b8f..79f60f4a4 100644 --- a/src/mkvtoolnix-gui/chapter_editor/tool.h +++ b/src/mkvtoolnix-gui/chapter_editor/tool.h @@ -35,7 +35,7 @@ public: virtual std::pair nextPreviousWindowActionTexts() const override; virtual QVector tabs(); -public slots: +public Q_SLOTS: virtual void retranslateUi(); virtual void toolShown() override; virtual void tabTitleChanged(); diff --git a/src/mkvtoolnix-gui/header_editor/attached_file_page.cpp b/src/mkvtoolnix-gui/header_editor/attached_file_page.cpp index c425698d2..c74a6769a 100644 --- a/src/mkvtoolnix-gui/header_editor/attached_file_page.cpp +++ b/src/mkvtoolnix-gui/header_editor/attached_file_page.cpp @@ -94,7 +94,7 @@ AttachedFilePage::dragEnterEvent(QDragEnterEvent *event) { void AttachedFilePage::dropEvent(QDropEvent *event) { if (m_filesDDHandler.handle(event, true)) - emit filesDropped(m_filesDDHandler.fileNames()); + Q_EMIT filesDropped(m_filesDDHandler.fileNames()); } QString diff --git a/src/mkvtoolnix-gui/header_editor/attached_file_page.h b/src/mkvtoolnix-gui/header_editor/attached_file_page.h index 9566fcfe7..bc2bb71c3 100644 --- a/src/mkvtoolnix-gui/header_editor/attached_file_page.h +++ b/src/mkvtoolnix-gui/header_editor/attached_file_page.h @@ -46,7 +46,7 @@ public: virtual void saveContent(); virtual void replaceContent(bool deriveNameAndMimeType); -signals: +Q_SIGNALS: void filesDropped(QStringList const &fileNames); protected: diff --git a/src/mkvtoolnix-gui/header_editor/attachments_page.cpp b/src/mkvtoolnix-gui/header_editor/attachments_page.cpp index 97a637a3a..c40271d6e 100644 --- a/src/mkvtoolnix-gui/header_editor/attachments_page.cpp +++ b/src/mkvtoolnix-gui/header_editor/attachments_page.cpp @@ -67,7 +67,7 @@ AttachmentsPage::dragEnterEvent(QDragEnterEvent *event) { void AttachmentsPage::dropEvent(QDropEvent *event) { if (m_filesDDHandler.handle(event, true)) - emit filesDropped(m_filesDDHandler.fileNames()); + Q_EMIT filesDropped(m_filesDDHandler.fileNames()); } QString diff --git a/src/mkvtoolnix-gui/header_editor/attachments_page.h b/src/mkvtoolnix-gui/header_editor/attachments_page.h index 77e16fca4..f40ec7257 100644 --- a/src/mkvtoolnix-gui/header_editor/attachments_page.h +++ b/src/mkvtoolnix-gui/header_editor/attachments_page.h @@ -36,10 +36,10 @@ public: virtual bool hasThisBeenModified() const override; virtual QString internalIdentifier() const override; -signals: +Q_SIGNALS: void filesDropped(QStringList const &fileNames); -public slots: +public Q_SLOTS: virtual void retranslateUi() override; virtual void rereadChildren(PageModel &model); diff --git a/src/mkvtoolnix-gui/header_editor/page_model.cpp b/src/mkvtoolnix-gui/header_editor/page_model.cpp index 0688b8121..25a7df0ca 100644 --- a/src/mkvtoolnix-gui/header_editor/page_model.cpp +++ b/src/mkvtoolnix-gui/header_editor/page_model.cpp @@ -211,7 +211,7 @@ PageModel::dropMimeData(QMimeData const *data, Util::requestAllItems(*this); - emit attachmentsReordered(); + Q_EMIT attachmentsReordered(); return result; } diff --git a/src/mkvtoolnix-gui/header_editor/page_model.h b/src/mkvtoolnix-gui/header_editor/page_model.h index 90cd26316..d2f552a81 100644 --- a/src/mkvtoolnix-gui/header_editor/page_model.h +++ b/src/mkvtoolnix-gui/header_editor/page_model.h @@ -47,7 +47,7 @@ public: virtual bool canDropMimeData(QMimeData const *data, Qt::DropAction action, int row, int, QModelIndex const &parent) const override; virtual bool dropMimeData(QMimeData const *data, Qt::DropAction action, int row, int column, QModelIndex const &parent) override; -signals: +Q_SIGNALS: void attachmentsReordered(); }; diff --git a/src/mkvtoolnix-gui/header_editor/tab.cpp b/src/mkvtoolnix-gui/header_editor/tab.cpp index f62ef7567..3b78ff847 100644 --- a/src/mkvtoolnix-gui/header_editor/tab.cpp +++ b/src/mkvtoolnix-gui/header_editor/tab.cpp @@ -122,7 +122,7 @@ Tab::load() { .arg(QY("The file you tried to open (%1) is not recognized as a valid Matroska/WebM file.").arg(m_fileName)) .arg(QY("Possible reasons are: the file is not a Matroska file; the file is write-protected; the file is locked by another process; you do not have permission to access the file.")); Util::MessageBox::critical(this)->title(QY("File parsing failed")).text(text).exec(); - emit removeThisTab(); + Q_EMIT removeThisTab(); return; } @@ -148,7 +148,7 @@ Tab::load() { .arg(QY("The file you tried to open (%1) could not be read successfully.").arg(m_fileName)) .arg(error); Util::MessageBox::critical(this)->title(QY("File parsing failed")).text(text).exec(); - emit removeThisTab(); + Q_EMIT removeThisTab(); return; } diff --git a/src/mkvtoolnix-gui/header_editor/tab.h b/src/mkvtoolnix-gui/header_editor/tab.h index 698d7902d..d6a218e04 100644 --- a/src/mkvtoolnix-gui/header_editor/tab.h +++ b/src/mkvtoolnix-gui/header_editor/tab.h @@ -67,10 +67,10 @@ public: virtual void addAttachment(KaxAttachedPtr const &attachment); virtual bool isClosingOrReloadingOkIfModified(ModifiedConfirmationMode mode); -signals: +Q_SIGNALS: void removeThisTab(); -public slots: +public Q_SLOTS: virtual void showTreeContextMenu(QPoint const &pos); virtual void selectionChanged(QModelIndex const ¤t, QModelIndex const &previous); virtual void load(); diff --git a/src/mkvtoolnix-gui/header_editor/tool.h b/src/mkvtoolnix-gui/header_editor/tool.h index 63346b7e4..aad46ad7d 100644 --- a/src/mkvtoolnix-gui/header_editor/tool.h +++ b/src/mkvtoolnix-gui/header_editor/tool.h @@ -37,7 +37,7 @@ public: virtual void dragEnterEvent(QDragEnterEvent *event) override; virtual void dropEvent(QDropEvent *event) override; -public slots: +public Q_SLOTS: virtual void retranslateUi(); virtual void toolShown() override; virtual void selectFileToOpen(); diff --git a/src/mkvtoolnix-gui/header_editor/track_name_page.h b/src/mkvtoolnix-gui/header_editor/track_name_page.h index 18bb5ab50..b1ab4d846 100644 --- a/src/mkvtoolnix-gui/header_editor/track_name_page.h +++ b/src/mkvtoolnix-gui/header_editor/track_name_page.h @@ -29,7 +29,7 @@ public: virtual bool validateValue() const override; virtual void copyValueToElement() override; -public slots: +public Q_SLOTS: virtual void setupPredefinedTrackNames(); }; diff --git a/src/mkvtoolnix-gui/header_editor/track_type_page.h b/src/mkvtoolnix-gui/header_editor/track_type_page.h index cd39695ea..8b3001d0b 100644 --- a/src/mkvtoolnix-gui/header_editor/track_type_page.h +++ b/src/mkvtoolnix-gui/header_editor/track_type_page.h @@ -32,7 +32,7 @@ protected: virtual void setItems(QList const &items) const override; virtual void summarizeProperties(); -public slots: +public Q_SLOTS: virtual void retranslateUi() override; }; diff --git a/src/mkvtoolnix-gui/header_editor/value_page.h b/src/mkvtoolnix-gui/header_editor/value_page.h index 3b0539bb3..97576b2bc 100644 --- a/src/mkvtoolnix-gui/header_editor/value_page.h +++ b/src/mkvtoolnix-gui/header_editor/value_page.h @@ -62,7 +62,7 @@ public: virtual void modifyThis() override; virtual void retranslateUi() override; -public slots: +public Q_SLOTS: virtual void onResetClicked(); virtual void onAddOrRemoveChecked(); }; diff --git a/src/mkvtoolnix-gui/info/element_reader.cpp b/src/mkvtoolnix-gui/info/element_reader.cpp index bc8798cb5..1aa9381d7 100644 --- a/src/mkvtoolnix-gui/info/element_reader.cpp +++ b/src/mkvtoolnix-gui/info/element_reader.cpp @@ -52,7 +52,7 @@ ElementReader::run() { } catch (mtx::mm_io::exception &) { } - emit elementRead(m_idx); + Q_EMIT elementRead(m_idx); } } diff --git a/src/mkvtoolnix-gui/info/element_reader.h b/src/mkvtoolnix-gui/info/element_reader.h index 936ca7a7c..641fda6d7 100644 --- a/src/mkvtoolnix-gui/info/element_reader.h +++ b/src/mkvtoolnix-gui/info/element_reader.h @@ -25,7 +25,7 @@ public: virtual void run() override; virtual void abort() override; -signals: +Q_SIGNALS: void elementRead(const QModelIndex &idx); }; diff --git a/src/mkvtoolnix-gui/info/element_viewer_dialog.h b/src/mkvtoolnix-gui/info/element_viewer_dialog.h index 9b144ee6b..3014eea9f 100644 --- a/src/mkvtoolnix-gui/info/element_viewer_dialog.h +++ b/src/mkvtoolnix-gui/info/element_viewer_dialog.h @@ -38,7 +38,7 @@ public: void detachWindow(); -public slots: +public Q_SLOTS: virtual int exec() override; virtual void retranslateUi(); virtual void requestDetachingWindow(); diff --git a/src/mkvtoolnix-gui/info/job_settings_dialog.h b/src/mkvtoolnix-gui/info/job_settings_dialog.h index 65be90881..a8262a266 100644 --- a/src/mkvtoolnix-gui/info/job_settings_dialog.h +++ b/src/mkvtoolnix-gui/info/job_settings_dialog.h @@ -29,7 +29,7 @@ public: JobSettings settings(); -public slots: +public Q_SLOTS: virtual void accept() override; void enableOkButton(QString const &fileName); }; diff --git a/src/mkvtoolnix-gui/info/job_settings_widget.cpp b/src/mkvtoolnix-gui/info/job_settings_widget.cpp index cb2de5224..86fb02424 100644 --- a/src/mkvtoolnix-gui/info/job_settings_widget.cpp +++ b/src/mkvtoolnix-gui/info/job_settings_widget.cpp @@ -104,7 +104,7 @@ JobSettingsWidget::browseFileName() { void JobSettingsWidget::emitFileNameChangeSignal(QString const &fileName) { - emit fileNameChanged(fileName); + Q_EMIT fileNameChanged(fileName); } } diff --git a/src/mkvtoolnix-gui/info/job_settings_widget.h b/src/mkvtoolnix-gui/info/job_settings_widget.h index 881512422..22d80de8c 100644 --- a/src/mkvtoolnix-gui/info/job_settings_widget.h +++ b/src/mkvtoolnix-gui/info/job_settings_widget.h @@ -31,10 +31,10 @@ public: void setSettings(JobSettings const &jobSettings); void setFileNameVisible(bool visible); -signals: +Q_SIGNALS: void fileNameChanged(QString const &fileName); -public slots: +public Q_SLOTS: void enableControlsAccordingToMode(); void browseFileName(); void emitFileNameChangeSignal(QString const &fileName); diff --git a/src/mkvtoolnix-gui/info/model.h b/src/mkvtoolnix-gui/info/model.h index 445778355..51aa2c9b3 100644 --- a/src/mkvtoolnix-gui/info/model.h +++ b/src/mkvtoolnix-gui/info/model.h @@ -65,7 +65,7 @@ public: bool hasChildren(const QModelIndex &parent) const override; std::pair elementName(libebml::EbmlElement &element); -public slots: +public Q_SLOTS: void addElement(int level, libebml::EbmlElement *element, bool readFully); void addElementInfo(int level, QString const &text, std::optional position, std::optional size, std::optional dataSize); void addElementStructure(QStandardItem &parent, libebml::EbmlElement &element); diff --git a/src/mkvtoolnix-gui/info/tab.cpp b/src/mkvtoolnix-gui/info/tab.cpp index 234ce334c..0c6b2aab5 100644 --- a/src/mkvtoolnix-gui/info/tab.cpp +++ b/src/mkvtoolnix-gui/info/tab.cpp @@ -129,14 +129,14 @@ Tab::load(QString const &fileName) { connect(&info, &Util::KaxInfo::elementFound, p->m_model, &Model::addElement); connect(&info, &Util::KaxInfo::elementInfoFound, p->m_model, &Model::addElementInfo); - emit titleChanged(); + Q_EMIT titleChanged(); p->m_queue->add(new InitialScan{info, Util::KaxInfo::ScanType::StartOfFile}); p->m_queue->add(new InitialScan{info, Util::KaxInfo::ScanType::Level1Elements}); } catch (mtx::mm_io::exception &ex) { Util::MessageBox::critical(this)->title(QY("Reading failed")).text(QY("The file you tried to open (%1) could not be read successfully.").arg(fileName)).exec(); - emit removeThisTab(); + Q_EMIT removeThisTab(); } catch (mtx::kax_info::exception &ex) { qDebug() << "Info::Tab::load: kax_info exception:" << Q(ex.what()); @@ -188,13 +188,13 @@ Tab::retranslateUi() { p->m_showHexDumpAction->setText(QY("Show &hex dump")); - emit titleChanged(); + Q_EMIT titleChanged(); } void Tab::showError(const QString &message) { Util::MessageBox::critical(this)->title(QY("Error reading Matroska file")).text(message).exec(); - emit removeThisTab(); + Q_EMIT removeThisTab(); } void diff --git a/src/mkvtoolnix-gui/info/tab.h b/src/mkvtoolnix-gui/info/tab.h index 3101173e9..7193f0919 100644 --- a/src/mkvtoolnix-gui/info/tab.h +++ b/src/mkvtoolnix-gui/info/tab.h @@ -33,11 +33,11 @@ public: void load(QString const &fileName); void save(); -signals: +Q_SIGNALS: void removeThisTab(); void titleChanged(); -public slots: +public Q_SLOTS: void retranslateUi(); void showError(const QString &message); void expandImportantElements(); diff --git a/src/mkvtoolnix-gui/info/tool.h b/src/mkvtoolnix-gui/info/tool.h index 5e1a6ec72..8c0a5b1a5 100644 --- a/src/mkvtoolnix-gui/info/tool.h +++ b/src/mkvtoolnix-gui/info/tool.h @@ -35,7 +35,7 @@ public: virtual std::pair nextPreviousWindowActionTexts() const override; virtual void openFile(QString const &fileName); -public slots: +public Q_SLOTS: virtual void retranslateUi(); virtual void selectAndOpenFile(); diff --git a/src/mkvtoolnix-gui/jobs/info_job.cpp b/src/mkvtoolnix-gui/jobs/info_job.cpp index df30b57d2..1c8e9e850 100644 --- a/src/mkvtoolnix-gui/jobs/info_job.cpp +++ b/src/mkvtoolnix-gui/jobs/info_job.cpp @@ -95,8 +95,8 @@ InfoJob::infoStarted() { setStatus(Job::Running); setProgress(0); - emit lineRead(QY("Source file name: %1").arg(QDir::toNativeSeparators(p->config->m_sourceFileName)), InfoLine); - emit lineRead(QY("Destination file name: %1").arg(QDir::toNativeSeparators(p->config->m_destinationFileName)), InfoLine); + Q_EMIT lineRead(QY("Source file name: %1").arg(QDir::toNativeSeparators(p->config->m_sourceFileName)), InfoLine); + Q_EMIT lineRead(QY("Destination file name: %1").arg(QDir::toNativeSeparators(p->config->m_destinationFileName)), InfoLine); } void @@ -119,7 +119,7 @@ InfoJob::updateProgress(int percentage, void InfoJob::showError(QString const &text) { - emit lineRead(text, ErrorLine); + Q_EMIT lineRead(text, ErrorLine); } QString diff --git a/src/mkvtoolnix-gui/jobs/info_job.h b/src/mkvtoolnix-gui/jobs/info_job.h index d788d0376..0c45a5c21 100644 --- a/src/mkvtoolnix-gui/jobs/info_job.h +++ b/src/mkvtoolnix-gui/jobs/info_job.h @@ -43,7 +43,7 @@ public: virtual void runProgramSetupVariables(ProgramRunner::VariableMap &variables) const override; -public slots: +public Q_SLOTS: virtual void abort() override; virtual void showError(const QString &message); virtual void updateProgress(int percentage, const QString &text); diff --git a/src/mkvtoolnix-gui/jobs/job.cpp b/src/mkvtoolnix-gui/jobs/job.cpp index ea602037c..2ba99c5c7 100644 --- a/src/mkvtoolnix-gui/jobs/job.cpp +++ b/src/mkvtoolnix-gui/jobs/job.cpp @@ -194,7 +194,7 @@ Job::setStatus(Status status) { if (oldStatus == Running) runProgramsAfterCompletion(); - emit statusChanged(p->id, oldStatus, status); + Q_EMIT statusChanged(p->id, oldStatus, status); } bool @@ -214,7 +214,7 @@ Job::setProgress(unsigned int progress) { p->progress = progress; p->modified = true; - emit progressChanged(p->id, p->progress); + Q_EMIT progressChanged(p->id, p->progress); } void @@ -437,7 +437,7 @@ Job::acknowledgeErrors() { void Job::updateUnacknowledgedWarningsAndErrors() { - emit numUnacknowledgedWarningsOrErrorsChanged(p_func()->id, numUnacknowledgedWarnings(), numUnacknowledgedErrors()); + Q_EMIT numUnacknowledgedWarningsOrErrorsChanged(p_func()->id, numUnacknowledgedWarnings(), numUnacknowledgedErrors()); } int diff --git a/src/mkvtoolnix-gui/jobs/job.h b/src/mkvtoolnix-gui/jobs/job.h index 247f9f980..5a3d1c3ee 100644 --- a/src/mkvtoolnix-gui/jobs/job.h +++ b/src/mkvtoolnix-gui/jobs/job.h @@ -114,7 +114,7 @@ protected: void setupJobConnections(); virtual void maybeRemoveOutputFile(); -public slots: +public Q_SLOTS: virtual void setStatus(Job::Status status); virtual void setProgress(unsigned int progress); virtual void addLineToInternalLogs(QString const &line, mtx::gui::Jobs::Job::LineType type); @@ -122,7 +122,7 @@ public slots: virtual void updateUnacknowledgedWarningsAndErrors(); virtual void openOutputFolder() const; -signals: +Q_SIGNALS: void statusChanged(uint64_t id, mtx::gui::Jobs::Job::Status oldStatus, mtx::gui::Jobs::Job::Status newStatus); void progressChanged(uint64_t id, unsigned int progress); void numUnacknowledgedWarningsOrErrorsChanged(uint64_t id, int numWarnings, int numErrors); diff --git a/src/mkvtoolnix-gui/jobs/model.cpp b/src/mkvtoolnix-gui/jobs/model.cpp index 2a1aba4d5..4ddf66462 100644 --- a/src/mkvtoolnix-gui/jobs/model.cpp +++ b/src/mkvtoolnix-gui/jobs/model.cpp @@ -292,7 +292,7 @@ Model::onStatusChanged(uint64_t id, m_queueStartTime = QDateTime::currentDateTime(); m_queueNumDone = 0; - emit queueStatusChanged(QueueStatus::Running); + Q_EMIT queueStatusChanged(QueueStatus::Running); } @@ -385,7 +385,7 @@ Model::updateNumUnacknowledgedWarningsOrErrors() { numErrors += job->numUnacknowledgedErrors(); } - emit numUnacknowledgedWarningsOrErrorsChanged(numWarnings, numErrors); + Q_EMIT numUnacknowledgedWarningsOrErrorsChanged(numWarnings, numErrors); } void @@ -426,7 +426,7 @@ Model::startNextAutoJob() { auto wasRunning = m_running; m_running = false; if (wasRunning) - emit queueStatusChanged(QueueStatus::Stopped); + Q_EMIT queueStatusChanged(QueueStatus::Stopped); } void @@ -454,7 +454,7 @@ Model::stop() { auto wasRunning = m_running; m_running = false; if (wasRunning) - emit queueStatusChanged(QueueStatus::Stopped); + Q_EMIT queueStatusChanged(QueueStatus::Stopped); } void @@ -466,7 +466,7 @@ Model::resetTotalProgress() { m_queueNumDone = 0; - emit progressChanged(0, 0); + Q_EMIT progressChanged(0, 0); } void @@ -496,7 +496,7 @@ Model::updateProgress() { qDebug() << "updateProgress: total" << totalProgress << "numDone" << m_queueNumDone << "numRunning" << numRunning << "numPendingAuto" << numPendingAuto << "runningProgress" << runningProgress; - emit progressChanged(progress, totalProgress); + Q_EMIT progressChanged(progress, totalProgress); } void @@ -510,7 +510,7 @@ Model::updateJobStats() { ++numJobs[idx]; } - emit jobStatsChanged(numJobs[ Job::PendingAuto ], numJobs[ Job::PendingManual ], numJobs[ Job::Running ], numJobs[ Job::Disabled ]); + Q_EMIT jobStatsChanged(numJobs[ Job::PendingAuto ], numJobs[ Job::PendingManual ], numJobs[ Job::Running ], numJobs[ Job::Disabled ]); } void diff --git a/src/mkvtoolnix-gui/jobs/model.h b/src/mkvtoolnix-gui/jobs/model.h index 2f0e625b6..504079be7 100644 --- a/src/mkvtoolnix-gui/jobs/model.h +++ b/src/mkvtoolnix-gui/jobs/model.h @@ -83,14 +83,14 @@ public: QDateTime queueStartTime() const; -signals: +Q_SIGNALS: void progressChanged(int progress, int totalProgress); void jobStatsChanged(int numPendingAutomatic, int numPendingManual, int numRunning, int numOther); void numUnacknowledgedWarningsOrErrorsChanged(int numWarnings, int numErrors); void queueStatusChanged(QueueStatus status); -public slots: +public Q_SLOTS: void onStatusChanged(uint64_t id, mtx::gui::Jobs::Job::Status oldStatus, mtx::gui::Jobs::Job::Status newStatus); void onProgressChanged(uint64_t id, unsigned int progress); void onNumUnacknowledgedWarningsOrErrorsChanged(uint64_t id, int numWarnings, int numErrors); diff --git a/src/mkvtoolnix-gui/jobs/mux_job.cpp b/src/mkvtoolnix-gui/jobs/mux_job.cpp index 6e46c9820..f99244c79 100644 --- a/src/mkvtoolnix-gui/jobs/mux_job.cpp +++ b/src/mkvtoolnix-gui/jobs/mux_job.cpp @@ -106,23 +106,23 @@ MuxJob::processLine(QString const &rawLine) { if (line.startsWith("#GUI#warning ")) { line.replace(QRegularExpression{"^#GUI#warning *"}, ""); - emit lineRead(line, WarningLine); + Q_EMIT lineRead(line, WarningLine); return; } if (line.startsWith("#GUI#error ")) { line.replace(QRegularExpression{"^#GUI#error *"}, ""); - emit lineRead(line, ErrorLine); + Q_EMIT lineRead(line, ErrorLine); return; } if (line.startsWith("#GUI#begin_scanning_playlists")) { - emit startedScanningPlaylists(); + Q_EMIT startedScanningPlaylists(); return; } if (line.startsWith("#GUI#end_scanning_playlists")) { - emit finishedScanningPlaylists(); + Q_EMIT finishedScanningPlaylists(); return; } @@ -132,7 +132,7 @@ MuxJob::processLine(QString const &rawLine) { return; } - emit lineRead(line, InfoLine); + Q_EMIT lineRead(line, InfoLine); } void @@ -167,7 +167,7 @@ MuxJob::processFinished(int exitCode, void MuxJob::processError(QProcess::ProcessError error) { if (QProcess::FailedToStart == error) - emit lineRead(QY("The mkvmerge executable was not found."), ErrorLine); + Q_EMIT lineRead(QY("The mkvmerge executable was not found."), ErrorLine); setStatus(Job::Failed); } diff --git a/src/mkvtoolnix-gui/jobs/mux_job.h b/src/mkvtoolnix-gui/jobs/mux_job.h index 2e133841e..70b02a390 100644 --- a/src/mkvtoolnix-gui/jobs/mux_job.h +++ b/src/mkvtoolnix-gui/jobs/mux_job.h @@ -45,7 +45,7 @@ public: virtual void runProgramSetupVariables(ProgramRunner::VariableMap &variables) const override; -public slots: +public Q_SLOTS: virtual void readAvailable(); virtual void processFinished(int exitCode, QProcess::ExitStatus exitStatus); virtual void processError(QProcess::ProcessError error); @@ -57,7 +57,7 @@ protected: void processLine(QString const &rawLine); virtual void saveJobInternal(Util::ConfigFile &settings) const; -signals: +Q_SIGNALS: void startedScanningPlaylists(); void finishedScanningPlaylists(); diff --git a/src/mkvtoolnix-gui/jobs/program_runner.h b/src/mkvtoolnix-gui/jobs/program_runner.h index 10a5829dc..fde81e5a1 100644 --- a/src/mkvtoolnix-gui/jobs/program_runner.h +++ b/src/mkvtoolnix-gui/jobs/program_runner.h @@ -39,7 +39,7 @@ public: virtual QString defaultAudioFileName() const; -public slots: +public Q_SLOTS: virtual void executeActionsAfterJobFinishes(Job const &job); virtual void executeActionsAfterQueueFinishes(Jobs::QueueStatus status); diff --git a/src/mkvtoolnix-gui/jobs/tool.h b/src/mkvtoolnix-gui/jobs/tool.h index d8e164dcd..86900c4cd 100644 --- a/src/mkvtoolnix-gui/jobs/tool.h +++ b/src/mkvtoolnix-gui/jobs/tool.h @@ -49,7 +49,7 @@ public: bool checkIfOverwritingExistingFileIsOK(QString const &existingDestination); bool checkIfOverwritingExistingJobIsOK(QString const &newDestination, bool isMuxJobAndSplittingEnabled = false); -public slots: +public Q_SLOTS: virtual void retranslateUi(); void onStartAutomatically(); void onStartManually(); diff --git a/src/mkvtoolnix-gui/main_window/available_update_info_dialog.h b/src/mkvtoolnix-gui/main_window/available_update_info_dialog.h index a40d46629..e853ae715 100644 --- a/src/mkvtoolnix-gui/main_window/available_update_info_dialog.h +++ b/src/mkvtoolnix-gui/main_window/available_update_info_dialog.h @@ -35,7 +35,7 @@ public: void setChangeLogContent(QString const &content); -public slots: +public Q_SLOTS: void setReleaseInformation(std::shared_ptr releasesInfo); void updateCheckFinished(mtx::gui::UpdateCheckStatus status, mtx_release_version_t releaseVersion); void visitDownloadLocation(); diff --git a/src/mkvtoolnix-gui/main_window/main_window.cpp b/src/mkvtoolnix-gui/main_window/main_window.cpp index 9c5bf40bf..50b293c69 100644 --- a/src/mkvtoolnix-gui/main_window/main_window.cpp +++ b/src/mkvtoolnix-gui/main_window/main_window.cpp @@ -447,7 +447,7 @@ MainWindow::beforeCloseCheckRunningJobs() { void MainWindow::closeEvent(QCloseEvent *event) { - emit aboutToClose(); + Q_EMIT aboutToClose(); auto ok = mergeTool()->closeAllTabs(); ok = ok && headerEditorTool()->closeAllTabs(); @@ -488,7 +488,7 @@ MainWindow::editPreferencesAndShowPage(PreferencesDialog::Page page) { if (dlg.uiLocaleChanged() || dlg.probeRangePercentageChanged()) QtConcurrent::run(Util::FileIdentifier::cleanAllCacheFiles); - emit preferencesChanged(); + Q_EMIT preferencesChanged(); } #if defined(HAVE_UPDATE_CHECK) @@ -617,7 +617,7 @@ MainWindow::showSystemInformation() { void MainWindow::showEvent(QShowEvent *event) { - emit windowShown(); + Q_EMIT windowShown(); event->accept(); } diff --git a/src/mkvtoolnix-gui/main_window/main_window.h b/src/mkvtoolnix-gui/main_window/main_window.h index 175f856f8..58191aac2 100644 --- a/src/mkvtoolnix-gui/main_window/main_window.h +++ b/src/mkvtoolnix-gui/main_window/main_window.h @@ -68,12 +68,12 @@ public: virtual void registerSubWindowWidget(ToolBase &toolBase, QTabWidget &tabWidget); -signals: +Q_SIGNALS: void windowShown(); void preferencesChanged(); void aboutToClose(); -public slots: +public Q_SLOTS: virtual void changeToolToSender(); virtual void toolChanged(int index); virtual void editPreferences(); diff --git a/src/mkvtoolnix-gui/main_window/preferences_dialog.h b/src/mkvtoolnix-gui/main_window/preferences_dialog.h index 9f103d8c2..9838a9189 100644 --- a/src/mkvtoolnix-gui/main_window/preferences_dialog.h +++ b/src/mkvtoolnix-gui/main_window/preferences_dialog.h @@ -57,7 +57,7 @@ public: bool disableToolTipsChanged() const; bool probeRangePercentageChanged() const; -public slots: +public Q_SLOTS: void editDefaultAdditionalCommandLineOptions(); void enableOutputFileNameControls(); void browseMediaInfoExe(); diff --git a/src/mkvtoolnix-gui/main_window/prefs_run_program_widget.cpp b/src/mkvtoolnix-gui/main_window/prefs_run_program_widget.cpp index 6c10eb7ca..a636c3489 100644 --- a/src/mkvtoolnix-gui/main_window/prefs_run_program_widget.cpp +++ b/src/mkvtoolnix-gui/main_window/prefs_run_program_widget.cpp @@ -333,7 +333,7 @@ PrefsRunProgramWidget::changeExecutable() { enableControls(); - emit titleChanged(); + Q_EMIT titleChanged(); } void @@ -349,12 +349,12 @@ PrefsRunProgramWidget::commandLineEdited(QString const &commandLine) { enableControls(); - emit titleChanged(); + Q_EMIT titleChanged(); } void PrefsRunProgramWidget::nameEdited() { - emit titleChanged(); + Q_EMIT titleChanged(); } void @@ -404,14 +404,14 @@ PrefsRunProgramWidget::changeAudioFile() { enableControls(); - emit titleChanged(); + Q_EMIT titleChanged(); } void PrefsRunProgramWidget::audioFileEdited() { enableControls(); - emit titleChanged(); + Q_EMIT titleChanged(); } void @@ -421,7 +421,7 @@ PrefsRunProgramWidget::typeChanged(int index) { showPageForType(type); - emit titleChanged(); + Q_EMIT titleChanged(); enableControls(); } diff --git a/src/mkvtoolnix-gui/main_window/prefs_run_program_widget.h b/src/mkvtoolnix-gui/main_window/prefs_run_program_widget.h index 339ae216b..063cebdd6 100644 --- a/src/mkvtoolnix-gui/main_window/prefs_run_program_widget.h +++ b/src/mkvtoolnix-gui/main_window/prefs_run_program_widget.h @@ -28,10 +28,10 @@ public: Util::Settings::RunProgramConfigPtr config() const; QString validate() const; -signals: +Q_SIGNALS: void titleChanged(); -protected slots: +protected Q_SLOTS: void typeChanged(int index); void selectVariableToAdd(); diff --git a/src/mkvtoolnix-gui/main_window/select_character_set_dialog.cpp b/src/mkvtoolnix-gui/main_window/select_character_set_dialog.cpp index cc62a62e2..b66b2dc57 100644 --- a/src/mkvtoolnix-gui/main_window/select_character_set_dialog.cpp +++ b/src/mkvtoolnix-gui/main_window/select_character_set_dialog.cpp @@ -92,7 +92,7 @@ SelectCharacterSetDialog::updatePreview() { void SelectCharacterSetDialog::emitResult() { - emit characterSetSelected(selectedCharacterSet()); + Q_EMIT characterSetSelected(selectedCharacterSet()); } QString diff --git a/src/mkvtoolnix-gui/main_window/select_character_set_dialog.h b/src/mkvtoolnix-gui/main_window/select_character_set_dialog.h index b9a7f9d55..86df8ed14 100644 --- a/src/mkvtoolnix-gui/main_window/select_character_set_dialog.h +++ b/src/mkvtoolnix-gui/main_window/select_character_set_dialog.h @@ -30,10 +30,10 @@ public: void setUserData(QVariant const &data); QVariant const &userData() const; -signals: +Q_SIGNALS: void characterSetSelected(QString const &characterSet); -public slots: +public Q_SLOTS: virtual void updatePreview(); virtual void emitResult(); virtual void retranslateUi(); diff --git a/src/mkvtoolnix-gui/main_window/status_bar_progress_widget.h b/src/mkvtoolnix-gui/main_window/status_bar_progress_widget.h index c8682dbaf..6a6bde1bc 100644 --- a/src/mkvtoolnix-gui/main_window/status_bar_progress_widget.h +++ b/src/mkvtoolnix-gui/main_window/status_bar_progress_widget.h @@ -31,7 +31,7 @@ public: void retranslateUi(); -public slots: +public Q_SLOTS: void setProgress(int progress, int totalProgress); void setJobStats(int numPendingAutomatic, int numPendingManual, int numRunning, int numOther); void setNumUnacknowledgedWarningsOrErrors(int numWarnings, int numErrors); diff --git a/src/mkvtoolnix-gui/main_window/taskbar_progress.h b/src/mkvtoolnix-gui/main_window/taskbar_progress.h index ee5966b3e..f97b04f06 100644 --- a/src/mkvtoolnix-gui/main_window/taskbar_progress.h +++ b/src/mkvtoolnix-gui/main_window/taskbar_progress.h @@ -25,7 +25,7 @@ public: explicit TaskbarProgress(QWidget *parent = nullptr); virtual ~TaskbarProgress(); -public slots: +public Q_SLOTS: void setupWindowHandle(); void updateTaskbarProgress(int progress, int totalProgress); void updateTaskbarStatus(Jobs::QueueStatus status); diff --git a/src/mkvtoolnix-gui/main_window/tool_base.h b/src/mkvtoolnix-gui/main_window/tool_base.h index c1e507ef3..3eed75acb 100644 --- a/src/mkvtoolnix-gui/main_window/tool_base.h +++ b/src/mkvtoolnix-gui/main_window/tool_base.h @@ -17,7 +17,7 @@ public: virtual void setupActions() = 0; virtual std::pair nextPreviousWindowActionTexts() const { return {}; }; -public slots: +public Q_SLOTS: virtual void toolShown() = 0; }; diff --git a/src/mkvtoolnix-gui/main_window/update_checker.cpp b/src/mkvtoolnix-gui/main_window/update_checker.cpp index 2b07ff67e..232679741 100644 --- a/src/mkvtoolnix-gui/main_window/update_checker.cpp +++ b/src/mkvtoolnix-gui/main_window/update_checker.cpp @@ -53,7 +53,7 @@ UpdateChecker::start() { qDebug() << "UpdateChecker::start: initiating requests"; - emit checkStarted(); + Q_EMIT checkStarted(); qDebug() << "UpdateChecker::start: checkStarted emitted"; auto &manager = App::instance()->networkAccessManager(); @@ -104,11 +104,11 @@ UpdateChecker::handleDownloadedContent(quint64 token, qDebug() << "UpdateChecker::handleDownloadedContent: latest version info retrieved; status:" << static_cast(status); - emit checkFinished(status, p->m_release); + Q_EMIT checkFinished(status, p->m_release); } else { qDebug() << "UpdateChecker::handleDownloadedContent: releases info retrieved"; - emit releaseInformationRetrieved(doc); + Q_EMIT releaseInformationRetrieved(doc); } if (p->m_numFinished < p->m_tokens.size()) diff --git a/src/mkvtoolnix-gui/main_window/update_checker.h b/src/mkvtoolnix-gui/main_window/update_checker.h index e7efa138f..9e4fefea6 100644 --- a/src/mkvtoolnix-gui/main_window/update_checker.h +++ b/src/mkvtoolnix-gui/main_window/update_checker.h @@ -35,12 +35,12 @@ public: UpdateChecker &setRetrieveReleasesInfo(bool enable); -signals: +Q_SIGNALS: void checkStarted(); void checkFinished(mtx::gui::UpdateCheckStatus status, mtx_release_version_t release); void releaseInformationRetrieved(std::shared_ptr releasesInfo); -public slots: +public Q_SLOTS: void handleDownloadedContent(quint64 token, QByteArray const &content); void start(); diff --git a/src/mkvtoolnix-gui/merge/adding_appending_files_dialog.h b/src/mkvtoolnix-gui/merge/adding_appending_files_dialog.h index 4a2073095..2c304d2c4 100644 --- a/src/mkvtoolnix-gui/merge/adding_appending_files_dialog.h +++ b/src/mkvtoolnix-gui/merge/adding_appending_files_dialog.h @@ -28,7 +28,7 @@ public: int fileIndex() const; bool alwaysUseThisDecision() const; -public slots: +public Q_SLOTS: void selectionChanged(); }; diff --git a/src/mkvtoolnix-gui/merge/additional_command_line_options_dialog.h b/src/mkvtoolnix-gui/merge/additional_command_line_options_dialog.h index 4975df8c1..496c74a30 100644 --- a/src/mkvtoolnix-gui/merge/additional_command_line_options_dialog.h +++ b/src/mkvtoolnix-gui/merge/additional_command_line_options_dialog.h @@ -43,7 +43,7 @@ public: QString additionalOptions() const; bool saveAsDefault() const; -public slots: +public Q_SLOTS: void enableOkButton(); private: diff --git a/src/mkvtoolnix-gui/merge/attachments.cpp b/src/mkvtoolnix-gui/merge/attachments.cpp index 927ff2627..4e3d3c676 100644 --- a/src/mkvtoolnix-gui/merge/attachments.cpp +++ b/src/mkvtoolnix-gui/merge/attachments.cpp @@ -68,7 +68,7 @@ Tab::setupAttachmentsControls() { m_removeAttachmentsAction->setIcon(QIcon{Q(":/icons/16x16/list-remove.png")}); m_selectAllAttachmentsAction->setIcon(QIcon{Q(":/icons/16x16/edit-select-all.png")}); - // Signals & slots + // Q_SIGNALS & Q_SLOTS connect(m_addAttachmentsAction, &QAction::triggered, this, &Tab::onAddAttachments); connect(m_removeAttachmentsAction, &QAction::triggered, this, &Tab::onRemoveAttachments); connect(m_removeAllAttachmentsAction, &QAction::triggered, this, &Tab::onRemoveAllAttachments); diff --git a/src/mkvtoolnix-gui/merge/command_line_dialog.h b/src/mkvtoolnix-gui/merge/command_line_dialog.h index f7c4798cc..531632854 100644 --- a/src/mkvtoolnix-gui/merge/command_line_dialog.h +++ b/src/mkvtoolnix-gui/merge/command_line_dialog.h @@ -23,7 +23,7 @@ public: explicit CommandLineDialog(QWidget *parent, QStringList const &options, QString const &title); ~CommandLineDialog(); -public slots: +public Q_SLOTS: void onEscapeModeChanged(int index); void copyToClipboard(); }; diff --git a/src/mkvtoolnix-gui/merge/executable_location_dialog.h b/src/mkvtoolnix-gui/merge/executable_location_dialog.h index e99d1a30e..752b22fc7 100644 --- a/src/mkvtoolnix-gui/merge/executable_location_dialog.h +++ b/src/mkvtoolnix-gui/merge/executable_location_dialog.h @@ -27,7 +27,7 @@ public: QString executable() const; -public slots: +public Q_SLOTS: void browse(); }; diff --git a/src/mkvtoolnix-gui/merge/file_identification_thread.cpp b/src/mkvtoolnix-gui/merge/file_identification_thread.cpp index ae3fdbbc6..b522d4ffa 100644 --- a/src/mkvtoolnix-gui/merge/file_identification_thread.cpp +++ b/src/mkvtoolnix-gui/merge/file_identification_thread.cpp @@ -104,7 +104,7 @@ FileIdentificationWorker::identifyFiles() { qDebug() << "FileIdentificationWorker::identifyFiles: starting loop"; - emit queueStarted(); + Q_EMIT queueStarted(); while (true) { QString fileName; @@ -114,7 +114,7 @@ FileIdentificationWorker::identifyFiles() { if (p->m_toIdentify.isEmpty()) { qDebug() << "FileIdentificationWorker::identifyFiles: exiting loop (nothing left to do)"; - emit queueFinished(); + Q_EMIT queueFinished(); return; } @@ -124,7 +124,7 @@ FileIdentificationWorker::identifyFiles() { if (pack.m_fileNames.isEmpty()) { qDebug() << "FileIdentificationWorker::identifyFiles: pack finished, notifying"; - emit filesIdentified(pack.m_identifiedFiles, pack.m_append, pack.m_sourceFileIdx); + Q_EMIT filesIdentified(pack.m_identifiedFiles, pack.m_append, pack.m_sourceFileIdx); p->m_toIdentify.removeFirst(); continue; @@ -154,7 +154,7 @@ FileIdentificationWorker::abortIdentification() { p->m_toIdentify.clear(); - emit queueFinished(); + Q_EMIT queueFinished(); } bool @@ -168,13 +168,13 @@ FileIdentificationWorker::handleFileThatShouldBeSelectedElsewhere(QString const auto content = std::string{ file.read(1024).data() }; if (std::regex_search(content, p->m_simpleChaptersRE) || std::regex_search(content, p->m_xmlChaptersRE)) - emit identifiedAsXmlOrSimpleChapters(fileName); + Q_EMIT identifiedAsXmlOrSimpleChapters(fileName); else if (std::regex_search(content, p->m_xmlSegmentInfoRE)) - emit identifiedAsXmlSegmentInfo(fileName); + Q_EMIT identifiedAsXmlSegmentInfo(fileName); else if (std::regex_search(content, p->m_xmlTagsRE)) - emit identifiedAsXmlTags(fileName); + Q_EMIT identifiedAsXmlTags(fileName); else return false; @@ -212,7 +212,7 @@ FileIdentificationWorker::handleIdentifiedPlaylist(SourceFilePtr const &sourceFi if (Util::Settings::AlwaysScan == policy) return scanPlaylists(files); - emit playlistScanDecisionNeeded(sourceFile, files); + Q_EMIT playlistScanDecisionNeeded(sourceFile, files); return Result::Wait; } @@ -238,7 +238,7 @@ FileIdentificationWorker::scanPlaylists(QFileInfoList const &files) { p->m_abortPlaylistScan = false; - emit playlistScanStarted(numFiles); + Q_EMIT playlistScanStarted(numFiles); QList identifiedPlaylists; auto minimumPlaylistDuration = timestamp_c::s(Util::Settings::get().m_minimumPlaylistDuration); @@ -256,16 +256,16 @@ FileIdentificationWorker::scanPlaylists(QFileInfoList const &files) { if (p->m_abortPlaylistScan) { qDebug() << "FileIdentificationWorker::scanPlaylists: scan aborted"; - emit playlistScanFinished(); + Q_EMIT playlistScanFinished(); return Result::Continue; } - emit playlistScanProgressChanged(idx + 1); + Q_EMIT playlistScanProgressChanged(idx + 1); } - emit playlistScanProgressChanged(numFiles); - emit playlistScanFinished(); + Q_EMIT playlistScanProgressChanged(numFiles); + Q_EMIT playlistScanFinished(); if (identifiedPlaylists.isEmpty()) { qDebug() << "FileIdentificationWorker::scanPlaylists: scan finished, no files"; @@ -274,7 +274,7 @@ FileIdentificationWorker::scanPlaylists(QFileInfoList const &files) { qDebug() << "FileIdentificationWorker::scanPlaylists: scan finished with one or more files, potentially requiring user selection"; - emit playlistSelectionNeeded(identifiedPlaylists); + Q_EMIT playlistSelectionNeeded(identifiedPlaylists); return Result::Wait; } @@ -298,7 +298,7 @@ FileIdentificationWorker::identifyThisFile(QString const &fileName) { Util::FileIdentifier identifier{fileName}; if (!identifier.identify()) { qDebug() << "FileIdentificationWorker::identifyThisFile: failed"; - emit identificationFailed(identifier.errorTitle(), identifier.errorText()); + Q_EMIT identificationFailed(identifier.errorTitle(), identifier.errorText()); return Result::Wait; } diff --git a/src/mkvtoolnix-gui/merge/file_identification_thread.h b/src/mkvtoolnix-gui/merge/file_identification_thread.h index 153c6647d..b8794c26a 100644 --- a/src/mkvtoolnix-gui/merge/file_identification_thread.h +++ b/src/mkvtoolnix-gui/merge/file_identification_thread.h @@ -40,14 +40,14 @@ public: bool isEmpty() const; -public slots: +public Q_SLOTS: void continueByScanningPlaylists(QFileInfoList const &files); -protected slots: +protected Q_SLOTS: void identifyFiles(); void abortIdentification(); -signals: +Q_SIGNALS: void queueStarted(); void queueFinished(); @@ -93,7 +93,7 @@ public: void continueIdentification(); void abortIdentification(); -public slots: +public Q_SLOTS: void abortPlaylistScan(); }; diff --git a/src/mkvtoolnix-gui/merge/input.cpp b/src/mkvtoolnix-gui/merge/input.cpp index 15e4819c3..69538bfcf 100644 --- a/src/mkvtoolnix-gui/merge/input.cpp +++ b/src/mkvtoolnix-gui/merge/input.cpp @@ -328,7 +328,7 @@ Tab::setupInputControls() { m_appendFilesAction2->setIcon(QIcon{Q(":/icons/16x16/distribute-horizontal-x.png")}); m_addAdditionalPartsAction2->setIcon(QIcon{Q(":/icons/16x16/distribute-horizontal-margin.png")}); - // Connect signals & slots. + // Connect Q_SIGNALS & Q_SLOTS. auto mw = MainWindow::get(); using CMSAction = Util::Settings::ClearMergeSettingsAction; diff --git a/src/mkvtoolnix-gui/merge/output.cpp b/src/mkvtoolnix-gui/merge/output.cpp index f62efab51..fc9c08d8d 100644 --- a/src/mkvtoolnix-gui/merge/output.cpp +++ b/src/mkvtoolnix-gui/merge/output.cpp @@ -345,7 +345,7 @@ void Tab::setDestination(QString const &newValue) { if (newValue.isEmpty()) { m_config.m_destination.clear(); - emit titleChanged(); + Q_EMIT titleChanged(); return; } @@ -360,7 +360,7 @@ Tab::setDestination(QString const &newValue) { settings.m_lastOutputDir = QFileInfo{ newValue }.absoluteDir(); } - emit titleChanged(); + Q_EMIT titleChanged(); if (m_config.m_destination == newValue) return; diff --git a/src/mkvtoolnix-gui/merge/select_playlist_dialog.h b/src/mkvtoolnix-gui/merge/select_playlist_dialog.h index 02b3a861b..a32ff95aa 100644 --- a/src/mkvtoolnix-gui/merge/select_playlist_dialog.h +++ b/src/mkvtoolnix-gui/merge/select_playlist_dialog.h @@ -31,7 +31,7 @@ public: SourceFilePtr select(); -protected slots: +protected Q_SLOTS: void onScannedFileSelected(QTreeWidgetItem *current, QTreeWidgetItem *); protected: diff --git a/src/mkvtoolnix-gui/merge/source_file_model.h b/src/mkvtoolnix-gui/merge/source_file_model.h index 02fdc376d..cc3de964a 100644 --- a/src/mkvtoolnix-gui/merge/source_file_model.h +++ b/src/mkvtoolnix-gui/merge/source_file_model.h @@ -55,7 +55,7 @@ public: virtual bool canDropMimeData(QMimeData const *data, Qt::DropAction action, int row, int column, QModelIndex const &parent) const override; virtual bool dropMimeData(QMimeData const *data, Qt::DropAction action, int row, int column, QModelIndex const &parent) override; -public slots: +public Q_SLOTS: void updateSelectionStatus(); void updateSourceFileLists(); diff --git a/src/mkvtoolnix-gui/merge/tab.cpp b/src/mkvtoolnix-gui/merge/tab.cpp index d6124c64e..3cf7ee8bc 100644 --- a/src/mkvtoolnix-gui/merge/tab.cpp +++ b/src/mkvtoolnix-gui/merge/tab.cpp @@ -157,14 +157,14 @@ Tab::load(QString const &fileName) { MainWindow::get()->setStatusBarMessage(QY("The configuration has been loaded.")); - emit titleChanged(); + Q_EMIT titleChanged(); } catch (InvalidSettingsX &) { m_config.reset(); Util::MessageBox::critical(this)->title(QY("Error loading settings file")).text(QY("The settings file '%1' contains invalid settings and was not loaded.").arg(fileName)).exec(); - emit removeThisTab(); + Q_EMIT removeThisTab(); } } @@ -177,7 +177,7 @@ Tab::cloneConfig(MuxConfig const &config) { m_config.m_configFileName.clear(); m_savedState.clear(); - emit titleChanged(); + Q_EMIT titleChanged(); } void @@ -223,7 +223,7 @@ Tab::onSaveConfigAs() { m_savedState = currentState(); - emit titleChanged(); + Q_EMIT titleChanged(); MainWindow::get()->setStatusBarMessage(QY("The configuration has been saved.")); } @@ -331,7 +331,7 @@ Tab::retranslateUi() { retranslateOutputUI(); retranslateAttachmentsUI(); - emit titleChanged(); + Q_EMIT titleChanged(); } bool @@ -503,7 +503,7 @@ Tab::handleClearingMergeSettings(Util::Settings::ClearMergeSettingsAction action void Tab::signalRemovalOfThisTab() { - emit removeThisTab(); + Q_EMIT removeThisTab(); } QString diff --git a/src/mkvtoolnix-gui/merge/tab.h b/src/mkvtoolnix-gui/merge/tab.h index 9d21b2da9..81a41e14f 100644 --- a/src/mkvtoolnix-gui/merge/tab.h +++ b/src/mkvtoolnix-gui/merge/tab.h @@ -93,11 +93,11 @@ public: virtual void cloneConfig(MuxConfig const &config); virtual void addFiles(QStringList const &fileNames); -signals: +Q_SIGNALS: void removeThisTab(); void titleChanged(); -public slots: +public Q_SLOTS: // Input tab: virtual void onSaveConfig(); virtual void onSaveConfigAs(); diff --git a/src/mkvtoolnix-gui/merge/tool.h b/src/mkvtoolnix-gui/merge/tool.h index 324b30763..fa984ce5c 100644 --- a/src/mkvtoolnix-gui/merge/tool.h +++ b/src/mkvtoolnix-gui/merge/tool.h @@ -40,7 +40,7 @@ public: virtual void addMergeTabIfNoneOpen(); -public slots: +public Q_SLOTS: virtual void retranslateUi(); virtual void newConfig(); diff --git a/src/mkvtoolnix-gui/merge/track_model.h b/src/mkvtoolnix-gui/merge/track_model.h index e58a492b6..8dfa831ff 100644 --- a/src/mkvtoolnix-gui/merge/track_model.h +++ b/src/mkvtoolnix-gui/merge/track_model.h @@ -71,7 +71,7 @@ public: virtual bool canDropMimeData(QMimeData const *data, Qt::DropAction action, int row, int column, QModelIndex const &parent) const override; virtual bool dropMimeData(QMimeData const *data, Qt::DropAction action, int row, int column, QModelIndex const &parent) override; -public slots: +public Q_SLOTS: void updateTrackLists(); void updateSelectionStatus(); void updateEffectiveDefaultTrackFlags(); diff --git a/src/mkvtoolnix-gui/util/basic_line_edit.cpp b/src/mkvtoolnix-gui/util/basic_line_edit.cpp index 6bfe4b7a9..c0959fe1a 100644 --- a/src/mkvtoolnix-gui/util/basic_line_edit.cpp +++ b/src/mkvtoolnix-gui/util/basic_line_edit.cpp @@ -69,7 +69,7 @@ BasicLineEdit::dropEvent(QDropEvent *event) { if (p->m_setTextToDroppedFileName && !fileNames.isEmpty()) setText(fileNames[0]); - emit filesDropped(fileNames); + Q_EMIT filesDropped(fileNames); return; } @@ -81,7 +81,7 @@ void BasicLineEdit::keyPressEvent(QKeyEvent *event) { if ( (event->modifiers() == Qt::ShiftModifier) && mtx::included_in(static_cast(event->key()), Qt::Key_Return, Qt::Key_Enter)) { - emit shiftReturnPressed(); + Q_EMIT shiftReturnPressed(); event->accept(); } else diff --git a/src/mkvtoolnix-gui/util/basic_line_edit.h b/src/mkvtoolnix-gui/util/basic_line_edit.h index 5a86338c6..d8c25e791 100644 --- a/src/mkvtoolnix-gui/util/basic_line_edit.h +++ b/src/mkvtoolnix-gui/util/basic_line_edit.h @@ -31,7 +31,7 @@ public: BasicLineEdit &acceptDroppedFiles(bool enable); BasicLineEdit &setTextToDroppedFileName(bool enable); -signals: +Q_SIGNALS: void filesDropped(QStringList const &fileNames); void shiftReturnPressed(); diff --git a/src/mkvtoolnix-gui/util/basic_tab_widget.cpp b/src/mkvtoolnix-gui/util/basic_tab_widget.cpp index 2c748db71..005c04795 100644 --- a/src/mkvtoolnix-gui/util/basic_tab_widget.cpp +++ b/src/mkvtoolnix-gui/util/basic_tab_widget.cpp @@ -52,7 +52,7 @@ BasicTabWidget::eventFilter(QObject *o, auto tabIdx = tabBar()->tabAt(me->pos()); if (tabIdx >= 0) - emit tabCloseRequested(tabIdx); + Q_EMIT tabCloseRequested(tabIdx); return true; } diff --git a/src/mkvtoolnix-gui/util/basic_tree_view.cpp b/src/mkvtoolnix-gui/util/basic_tree_view.cpp index f20b20069..214ae156c 100644 --- a/src/mkvtoolnix-gui/util/basic_tree_view.cpp +++ b/src/mkvtoolnix-gui/util/basic_tree_view.cpp @@ -72,7 +72,7 @@ BasicTreeView::dropEvent(QDropEvent *event) { auto p = p_func(); if (p->m_acceptDroppedFiles && p->m_filesDDHandler.handle(event, true)) { - emit filesDropped(p->m_filesDDHandler.fileNames(), event->mouseButtons(), event->keyboardModifiers()); + Q_EMIT filesDropped(p->m_filesDDHandler.fileNames(), event->mouseButtons(), event->keyboardModifiers()); return; } @@ -94,24 +94,24 @@ BasicTreeView::keyPressEvent(QKeyEvent *event) { if ( p->m_enterActivatesAllSelected && (event->modifiers() == Qt::NoModifier) && mtx::included_in(static_cast(event->key()), Qt::Key_Return, Qt::Key_Enter)) { - emit allSelectedActivated(); + Q_EMIT allSelectedActivated(); event->accept(); } else if ( (event->modifiers() == Qt::NoModifier) && mtx::included_in(static_cast(event->key()), Qt::Key_Backspace, Qt::Key_Delete)) - emit deletePressed(); + Q_EMIT deletePressed(); else if ( (event->modifiers() == Qt::NoModifier) && (event->key() == Qt::Key_Insert)) - emit insertPressed(); + Q_EMIT insertPressed(); else if ( (event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_Up)) - emit ctrlUpPressed(); + Q_EMIT ctrlUpPressed(); else if ( (event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_Down)) - emit ctrlDownPressed(); + Q_EMIT ctrlDownPressed(); else if ( (event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) && (event->key() == Qt::Key_Space)) diff --git a/src/mkvtoolnix-gui/util/basic_tree_view.h b/src/mkvtoolnix-gui/util/basic_tree_view.h index 5472364a6..2a4027a78 100644 --- a/src/mkvtoolnix-gui/util/basic_tree_view.h +++ b/src/mkvtoolnix-gui/util/basic_tree_view.h @@ -31,7 +31,7 @@ public: BasicTreeView &acceptDroppedFiles(bool enable); BasicTreeView &enterActivatesAllSelected(bool enable); -signals: +Q_SIGNALS: void filesDropped(QStringList const &fileNames, Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers); void allSelectedActivated(); void deletePressed(); @@ -39,7 +39,7 @@ signals: void ctrlUpPressed(); void ctrlDownPressed(); -public slots: +public Q_SLOTS: void toggleSelectionOfCurrentItem(); protected: diff --git a/src/mkvtoolnix-gui/util/combo_box_base.h b/src/mkvtoolnix-gui/util/combo_box_base.h index d3478e08c..ab64ccd79 100644 --- a/src/mkvtoolnix-gui/util/combo_box_base.h +++ b/src/mkvtoolnix-gui/util/combo_box_base.h @@ -37,7 +37,7 @@ public: virtual ComboBoxBase &reInitializeIfNecessary(); virtual bool onlyShowOftenUsed() const; -public slots: +public Q_SLOTS: virtual void reInitialize(); protected: diff --git a/src/mkvtoolnix-gui/util/elide_label.cpp b/src/mkvtoolnix-gui/util/elide_label.cpp index 77d09b2a7..67e7e1835 100644 --- a/src/mkvtoolnix-gui/util/elide_label.cpp +++ b/src/mkvtoolnix-gui/util/elide_label.cpp @@ -63,7 +63,7 @@ ElideLabel::setText(QString const &text) { p->m_text = text; updateLabel(); - emit textChanged(p->m_text); + Q_EMIT textChanged(p->m_text); } Qt::TextElideMode diff --git a/src/mkvtoolnix-gui/util/elide_label.h b/src/mkvtoolnix-gui/util/elide_label.h index 537c89bc9..801bb753b 100644 --- a/src/mkvtoolnix-gui/util/elide_label.h +++ b/src/mkvtoolnix-gui/util/elide_label.h @@ -37,10 +37,10 @@ public: virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; -public slots: +public Q_SLOTS: void setText(QString const &text); -signals: +Q_SIGNALS: void textChanged(QString const &text); protected: diff --git a/src/mkvtoolnix-gui/util/fancy_tab_widget.cpp b/src/mkvtoolnix-gui/util/fancy_tab_widget.cpp index ef1b979d3..59986ce90 100644 --- a/src/mkvtoolnix-gui/util/fancy_tab_widget.cpp +++ b/src/mkvtoolnix-gui/util/fancy_tab_widget.cpp @@ -219,7 +219,7 @@ FancyTabBar::tabRect(int index) // mode itself void FancyTabBar::emitCurrentIndex() { - emit currentChanged(m_currentIndex); + Q_EMIT currentChanged(m_currentIndex); } void @@ -343,7 +343,7 @@ FancyTabBar::setCurrentIndex(int index) { if (isTabEnabled(index)) { m_currentIndex = index; update(); - emit currentChanged(m_currentIndex); + Q_EMIT currentChanged(m_currentIndex); } } @@ -578,9 +578,9 @@ FancyTabWidget::setCurrentIndex(int index) { void FancyTabWidget::showWidget(int index) { - emit currentAboutToShow(index); + Q_EMIT currentAboutToShow(index); m_modesStack->setCurrentIndex(index); - emit currentChanged(index); + Q_EMIT currentChanged(index); } void diff --git a/src/mkvtoolnix-gui/util/fancy_tab_widget.h b/src/mkvtoolnix-gui/util/fancy_tab_widget.h index 9ff2318b2..58f1aaca8 100644 --- a/src/mkvtoolnix-gui/util/fancy_tab_widget.h +++ b/src/mkvtoolnix-gui/util/fancy_tab_widget.h @@ -111,10 +111,10 @@ public: int count() const; QRect tabRect(int index) const; -signals: +Q_SIGNALS: void currentChanged(int); -public slots: +public Q_SLOTS: void emitCurrentIndex(); private: @@ -154,14 +154,14 @@ public: FancyTabBar *tabBar(); -signals: +Q_SIGNALS: void currentAboutToShow(int index); void currentChanged(int index); -public slots: +public Q_SLOTS: void setCurrentIndex(int index); -private slots: +private Q_SLOTS: void showWidget(int index); }; diff --git a/src/mkvtoolnix-gui/util/files_drag_drop_widget.cpp b/src/mkvtoolnix-gui/util/files_drag_drop_widget.cpp index 22771877c..26a5dbeb2 100644 --- a/src/mkvtoolnix-gui/util/files_drag_drop_widget.cpp +++ b/src/mkvtoolnix-gui/util/files_drag_drop_widget.cpp @@ -40,7 +40,7 @@ FilesDragDropWidget::dropEvent(QDropEvent *event) { auto p = p_func(); if (p->m_filesDDHandler.handle(event, true)) - emit filesDropped(p->m_filesDDHandler.fileNames()); + Q_EMIT filesDropped(p->m_filesDDHandler.fileNames()); } } diff --git a/src/mkvtoolnix-gui/util/files_drag_drop_widget.h b/src/mkvtoolnix-gui/util/files_drag_drop_widget.h index 3e1aea396..5229ff23b 100644 --- a/src/mkvtoolnix-gui/util/files_drag_drop_widget.h +++ b/src/mkvtoolnix-gui/util/files_drag_drop_widget.h @@ -26,7 +26,7 @@ public: virtual void dragEnterEvent(QDragEnterEvent *event) override; virtual void dropEvent(QDropEvent *event) override; -signals: +Q_SIGNALS: void filesDropped(QStringList const &files); }; diff --git a/src/mkvtoolnix-gui/util/header_view_manager.h b/src/mkvtoolnix-gui/util/header_view_manager.h index 1e5822e55..227383ca6 100644 --- a/src/mkvtoolnix-gui/util/header_view_manager.h +++ b/src/mkvtoolnix-gui/util/header_view_manager.h @@ -30,7 +30,7 @@ public: HeaderViewManager &setDefaultSizes(QHash const &defaultSizes); -public slots: +public Q_SLOTS: void saveState(); void restoreState(); diff --git a/src/mkvtoolnix-gui/util/installation_checker.cpp b/src/mkvtoolnix-gui/util/installation_checker.cpp index 5e3c1f7cc..3b7b96b15 100644 --- a/src/mkvtoolnix-gui/util/installation_checker.cpp +++ b/src/mkvtoolnix-gui/util/installation_checker.cpp @@ -61,9 +61,9 @@ InstallationChecker::runChecks() { #endif // SYS_WINDOWS if (!m_problems.isEmpty()) - emit problemsFound(m_problems); + Q_EMIT problemsFound(m_problems); - emit finished(); + Q_EMIT finished(); } void diff --git a/src/mkvtoolnix-gui/util/installation_checker.h b/src/mkvtoolnix-gui/util/installation_checker.h index 517f92347..9861f6e23 100644 --- a/src/mkvtoolnix-gui/util/installation_checker.h +++ b/src/mkvtoolnix-gui/util/installation_checker.h @@ -35,11 +35,11 @@ public: QString mkvmergeVersion() const; Problems problems() const; -signals: +Q_SIGNALS: void problemsFound(Util::InstallationChecker::Problems const &results); void finished(); -public slots: +public Q_SLOTS: void runChecks(); public: diff --git a/src/mkvtoolnix-gui/util/kax_info.cpp b/src/mkvtoolnix-gui/util/kax_info.cpp index 5e8b5e70b..ac55335e3 100644 --- a/src/mkvtoolnix-gui/util/kax_info.cpp +++ b/src/mkvtoolnix-gui/util/kax_info.cpp @@ -61,7 +61,7 @@ KaxInfo::~KaxInfo() { void KaxInfo::ui_show_error(std::string const &error) { - emit errorFound(Q(error)); + Q_EMIT errorFound(Q(error)); } void @@ -71,7 +71,7 @@ KaxInfo::ui_show_element_info(int level, std::optional size, std::optional dataSize) { if (p_func()->m_use_gui) - emit elementInfoFound(level, Q(text), position, size, dataSize); + Q_EMIT elementInfoFound(level, Q(text), position, size, dataSize); else kax_info_c::ui_show_element_info(level, text, position, size, dataSize); @@ -85,7 +85,7 @@ KaxInfo::ui_show_element(EbmlElement &e) { if ((p->m_scanType == ScanType::StartOfFile) && Is(e)) p->m_firstLevel1ElementPosition = e.GetElementPosition(); else - emit elementFound(p->m_level, &e, p->m_scanType == ScanType::StartOfFile); + Q_EMIT elementFound(p->m_level, &e, p->m_scanType == ScanType::StartOfFile); } else kax_info_c::ui_show_element(e); @@ -94,7 +94,7 @@ KaxInfo::ui_show_element(EbmlElement &e) { void KaxInfo::ui_show_progress(int percentage, std::string const &text) { - emit progressChanged(percentage, Q(text)); + Q_EMIT progressChanged(percentage, Q(text)); } void @@ -126,22 +126,22 @@ KaxInfo::scanStartOfFile() { auto p = p_func(); - emit startOfFileScanStarted(); + Q_EMIT startOfFileScanStarted(); p->m_firstLevel1ElementPosition.reset(); p->m_abort = false; auto result = p->m_in ? process_file() : open_and_process_file(p->m_source_file_name); - emit startOfFileScanFinished(result); + Q_EMIT startOfFileScanFinished(result); } void KaxInfo::scanLevel1Elements() { - emit level1ElementsScanStarted(); + Q_EMIT level1ElementsScanStarted(); auto result = doScanLevel1Elements(); - emit level1ElementsScanFinished(result); + Q_EMIT level1ElementsScanFinished(result); } mtx::kax_info_c::result_e diff --git a/src/mkvtoolnix-gui/util/kax_info.h b/src/mkvtoolnix-gui/util/kax_info.h index 2fa712b75..d38404962 100644 --- a/src/mkvtoolnix-gui/util/kax_info.h +++ b/src/mkvtoolnix-gui/util/kax_info.h @@ -54,13 +54,13 @@ public: void disableFrameInfo(); -public slots: +public Q_SLOTS: virtual void runScan(ScanType type); virtual void scanStartOfFile(); virtual void scanLevel1Elements(); virtual void abort(); -signals: +Q_SIGNALS: void elementInfoFound(int level, QString const &text, std::optional position, std::optional size, std::optional dataSize); void elementFound(int level, EbmlElement *e, bool readFully); void errorFound(const QString &message); diff --git a/src/mkvtoolnix-gui/util/media_player.h b/src/mkvtoolnix-gui/util/media_player.h index f8f2ffe40..d40c04360 100644 --- a/src/mkvtoolnix-gui/util/media_player.h +++ b/src/mkvtoolnix-gui/util/media_player.h @@ -25,7 +25,7 @@ public: bool isPlaying() const; -public slots: +public Q_SLOTS: void playFile(QString const &fileName, unsigned int volume); void stopPlayback(); }; diff --git a/src/mkvtoolnix-gui/util/network_access_manager.cpp b/src/mkvtoolnix-gui/util/network_access_manager.cpp index 887a6dd33..f0ca26172 100644 --- a/src/mkvtoolnix-gui/util/network_access_manager.cpp +++ b/src/mkvtoolnix-gui/util/network_access_manager.cpp @@ -85,7 +85,7 @@ NetworkAccessManager::httpFinished() { qDebug() << "NetworkAccessManager::httpFinished: token" << token << "request done, read" << content.size(); - emit downloadFinished(token, content); + Q_EMIT downloadFinished(token, content); } else qDebug() << "NetworkAccessManager::httpFinished: unknown reply?"; diff --git a/src/mkvtoolnix-gui/util/network_access_manager.h b/src/mkvtoolnix-gui/util/network_access_manager.h index da7910ec7..2287e94c9 100644 --- a/src/mkvtoolnix-gui/util/network_access_manager.h +++ b/src/mkvtoolnix-gui/util/network_access_manager.h @@ -29,13 +29,13 @@ public: quint64 download(QUrl const &url); -signals: +Q_SIGNALS: void downloadFinished(quint64 token, QByteArray const &content); -public slots: +public Q_SLOTS: void httpFinished(); -protected slots: +protected Q_SLOTS: void startDownload(quint64 token, QUrl const &url); protected: diff --git a/src/mkvtoolnix-gui/util/process.h b/src/mkvtoolnix-gui/util/process.h index cdf9323c7..785d108fd 100644 --- a/src/mkvtoolnix-gui/util/process.h +++ b/src/mkvtoolnix-gui/util/process.h @@ -39,7 +39,7 @@ public: virtual bool hasError() const; virtual void run(); -public slots: +public Q_SLOTS: virtual void dataAvailable(); virtual void onError(); diff --git a/src/mkvtoolnix-gui/util/serial_worker_queue.h b/src/mkvtoolnix-gui/util/serial_worker_queue.h index 62c2866e3..b8a6d6e48 100644 --- a/src/mkvtoolnix-gui/util/serial_worker_queue.h +++ b/src/mkvtoolnix-gui/util/serial_worker_queue.h @@ -25,7 +25,7 @@ public: virtual void add(Runnable *work); -public slots: +public Q_SLOTS: virtual void run(); virtual void abort(); diff --git a/src/mkvtoolnix-gui/util/settings.h b/src/mkvtoolnix-gui/util/settings.h index aa65556b8..07a883a18 100644 --- a/src/mkvtoolnix-gui/util/settings.h +++ b/src/mkvtoolnix-gui/util/settings.h @@ -216,7 +216,7 @@ public: QString lastOpenDirPath() const; QString lastConfigDirPath() const; -public slots: +public Q_SLOTS: void storeSplitterSizes(); protected: diff --git a/src/mkvtoolnix-gui/util/side_by_side_multi_select.cpp b/src/mkvtoolnix-gui/util/side_by_side_multi_select.cpp index 146eac601..e9ee3f7e6 100644 --- a/src/mkvtoolnix-gui/util/side_by_side_multi_select.cpp +++ b/src/mkvtoolnix-gui/util/side_by_side_multi_select.cpp @@ -138,7 +138,7 @@ SideBySideMultiSelect::moveSelectedListWidgetItems(QListWidget &from, to.addItem(actualItem); } - emit listsChanged(); + Q_EMIT listsChanged(); } void diff --git a/src/mkvtoolnix-gui/util/side_by_side_multi_select.h b/src/mkvtoolnix-gui/util/side_by_side_multi_select.h index c221d6183..e72abfdb5 100644 --- a/src/mkvtoolnix-gui/util/side_by_side_multi_select.h +++ b/src/mkvtoolnix-gui/util/side_by_side_multi_select.h @@ -41,10 +41,10 @@ public: ItemList selectedItems() const; QStringList selectedItemValues() const; -signals: +Q_SIGNALS: void listsChanged(); -public slots: +public Q_SLOTS: void availableSelectionChanged(); void selectedSelectionChanged(); diff --git a/src/mkvtoolnix-gui/util/string_list_configuration_widget.h b/src/mkvtoolnix-gui/util/string_list_configuration_widget.h index 398f63377..c4c86d64d 100644 --- a/src/mkvtoolnix-gui/util/string_list_configuration_widget.h +++ b/src/mkvtoolnix-gui/util/string_list_configuration_widget.h @@ -39,7 +39,7 @@ public: void addItem(QString const &name); -public slots: +public Q_SLOTS: void enableControls(); void addNewItem(); diff --git a/src/mkvtoolnix-gui/util/style_helper.cpp b/src/mkvtoolnix-gui/util/style_helper.cpp index 8cbbf10ea..f0cadb991 100644 --- a/src/mkvtoolnix-gui/util/style_helper.cpp +++ b/src/mkvtoolnix-gui/util/style_helper.cpp @@ -146,7 +146,7 @@ StyleHelper::setBaseColor(QColor const &newcolor) { if (color.isValid() && color != m_baseColor) { m_baseColor = color; - foreach (QWidget *w, QApplication::topLevelWidgets()) + for (auto & w : QApplication::topLevelWidgets()) w->update(); } } diff --git a/src/mkvtoolnix-gui/util/text_display_dialog.h b/src/mkvtoolnix-gui/util/text_display_dialog.h index b929da99a..d86c3ac76 100644 --- a/src/mkvtoolnix-gui/util/text_display_dialog.h +++ b/src/mkvtoolnix-gui/util/text_display_dialog.h @@ -33,7 +33,7 @@ public: virtual bool eventFilter(QObject *o, QEvent *e) override; -public slots: +public Q_SLOTS: virtual void copyToClipboard(); }; diff --git a/src/mkvtoolnix-gui/util/waiting_spinner_widget.h b/src/mkvtoolnix-gui/util/waiting_spinner_widget.h index 12aa77df9..f89356ddb 100644 --- a/src/mkvtoolnix-gui/util/waiting_spinner_widget.h +++ b/src/mkvtoolnix-gui/util/waiting_spinner_widget.h @@ -49,7 +49,7 @@ public: virtual ~WaitingSpinnerWidget(); -public slots: +public Q_SLOTS: void start(); void stop(); void reset(); @@ -78,7 +78,7 @@ public: bool isSpinning() const; -private slots: +private Q_SLOTS: void rotate(); protected: diff --git a/src/mkvtoolnix-gui/watch_jobs/tab.cpp b/src/mkvtoolnix-gui/watch_jobs/tab.cpp index 055d255e2..1464b80c6 100644 --- a/src/mkvtoolnix-gui/watch_jobs/tab.cpp +++ b/src/mkvtoolnix-gui/watch_jobs/tab.cpp @@ -46,7 +46,7 @@ class TabPrivate { bool m_forCurrentJob; // Only use this variable for determining whether or not to ignore - // certain signals. + // certain Q_SIGNALS. QObject const *m_currentlyConnectedJob; QAction *m_saveOutputAction, *m_clearOutputAction, *m_openFolderAction; @@ -234,7 +234,7 @@ Tab::onStatusChanged(uint64_t id, // Check for the signalled status, not the current one, in order to // detect a change from "not running" to "running" only once, no - // matter which order the signals arrive in. + // matter which order the Q_SIGNALS arrive in. if (Jobs::Job::Running == newStatus) setInitialDisplay(*job); @@ -456,7 +456,7 @@ Tab::clearOutput() { p->ui->remainingTimeCurrentJob->setText(Q("–")); p->ui->remainingTimeQueue->setText(Q("–")); - emit watchCurrentJobTabCleared(); + Q_EMIT watchCurrentJobTabCleared(); } void diff --git a/src/mkvtoolnix-gui/watch_jobs/tab.h b/src/mkvtoolnix-gui/watch_jobs/tab.h index 4d7ec5d73..14ddc72e2 100644 --- a/src/mkvtoolnix-gui/watch_jobs/tab.h +++ b/src/mkvtoolnix-gui/watch_jobs/tab.h @@ -44,11 +44,11 @@ public: bool isSaveOutputEnabled() const; bool isCurrentJobTab() const; -signals: +Q_SIGNALS: void abortJob(); void watchCurrentJobTabCleared(); -public slots: +public Q_SLOTS: void onStatusChanged(uint64_t id, mtx::gui::Jobs::Job::Status oldStatus, mtx::gui::Jobs::Job::Status newStatus); void onJobProgressChanged(uint64_t id, unsigned int progress); void onQueueProgressChanged(int progress, int totalProgress); diff --git a/src/mkvtoolnix-gui/watch_jobs/tool.h b/src/mkvtoolnix-gui/watch_jobs/tool.h index 9f4730847..3534c0e8e 100644 --- a/src/mkvtoolnix-gui/watch_jobs/tool.h +++ b/src/mkvtoolnix-gui/watch_jobs/tool.h @@ -43,7 +43,7 @@ public: virtual void setupActions() override; virtual std::pair nextPreviousWindowActionTexts() const override; -public slots: +public Q_SLOTS: virtual void toolShown() override; virtual void closeTab(int idx); virtual void closeCurrentTab();