Qt Jambi

Hi!
Maybe you've already heard about Qt ( Trolltech ) company. It is best known in the Linux community as the basis for the KDE desktop environment. They are developing a cross platform framework for C++ and Java (Qt Jambi). Today I tested their framework and compared it to Swing/AWT (Sun's framework).
The naming conventions are basically identical to Java, the most difference is that in Qt Jambi everything begins with Q (QTable, QPushButton), and not with J like in Swing (JTable, JButton). :)
The components are being created on the same way in booth frameworks.

Qt Jambi:
QTableWidget table = new QTableWidget(1000, 5);
QTableWidgetItem item = null;

Swing / AWT:
JTable table = new JTable(1000, 5);
Object data = null;

The concept for filling out tables is the same for booth TableModel and AbstractTableModel. Let's fill out these tables:


Qt Jambi:
for(int i = 0; i < 1000; i++) {
for(int j = 0; j < 5; j++) {
item = new QTableWidgetItem("Test value");
table.setItem(i, j, item);
}
}


Swing / AWT:

for(int i = 0; i < 1000; i++) {
for(int j = 0; j < 5; j++) {
data = "Test value";
table.setValueAt(data, i, j);
}
}


Qt table uses less memory with ~4MB, which is probably caused by the number of preloaded classes. I hope that Qt's Slot approach for generating events also takes less memory then the Swing listeners. That was for today. I'll come back with new test result as soon as I can.
Bye!

3 comments:

M M Arif said...

Yup, heard about Qt... while using KDE, you have to use word many times(if not mistaken). Ayn way nice comparison between Swing and Qt. Keep up the good work.
Have a nice time.
Arif

akoskm said...

Thank you! I'm trying to be up-to-date with Qt Jambi development. In the last version - due to relicensing - Jambi is being developed by the "community". I hope they'll be active, Qt is a widely used cross platform framework, including embedded devices, mobile phones. Java community need framework, like this!

M M Arif said...

Appreciate all the work you are searching and posting. Thanks buddy.