[Qt-interest] QT program having issues over VNC
Cole, Derek
dcole at integrity-apps.com
Mon May 23 20:24:13 CEST 2011
I think this is narrowing in on that same thing - I am passing single-band data to my image filters, so they just work in grayscale essentially. I noticed that when I create my image chip from the QImage, and then do a bytesPerLine() call, I basically get 4x width on SSH, and only 2x width when I am running it from VNC. I had no idea this call would be dependent on something like that. My image filter algorithms work on the pure unsigned char ** data, so I thought extracting it with something like this was the best way:
int chipDataLength = chip.bytesPerLine();
int bpp = chipDataLength/width;
tempData = chip.bits();
for (int i = 0; i < imheight; i++)
{
for (int j = 0; j < imwidth; j++)
{
oneBandData[i*imwidth+j] = tempData[i*chipDataLength + j*bpp];
}
}
This gave me more recognizable results, because before I had "j*4" hardcoded instead of using the bpp variable. It still looked terrible though. I will see about forcing the raster argument or whatever.
________________________________________
From: qt-interest-bounces+dcole=integrity-apps.com at qt.nokia.com [qt-interest-bounces+dcole=integrity-apps.com at qt.nokia.com] on behalf of Arnold Krille [arnold at arnoldarts.de]
Sent: Monday, May 23, 2011 1:36 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] QT program having issues over VNC
On Monday 23 May 2011 18:07:31 Cole, Derek wrote:
> I am working on some software that I created in QT Creator. It is basically
> running some filters on images and displaying the filtered image. When I
> run this program sitting at the terminal, or over SSH, it works perfectly.
> However, when I run this over a VNC session, the filtered images come back
> looking like random noise.
> Any idea what could be causing this?
The graphics are using the systems X11 to do the rendering. VNC generally
doesn't seem to have all the needed extensions so it looks ugly as hell
(happens with KDE for example too).
You can (and should) force Qt to use the graphicsystem=raster, either by
commandline argument to your app or with some global configuration.
Or you use NX/X2Go instead of VNC:-)
Have fun,
Arnold
More information about the Qt-interest-old
mailing list