c++ - Qt paintEvent() unnormally triggered -


i'm qt beginner.

so have mainwindow qslider , qpixmap. redefined paintevent( qpaintevent* event ) ,

connect( slider, signal(valuechanged(int)), this, slot(centerchange(int)) ); 

with slot:

void mainwindow::centerchange(int value) {     center = value;     update(); } 

so wanted repainte pixmap if slider's value changed. notice everytime when make mouse-in or mouse-out slider, repaint triggered. why happenning?

thanks.

paint event may triggered @ time underlying qt drawing system. should not assume paint event can triggered you. need change logic in app.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -