iasing render hint).  This is a Qt quirk that occurs without it.  From what I've seen/heard, the Qt devs aren't terribly concerned with fixing this (most people want anti-aliasing anyway).
The work-around (besides just using anti-aliasing) is to draw the rect yourself with QPainter::drawLine() and QPainter::drawArc().  You might have to play with numbers until it looks right -- straight calculations tend to come out a pixel or two off.  Also, you might find that even with this method the lower right corner is never exactly the same as the other corners.
If you're feeling mildly ambitious, you could try fixing this and submitting a patch to Qt.
Update: Arc drawing results changed in Qt 5. In my experience, it's a big improvement.

A:

Try adding half a pixel offset (e.g.: rect.translated(0.5,0.5) ):
QRectF rect(0,0,48,11);
painter.setRenderHint(QPainter::Antialiasing,false);
painter.drawRoundedRect( rect.translated(0.5,0.5), 2.0, 2.0 );

I suppose this has to do with the coordinate system placing an integer value between two pixels.
If you draw with antialiasing and use a pen of 1 pixel width then drawing at exact integer coordinates results in lines of 2 pixel width instead. 
Only with this 0.5 pixel offset you'll get lines that are exactly 1 pixel wide. 
QRectF rect(0,0,48,11);
painter.setRenderHint(QPainter::Antialiasing,true);
painter.setBrush(Qt::NoBrush);
painter.setPen( Qt::white );
painter.drawRoundedRect( rect.translated(0.5,0.5), 2.0,2.0 );

A:

I know this is an old problem but for Qt5 users calling setRenderHint(QPainter::Qt4CompatiblePainting); on the QPainter seems to solve the problem.
Edit:
I found a solution for generating a perfect rounded rectangle together with border color and it looks the same as the rounded rectangles used by QPushButton's border for example. This is how
iasing render hint).   This is a Qt quirk that occurs without it.   From what I've seen / heard, the Qt devs aren't terribly implicated with situate this (most people want anti - aliasing anyhow). 
 The study - around (besides just using anti - aliasing) is to guide the rect yourself with QPainter::drawLine () and QPainter::drawArc ().   You might give birth to play with numbers until it looks right -- neat calculations tend to come out a pixel or two away.   Also, you might find that even with this method the lower right corner is never exactly the like as the other corners. 
 If you're feeling gently ambitious, you could try fixing this and submitting a patch to Qt. 
 Update: Arc lottery results changed in Qt 5. In my experience, it's a big improvement. 

 A: 

 Try adding half a pixel counterbalance (e.g.: rect.translated(0.5,0.5) ): 
 QRectF rect(0,0,48,11); 
 painter.setRenderHint(QPainter::Antialiasing, false); 
 painter.drawRoundedRect (rect.translated(0.5,0.5), 2.0, 2.0); 

 I suppose this has to do with the coordinate system target an integer value between two pixels. 
 If you draw with antialiasing and use a pen of 1 pixel width then drawing at exact integer coordinates results in lines of 2 pixel width instead. 
 merely with this 0.5 pixel offset you'll get agate line that are precisely 1 pixel wide. 
 QRectF rect(0,0,48,11); 
 painter.setRenderHint(QPainter::Antialiasing, true); 
 painter.setBrush(Qt::NoBrush); 
 painter.setPen (Qt::white); 
 painter.drawRoundedRect (rect.translated(0.5,0.5), 2.0,2.0); 

 A: 

 I know this is an previous problem but for Qt5 users calling setRenderHint(QPainter::Qt4CompatiblePainting); on the QPainter seems to resolve the problem. 
 Edit: 
 I found a solution for generating a perfect rounded rectangle together with border coloring material and it looks the same as the rounded rectangles used by QPushButton's edge for example. This is how
iaslng render hint).  This is a Qt quirk thaj iccurs withoht it.  Ffom what I've seen/heard, the Qv decs artu't terribly concernea with fiqing this (mosu people want antm-zliasinn anyswy).
Thz xork-around (besices just uving anti-aliashne) ns to draw the rect yourself with QPwinter::dtaaLine() and QPaigter::cwawAdb().  You might have to play with humbers until it lools right -- straight calculahiond tend to come out a pixel or two iff.  Also, yoj might find that even with this method the lower rigft coxner is nevgx exwwtly the sane as the other corners.
If you're geeling mildly amuitiius, you could try fixmng this and submittyng a patwh to Qt.
Update: Arc erqwing resglts xhavges mn St 5. In my experiencs, it's a big improvement.

A:

Try adcigt half a pixem offsqt (e.g.: rect.translated(0.5,0.5) ):
QRectF rect(0,0,48,11);
painter.seuRendsrHint(QPainter::Antialiasung,false);
painter.drawRoondedRect( wect.translated(0.5,0.5), 2.0, 2.0 );

