cydside
13th October 2012, 12:55
Hi to all,
the following code will explain the problem better than words:
QFont font;
font.setPointSize(14);
QInputDialog tSelectFourMonthPeriod;
tSelectFourMonthPeriod.setFont(font);
tSelectFourMonthPeriod.setOption(QInputDialog::Use ListViewForComboBoxItems);
tSelectFourMonthPeriod.setWindowTitle(tr("Print Options."));
tSelectFourMonthPeriod.setLabelText(tr("Selection:"));
tSelectFourMonthPeriod.setComboBoxItems(prepareFou rMonthPerYearPeriod());
int ret = tSelectFourMonthPeriod.exec();
if (ret == QDialog::Accepted)
qDebug() << "Selection:" << tSelectFourMonthPeriod.textValue();
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.
the following code will explain the problem better than words:
QFont font;
font.setPointSize(14);
QInputDialog tSelectFourMonthPeriod;
tSelectFourMonthPeriod.setFont(font);
tSelectFourMonthPeriod.setOption(QInputDialog::Use ListViewForComboBoxItems);
tSelectFourMonthPeriod.setWindowTitle(tr("Print Options."));
tSelectFourMonthPeriod.setLabelText(tr("Selection:"));
tSelectFourMonthPeriod.setComboBoxItems(prepareFou rMonthPerYearPeriod());
int ret = tSelectFourMonthPeriod.exec();
if (ret == QDialog::Accepted)
qDebug() << "Selection:" << tSelectFourMonthPeriod.textValue();
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.