コード例 #1
0
ファイル: mimas_GLWidget.cpp プロジェクト: lubyk/mimas
/** void QWidget::setStyleSheet(const char *text)
 * bind/QWidget.h:52
 */
static int GLWidget_setStyleSheet(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    const char *text = dub_checkstring(L, 2);
    self->setStyleSheet(text);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setStyleSheet: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setStyleSheet: Unknown exception");
  }
  return dub_error(L);
}
コード例 #2
0
ファイル: mimas_GLWidget.cpp プロジェクト: lubyk/mimas
/** void QWidget::setStyle(const char *text)
 * bind/QWidget.h:51
 */
static int GLWidget_setStyle(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    const char *text = dub_checkstring(L, 2);
    self->setStyleSheet(QString("%1 { %2 }").arg(self->metaObject()->className()).arg(text));
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setStyle: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setStyle: Unknown exception");
  }
  return dub_error(L);
}