本文整理汇总了C++中SubQFontComboBox类的典型用法代码示例。如果您正苦于以下问题:C++ SubQFontComboBox类的具体用法?C++ SubQFontComboBox怎么用?C++ SubQFontComboBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SubQFontComboBox类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeHint
// public QSize sizeHint() const
void tst_QFontComboBox::sizeHint()
{
SubQFontComboBox box;
QSize sizeHint = box.QComboBox::sizeHint();
QFontMetrics fm(box.font());
sizeHint.setWidth(qMax(sizeHint.width(), fm.width(QLatin1Char('m'))*14));
QCOMPARE(box.sizeHint(), sizeHint);
}
示例2: currentFontChanged
// protected void currentFontChanged(QFont const& f)
void tst_QFontComboBox::currentFontChanged()
{
SubQFontComboBox box;
QSignalSpy spy0(&box, SIGNAL(currentFontChanged(QFont const&)));
if (box.model()->rowCount() > 2) {
QTest::keyPress(&box, Qt::Key_Down);
QCOMPARE(spy0.count(), 1);
} else
qWarning("Not enough fonts installed on test system. Consider adding some");
}
示例3: qfontcombobox
void tst_QFontComboBox::qfontcombobox()
{
SubQFontComboBox box;
QCOMPARE(box.currentFont(), QFont());
QCOMPARE(box.fontFilters(), QFontComboBox::AllFonts);
box.setCurrentFont(QFont());
box.setFontFilters(QFontComboBox::AllFonts);
box.setWritingSystem(QFontDatabase::Any);
QVERIFY(box.sizeHint() != QSize());
QCOMPARE(box.writingSystem(), QFontDatabase::Any);
box.call_currentFontChanged(QFont());
QEvent event(QEvent::None);
QCOMPARE(box.call_event(&event), false);
}
示例4: QFETCH
// public QFontDatabase::WritingSystem writingSystem() const
void tst_QFontComboBox::writingSystem()
{
QFETCH(QFontDatabase::WritingSystem, writingSystem);
SubQFontComboBox box;
QSignalSpy spy0(&box, SIGNAL(currentFontChanged(QFont)));
QFont currentFont = box.currentFont();
box.setWritingSystem(writingSystem);
QCOMPARE(box.writingSystem(), writingSystem);
QFontDatabase db;
QStringList list = db.families(writingSystem);
int c = list.count();
for (int i = 0; i < list.count(); ++i) {
if (db.isPrivateFamily(list[i]))
c--;
}
QCOMPARE(box.model()->rowCount(), c);
if (list.count() == 0)
QCOMPARE(box.currentFont(), QFont());
QCOMPARE(spy0.count(), (currentFont != box.currentFont()) ? 1 : 0);
}