LeHuuTien
LeHuuTien

Reputation: 29

Qt: Update an area of qwidget

I have a problem, need some helps. I have a Qwidget that have paint event, assume I have 3 areas on my qwidget are area 1, area 2 and area 3. I want to repaint only area 2 and area 3(not repaint area 1) when I call update or repaint of Qwidget. How can I do that.

Upvotes: 0

Views: 947

Answers (1)

vahancho
vahancho

Reputation: 21220

There is QWidget::update(int x, int y, int w, int h) function. According to Qt docs it:

This is an overloaded function. This version updates a rectangle (x, y, w, h) inside the widget.

You can use it to repaint only a particular region of your widget.

Upvotes: 1

Related Questions