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


C++ HBoxLayout类代码示例

本文整理汇总了C++中HBoxLayout的典型用法代码示例。如果您正苦于以下问题:C++ HBoxLayout类的具体用法?C++ HBoxLayout怎么用?C++ HBoxLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了HBoxLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HBoxLayout_addWidget

/** void HBoxLayout::addWidget(QWidget *widget, int stretch=0, int alignment=0)
 * include/mimas/HBoxLayout.h:54
 */
static int HBoxLayout_addWidget(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      QWidget *widget = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      int stretch = dub_checkint(L, 3);
      int alignment = dub_checkint(L, 4);
      self->addWidget(widget, stretch, alignment);
      return 0;
    } else if (top__ >= 3) {
      QWidget *widget = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      int stretch = dub_checkint(L, 3);
      self->addWidget(widget, stretch);
      return 0;
    } else {
      QWidget *widget = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      self->addWidget(widget);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "addWidget: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "addWidget: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:30,代码来源:mimas_HBoxLayout.cpp

示例2: Application

ILXStatusBar::ILXStatusBar(int argc, char* argv[])
        : Application(&argc, &argv, (AppOptions) (OptDaleAuto))
{
    setBackgroundImage(ILIXI_DATADIR"car/statusbar/statusbar_bg.png");

    setMargins(0, 0, 0, 0);
    HBoxLayout* mainLayout = new HBoxLayout();
    mainLayout->setVerticalAlignment(Alignment::Middle);
    mainLayout->setSpacing(0);
    setLayout(mainLayout);

    _home = new StatusbarButton();
    _home->addImage(new Image(ILIXI_DATADIR"car/statusbar/home.png", Size(48, 48)));
    _home->addImage(new Image(ILIXI_DATADIR"car/statusbar/homeG.png", Size(48, 48)));
    _home->setActive(1);
    _home->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedHome));
    addWidget(_home);

    _switch = new StatusbarButton();
    _switch->addImage(new Image(ILIXI_DATADIR"car/statusbar/switch.png", Size(48, 48)));
    _switch->addImage(new Image(ILIXI_DATADIR"car/statusbar/switchG.png", Size(48, 48)));
    _switch->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedSwitcher));
    addWidget(_switch);

    _dash = new StatusbarButton();
    _dash->addImage(new Image(ILIXI_DATADIR"car/statusbar/dash.png", Size(48, 48)));
    _dash->addImage(new Image(ILIXI_DATADIR"car/statusbar/dashG.png", Size(48, 48)));
    _dash->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedDash));
    addWidget(_dash);

    _sound = new StatusbarButton();
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol0.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol0G.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol1.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol1G.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol2.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol2G.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol3.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol3G.png", Size(48, 48)));
    _sound->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedSound));
    _sound->setButtonState(6);
    addWidget(_sound);

    _back = new StatusbarButton();
    _back->setVisible(false);
    _back->addImage(new Image(ILIXI_DATADIR"car/statusbar/back0.png", Size(48, 48)));
    _back->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedBack));
    addWidget(_back);

    addWidget(new Clock());

    _rca = new RemoteContentArea();
    addWidget(_rca);

    sigVisible.connect(sigc::mem_fun(this, &ILXStatusBar::onShow));
    sigHidden.connect(sigc::mem_fun(this, &ILXStatusBar::onHide));

    _statComp = new StatusbarComponent(this);

}
开发者ID:91yuan,项目名称:ilixi,代码行数:60,代码来源:StatusBar.cpp

示例3: HBoxLayout_property

/** QVariant QObject::property(const char *name)
 * bind/QObject.h:9
 */
