Draw Circle with Dash Dot in my Qt Project -


to draw circle dash dot should include , code should use ? try codes in project not work:

qpainter painter(this);     painter.setbackgroundcolor(qt::cyan);     painter.setbrush(qt::yellow);     painter.drawellipse(0,0,500,500); 

i see normal project work not circle or area. please , write code ? in main.cpp or myproject.cpp ? lot.

you should write code example in paint event of qgraphicsitem or in paintevent of qwidget. can use qt::dashdotline pen:

void myitem::paint(qpainter *painter, const qstyleoptiongraphicsitem *option, qwidget *widget) {     painter->setrenderhint(qpainter::antialiasing,true);     painter->setwindow( -500,-500,1000,1000);     painter->setviewport( -500,-500,1000,1000);      painter->setpen(qpen(qt::black, 20, qt::dashdotline));      painter->setbrush(qt::yellow);     painter->drawellipse(-450, -450, 900, 900); } 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -