当前位置: 首页>>代码示例>>C++>>正文


C++ JsModuleUiV8QtBasic::_to_qwidget方法代码示例

本文整理汇总了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);
}
开发者ID:rharder,项目名称:js,代码行数:50,代码来源:dmzJsModuleUiV8QtBasicLayout.cpp

示例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);
}
开发者ID:bstewart33,项目名称:js,代码行数:30,代码来源:dmzJsModuleUiV8QtBasicTreeWidget.cpp

示例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);
}
开发者ID:ben-sangster,项目名称:js,代码行数:26,代码来源:dmzJsModuleUiV8QtBasicMessageBox.cpp

示例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);
}
开发者ID:rharder,项目名称:js,代码行数:31,代码来源:dmzJsModuleUiV8QtBasicLayout.cpp

示例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);
}
开发者ID:bstewart33,项目名称:js,代码行数:17,代码来源:dmzJsModuleUiV8QtBasicTreeWidget.cpp

示例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);
}
开发者ID:rharder,项目名称:js,代码行数:17,代码来源:dmzJsModuleUiV8QtBasicLayout.cpp

示例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);
}
开发者ID:rharder,项目名称:js,代码行数:41,代码来源:dmzJsModuleUiV8QtBasicLayout.cpp


注:本文中的JsModuleUiV8QtBasic::_to_qwidget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。