Merge pull request #3685 from Soerboe/224121_crash_when_clearing_palette_when_filtered
fix #224121: Crash when clearing palette cell with filter active
This commit is contained in:
commit
fa17f01af0
3 changed files with 7 additions and 5 deletions
|
@ -52,6 +52,8 @@ void PaletteBoxButton::contextMenuEvent(QContextMenuEvent* event)
|
|||
QAction* actionEdit = menu.addAction(tr("Enable Editing"));
|
||||
actionEdit->setCheckable(true);
|
||||
actionEdit->setChecked(!palette->readOnly());
|
||||
if (palette->isFilterActive())
|
||||
actionEdit->setVisible(false);
|
||||
|
||||
bool _systemPalette = palette->systemPalette();
|
||||
actionProperties->setDisabled(_systemPalette);
|
||||
|
|
|
@ -52,10 +52,10 @@ class PaletteBoxButton : public QToolButton {
|
|||
void upTriggered() { emit paletteCmd(PaletteCommand::UP, id); }
|
||||
void downTriggered() { emit paletteCmd(PaletteCommand::DOWN, id); }
|
||||
void newTriggered() { emit paletteCmd(PaletteCommand::NEW, id); }
|
||||
void enableEditing(bool);
|
||||
|
||||
public slots:
|
||||
void showPalette(bool);
|
||||
void enableEditing(bool);
|
||||
|
||||
signals:
|
||||
void paletteCmd(PaletteCommand, int);
|
||||
|
|
|
@ -119,13 +119,13 @@ void PaletteBox::filterPalettes(const QString& text)
|
|||
bool f = p->filter(text);
|
||||
b->setVisible(!f);
|
||||
if (b->isVisible()) {
|
||||
if (text.isEmpty())
|
||||
b->showPalette(false);
|
||||
else
|
||||
b->showPalette(true);
|
||||
b->showPalette(!text.isEmpty());
|
||||
}
|
||||
else
|
||||
b->showPalette(false);
|
||||
|
||||
// disable editing while palette is filtered
|
||||
b->enableEditing(text.isEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue