[Qt-interest] qt4.4,4.5|win32 setWindowIcon
me
mutschae at gmail.com
Mon Nov 2 19:23:44 CET 2009
hello group,
we managed to get into a strange situation: our applications get to
the windows GUI-Resource-Handle limit of ~10k very fast. after some
debugging we found that the 'causer' of this behaviour was a XPM file
that has been set as main-window-icon:
char* iconpath="app.xpm";
application->setWindowIcon(QIcon(QString(iconpath)));
without this line (or the missing file) the apps use 30 handles instead of 1500.
so we started stepping through qt and put a breakpoint to
QApplication::windowIcon() and figured out that almost every control
that is created hits this breakpoint
eg: 'QFrame','QToolBar', 'QMenu'
QtGuid4.dll!QApplication::windowIcon() Line 1948 C++
QtGuid4.dll!QWidget::windowIcon() Line 5400 + 0xf bytes C++
QtGuid4.dll!QWidgetPrivate::setWindowIcon_sys(bool forceReset=false)
Line 854 + 0x28 bytes C++
QtGuid4.dll!QWidget::create(HWND__ * window=0x00000000, bool
initializeWindow=true, bool destroyOldWindow=true) Line 1284 C++
QtGuid4.dll!QWidgetPrivate::init(QWidget * parentWidget=0x00000000,
QFlags<enum Qt::WindowType> f={...}) Line 1137 C++
QtGuid4.dll!QWidget::QWidget(QWidgetPrivate & dd={...}, QWidget *
parent=0x023eff88, QFlags<enum Qt::WindowType> f={...}) Line 974 C++
QtGuid4.dll!QFrame::QFrame(QWidget * parent=0x023eff88, QFlags<enum
Qt::WindowType> f={...}) Line 211 + 0x7b bytes C++
and QFrame is a window for some reason:
if (isWindow() && !testAttribute(Qt::WA_SetWindowIcon))
d->setWindowIcon_sys();
the current workarround is not to set the application-icon in
production systems, but i am sure there is another solution.
has anybody tips how to 'detect' the creator of the GUI-Handles? (eg
memory breakpoints)
so far we came up displaying the handle-counts on the construction of
each widget:
std::cout << "\n" <<
<< GetGuiResources(GetCurrentProcess(),0)
<< " - " << GetGuiResources(GetCurrentProcess(),1)
<< std::flush;
can anybody confirm this?
did someone experience a similar behavior and did come up with a solution?
is there a global setting that is nessesary for the QFrame's that are created?
this problem first occured in qt 4.4.3 and is still in 4.5.1
thanks for you help!
More information about the Qt-interest-old
mailing list