@@ -51,16 +51,10 @@ CondFormatManager::CondFormatManager(const std::vector<CondFormat>& condFormats,
5151 ui->tableCondFormats ->setItemDelegateForColumn (ColumnFilter, new FilterEditDelegate (this ));
5252
5353 // Make columns not text-editable, except for the condition.
54- for (int col = ColumnForeground; col < ColumnFilter; ++col)
54+ for (int col = ColumnForeground; col < ColumnFilter; ++col) {
5555 ui->tableCondFormats ->setItemDelegateForColumn (col, new DefaultDelegate (this ));
56-
57- // Resize columns that need more space than the default, but whose content might be too wide
58- // (moreover, resizeColumnToContents seems to have problems with the font column in some Qt versions)
59- ui->tableCondFormats ->setColumnWidth (ColumnFont, 125 );
60-
61- // Resize columns that need less space than the default.
62- for (int col = ColumnSize; col < ColumnFilter; ++col)
6356 ui->tableCondFormats ->resizeColumnToContents (col);
57+ }
6458
6559 connect (ui->buttonAdd , SIGNAL (clicked (bool )), this , SLOT (addNewItem ()));
6660 connect (ui->buttonRemove , SIGNAL (clicked (bool )), this , SLOT (removeItem ()));
@@ -109,6 +103,8 @@ void CondFormatManager::addItem(const CondFormat& aCondFormat)
109103
110104 QFontComboBox* fontCombo = new QFontComboBox (ui->tableCondFormats );
111105 fontCombo->setCurrentFont (aCondFormat.font ());
106+ // Avoid that the font combo box gets too wide and work around a possible Qt bug where the box overlaps the next column.
107+ fontCombo->setMaximumWidth (150 );
112108 ui->tableCondFormats ->setItemWidget (newItem, ColumnFont, fontCombo);
113109
114110 QSpinBox* sizeBox = new QSpinBox (ui->tableCondFormats );
0 commit comments