diff --git a/modules/gui/pymod/export_gosty.cc b/modules/gui/pymod/export_gosty.cc
index a29bbab70ca799372ecd3ce2ff7efac653ed6692..a4000a992cadc87ed1897c8e5610033657094a5e 100644
--- a/modules/gui/pymod/export_gosty.cc
+++ b/modules/gui/pymod/export_gosty.cc
@@ -82,7 +82,7 @@ DataViewerProxyPtr app_create_data_viewer2(GostyApp* app, const ost::img::Data&
 }
 
 void app_add_widget_to_app_a(GostyApp* app, const QString& ident,
-                               QObject* object)
+                               QWidget* object)
 {
   if(QWidget* widget = dynamic_cast<QWidget*>(object)){
     TransferOwnership(widget);
diff --git a/modules/gui/pymod/export_sip_handler.cc b/modules/gui/pymod/export_sip_handler.cc
index 28fe99a72d0f3f845901bb3b557695e894cc27a9..2d746fab72b5ffed2ba7a0f3b7303cbdb623840b 100644
--- a/modules/gui/pymod/export_sip_handler.cc
+++ b/modules/gui/pymod/export_sip_handler.cc
@@ -36,9 +36,9 @@ unsigned long sip_handle(QObject* w)
   return reinterpret_cast<unsigned long>(w);
 }
 
-QObject* bpqt_handle(unsigned long a)
+QWidget* bpqt_handle(unsigned long a)
 {
-  return reinterpret_cast<QObject*>(a);
+  return reinterpret_cast<QWidget*>(a);
 }
 
 }