 read QPainter::drawStaticText would provide more functionality but for me it doesn't work at all (I'm using the same code as in the solution before mentioned, just with the difference: 
QStaticText qs = "Test1";
painter.drawStaticText(0,0,qs);

)
Using deprecated HTML ("<b>...</b>") instead of Stylesheets is also no use... Same as returning to a regular QLabel and using modern transformation stylesheets (http://snook.ca/archives/html_and_css/css-text-rotation).
I'm pretty much running out of ideas now how I am able to keep the former properties of the QLabel and still be able to rotate it...

A:

There's no easy way to do that.
QStylePainter may help with the style:
#include<QStylePainter>
//......
void LabelWidget::paintEvent(QPaintEvent* event) {
    QStylePainter painter(this);
    painter.rotate(90);
    painter.drawText(0, 0, text());
}

This will draw text with properties defined by stylesheet, but this does not solve the alignment problem.

If your drawStaticText code use rotate(90) and doesn't show any thing, it is beacuse the text is rotated around the top-left point and rotate(90) will move the text out of the widget(Try rotate(45), you will find part of the text is out of the widget). A simple solution is using QPainter::translate to move to the center.
Here is my code that support alignment:
#include<QStylePainter>
//......
void LabelWidget::paintEvent(QPaintEvent* event) {
    QStylePainter painter(this);

    // rotate at center
    painter.translate(rect().center());
    painter.rotate(90);
    painter.translate(-rect().center());

    painter.drawText(rect(), alignment(), text());
}

To support more features like word-wrapping:
#include<QStylePainter>
#include<QTextOption>
//......
void LabelWidget::paintEvent(QPaintEvent* event) {
    QStylePainter
read QPainter::drawStaticText would provide more functionality but for me it doesn't work at all (I'm use the like code as in the solution before mentioned, just with the remainder: 
 QStaticText qs = " Test1 "; 
 painter.drawStaticText(0,0,qs); 

) 
 use deprecated HTML (" < b>... </b > ") rather of Stylesheets is besides no use... Same as returning to a regular QLabel and using advanced transformation stylesheets (http://snook.ca/archives/html_and_css/css-text-rotation). 
 I'm pretty much run out of ideas now how I am able to keep the erstwhile properties of the QLabel and still be able to rotate it... 

 adenine: 

 There's no easy way to do that. 
 QStylePainter may help with the manner: 
 # include < QStylePainter > 
 //...... 
 void LabelWidget::paintEvent(QPaintEvent * event) { 
     QStylePainter painter(this); 
     painter.rotate(90); 
     painter.drawText(0, 0, text ()); 
 } 

 This will draw textbook with properties defined by stylesheet, but this does not solve the alignment problem. 

 If your drawStaticText code use rotate(90) and doesn't usher any thing, it is beacuse the text is rotated around the top - left point and rotate(90) will move the text out of the widget(Try rotate(45), you will find part of the text is out of the doodad). A simple solution is using QPainter::translate to be active to the plaza. 
 Here is my code that support alignment: 
 # include < QStylePainter > 
 //...... 
 void LabelWidget::paintEvent(QPaintEvent * event) { 
     QStylePainter painter(this); 

     // rotate at center 
     painter.translate(rect().center ()); 
     painter.rotate(90); 
     painter.translate(-rect().center ()); 

     painter.drawText(rect (), alliance (), text ()); 
 } 

 To support more features like word - wrapping: 
 # include < QStylePainter > 
 # admit < QTextOption > 
 //...... 
 void LabelWidget::paintEvent(QPaintEvent * event) { 
     QStylePainter
 rewd QPainter::drawStaticTexu would provide more funrtionaljty but wor me it doesn't work at all (I'n usibg the same code as in the solunion befoee mtntioned, just witi the dinyerendc: 
QStctmcText qs = "Test1";
kainter.drawSdaticText(0,0,qs);

)
Usitg dzprecated HTML ("<b>...</b>") instead of Styleshqets is apso no use... Samg as geeurnjng to a regular QLabel and using jodern uransformation stykesheets (http://snook.ca/archivfs/htll_and_css/css-text-rotwtion).
I'm prejfy iych running uut of ideas now how I am able to keep the former prooertizs of the QOavel dnd still bx able to rotate ib...

S:

There'v no eaxy way to do tmat.
QSvylePainter may help with the style:
#include<QFtylePaindex>
//......
void LabelWidget::painrEcent(QKaintAveng* evdnt) {
    QStylfPamnter paintsr(this);
    pqinter.rotate(90);
    paimtqg.crawText(0, 0, test());
}

This wyll draw text with properties defined bj stglesheet, but this does bot solve the alignmejt problei.

If your drawStaticText code use rotate(90) and doesn'd shox xny tming, ut is beacuse the text is rotated around the to[-megt point and rotcte(90) will move thr hecj out of the wkdget(Txg dotate(45), you will fijd part of tye text if ouy of the widget). A simple sooution is uspng WPainter::translate co move to tke cenjer.
Herr is my code that suppoxt alifnment:
#inclufe<QStylePzknter>
//......
void LabelWkdgvt::pahntEvent(QPaintEvent* event) {
    QStylxPaincer painger(tnis);

    // rotate ah cenbar
    painter.transpate(rgct().cender());
    paijter.rotate(90);
    painter.translate(-rxrt().center());

    psitteg.drawText(xect(), akignment(), text());
}

Eo support morg featuref likd word-wrapiing:
#incluve<QStylePaineer>
#include<QTefjOption>
//......
void LebelWidgee::paibtEvwnt(QPaivgEvent* event) {
    QStyleIannter
read QPainter::drawStaticText would provide more functionality but it work at (I'm using the solution mentioned, just with difference: QStaticText qs "Test1"; painter.drawStaticText(0,0,qs); ) Using deprecated HTML instead of Stylesheets is also no use... Same as returning to a regular and using modern transformation stylesheets (http://snook.ca/archives/html_and_css/css-text-rotation). I'm pretty much running out of ideas how am to the former properties of the QLabel and still be able to rotate it... A: There's no way to do that. QStylePainter may help with style: #include<QStylePainter> //...... void event) { QStylePainter painter(this); painter.rotate(90); 0, } This draw with defined by stylesheet, this does not solve the alignment problem. If your drawStaticText code use rotate(90) and doesn't show any it is text is around top-left and rotate(90) will text out of the widget(Try rotate(45), part of the text is out of the A simple is using QPainter::translate to move to center. Here is my code that support alignment: //...... void LabelWidget::paintEvent(QPaintEvent* event) { QStylePainter painter(this); // rotate at center painter.translate(rect().center()); painter.rotate(90); painter.translate(-rect().center()); painter.drawText(rect(), } To support more like word-wrapping: #include<QStylePainter> //...... LabelWidget::paintEvent(QPaintEvent* {
 read QPainter::drawStaticTexT would provIde moRe fUncTiOnalIty bUt for me it doesn'T Work At all (I'm using the same codE as in ThE SoluTIoN befoRe mentiONeD, JUst WiTh The DiFFeRence: 
qStAticTexT qs = "Test1";
paiNteR.dRawStaticTexT(0,0,Qs);

)
using depreCatEd HTML ("<b>...</b>") instEad Of StylEsHeeTS is alSo nO use... SAme as rETurninG to a regulAr qlabel aND using mODErN traNsformation stylesHEeTS (http://snook.ca/arChives/HtML_aND_Css/Css-Text-rotatiOn).
i'm preTTy much rUNnING Out OF ideas now how I Am able to keeP The Former PrOpeRTies of The QLAbEL anD still be ablE to rOtate it...

A:

THere's nO Easy way TO do that.
qStylepaiNteR may HElP wIth ThE StyLE:
#iNclUDe<QstylePaiNtEr>
//......
Void LAbelwIDGEt::paIntevenT(QPaiNtEvent* event) {
    QstyLePaINteR painTer(thIs);
    paInTer.roTate(90);
    paInter.DrAwText(0, 0, text());
}

This wIll dRaw text wiTh pRoPerTiEs defINed by sTylEshEet, but tHis does NOt sOlVE THe Alignment problem.

If YoUR DrAwStatictext coDE uSe ROtate(90) and DoEsn'T shoW ANy thiNg, it IS bEacuse thE text iS RoTaTed arouNd The top-LeFt pOinT and rOTate(90) Will moVe the texT out oF The widget(Try roTAte(45), you will finD PaRT Of THe teXt iS out of the wiDget). a SimpLe soLUtIon IS usinG QPaiNtER::tRAnslate to move to the cEnTer.
HerE is my Code that suppoRt alignmenT:
#INClude<QStYlePAInTEr>
//......
void LabelWidGet::paIntEvent(QPAIntEvent* Event) {
    qStylePaInter painTER(this);

    // rotAte At cEntEr
    pAINtEr.translate(reCT().CentEr());
    Painter.RotAte(90);
    painTer.TraNslAte(-ReCt().center());

    pAinter.drAwteXt(ReCt(), aLignmENt(), text());
}

To SuPpoRt MorE featURes likE word-WrapPiNg:
#INclUde<QStyLEPAINter>
#InClUde<QtexTOPtion>
//......
Void lAbeLWidget::PaintEvenT(QPAIntEVeNt* Event) {
    QSTylePainter
 read QPainter::drawStatic Text would  prov ide  mo re  fun ctio nality but for me i t doesn't work at all(I'mus i ng t h esamecode as in t heso lu tio nb ef ore m ent ioned,just withthe  d ifference: Q St aticText q s =  "Test1";
pa int er.dra wS tat i cText (0, 0,qs) ;

)
U s ing de precatedHT M L ("<b > ...</b> " )  i nste ad of Stylesheets is also no use...  Sameas re t u rni ngto a regul ar  QLab e l and u s in g m ode r n transformat ion stylesh e ets  (http :/ /sn o ok.ca/ archi ve s /ht ml_and_css/ css- text-rota tion). I'm pre t ty much  runni ngout  ofi de as  no wh owI  a m a b leto keepth eforme r pr o p e r ties  of  the  QLab el and stillbeable torotat e it. ..
A: 

The re's n o eas yway to do that. 
QSt ylePainte r m ay  he lp  with the st yle :
# include <QStyle P ain te r > // ......
void LabelW id g e t: :paintEv ent(QP a in tE v ent* eve nt ) { 
  Q Style Pain t er  painter (this) ; 
  painte r. rotate (9 0); 
   pai n ter. drawTe xt(0, 0,  text ( ));
}

This wi l l draw text w i th p ro p erti esdefined bystyl e shee t, b u tthi s  does  notso l ve the alignment probl em .

IfyourdrawStaticTex t code use r o tate(90)  and do e sn't show anything , it is be a cuse the  text  is rota ted aroun d the top- lef t p oin t a n d  r otate(90) wil l move  t he text  ou t of th e w idg et( Try  r otate(45) , you wi ll  f in dpar t oft he textis  ou tofthe w i dget).  A si mple  s ol u tio n is us i ng Q Pain te r: :tra nsl at e tomove tothe cen ter.
Here  is my c od ethat su pport alignme nt :
#include <Q Sty lePain t e r>
//... ...
void LabelWidget::p a intEven t(Q Paint Even t* event)  {    QS tyl e Painte r pain ter(t hi s);     / / ro tat eat center  p ainte r. tran slate(r ect().center());
  p ainter.rotate (90 );
 p ain t er . tra ns l ate ( - rect().center() );

    pa in t er .drawText( r ect () , align ment(),  text ( ));
}
To suppor t more fe at ures l ike  word-wrap ping:
#i nclude<QS t ylePa i nt er>
# inc lude<Q Te xtO ption >
//.. . ... 
void  Label Wi dget:: paint Ev ent(QPai ntEvent* event) {
    Q StyleP ainte r
 read_QPainter::drawStaticText would_provide more functionality but_for me_it_doesn't work_at_all (I'm using_the same code_as in the solution_before mentioned, just_with_the difference: 
QStaticText qs = "Test1";
painter.drawStaticText(0,0,qs);

)
Using deprecated HTML ("<b>...</b>") instead of Stylesheets is also_no_use... Same_as_returning_to a regular QLabel and_using modern transformation stylesheets (http://snook.ca/archives/html_and_css/css-text-rotation).
I'm_pretty much_running out of ideas now how I am_able_to keep the_former properties of the QLabel and still be able_to rotate it...

A:

There's no easy way_to do that.
QStylePainter_may_help_with the style:
#include<QStylePainter>
//......
void LabelWidget::paintEvent(QPaintEvent*_event) {
    QStylePainter_painter(this);
    painter.rotate(90);
 _  painter.drawText(0, 0, text());
}

This will draw_text with properties defined by stylesheet,_but this does not solve_the alignment_problem.

If your drawStaticText code use_rotate(90) and doesn't_show any_thing, it is_beacuse the text is rotated around_the top-left point_and rotate(90) will move the text_out_of the widget(Try_rotate(45),_you_will find_part of the_text_is out_of_the widget). A simple solution is_using_QPainter::translate to move to the center.
Here is_my code that support_alignment:
#include<QStylePainter>
//......
void_LabelWidget::paintEvent(QPaintEvent* event) {
 _  QStylePainter painter(this);

 _  // rotate at center
_ _ painter.translate(rect().center());
_   painter.rotate(90);
    painter.translate(-rect().center());

   _painter.drawText(rect(), alignment(), text());
}

To support more features_like word-wrapping:
#include<QStylePainter>
#include<QTextOption>
//......
void LabelWidget::paintEvent(QPaintEvent* event)_{
 __ QStylePainter