Skip to content

Commit

Permalink
1. support for QScrollArea
Browse files Browse the repository at this point in the history
2. rename and,or,xor to bitand,bitor,bitxor
  • Loading branch information
[email protected] committed Aug 10, 2013
1 parent ff2cde1 commit 9a1cd30
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flexview/src/lua_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ LQUtil lqutil()
def("toBase64", toBase64),
def("fromBase64", fromBase64),
def("fromString", fromString),
def("and", my_and),
def("or", my_or),
def("xor", my_xor),
def("bitand", my_and),
def("bitor", my_or),
def("bitxor", my_xor),

def("toUint32", toT<uint32_t>),
def("toUint16", toT<uint16_t>),
Expand Down
69 changes: 69 additions & 0 deletions flexview/src/qtwrapper/lua_qmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,75 @@ LQAbstractScrollArea lqabstractscrollarea()
;
}

static setter_map<QScrollArea> lqscrollarea_set_map;
QScrollArea* lqscrollarea_init(QScrollArea* widget, const object& obj)
{
lqwidget_init(widget,obj);
lq_general_init(widget, obj, lqscrollarea_set_map);
return widget;
}

template<>
void table_init_general<QScrollArea>(const luabind::argument & arg, const object& obj)
{
lqscrollarea_init(construct<QScrollArea>(arg), obj);
}

void QScrollArea_ensureVisible1(QScrollArea* widget, int x, int y)
{
widget->ensureVisible(x,y);
}
void QScrollArea_ensureVisible2(QScrollArea* widget, int x, int y, int xmargin)
{
widget->ensureVisible(x,y,xmargin);
}
void QScrollArea_ensureVisible3(QScrollArea* widget, int x, int y, int xmargin, int ymargin)
{
widget->ensureVisible(x,y,xmargin,ymargin);
}

void QScrollArea_ensureWidgetVisible1(QScrollArea* widget, QWidget * childWidget)
{
widget->ensureWidgetVisible(childWidget);
}
void QScrollArea_ensureWidgetVisible2(QScrollArea* widget, QWidget * childWidget, int xmargin)
{
widget->ensureWidgetVisible(childWidget,xmargin);
}
void QScrollArea_ensureWidgetVisible3(QScrollArea* widget, QWidget * childWidget, int xmargin, int ymargin)
{
widget->ensureWidgetVisible(childWidget,xmargin,ymargin);
}

ENUM_FILTER(QScrollArea,alignment,setAlignment)
LQScrollArea lqscrollarea()
{
return
myclass_<QScrollArea,QAbstractScrollArea>("QScrollArea", lqscrollarea_set_map)
.def(constructor<>())
.def(constructor<QWidget*>())
.def("__call", lqscrollarea_init)
.def("__init", table_init_general<QScrollArea>)

.def("ensureVisible", QScrollArea_ensureVisible1)
.def("ensureVisible", QScrollArea_ensureVisible2)
.def("ensureVisible", QScrollArea_ensureVisible3)
.def("ensureVisible", QScrollArea_ensureWidgetVisible1)
.def("ensureVisible", QScrollArea_ensureWidgetVisible2)
.def("ensureVisible", QScrollArea_ensureWidgetVisible3)

.def("ensureWidgetVisible", QScrollArea_ensureWidgetVisible1)
.def("ensureWidgetVisible", QScrollArea_ensureWidgetVisible2)
.def("ensureWidgetVisible", QScrollArea_ensureWidgetVisible3)
.def("takeWidget", &QScrollArea::takeWidget)

.property("alignment", QScrollArea_alignment, QScrollArea_setAlignment)
.property("widgetResizable", &QScrollArea::widgetResizable, &QScrollArea::setWidgetResizable)

.class_<QScrollArea,QAbstractScrollArea>::property("widget", &QScrollArea::widget, &QScrollArea::setWidget)
;
}

SIGNAL_PROPERYT(lqmdiarea, subWindowActivated, QMdiArea, "(QMdiSubWindow*)")
LQMdiArea lqmdiarea()
{
Expand Down
2 changes: 2 additions & 0 deletions flexview/src/qtwrapper/lua_qmainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ typedef class_<QMainWindow,QWidget> LQMainWindow;
typedef class_<QDockWidget,QWidget> LQDockWidget;
typedef class_<QStatusBar,QWidget> LQStatusBar;
typedef class_<QAbstractScrollArea,QFrame> LQAbstractScrollArea;
typedef class_<QScrollArea,QAbstractScrollArea> LQScrollArea;
typedef class_<QMdiArea,QAbstractScrollArea> LQMdiArea;
typedef class_<QMdiSubWindow,QWidget> LQMdiSubWindow;
typedef class_<QSystemTrayIcon,QObject> LQSystemTrayIcon;
Expand All @@ -17,6 +18,7 @@ LQMainWindow lqmainwindow();
LQDockWidget lqdockwidget();
LQStatusBar lqstatusbar();
LQAbstractScrollArea lqabstractscrollarea();
LQScrollArea lqscrollarea();
LQMdiArea lqmdiarea();
LQMdiSubWindow lqmdisubwindow();
LQSystemTrayIcon lqsystemtrayicon();
Expand Down
1 change: 1 addition & 0 deletions flexview/src/qtwrapper/regclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ void register_classes(lua_State* L, char const* name = 0)
lqsplitter(),

lqabstractscrollarea(),
lqscrollarea(),
lqmdisubwindow(),
lqmdiarea(),
lqsystemtrayicon(),
Expand Down

0 comments on commit 9a1cd30

Please sign in to comment.