Skip to content

Commit 398ff76

Browse files
committed
Fixes clangd errors
1 parent eee6ba2 commit 398ff76

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

foucaultview.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ foucaultView::foucaultView(QWidget *parent, SurfaceManager *sm) :
4343
// Using name() and string check for robust color persistence
4444
m_gridColor = QColor(set.value("ronchiGrid/color", "#00FFFF").toString()); // Default Cyan
4545
m_textColor = QColor(set.value("ronchiGrid/textColor", "#FFFFFF").toString()); // Default White
46+
47+
// Color storage (using local temps for the dialog session)
48+
4649
}
4750

4851

@@ -118,17 +121,16 @@ void foucaultView::showGrid() {
118121
QCheckBox *textToggle = new QCheckBox("Show unit labels", &dlg);
119122
textToggle->setChecked(m_showUnitLabels);
120123

121-
// Color storage (using local temps for the dialog session)
122-
struct State { QColor grid; QColor text; } colors = { m_gridColor, m_textColor };
123-
124124
QPushButton *btnGridCol = new QPushButton("Grid Color");
125125
QPushButton *btnTextCol = new QPushButton("Text Color");
126126

127-
connect(btnGridCol, &QPushButton::clicked, [&]() {
127+
colors = { m_gridColor, m_textColor }; // store current values
128+
129+
connect(btnGridCol, &QPushButton::clicked, this,[this]() {
128130
QColor c = QColorDialog::getColor(colors.grid, this);
129131
if (c.isValid()) colors.grid = c;
130132
});
131-
connect(btnTextCol, &QPushButton::clicked, [&]() {
133+
connect(btnTextCol, &QPushButton::clicked, this, [this]() {
132134
QColor c = QColorDialog::getColor(colors.text, this);
133135
if (c.isValid()) colors.text = c;
134136
});
@@ -146,7 +148,7 @@ void foucaultView::showGrid() {
146148
form.addRow(&buttonBox);
147149

148150
// Reset Logic
149-
connect(resetBtn, &QPushButton::clicked, [&]() {
151+
connect(resetBtn, &QPushButton::clicked, this, [=]() {
150152
unitCombo->setCurrentIndex(0); // None
151153
spacingSpin->setValue(10.0);
152154
widthSpin->setValue(1);

foucaultview.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ private slots:
109109
bool m_showUnitLabels = true;
110110
QColor m_gridColor = Qt::cyan;
111111
QColor m_textColor = Qt::white;
112+
struct State { QColor grid; QColor text; } colors;
113+
112114

113115
void drawGridOverlay(QImage &img);
114116
explicit foucaultView(QWidget *parent = 0, SurfaceManager *sm = 0);

0 commit comments

Comments
 (0)