Archive for October, 2007

The KHTML Future FAQ

Tuesday, October 23rd, 2007

As people on #khtml and elsewhere keep asking the same type of questions I will summarize some of the answers that I can give and which - to my best knowledge - should match the view of other maintainers. This is to inform contributors, bug reporters, other helpers and users about the current state, avoid unfounded irritation and provide the basis for further discussion.

Feedback is greatly appreciated and will be incorporated into an updated version to be placed on konqueror.kde.org or so.

(more…)

New hardware => new KNewsTicker!

Sunday, October 21st, 2007

My kind employer decided to grant me a brand new ThinkPad R61 - yay! Not only does this new machine allow my to play my beloved World of Warcraft in all its graphical glory, it also made me spend most of this weekend on hacking KDE4.

I decided to use the latest Kubuntu release 7.10 and not only did it come with a nice default setup, getting KDE trunk to build on this thing was quite simple as well - I basically followed the KDE4 build instructions I found online.

My plan was to give some love to my pet project KNewsTicker by porting it to KDE4. After a while of research it turned out though that so many things changed which affect KNewsTicker:

  • Qt3 is gone, Qt4 is the new standard. In particular, the way of creating menus (like KNewsTickers context menu) changed a lot.
  • Kicker is gone, Plasma is the new standard.
  • kdepimlibs features the ’syndication’ library, a further development of librss (which I factored out of KNT a few years ago for akregator to use). So I don’t need my own RSS parsing code at all anymore.

Given that KNewsTicker is quite small, I ended up throwing almost everything away and starting from scratch. By now, I have a KNewsTicker plasmoid which can scroll the headlines of the KDE news along. It’s still pretty rough, for example you cannot extend the list of news feeds at the moment (except by editing the configuration file by hand). In fact, the only things you can configure via the settings dialog are the font size, font color and update interval. It’s a start though!

The obligatory screenshot showing the new KNT in all its glory:

This shows my current KDE4 desktop in a Xephyr window.

Checking a QTableWidget object against some test data

Thursday, October 18th, 2007

A common problem when developing test scripts for Qt application is that some table should be checked for whether it contains the correct data. In particular, the expected data is stored in an external file and the test script should load the file and then compare its contents against the table cells. Here’s one way to do it, in Python:


def checkTableAgainstTestdata( tableName, testDataFileName ):
    table = findObject( tableName )
    dataset = testData.dataset( testDataFileName )  

    columns = table.columnCount
    rows = table.rowCount  

    testDataColumns = len( testData.fieldNames( dataset[ 0 ] ) )
    if columns != testDataColumns:
        test.fail( "Tables does not match test data",
                   "Table " + tableName + " has different number"
                   " of columns than test data in " + testDataFileName )  

    row = 0
    for idx in dataset:
        for col in range( 0, columns ):
            if col >= testDataColumns:
                break
            expectedText = testData.field( idx, col )
            tableText = table.item( row, col ).text()
            test.compare( expectedText, tableText )
        row += 1  

        if row >= rows:
            test.fail( "Tables does not match test data",
                       "Table " + tableName + " has different number"
                       " of rows than test data in " + testDataFileName )
            return  

    if row >= rows:
        test.fail( "Tables does not match test data",
                   "Table " + tableName + " has different number of"
                   " rows than test data in " + testDataFileName )
        return

The function simple takes the name of the table object to check as well as the name of the test data file. The test data file is expected to live in either the test cases “testdata” directory or in the shared testdata directory. A sample invocation might look like:


def main():
    tableName = "{type='QTableWidget' visible='1'}"
    testDataFileName = "expectedvalues.tsv"
    checkTableAgainstTestdata( tableName, testDataFileName )

Note that this doesn’t work for Qt3 QTable objects or with plain QTableView objects. For those, the API for aquiring the contents of a specific table cell is different. However, the algorithm of the function is the same.


				

Interview: Squish’s Advantages over QTP

Wednesday, October 10th, 2007

Hi!

You can read an interview with one of our Squish for Java users on our web site.

It talkes about their test automation process and why they chose Squish over Mercury’s (now it’s actually HP) Quick Test Pro.

Returned from Redwood City

Sunday, October 7th, 2007

We returned from the first of two Trolltech Developer Day’s events on Friday evening. There surely are many theories on how to best fight the jet lag but I dediced to simply do what my body asked for and gave in on any of the sudden urges to sleep that attacked me over the weekend.

London Heathrow airport was less crowded than during the summer but waiting lines were still long enough to be annoying and shortage of ground crew caused delays on take-off. I find it very much irresponsible of both airlines and airports to schedule more flights via a hub that it can obviously handle. Will try even harder next time to avoid this route.

The Silicon Valley stay itself was very much worth it. Met with several existing customers and prospects on their premises and at the conference. The exhibition area was well positioned with respect to the talks, meals and fresh air enabling an effective still relaxed contact with attendees. Our Qt programming quiz turned out to be more challenging than intended. The winner of the Nintendo DS Lite game console was drawn out of only five partipants that got it right!