static int HBoxLayout_property(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    const char *name = dub_checkstring(L, 2);
    return pushVariantInLua(L, self->property(name));
  } catch (std::exception &e) {
    lua_pushfstring(L, "property: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "property: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:15,代码来源:mimas_HBoxLayout.cpp

示例4: HBoxLayout_activate

/** void QLayout::activate()
 * bind/QLayout.h:12
 */
static int HBoxLayout_activate(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    self->activate();
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "activate: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "activate: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:15,代码来源:mimas_HBoxLayout.cpp

示例5: HBoxLayout_objectName

/** QString QObject::objectName() const
 * bind/QObject.h:7
 */
static int HBoxLayout_objectName(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QByteArray str_(self->objectName().toUtf8());
    lua_pushlstring(L, str_.constData(), str_.size());
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "objectName: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "objectName: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:16,代码来源:mimas_HBoxLayout.cpp

示例6: HBoxLayout_setParent

/** void QObject::setParent(QObject *parent)
 * bind/QObject.h:11
 */
static int HBoxLayout_setParent(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QObject *parent = *((QObject **)dub_checksdata(L, 2, "mimas.QObject"));
    self->setParent(parent);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setParent: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setParent: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:16,代码来源:mimas_HBoxLayout.cpp

示例7: HBoxLayout_setSpacing

/** void QBoxLayout::setSpacing(int space)
 * bind/QBoxLayout.h:19
 */
static int HBoxLayout_setSpacing(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int space = dub_checkint(L, 2);
    self->setSpacing(space);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setSpacing: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setSpacing: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:16,代码来源:mimas_HBoxLayout.cpp

示例8: HBoxLayout_minimumSize

/** LuaStackSize QLayout::minimumSize(lua_State *L)
 * bind/QLayout.h:14
 */
static int HBoxLayout_minimumSize(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QSize s(self->minimumSize());
    lua_pushnumber(L, s.width());
    lua_pushnumber(L, s.height());
    return 2;
  } catch (std::exception &e) {
    lua_pushfstring(L, "minimumSize: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "minimumSize: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_HBoxLayout.cpp

示例9: HBoxLayout_setAlignment

/** bool QLayout::setAlignment(QWidget *w, int alignment)
 * bind/QLayout.h:13
 */
static int HBoxLayout_setAlignment(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QWidget *w = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
    int alignment = dub_checkint(L, 3);
    lua_pushboolean(L, self->setAlignment(w, (Qt::Alignment)alignment));
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setAlignment: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setAlignment: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_HBoxLayout.cpp

示例10: HBoxLayout_setProperty

/** bool QObject::setProperty(const char *name, const QVariant &value)
 * bind/QObject.h:10
 */
static int HBoxLayout_setProperty(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    const char *name = dub_checkstring(L, 2);
    QVariant value(variantFromLua(L, 3));
    lua_pushboolean(L, self->setProperty(name, value));
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setProperty: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setProperty: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_HBoxLayout.cpp

示例11: HBoxLayout

LayoutBase*
WidgetsDemo::createLabelGroup()
{
    HBoxLayout* group = new HBoxLayout();

    Label* label1 = new Label("This is a Label");
    group->addWidget(label1);

    Label* label2 = new Label("This is a disabled Label");
    label2->setDisabled();
    group->addWidget(label2);

    return group;
}
开发者ID:91yuan,项目名称:ilixi,代码行数:14,代码来源:WidgetsDemo.cpp

示例12: HBoxLayout_parent

/** QObject* QObject::parent()
 * bind/QObject.h:12
 */
static int HBoxLayout_parent(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QObject *retval__ = self->parent();
    if (!retval__) return 0;
    dub_pushudata(L, retval__, "mimas.QObject", false);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "parent: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "parent: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_HBoxLayout.cpp

示例13: HBoxLayout_setObjectName

/** void QObject::setObjectName(const QString &name)
 * bind/QObject.h:8
 */
static int HBoxLayout_setObjectName(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    size_t name_sz_;
    const char *name = dub_checklstring(L, 2, &name_sz_);
    
    self->setObjectName(QString::fromUtf8(name, name_sz_));
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setObjectName: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setObjectName: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:18,代码来源:mimas_HBoxLayout.cpp

示例14: HBoxLayout_setContentsMargins

/** void QLayout::setContentsMargins(int left, int top, int right, int bottom)
 * bind/QLayout.h:15
 */
static int HBoxLayout_setContentsMargins(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int left = dub_checkint(L, 2);
    int top = dub_checkint(L, 3);
    int right = dub_checkint(L, 4);
    int bottom = dub_checkint(L, 5);
    self->setContentsMargins(left, top, right, bottom);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setContentsMargins: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setContentsMargins: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:19,代码来源:mimas_HBoxLayout.cpp

示例15: HBoxLayout_addStretch

/** void QBoxLayout::addStretch(int stretch=0)
 * bind/QBoxLayout.h:11
 */
static int HBoxLayout_addStretch(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      int stretch = dub_checkint(L, 2);
      self->addStretch(stretch);
      return 0;
    } else {
      self->addStretch();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "addStretch: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "addStretch: Unknown exception");
  }
  return dub_error(L);
}
开发者ID:lubyk,项目名称:mimas,代码行数:22,代码来源:mimas_HBoxLayout.cpp


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