Archive for February, 2010

Filtering relational tables in Qt Sql

Friday, February 19th, 2010

I have a database which I’m using in my program which has foreign keys with same column name as in the table which it’s related. So I tried to set a filter to the related tables using setFilter(“relationtable.fieldName = ‘value'”), but it’s not working. I found out that Qt makes aliases to the relation table. Qt’s reference manual says “The alias is is the relation’s table name and display column name joined by an underscore (e.g. tablename_columnname)”.

I tried that but I think there’s somekind of bug because the query still says it’s an unknown column. However, I looked through the Qt’s Sql source code and found a solution.

For the relation table name you should use name like relTblAl_2, where the number after the underscore is the foreign key column in the main table.

Example:

  1. relTableModel>setTable("MainTable");
  2. relTableModel>setRelation(2, QSqlRelation("RelationTable", "ID", "Name"));
  3. relTableModel>setFilter("relTblAl_2.Name = 'Example'");

In this example table named RelationTable is aliased as relTblAl_2. By using the alias you can filter the values in the relational table.

SpeedTest – Qt game

Saturday, February 6th, 2010

It’s just basic clicking game made in a couple of hours but it was  good way to find out how to do a cross-platform project with Qt.

It builds with no problems for Symbian and Windows platform and probably to others as well with some tweaks. Especially great was the Qt’s interface for symbian touch screen devices. Qt handles the touches as mouse clicks so it’s easy to do programs/games which uses the touch screen devices.

Only drawback for developing with Qt for Symbian is the lack of the smart installer atm(release date Q1/2010?). It means, that you have to include the Qt installer to the .sis file which increases the size of the program. In the future Qt is included to the mobile phones so we’ll just have to wait for that.

Project information:  SpeedTest

Testing applications with different Nokia phones

Wednesday, February 3rd, 2010

Nokia offers a great service for developers where you can test and install your applications with different Nokia mobile phones. All you need is an account for Nokia forums and you’re free to test different models.

List of available phone models

It’s a great tool to help you develop and test applications and verify the app’s functions without concretely owning all possible mobile phones. You can also use some debugging options in the service, like trace a Symbian panic information and text files in a real-time. You can also record the session with built-in screen capture.

Interface

The service is called Remote Device Access and it works with Java Runtime and browsers supported are Firefox v2+, Internet Explorer v7+, Opera v9.6+ and Safari v3+. It works with Google Chrome too.

Link: Remote Device Access