#include<windows.h>
HDC hdc;hdc = widget->getDC();//widget为QWidget类型for ( int i=0;i<100;i++ ){ SetPixel( hdc,100+i,100+i,0xFF666666 );}