kai
18th December 2008, 02:41
Hi,
I am writing a simple application with Qt. The application is to display about four thousand rectangles in different colors. The rectangles are implemented with QGraphicsRectItem. The window is implemented with QMainWindow. The window has several menus to allow users to display rectangles in selected colors.
It's pretty fast to bring up the window with the default colors, in only a few seconds. However, it takes more than 2 minutes to do the recoloring after selecting an action from the menu.
I double check the codes to make sure there is no hidden inefficient coding, and can't find any. I am new to Qt. So I am wondering whether there is any trap I should avoid in order to speed the recoloring.
The application is written using Qt 4.4.0, compiled with GCC 4.2.2 , running on a Linux machine with 3GHz Pentium and 2G RAM.
Thanks for any suggestion.
Kai
I am writing a simple application with Qt. The application is to display about four thousand rectangles in different colors. The rectangles are implemented with QGraphicsRectItem. The window is implemented with QMainWindow. The window has several menus to allow users to display rectangles in selected colors.
It's pretty fast to bring up the window with the default colors, in only a few seconds. However, it takes more than 2 minutes to do the recoloring after selecting an action from the menu.
I double check the codes to make sure there is no hidden inefficient coding, and can't find any. I am new to Qt. So I am wondering whether there is any trap I should avoid in order to speed the recoloring.
The application is written using Qt 4.4.0, compiled with GCC 4.2.2 , running on a Linux machine with 3GHz Pentium and 2G RAM.
Thanks for any suggestion.
Kai