本文整理汇总了C++中JsModuleUiV8QtBasic::_to_qwidget方法的典型用法代码示例。如果您正苦于以下问题:C++ JsModuleUiV8QtBasic::_to_qwidget方法的具体用法?C++ JsModuleUiV8QtBasic::_to_qwidget怎么用?C++ JsModuleUiV8QtBasic::_to_qwidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsModuleUiV8QtBasic
的用法示例。
在下文中一共展示了JsModuleUiV8QtBasic::_to_qwidget方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_form_layout_insert_row (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QFormLayout *form = self->v8_to_qobject<QFormLayout> (Args.This ());
if (form) {
QLayout *layout = 0;
QWidget *widget = 0;
int row = v8_to_int32 (Args[0]);
if (Args.Length () == 2) {
layout = self->v8_to_qobject<QLayout> (Args[1]);
widget = self->_to_qwidget (Args[1]);
if (layout) { form->addRow (layout); }
else if (widget) { form->addRow (widget); }
}
else if (Args.Length () == 3) {
String text = v8_to_string (Args[1]);
widget = self->_to_qwidget (Args[1]);
QWidget *field = self->_to_qwidget (Args[2]);
layout = self->v8_to_qobject<QLayout> (Args[2]);
if (widget) {
if (field) { form->insertRow (row, widget, field); }
else if (layout) { form->insertRow (row, widget, layout); }
}
else if (text) {
if (field) { form->insertRow (row, text.get_buffer (), field); }
else if (layout) {
form->insertRow (row, text.get_buffer (), layout);
}
}
}
}
}
return scope.Close (result);
}
示例2:
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_tree_item_widget (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QTreeWidget *tree = self->v8_to_qobject<QTreeWidget> (Args.This ());
if (tree) {
if (Args.Length () > 1) {
QTreeWidgetItem *item = self->_to_qtreewidgetitem (Args[0]);
int col = v8_to_uint32 (Args[1]);
if (item) {
if (Args.Length () > 2) {
tree->setItemWidget (item, col, self->_to_qwidget (Args[2]));
}
result = self->create_v8_qwidget (tree->itemWidget (item, col));
}
}
}
}
return scope.Close (result);
}
示例3:
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_create_message_box (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QWidget *parent = 0;
V8Object params = v8_to_object (Args[0]);
if (Args.Length () >= 2) {
parent = self->_to_qwidget (Args[1]);
}
if (!params.IsEmpty ()) {
QMessageBox *dialog = self->_create_message_box (params, parent);
result = self->create_v8_qwidget (dialog);
}
}
return scope.Close (result);
}
示例4: QBoxLayout
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_create_box_layout (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QWidget *parent (0);
int direction = 0;
if (Args.Length () > 0) {
direction = v8_to_int32 (Args[0]);
if ((direction < 0) || (direction > 3)) {
direction = 0;
}
}
if (Args.Length () > 1) {
parent = self->_to_qwidget (Args[1]);
}
QBoxLayout *layout = new QBoxLayout((QBoxLayout::Direction)direction, parent);
result = self->create_v8_qobject (layout);
}
return scope.Close (result);
}
示例5: QTreeWidget
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_create_tree_widget (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QWidget *parent = 0;
if (Args.Length ()) { parent = self->_to_qwidget (Args[0]); }
QTreeWidget *widget = new QTreeWidget (parent);
result = self->create_v8_qobject (widget);
}
return scope.Close (result);
}
示例6: QFormLayout
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_create_form_layout (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QWidget *parent = self->_to_qwidget (Args[0]);
QFormLayout *layout = new QFormLayout(parent);
result = self->create_v8_qobject (layout);
}
return scope.Close (result);
}
示例7:
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_grid_layout_add_widget (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QGridLayout *grid = self->v8_to_qobject<QGridLayout> (Args.This ());
QWidget *widget = self->_to_qwidget (Args[0]);
if (grid && widget) {
int row = v8_to_int32 (Args[1]);
int column = v8_to_int32 (Args[2]);
int rowSpan = -1;
int columnSpan = -1;
if (Args.Length () > 3) {
rowSpan = v8_to_int32 (Args[3]);
columnSpan = v8_to_int32 (Args[4]);
}
if ((row >= 0) && (column >= 0)) {
if ((rowSpan < 0) || (columnSpan < 0)) {
grid->addWidget (widget, row, column, 0);
}
else {
grid->addWidget (widget, row, column, rowSpan, columnSpan);
}
}
}
}
return scope.Close (result);
}