mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-24 22:48:23 -05:00
Fix a harmless warning when searching for an empty font name
When the index of the selected cell is invalid, i.e. no cell is selected, we cannot retrieve the font of the selected cell. Trying to look up the empty font name for updating the font combo box in the Format toolbar then fails, outputting a warning with some Qt versions. See issue #2288.
This commit is contained in:
@@ -212,8 +212,10 @@ TableBrowser::TableBrowser(QWidget* parent) :
|
||||
|
||||
connect(ui->dataTable, &ExtendedTableWidget::currentIndexChanged, this, [this](const QModelIndex ¤t, const QModelIndex &) {
|
||||
// Get cell current format for updating the format toolbar values. Block signals, so the format change is not reapplied.
|
||||
QString font_string = m_model->data(current, Qt::FontRole).toString();
|
||||
QFont font;
|
||||
font.fromString(m_model->data(current, Qt::FontRole).toString());
|
||||
if(!font_string.isEmpty())
|
||||
font.fromString(m_model->data(current, Qt::FontRole).toString());
|
||||
ui->fontComboBox->blockSignals(true);
|
||||
ui->fontComboBox->setCurrentFont(font);
|
||||
ui->fontComboBox->blockSignals(false);
|
||||
|
||||
Reference in New Issue
Block a user