diff --git a/gb.qt4/src/CProgress.cpp b/gb.qt4/src/CProgress.cpp index 0168ca8ed..796bcd998 100644 --- a/gb.qt4/src/CProgress.cpp +++ b/gb.qt4/src/CProgress.cpp @@ -22,18 +22,33 @@ #define __CPROGRESS_CPP +#include +#include #include #include "gambas.h" #include "CProgress.h" +static MyWindowsStyle _style; + +void MyWindowsStyle::timerEvent(QTimerEvent *e) +{ + e->ignore(); +} + +void CPROGRESS_style_hack(void *_object) +{ + THIS->widget.widget->setStyle(&_style); +} BEGIN_METHOD(CPROGRESS_new, GB_OBJECT parent) QProgressBar *wid = new QProgressBar(QCONTAINER(VARG(parent))); - wid->setMaximum(10000); + //QObject::connect(wid, SIGNAL(destroyed()), &CProgress::manager, SLOT(destroy())); + + wid->setMaximum(10000); wid->setTextVisible(true); CWIDGET_new(wid, (void *)_object); diff --git a/gb.qt4/src/CProgress.h b/gb.qt4/src/CProgress.h index 8cec6edc6..bcc320d1c 100644 --- a/gb.qt4/src/CProgress.h +++ b/gb.qt4/src/CProgress.h @@ -23,6 +23,8 @@ #ifndef __CPROGRESS_H #define __CPROGRESS_H +#include + #include "gambas.h" #include "CWidget.h" @@ -42,4 +44,18 @@ typedef } CPROGRESS; +class MyWindowsStyle : public QWindowsStyle +{ + Q_OBJECT + +public: + //MyCleanlooksStyle(); + //~MyCleanlooksStyle(); + +protected: + void timerEvent(QTimerEvent *event); +}; + +void CPROGRESS_style_hack(void *_object); + #endif diff --git a/gb.qt4/src/CWidget.cpp b/gb.qt4/src/CWidget.cpp index 1018e7d1f..d17b1fa8e 100644 --- a/gb.qt4/src/CWidget.cpp +++ b/gb.qt4/src/CWidget.cpp @@ -39,6 +39,7 @@ #include "CClipboard.h" #include "CMenu.h" #include "CScrollView.h" +#include "CProgress.h" #include #include @@ -57,6 +58,7 @@ #include #include #include +#include GB_CLASS CLASS_Control; GB_CLASS CLASS_Container; @@ -312,6 +314,9 @@ void CWIDGET_destroy(CWIDGET *object) CWIDGET_set_flag(object, WF_DELETED); CWIDGET_set_visible(object, false); + if (qobject_cast(object->widget)) + CPROGRESS_style_hack(object); + object->widget->deleteLater(); }