Category Archives: Uncategorized

2012 in review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

600 people reached the top of Mt. Everest in 2012. This blog got about 10,000 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 17 years to get that many views.

Click here to see the complete report.

Advertisements

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!