Skip to content

Commit 88e2e82

Browse files
scottfurrydanmar
authored andcommitted
Correct Signal/Slot signatures (cppcheck-opensource#2035)
Previous commit had updated declarations in Code Editor Style Dialog to use const QColor& and const QFont::Weight& variables. This change was not totally complete as const usage was not propagated to Signal/Slot connect statements. This commit corrects that oversight.
1 parent 8f92c43 commit 88e2e82

2 files changed

Lines changed: 34 additions & 34 deletions

File tree

gui/codeeditstylecontrols.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class SelectColorButton : public QPushButton {
3737
const QColor& getColor();
3838

3939
signals:
40-
void colorChanged(QColor& newColor);
40+
void colorChanged(const QColor& newColor);
4141

4242
public slots:
4343
void updateColor();
@@ -58,7 +58,7 @@ class SelectFontWeightCombo : public QComboBox {
5858
const QFont::Weight& getWeight();
5959

6060
signals:
61-
void weightChanged(QFont::Weight& newWeight);
61+
void weightChanged(const QFont::Weight& newWeight);
6262

6363
public slots:
6464
void updateWeight();

gui/codeeditstyledialog.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -157,38 +157,38 @@ StyleEditDialog::StyleEditDialog(const CodeEditorStyle& newStyle,
157157
this, SLOT(setStyleDefaultLight()));
158158
connect(mBtnDefaultDark, SIGNAL(clicked()),
159159
this, SLOT(setStyleDefaultDark()));
160-
connect(mBtnWidgetColorFG, SIGNAL(colorChanged(QColor&)),
161-
this, SLOT(colorChangedWidgetFG(QColor&)));
162-
connect(mBtnWidgetColorBG, SIGNAL(colorChanged(QColor&)),
163-
this, SLOT(colorChangedWidgetBG(QColor&)));
164-
connect(mBtnHighlightBG, SIGNAL(colorChanged(QColor&)),
165-
this, SLOT(colorChangedHighlightBG(QColor&)));
166-
connect(mBtnLineNumFG, SIGNAL(colorChanged(QColor&)),
167-
this, SLOT(colorChangedLineNumFG(QColor&)));
168-
connect(mBtnLineNumBG, SIGNAL(colorChanged(QColor&)),
169-
this, SLOT(colorChangedLineNumBG(QColor&)));
170-
connect(mBtnKeywordFG, SIGNAL(colorChanged(QColor&)),
171-
this, SLOT(colorChangedKeywordFG(QColor&)));
172-
connect(mCBKeywordWeight, SIGNAL(weightChanged(QFont::Weight&)),
173-
this, SLOT(weightChangedKeyword(QFont::Weight&)));
174-
connect(mBtnClassFG, SIGNAL(colorChanged(QColor&)),
175-
this, SLOT(colorChangedClassFG(QColor&)));
176-
connect(mCBClassWeight, SIGNAL(weightChanged(QFont::Weight&)),
177-
this, SLOT(weightChangedClass(QFont::Weight&)));
178-
connect(mBtnQuoteFG, SIGNAL(colorChanged(QColor&)),
179-
this, SLOT(colorChangedQuoteFG(QColor&)));
180-
connect(mCBQuoteWeight, SIGNAL(weightChanged(QFont::Weight&)),
181-
this, SLOT(weightChangedQuote(QFont::Weight&)));
182-
connect(mBtnCommentFG, SIGNAL(colorChanged(QColor&)),
183-
this, SLOT(colorChangedCommentFG(QColor&)));
184-
connect(mCBCommentWeight, SIGNAL(weightChanged(QFont::Weight&)),
185-
this, SLOT(weightChangedComment(QFont::Weight&)));
186-
connect(mBtnSymbolFG, SIGNAL(colorChanged(QColor&)),
187-
this, SLOT(colorChangedSymbolFG(QColor&)));
188-
connect(mBtnSymbolBG, SIGNAL(colorChanged(QColor&)),
189-
this, SLOT(colorChangedSymbolBG(QColor&)));
190-
connect(mCBSymbolWeight, SIGNAL(weightChanged(QFont::Weight&)),
191-
this, SLOT(weightChangedSymbol(QFont::Weight&)));
160+
connect(mBtnWidgetColorFG, SIGNAL(colorChanged(const QColor&)),
161+
this, SLOT(colorChangedWidgetFG(const QColor&)));
162+
connect(mBtnWidgetColorBG, SIGNAL(colorChanged(const QColor&)),
163+
this, SLOT(colorChangedWidgetBG(const QColor&)));
164+
connect(mBtnHighlightBG, SIGNAL(colorChanged(const QColor&)),
165+
this, SLOT(colorChangedHighlightBG(const QColor&)));
166+
connect(mBtnLineNumFG, SIGNAL(colorChanged(const QColor&)),
167+
this, SLOT(colorChangedLineNumFG(const QColor&)));
168+
connect(mBtnLineNumBG, SIGNAL(colorChanged(const QColor&)),
169+
this, SLOT(colorChangedLineNumBG(const QColor&)));
170+
connect(mBtnKeywordFG, SIGNAL(colorChanged(const QColor&)),
171+
this, SLOT(colorChangedKeywordFG(const QColor&)));
172+
connect(mCBKeywordWeight, SIGNAL(weightChanged(const QFont::Weight&)),
173+
this, SLOT(weightChangedKeyword(const QFont::Weight&)));
174+
connect(mBtnClassFG, SIGNAL(colorChanged(const QColor&)),
175+
this, SLOT(colorChangedClassFG(const QColor&)));
176+
connect(mCBClassWeight, SIGNAL(weightChanged(const QFont::Weight&)),
177+
this, SLOT(weightChangedClass(const QFont::Weight&)));
178+
connect(mBtnQuoteFG, SIGNAL(colorChanged(const QColor&)),
179+
this, SLOT(colorChangedQuoteFG(const QColor&)));
180+
connect(mCBQuoteWeight, SIGNAL(weightChanged(const QFont::Weight&)),
181+
this, SLOT(weightChangedQuote(const QFont::Weight&)));
182+
connect(mBtnCommentFG, SIGNAL(colorChanged(const QColor&)),
183+
this, SLOT(colorChangedCommentFG(const QColor&)));
184+
connect(mCBCommentWeight, SIGNAL(weightChanged(const QFont::Weight&)),
185+
this, SLOT(weightChangedComment(const QFont::Weight&)));
186+
connect(mBtnSymbolFG, SIGNAL(colorChanged(const QColor&)),
187+
this, SLOT(colorChangedSymbolFG(const QColor&)));
188+
connect(mBtnSymbolBG, SIGNAL(colorChanged(const QColor&)),
189+
this, SLOT(colorChangedSymbolBG(const QColor&)));
190+
connect(mCBSymbolWeight, SIGNAL(weightChanged(const QFont::Weight&)),
191+
this, SLOT(weightChangedSymbol(const QFont::Weight&)));
192192
}
193193

194194
void StyleEditDialog::updateControls()

0 commit comments

Comments
 (0)