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

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -