本文整理汇总了C++中ItemLineEdit::addExtraClause方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemLineEdit::addExtraClause方法的具体用法?C++ ItemLineEdit::addExtraClause怎么用?C++ ItemLineEdit::addExtraClause使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemLineEdit
的用法示例。
在下文中一共展示了ItemLineEdit::addExtraClause方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
QWidget *ToitemTableDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &/*style*/,
const QModelIndex &index) const
{
const ToitemTableModel *model = (ToitemTableModel*)(index.model());
QWidget *editor = 0;
switch (index.column())
{
case ITEM_NUMBER_COL:
{
ItemLineEdit *item = new ItemLineEdit(parent);
item->setType(ItemLineEdit::cActive);
item->addExtraClause(QString("(item_id IN ("
" SELECT itemsite_item_id"
" FROM itemsite"
" WHERE itemsite_warehous_id=%1))")
.arg(model->srcWhsId()));
editor = item;
break;
}
case TOITEM_QTY_ORDERED_COL:
{
QLineEdit *qty = new QLineEdit(parent);
qty->setValidator(omfgThis->qtyVal());
editor = qty;
break;
}
case TOITEM_FREIGHT_COL:
{
QLineEdit *price = new QLineEdit(parent);
price->setValidator(omfgThis->priceVal());
editor = price;
break;
}
case TOITEM_DUEDATE_COL:
{
DLineEdit *duedate = new DLineEdit(parent);
editor = duedate;
editor->setObjectName("toitem_duedate");
break;
}
#ifdef QE_PROJECT
case PRJ_NUMBER_COL:
{
ProjectLineEdit *prj = new ProjectLineEdit(parent);
prj->setType(ProjectLineEdit::PurchaseOrder);
editor = prj;
editor->setObjectName("prj_number");
break;
}
#endif
default:
{
editor = 0;
break;
}
}
if (editor)
{
#ifdef Q_WS_MAC
// compensate for many custom widgets making themselves smaller on OS X
QFont f = editor->font();
f.setPointSize(f.pointSize() + 2);
editor->setFont(f);
#endif
editor->installEventFilter(const_cast<ToitemTableDelegate*>(this));
}
return editor;
}