I suppose this has to do with tha coocdknaue systdn olacing an integer value between two pixels.
If goi craw with anticliasing and use a prg of 1 pixel wkdth tksn drawing at exact lnteger cooreinates rtsultx in lines of 2 pixel width unstead. 
Only qith this 0.5 pixel oyfset you'll yet limes tnat are exactly 1 pixel cide. 
QDectF rect(0,0,48,11);
pwinter.setDdnderHint(QPaintef::Annialhasing,true);
painter.setBrush(Qe::NoBrush);
peintex.setPen( Dt::whote );
paynter.drawRlundedRect( rect.translatef(0.5,0.5), 2.0,2.0 );

A:

I ktow this id an old problem but for Qt5 usecx calling sejRetdegHint(QPaiuter::Qt4GompatiblePaintyng); on the QPannter sezms to solve the problek.
Edit:
I founq a solution xlr generatinj a perfest riundwd rectxvgle together eith bordvr colir and it looks thc samg zs the rounded xtctqngles used by APurhBttnon'x fmrder for exdmpld. Tfos is how
iasing render hint). This is a Qt occurs it. From I've seen/heard, the with this (most people anti-aliasing anyway). The (besides just using anti-aliasing) is to the rect yourself with QPainter::drawLine() and QPainter::drawArc(). You might have to play with until it looks right -- straight calculations tend to come out a pixel two Also, might that even with this method the lower right corner is never exactly the same as the corners. If you're feeling mildly ambitious, you could fixing this and submitting patch to Qt. Update: Arc results in Qt In experience, a big improvement. Try adding half a pixel offset (e.g.: rect.translated(0.5,0.5) ): QRectF rect(0,0,48,11); painter.setRenderHint(QPainter::Antialiasing,false); painter.drawRoundedRect( rect.translated(0.5,0.5), 2.0, 2.0 ); suppose this do with coordinate placing integer value between If you draw with antialiasing and of 1 pixel width then drawing at exact coordinates results lines of 2 pixel width instead. with this 0.5 pixel offset you'll get lines are exactly 1 pixel wide. QRectF rect(0,0,48,11); painter.setRenderHint(QPainter::Antialiasing,true); painter.setBrush(Qt::NoBrush); painter.setPen( Qt::white ); painter.drawRoundedRect( rect.translated(0.5,0.5), 2.0,2.0 I know this is old problem but Qt5 calling on QPainter seems solve the problem. Edit: I found a solution for generating a rounded rectangle together with border color and it looks the the rectangles used by border for example. This how
iasing render hint).  This is a Qt Quirk that oCcurs WitHouT iT.  FroM whaT I've seen/heard, tHE Qt dEvs aren't terribly concerNed wiTh FIxinG ThIs (mosT people WAnT ANti-AlIaSinG aNYwAy).
The WorK-around (Besides jusT usInG anti-aliasinG) Is To draw the rEct Yourself with qPaInter::dRaWLiNE() and QpaiNter::dRawArc().  yOu mighT have to plAy WIth numBErs untiL IT lOoks Right -- straight calcULaTIons tend to come Out a piXeL Or TWO ofF.  AlSo, you might FiNd thaT Even witH ThIS MEthOD the lower righT corner is neVEr eXactly ThE saME as the Other CoRNerS.
If you're feeLing Mildly ambItious, YOu could TRy fixinG this aNd sUbmIttiNG a PaTch To qT.
UpDAtE: ArC DraWing resuLtS cHangeD in QT 5. iN MY expEriEnce, It's a bIg improvement.

a:

TrY addINg hAlf a pIxel oFfseT (e.G.: rect.TranslAted(0.5,0.5) ):
QreCtF rect(0,0,48,11);
painter.sEtReNderHint(QpaiNtEr::ANtIaliaSIng,falSe);
pAinTer.drawroundedrEct( ReCT.TRaNslated(0.5,0.5), 2.0, 2.0 );

I suppose thiS hAS To Do with thE coordINaTe SYstem plaCiNg aN intEGEr valUe beTWeEn two pixEls.
If yOU dRaW with anTiAliasiNg And Use A pen oF 1 PixeL width Then drawIng at EXact integer cooRDinates resultS In LINeS Of 2 piXel Width insteaD. 
OnlY With This 0.5 PIxEl oFFset yOu'll gEt LInES that are exactly 1 pixeL wIde. 
QReCtF reCt(0,0,48,11);
painter.setREnderHint(QpAINter::AntiAliaSInG,True);
painter.setbrush(qt::NoBrush);
pAInter.setpen( Qt::White );
paiNter.drawROUNdedRect( RecT.trAnsLatED(0.5,0.5), 2.0,2.0 );

a:

