May 1, 2012

akonshi akonshi
Lab Rat
6 posts

Impossible to use repaint() again

 

Hello everyone,

i am quite new in Qt Developement and already have a problem:
I have a MainWindow class #typical# which ownes a pointer on a another class – called Map.
When pressing a QAction the old Map is deleted and a new is constructed. After that an algorithm generates an island and similar stuff. I use an dynamic two-dimensional array for that… after generating the Map should be shown. First I used about 940 QWidgets for that with different colours etc. That worked as often as i wanted.
Now I wanted to start with painting. Therefore I call repaint()-method after Generate().
First time it works fine #and fast what was the main reason for changing#.
But when clicking again on QAction it doesn’t work.
Using comment out i found out that i can either call the repaint() or the Generate()-function. Generating is different from ctor..
Does anybody know what i can do?

MfG akonshi

1 reply

May 1, 2012

ZapB ZapB
Ant Farmer
1424 posts

To trigger your paint event just call update() on your custom widget.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

 
  ‹‹ How does WLAN debugging work ?      No matching signal for on_currentChanged with QItemSelectionModel ››

You must log in to post a reply. Not a member yet? Register here!