B O G
piggz.co.uk
BL4 BR4

TL TR
TL3

Latest Blog Entries

TR3
BL3 BR3
TL3 2009-03-14 08:11:18 | Tradeoffs TR3
BL3 BR3
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.
TL3 2009-03-12 07:01:15 | Drawing Performance (or not) TR3
BL3 BR3
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?
TL3 2009-01-16 23:55:52 | Kexi Data Access TR3
BL3 BR3
While its been possible to generate great looking reports in Kexi for quite some time, even containing user supplied scripts to enhance the core functionality, one thing that wasn't possible was the ability to access data from the database from within a script.

Well, now that has changed :)

If your familiar with the likes of DAO/ADO on windows/ms access then this should be a breeze to you.
Imaging having a report that contains the data from a table, but then for each record, while the report is being rendered, executing arbitrary queries based on that data to populate other fields....this should now be possible in Kexi.

The following snippet is a small example of opening a query when the report is opened, and getting the first 10 records to populate fields on the report:

function test_kexi_object_report()
{
this.OnOpen = function()
{
debug.message("On open", "open");
test_kexi_object.detail.setBackgroundColor("#dddddd");

var conn = Kexi.getConnection();

var cur = conn.executeQueryString("select msre_desc from weight");
for(i=0;i<10;i++) {
test_kexi_object.objectByName("Field" + (i + 10)).setSource("=" + cur.value(0));
test_kexi_object.objectByName("Field" + (i + 10)).setBackgroundOpacity(0);
cur.moveNext();
}

}
}

Nice, even if I do say so myself ;)
TL3 2008-10-18 14:29:19 | Charts with child/master fields TR3
BL3 BR3
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 :)
TL3 2008-07-08 14:56:07 | Kexi to ODS TR3
BL3 BR3
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.
BL BR

RSS Feed
visited by 71246 people.
Valid HTML 4.01! [Valid RSS] site by pigg solution designs


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

Mobilized by Mowser Mowser
Mobilytics