Ejemplo n.º 1
0
/** void QWidget::move(int x, int y)
 * bind/QWidget.h:10
 */
static int MenuBar_move(lua_State *L) {
  try {
    MenuBar *self = *((MenuBar **)dub_checksdata(L, 1, "mimas.MenuBar"));
    int x = dub_checkint(L, 2);
    int y = dub_checkint(L, 3);
    self->move(x, y);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "move: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "move: Unknown exception");
  }
  return dub_error(L);
}
Ejemplo n.º 2
0
/** void QWidget::globalMove(float x, float y)
 * bind/QWidget.h:79
 */
static int MenuBar_globalMove(lua_State *L) {
  try {
    MenuBar *self = *((MenuBar **)dub_checksdata(L, 1, "mimas.MenuBar"));
    float x = dub_checknumber(L, 2);
    float y = dub_checknumber(L, 3);
    self->move(
      self->mapToParent(
        self->mapFromGlobal(QPoint(x, y))
      )
    );
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "globalMove: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "globalMove: Unknown exception");
  }
  return dub_error(L);
}