本文整理汇总了C++中KexiFormDataItemInterface::columnInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ KexiFormDataItemInterface::columnInfo方法的具体用法?C++ KexiFormDataItemInterface::columnInfo怎么用?C++ KexiFormDataItemInterface::columnInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KexiFormDataItemInterface
的用法示例。
在下文中一共展示了KexiFormDataItemInterface::columnInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: changeText
void
KexiDBAutoField::setFieldCaptionInternal(const QString& text)
{
d->fieldCaptionInternal = text;
//change text only if autocaption is set and no columnInfo is available
KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)subwidget());
if ((!iface || !iface->columnInfo()) && d->autoCaption) {
changeText(d->fieldCaptionInternal);
}
}
示例2: paint
void KexiDBTextWidgetInterface::paint(
QWidget *w, QPainter* p, bool textIsEmpty, Qt::Alignment alignment, bool hasFocus)
{
KexiFormDataItemInterface *dataItemIface = dynamic_cast<KexiFormDataItemInterface*>(w);
KexiDB::QueryColumnInfo *columnInfo = dataItemIface ? dataItemIface->columnInfo() : 0;
if (columnInfo && columnInfo->field && dataItemIface->cursorAtNewRow() && textIsEmpty) {
int addMargin = 0;
if (dynamic_cast<QFrame*>(w))
addMargin += dynamic_cast<QFrame*>(w)->lineWidth() + dynamic_cast<QFrame*>(w)->midLineWidth();
if (columnInfo->field->isAutoIncrement() && m_autonumberDisplayParameters) {
if (w->hasFocus()) {
p->setPen(
KexiUtils::blendedColors(
m_autonumberDisplayParameters->textColor, w->palette().color(QPalette::Base), 1, 3));
}
KexiUtils::WidgetMargins margins(w);
KexiDisplayUtils::paintAutonumberSign(*m_autonumberDisplayParameters, p,
2 + addMargin + margins.left,
addMargin + margins.top,
w->width() - margins.left - margins.right - 2 - 2,
w->height() - margins.top - margins.bottom - 2, alignment, hasFocus);
}
}
}