Bug 194734

Summary: Ksysguard graphics are not filled by color under graphics lines with Qt 4.5.1
Product: [Applications] ksysguard Reporter: nucleo <nucleo>
Component: generalAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: johnflux, lotusom-dev, Markus.Elfring
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Ksysguard graphics
Qt 4.5.0 output

Description nucleo 2009-05-31 11:18:59 UTC
Version:            (using KDE 4.2.3)
Compiler:          gcc (GCC) 4.4.0 20090506 (Red Hat 4.4.0-4) 
OS:                Linux
Installed from:    Fedora RPMs

After installation of Qt 4.5.1 there are in Ksysguard graphics not filled by
color under graphics lines.
Comment 1 nucleo 2009-05-31 11:27:41 UTC
Created attachment 34142 [details]
Ksysguard graphics

graphics are not filled by color
Comment 2 John Tapsell 2009-06-11 18:58:08 UTC
Created attachment 34444 [details]
Qt 4.5.0 output
Comment 3 John Tapsell 2009-06-12 11:30:16 UTC
I've reported this to Qt as a Qt Bug 255995. ( http://www.qtsoftware.com/developer/task-tracker/index_html?id=255995&method=entry )
Comment 4 Markus Elfring 2009-07-24 11:56:39 UTC
(In reply to comment #3)

This issue tracker shows the message "Task id 255995 not found" for your link at the moment. Which topic would you like to reference in your bug report?
Comment 5 Sebastien Martel 2009-08-02 20:23:25 UTC
Until qt comes back as to why old code didn't work, changed the drawing code so it now works again.

http://websvn.kde.org/?view=rev&revision=1005871
Comment 6 John Tapsell 2009-08-02 22:15:47 UTC
You sent a simple test case to Qt for this right?  Don't suppose you
could attach that test case here as well?
Comment 7 Sebastien Martel 2009-08-02 23:15:12 UTC
(In reply to comment #6)
> You sent a simple test case to Qt for this right?  Don't suppose you
> could attach that test case here as well?

I did but somehow same as your link above the issue id doesn't show up, I'm not sure if they have to validate it before they add it... Here is the test case I sent them, put this code in the paintevent of a qwidget.


      QImage img = QImage(width(),height(),QImage::Format_ARGB32_Premultiplied);
	QPainter p(&img);

	QPen pen;
	p.setRenderHint(QPainter::Antialiasing, true);
	p.setCompositionMode(QPainter::CompositionMode_Source);

	int x0 = 5;
	int x1 = 15;
	int y0 = 100;
	int y1 = 110;
	int bottom = height();
	int mFillOpacity = 20;
	int iWidth = width();

	qDebug() << "width:" << width();

	while (x0 < iWidth) {
		QPainterPath path;
		y0 = rand() % bottom;
		y1 = rand() % bottom;
		path.moveTo(x1, y1);
		path.lineTo(x0, y0);

		QColor drawingColor = Qt::blue;

		drawingColor = drawingColor.lighter();
		pen.setColor(drawingColor);
		p.strokePath(path, pen);

		path.lineTo(x0, bottom);
		path.lineTo(x1, bottom);
		path.lineTo(x1, y1);
		drawingColor = Qt::red;
		drawingColor.setAlpha(mFillOpacity);
		p.fillPath(path, drawingColor);
		x0 += 5;
		x1 += 5;
	}

	QPainter pThis(this);
	pThis.setCompositionMode(QPainter::CompositionMode_SourceOver);
	pThis.drawImage(0,0,img,0,0,0,0);