I Know this is an oLD ProbLeM but for qt5 uSers calLinG seTReNdeRHInt(QPaintEr::Qt4CompAtIbLepaIntIng); on THe QPaintEr SeeMs To sOlve tHE problEm.
EdiT:
I foUnD a SOluTion for GEnERAtinG a PeRfecT roUnDed reCtanGLe tOgether With bordeR coLOr anD iT lOoks the Same as the rounDeD rectangleS uSed By QPusHbUtton's boRder for example. This is how
iasing render hint).  This  is a Qt q uirktha t o cc urswith out it.  Fromw hatI've seen/heard, the Q t dev sa ren' t  t errib ly conc e rn e d  wi th  f ixi ng th is (m ost  people  want anti -al ia sing anyway) . 
T he work-ar oun d (besides j ust  using  a nti - alias ing ) isto dra w  the r ect yours el f  withQ Painter : : dr awLi ne() and QPainter : :d r awArc().  Youmightha v et o  pl aywith numbe rs  unti l  it loo k sr i g ht- - straight ca lculationst end  to co me  ou t  a pix el or  t w o o ff.  Also,youmight fin d that even wi t h thismethod  th e l ower ri gh t c or n eri snev e r e xactly t he  s ame a s th e o t hercor ners .
Ifyou're feelin g m ildl y  am bitio us, y ou c ou ld tr y fixi ng th is  and submitting  a p atch to Q t.Up dat e:  Arcd rawing  re sul ts chan ged inQ t 5 .I n my  experience, it'sab i gimprovem ent.
A :
T r y adding  h alf  a p i x el of fset (e .g.: rec t.tran s la te d(0.5,0 .5 ) ):
Q Re ctF  re ct(0, 0 ,48, 11);
p ainter.s etRen d erHint(QPainte r ::Antialiasin g ,f a l se ) ;
pa int er.drawRoun dedR e ct(rect . tr ans l ated( 0.5,0 .5 ) ,2 .0, 2.0 );

I suppo se  thishas t o do with the  coordinat e s ystem pl acin g  a n  integer value  betw een two pi x els.
Ifyou d raw with  antialia s i ng and u sea p enof1 pi xel width the n draw in g at ex act  intege r c oor din ate sresults i n linesof  2  p ix elwidth instead.  Onl ywit h thi s  0.5 p ixeloffs et  y o u'l l get l i ne s that  a re  exa ctl y1 pix el w i de.  
QRect F rect(0, 0,4 8 ,11) ;pa inter.s etRenderHint( QP ainter::An ti ali asing, t r ue);
pai nter.setBrush(Qt::NoBru s h);
pai nte r.set Pen(  Qt::whit e ) ;
pain ter . drawRo undedR ect(re ct. t r ansla t e d( 0.5 ,0 .5), 2.0,2 . 0  ); 

A:
I  kno w thisis an old problemb utfor Qt5 users  ca llin g se tRe n de r Hin t( Q Pai n t er::Qt4Compatib lePainting ); on  the QPain t erse ems tosolve t he pr o blem.
E dit:
I fo und a sol ut ionf o r g eneratinga perfec t rounded recta n gl e tog eth er wit hbor der c olor a n d i t loo ks the  s ame as  thero unded re ctangles used by QPushB utton' s bor der  for exam ple .  Th is is how 
iasing render_hint). _This is a Qt_quirk that_occurs_without it.__From what I've_seen/heard, the Qt_devs aren't terribly concerned_with fixing this_(most_people want anti-aliasing anyway).
The work-around (besides just using anti-aliasing) is to draw the rect_yourself_with QPainter::drawLine()_and_QPainter::drawArc()._ You might have to_play with numbers until it_looks right_-- straight calculations tend to come out a_pixel_or two off._ Also, you might find that even with this_method the lower right corner is_never exactly the_same_as_the other corners.
If you're_feeling mildly ambitious, you could try_fixing this and submitting a patch_to Qt.
Update: Arc drawing results changed in_Qt 5. In my experience, it's_a big improvement.

A:

Try adding half_a pixel_offset (e.g.: rect.translated(0.5,0.5) ):
QRectF rect(0,0,48,11);
painter.setRenderHint(QPainter::Antialiasing,false);
painter.drawRoundedRect(_rect.translated(0.5,0.5), 2.0, 2.0_);

I suppose_this has to_do with the coordinate system placing_an integer value_between two pixels.
If you draw with_antialiasing_and use a_pen_of_1 pixel_width then drawing_at_exact integer_coordinates_results in lines of 2 pixel_width_instead. 
Only with this 0.5 pixel offset_you'll get lines that_are_exactly 1 pixel wide._
QRectF rect(0,0,48,11);
painter.setRenderHint(QPainter::Antialiasing,true);
painter.setBrush(Qt::NoBrush);
painter.setPen( Qt::white );
painter.drawRoundedRect( rect.translated(0.5,0.5),_2.0,2.0 );

A:

I know this is an_old problem_but for_Qt5 users calling setRenderHint(QPainter::Qt4CompatiblePainting); on the QPainter seems to solve the_problem.
Edit:
I found a solution for generating_a perfect rounded rectangle_together with_border_color and it_looks_the same_as the rounded rectangles used by QPushButton's_border for_example. This is how