Hi to all,
the following code will explain the problem better than words:
font.setPointSize(14);
tSelectFourMonthPeriod.setFont(font);
tSelectFourMonthPeriod.
setOption(QInputDialog::UseListViewForComboBoxItems);
tSelectFourMonthPeriod.setWindowTitle(tr("Print Options."));
tSelectFourMonthPeriod.setLabelText(tr("Selection:"));
tSelectFourMonthPeriod.setComboBoxItems(prepareFourMonthPerYearPeriod());
int ret = tSelectFourMonthPeriod.exec();
qDebug() << "Selection:" << tSelectFourMonthPeriod.textValue();
QFont font;
font.setPointSize(14);
QInputDialog tSelectFourMonthPeriod;
tSelectFourMonthPeriod.setFont(font);
tSelectFourMonthPeriod.setOption(QInputDialog::UseListViewForComboBoxItems);
tSelectFourMonthPeriod.setWindowTitle(tr("Print Options."));
tSelectFourMonthPeriod.setLabelText(tr("Selection:"));
tSelectFourMonthPeriod.setComboBoxItems(prepareFourMonthPerYearPeriod());
int ret = tSelectFourMonthPeriod.exec();
if (ret == QDialog::Accepted)
qDebug() << "Selection:" << tSelectFourMonthPeriod.textValue();
To copy to clipboard, switch view to plain text mode
and it runs nice but the QListView's font is NOT what I set, it's the default!!!
How can I set the same for the QListView?
Thanks in advance.
P.S.: It happens on Windows 7, Qt 4.8.3 Qt Creator 2.5.2.
Bookmarks