本文整理汇总了C++中QLCDNumber::value方法的典型用法代码示例。如果您正苦于以下问题:C++ QLCDNumber::value方法的具体用法?C++ QLCDNumber::value怎么用?C++ QLCDNumber::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLCDNumber
的用法示例。
在下文中一共展示了QLCDNumber::value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: text
/*! \reimp */
QString QAccessibleDisplay::text(Text t, int child) const
{
QString str;
switch (t) {
case Name:
str = widget()->accessibleName();
if (str.isEmpty()) {
if (qobject_cast<QLabel*>(object())) {
str = qobject_cast<QLabel*>(object())->text();
#ifndef QT_NO_LCDNUMBER
} else if (qobject_cast<QLCDNumber*>(object())) {
QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
if (l->digitCount())
str = QString::number(l->value());
else
str = QString::number(l->intValue());
#endif
}
}
break;
case Value:
#ifndef QT_NO_PROGRESSBAR
if (qobject_cast<QProgressBar*>(object()))
str = QString::number(qobject_cast<QProgressBar*>(object())->value());
#endif
break;
default:
break;
}
if (str.isEmpty())
str = QAccessibleWidgetEx::text(t, child);;
return qt_accStripAmp(str);
}
示例2: text
QString QAccessibleDisplay::text(QAccessible::Text t) const
{
QString str;
switch (t) {
case QAccessible::Name:
str = widget()->accessibleName();
if (str.isEmpty()) {
if (qobject_cast<QLabel*>(object())) {
QLabel *label = qobject_cast<QLabel*>(object());
str = label->text();
#ifndef QT_NO_TEXTHTMLPARSER
if (label->textFormat() == Qt::RichText
|| (label->textFormat() == Qt::AutoText && Qt::mightBeRichText(str))) {
QTextDocument doc;
doc.setHtml(str);
str = doc.toPlainText();
}
#endif
if (label->buddy())
str = qt_accStripAmp(str);
#ifndef QT_NO_LCDNUMBER
} else if (qobject_cast<QLCDNumber*>(object())) {
QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
if (l->digitCount())
str = QString::number(l->value());
else
str = QString::number(l->intValue());
#endif
} else if (qobject_cast<QStatusBar*>(object())) {
return qobject_cast<QStatusBar*>(object())->currentMessage();
}
}
break;
case QAccessible::Value:
#ifndef QT_NO_PROGRESSBAR
if (qobject_cast<QProgressBar*>(object()))
str = QString::number(qobject_cast<QProgressBar*>(object())->value());
#endif
break;
default:
break;
}
if (str.isEmpty())
str = QAccessibleWidget::text(t);
return str;
}