本文整理汇总了C++中JsModuleUiV8QtBasic::create_v8_qlistwidgetitem方法的典型用法代码示例。如果您正苦于以下问题:C++ JsModuleUiV8QtBasic::create_v8_qlistwidgetitem方法的具体用法?C++ JsModuleUiV8QtBasic::create_v8_qlistwidgetitem怎么用?C++ JsModuleUiV8QtBasic::create_v8_qlistwidgetitem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsModuleUiV8QtBasic
的用法示例。
在下文中一共展示了JsModuleUiV8QtBasic::create_v8_qlistwidgetitem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QListWidgetItem
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_list_widget_add_item (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QListWidget *lw = self->v8_to_qobject<QListWidget> (Args.This ());
if (lw) {
if (Args.Length ()) {
QString param = v8_to_qstring (Args[0]);
QListWidgetItem *item = new QListWidgetItem (param, lw);
if (Args.Length () >= 2) {
QVariant variant = self->_qvariant_wrap_v8 (Args[1]);
item->setData (Qt::UserRole, variant);
}
result = self->create_v8_qlistwidgetitem (item);
}
}
}
return scope.Close (result);
}
示例2:
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_list_widget_take_item (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QListWidget *lw = self->v8_to_qobject<QListWidget> (Args.This ());
if (lw) {
if (Args.Length ()) {
QListWidgetItem *item = self->_to_qlistwidgetitem (Args[0]);
if (item) {
item = lw->takeItem (lw->row (item));
if (item) {
result = self->create_v8_qlistwidgetitem (item);
}
}
}
}
}
return scope.Close (result);
}
示例3: str
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_list_widget_find_items (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QListWidget *table = self->v8_to_qobject<QListWidget> (Args.This ());
if (table) {
if (Args.Length ()) {
QString str (v8_to_qstring (Args[0]));
Qt::MatchFlags flag = Qt::MatchExactly;
if (Args.Length () > 1) {
flag = (Qt::MatchFlags)v8_to_uint32 (Args[1]);
}
QList<QListWidgetItem *> items = table->findItems (str, flag);
const int Length = items.count ();
V8Array array = v8::Array::New (Length);
for (int ix = 0; ix < Length; ++ix) {
V8Value value = self->create_v8_qlistwidgetitem (items.at (ix));
array->Set (v8::Integer::New (ix), value);
}
result = array;
}
}
}
return scope.Close (result);
}