Fix a warning

This commit is contained in:
Bill Somerville 2019-07-02 19:33:09 +01:00
parent a30d97fb57
commit e7ace39e44
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
1 changed files with 3 additions and 2 deletions

View File

@ -42,8 +42,8 @@ void ColorHighlighting::set_items (DecodeHighlightingModel const& highlighting_m
int index {0}; int index {0};
for (auto const& item : highlighting_model.items ()) for (auto const& item : highlighting_model.items ())
{ {
QLabel * example; QLabel * example {nullptr};
QLabel * label; QLabel * label {nullptr};
switch (index++) switch (index++)
{ {
case 0: case 0:
@ -111,6 +111,7 @@ void ColorHighlighting::set_items (DecodeHighlightingModel const& highlighting_m
label = ui->p16_label; label = ui->p16_label;
break; break;
} }
if (!example || !label) continue;
auto palette = example->parentWidget ()->palette (); auto palette = example->parentWidget ()->palette ();
if (Qt::NoBrush != item.background_.style ()) if (Qt::NoBrush != item.background_.style ())
{ {