[Qt] QPixmap::handle(): Pixmap is not an X11 class pixmap
zeljko
zeljko at holobit.net
Fri Apr 22 08:03:38 CEST 2011
On Thursday 21 of April 2011 17:39:01 Juha (gmail) wrote:
> zeljko kirjoitti keskiviikko, 13. huhtikuuta 2011 15:38:11:
> > On Wednesday 13 of April 2011 10:17:30 Juha (gmail) wrote:
> > > I am getting the output (in subject) from Lazarus compiled with QT
> > > bindings. Is it something to worry about?
> >
> > Yes. Something is wrong with Qt libs. Or you provided wrong QPixmap to Qt
> > or similar.
>
> I am still getting it all the time from Lazarus itself when I open a menu
> item or dialog.
Look at qt implemenation below. That comes from function which isn't called
from qtlcl, but from qt.It's just warning that passed data isn't valid X11
object. I cannot get such warning.You said that it happens when you open an
menu or dialog, so it's easy to see if it's qtlcl or qt problem.There's only
one function inside qtlcl which draws image (qtobjects ->
TQtDeviceContext.drawImage). Put there an writeln and see if warning comes
after that function is called.
/*!
Returns the pixmap's handle to the device context.
Note that, since QPixmap make use of \l {Implicit Data
Sharing}{implicit data sharing}, the detach() function must be
called explicitly to ensure that only \e this pixmap's data is
modified if the pixmap data is shared.
\warning This function is X11 specific; using it is non-portable.
\sa detach()
*/
Qt::HANDLE QPixmap::handle() const
{
#if defined(Q_WS_X11)
const QPixmapData *pd = pixmapData();
if (pd) {
if (pd->classId() == QPixmapData::X11Class)
return static_cast<const QX11PixmapData*>(pd)->handle();
else
qWarning("QPixmap::handle(): Pixmap is not an X11 class pixmap");
}
#endif
return 0;
}
More information about the Qt
mailing list