Skip to content

Commit f6092ce

Browse files
authored
Prevent long content search texts from widening search dialog (#900)
Previously, if the search history was enabled, long content search texts could widen the search dialog the next time it was shown. If the user entered a very long content search text (by mistake), the search dialog might become unusable the next time. This is an old issue in Qt and also exists in Qt6. The patch circumvents it by setting the minimum widths of the search boxes.
1 parent 2e05a4c commit f6092ce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/filesearchdialog.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ FileSearchDialog::FileSearchDialog(QStringList paths, QWidget* parent, Qt::Windo
4848
ui->namePatterns->completer()->setCaseSensitivity(Qt::CaseSensitive);
4949
ui->contentPattern->completer()->setCaseSensitivity(Qt::CaseSensitive);
5050

51+
// if the minimum width is not set here, it will be set by the item model,
52+
// which can contain long texts and make the window very wide
53+
ui->namePatterns->setMinimumWidth(150);
54+
ui->contentPattern->setMinimumWidth(150);
55+
5156
ui->namePatterns->setFocus();
5257
}
5358

0 commit comments

Comments
 (0)