summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/createwidget.h2
-rw-r--r--src/gui/widgets/widget.cpp6
-rw-r--r--src/gui/widgets/widget.h2
3 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/widgets/createwidget.h b/src/gui/widgets/createwidget.h
index 3a2102676..61f85e4c0 100644
--- a/src/gui/widgets/createwidget.h
+++ b/src/gui/widgets/createwidget.h
@@ -26,6 +26,6 @@
var->postInit()
#define CREATEWIDGET2(type, ...) \
- static_cast<type>(Widget::callPostInit(new type(__VA_ARGS__)))
+ static_cast<type*>(Widget::callPostInit(new type(__VA_ARGS__)))
#endif // GUI_WIDGETS_CREATEWIDGET_H
diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp
index 3be80c772..7fdab305e 100644
--- a/src/gui/widgets/widget.cpp
+++ b/src/gui/widgets/widget.cpp
@@ -513,3 +513,9 @@ void Widget::windowResized()
{
mRedraw = true;
}
+
+Widget *Widget::callPostInit(Widget *const widget)
+{
+ widget->postInit();
+ return widget;
+}
diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h
index 5868e20aa..416782dc2 100644
--- a/src/gui/widgets/widget.h
+++ b/src/gui/widgets/widget.h
@@ -1027,6 +1027,8 @@ class Widget notfinal : public Widget2
void windowResized();
+ static Widget *callPostInit(Widget *const widget);
+
virtual void postInit()
{ }