diff options
author | Saturneric <[email protected]> | 2022-02-02 06:47:24 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-02-02 06:47:24 +0000 |
commit | 3780c1baab8562e15eade1c1be25ccebd0e70814 (patch) | |
tree | 0f7984b0725830cad6492bd91a4d6adaf58601c2 /src/ui/widgets/TextEdit.cpp | |
parent | <doc>(project): Separate user manual from development documentation. (diff) | |
download | GpgFrontend-3780c1baab8562e15eade1c1be25ccebd0e70814.tar.gz GpgFrontend-3780c1baab8562e15eade1c1be25ccebd0e70814.zip |
<refactor, fix>(ui): Repair and tidy the signal and slot docking
1. Use more modern ways.
2. Repair partial docking.
Diffstat (limited to 'src/ui/widgets/TextEdit.cpp')
-rw-r--r-- | src/ui/widgets/TextEdit.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ui/widgets/TextEdit.cpp b/src/ui/widgets/TextEdit.cpp index a0e16081..5556397e 100644 --- a/src/ui/widgets/TextEdit.cpp +++ b/src/ui/widgets/TextEdit.cpp @@ -45,8 +45,8 @@ TextEdit::TextEdit(QWidget* parent) : QWidget(parent) { layout->setSpacing(0); setLayout(layout); - connect(tab_widget_, SIGNAL(tabCloseRequested(int)), this, - SLOT(slot_remove_tab(int))); + connect(tab_widget_, &QTabWidget::tabCloseRequested, this, + &TextEdit::slot_remove_tab); SlotNewTab(); setAcceptDrops(false); } @@ -129,8 +129,8 @@ void TextEdit::SlotOpen() { QApplication::restoreOverrideCursor(); page->GetTextPage()->setFocus(); connect(page->GetTextPage()->document(), - SIGNAL(modificationChanged(bool)), this, - SLOT(SlotShowModified())); + &QTextDocument::modificationChanged, this, + &TextEdit::SlotShowModified); // enableAction(true) file.close(); } else { @@ -508,7 +508,7 @@ QHash<int, QString> TextEdit::UnsavedDocuments() const { return unsavedDocs; } -void TextEdit::slot_cut() const { +void TextEdit::SlotCut() const { if (tab_widget_->count() == 0 || CurTextPage() == nullptr) { return; } @@ -516,7 +516,7 @@ void TextEdit::slot_cut() const { CurTextPage()->GetTextPage()->cut(); } -void TextEdit::slot_copy() const { +void TextEdit::SlotCopy() const { if (tab_widget_->count() == 0) { return; } @@ -526,7 +526,7 @@ void TextEdit::slot_copy() const { } } -void TextEdit::slot_paste() const { +void TextEdit::SlotPaste() const { if (tab_widget_->count() == 0 || CurTextPage() == nullptr) { return; } @@ -534,7 +534,7 @@ void TextEdit::slot_paste() const { CurTextPage()->GetTextPage()->paste(); } -void TextEdit::slot_undo() const { +void TextEdit::SlotUndo() const { if (tab_widget_->count() == 0 || CurTextPage() == nullptr) { return; } @@ -542,7 +542,7 @@ void TextEdit::slot_undo() const { CurTextPage()->GetTextPage()->undo(); } -void TextEdit::slot_redo() const { +void TextEdit::SlotRedo() const { if (tab_widget_->count() == 0 || CurTextPage() == nullptr) { return; } @@ -550,7 +550,7 @@ void TextEdit::slot_redo() const { CurTextPage()->GetTextPage()->redo(); } -void TextEdit::slot_zoom_in() const { +void TextEdit::SlotZoomIn() const { if (tab_widget_->count() == 0) { return; } @@ -560,7 +560,7 @@ void TextEdit::slot_zoom_in() const { } } -void TextEdit::slot_zoom_out() const { +void TextEdit::SlotZoomOut() const { if (tab_widget_->count() == 0) { return; } @@ -570,7 +570,7 @@ void TextEdit::slot_zoom_out() const { } } -void TextEdit::slot_select_all() const { +void TextEdit::SlotSelectAll() const { if (tab_widget_->count() == 0 || CurTextPage() == nullptr) { return; } |