[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#384325: libqt3-mt: Floating point exception in QPaintDevice::~QPaintDevice: SOLVED FOR ME.



Hi there. I found a way to solve the "floating point exception" in
QPaintDevice::~QPaintDevice. The problem seems to come during resolution
calculation in the function void create_dpis()
(src/kernel/qpaintdevice_x11.cpp:514)

During the loop:

    for ( i = 0; i < screens; i++ ) {
	dpisX[ i ] = (DisplayWidth(dpy,i) * 254 + DisplayWidthMM(dpy,i)*5)

		     / (DisplayWidthMM(dpy,i)*10);
	dpisY[ i ] = (DisplayHeight(dpy,i) * 254 + DisplayHeightMM(dpy,i)*5)
		     / (DisplayHeightMM(dpy,i)*10);
    }

the DisplayWidthMM and DisplayHeightMM macros were returning a 0,
causing the floating point exception.

This values are calculated from the X11 server accoring to the DPI of
the xserver and the Dimension of the monitor. 

In my case, the monitor dimension was not specified in
my /etc/X11/xorg.conf and I had to insert the following line to
xorg.conf (in section Monitor)

	DisplaySize	433 347

Assuming a resolution of 75dpi, 1280x1024 pixels,  I obtained the first
value by calculating 

	xsize = 25.4 * xpixels / dpi

and the second with a 

	ysize = 25.4 * ypixels / dpi

After that, QT seems to be happy again.

The problem I have seen should be detected by a:

	xdpyinfo | grep -A1 dimen

that should print out something like:
 
  dimensions:    1280x1024 pixels (433x347 millimeters)
  resolution:    75x75 dots per inch

I guess that all people having problem with the FLoating point exception
will have some strange values here.

Have fun.









Reply to: