本文整理汇总了C++中KexiFormDataItemInterface类的典型用法代码示例。如果您正苦于以下问题:C++ KexiFormDataItemInterface类的具体用法?C++ KexiFormDataItemInterface怎么用?C++ KexiFormDataItemInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KexiFormDataItemInterface类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
KexiDBAutoField::setColumnInfoInternal(KexiDB::QueryColumnInfo* cinfo, KexiDB::QueryColumnInfo* visibleColumnInfo)
{
// change widget type depending on field type
if (d->widgetType_property == Auto) {
WidgetType newWidgetType = Auto;
KexiDB::Field::Type fieldType;
if (cinfo)
fieldType = visibleColumnInfo->field->type();
else if (dataSource().isEmpty())
fieldType = KexiDB::Field::InvalidType;
else
fieldType = KexiDB::Field::Text;
if (fieldType != KexiDB::Field::InvalidType) {
newWidgetType = KexiDBAutoField::widgetTypeForFieldType(fieldType);
}
if (d->widgetType != newWidgetType || newWidgetType == Auto) {
d->widgetType = newWidgetType;
createEditor();
}
}
// update label's text
changeText((cinfo && d->autoCaption) ? cinfo->captionOrAliasOrName() : d->caption);
KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)subwidget());
if (iface)
iface->setColumnInfo(visibleColumnInfo);
}
示例2: keyPressed
bool KexiDBAutoField::keyPressed(QKeyEvent *ke)
{
KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)subwidget());
if (iface && iface->keyPressed(ke))
return true;
return false;
}
示例3:
void
KexiDBAutoField::clear()
{
KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)subwidget());
if (iface)
iface->clear();
}
示例4: QVariant
QVariant
KexiDBAutoField::value()
{
KexiFormDataItemInterface *iface = dynamic_cast<KexiFormDataItemInterface*>((QWidget*)subwidget());
if (iface)
return iface->value();
return QVariant();
}
示例5: 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);
}
}
示例6: 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);
}
}
}