

Latest Blog Entries

2009-03-14 08:11:18 | Tradeoffs 
So i tried several things to speed up my grid drawing.
1. As suggested by ZRusing, instead of multiple calls to drawLine and drawPoint, I instead created a vector of each and used a single call to drawLines and drawPoints. This made no difference.
2. Draw lines only. This was super fast.
3. Draw points only. This was still slow.
4. Anholt on #intel-gfx suggested grid-aligning my points to screen pixels. I wasnt 100% sure what this meant, so i changed the drawing code to use integer maths instead of floating point to ensure all drawing of points would be on an actual pixel, but this made no difference.
5. Turned off antialiasing in QPainter. Instant 200x speedup!
So the options seem to be use antialiasing with the raster graphics system, or dont use antialiasing, and have a slightly different look, which I dont mind, and is what im doing at the moment.
2009-03-12 07:01:15 | Drawing Performance (or not) 

In my app, I draw a background grid. Its nothing fancy, just some lines and dots but it was quite slow, and would get slower the larger the area obviously. I'm by no means an expert in drawing graphics optimally, but I had a few hacks in there to speed it up, like caching the background and only redrawing the affected rect. But still it wasn't great, it felt sluggish. 'Feeling' sluggish isn't very scientific, so I ripped out he drawing code and put it in a test app which timed it, that app is here. On my system, which isn't a 6GHz oct-core with the latest nvidia sli gfx, its just a run-of-the-mill core2duo with intel x3100, it takes roughly 200ms to draw the grid. Running under Qt4.5 with the raster graphics system, it takes 1ms. Yes, 1. 200x faster using software rendering than using x11. Restarting X using the VESA driver also had great improvements. Even running KDE4 with the VESA driver 'felt' more responsive. So, is it just my system? I have no idea if 200ms is a respectable time for this code, so how about you run it and post the results?
2008-10-18 14:29:19 | Charts with child/master fields 
I guess most database reporting apps can do this, and now Kexi can be added to the list. We could already embed a chart in a report, and assign it a set of data, but what if you want the chart to change depending on the data in the main report? The way to do that is with master->child field links. You specify a field (or fields) in the report (the master) which will be used as an expression on a field (or fields) in the chart (the child). If you're used to msa, its the same as you get with sub forms/reports/charts. This lets you do something like this. The example is a bit boring, but its the first thing I could think of after getting the implementation working :)
2008-07-08 14:56:07 | Kexi to ODS 
After reading the headers for kspread which showed me where I was going wrong, I now have Kexi reports able to output to an ODS (Opendocument Spreadsheet) file by utilising the excellent KSpread libraries. Fields in a report are ordered based on horizontal position, and the text saved into a Cell based on the order. As a test I generated a 20000 row sheet, and openened it up in OO.o, see it here, and download it here.

You are viewing a mobilized version of this site...
View original page here