Hi.

Is it possible to make the QLabel shrinkable with QScrollArea. I.e. when 
QScrollArea reduces its width, QLabel should shring its width to the 
QScrollArea::viewport().width() but grows in height... I tell about QLabel with 
text, not with pixmap...

class Widget    :       public QWidget{public:  Widget()        {               
QVBoxLayout * l = new QVBoxLayout( this );              QScrollArea * 
scrollArea =                      new QScrollArea( this );                
QLabel * label = new QLabel;            label->setWordWrap( true );             
label->setSizePolicy( QSizePolicy::Minimum,                     
QSizePolicy::Expanding );               label->setText( QLatin1String( "The 
volume of the ringer and alerts "                   "can be adjusted using the 
volume buttons. "                    "The volume of the ringer and alerts "     
             "can be adjusted using the volume buttons. "                    
"The volume of the ringer and alerts "                  "can be adjusted using 
the volume buttons. "                    "The volume of the ringer and alerts " 
                 "can be adjusted using the volume buttons. " ) );              
 scrollArea->setWidget( label );         scrollArea->setWidgetResizable( true 
);         l->addWidget( scrollArea );     }};

The code above doesn’t work as I expected...

Any ideas?

Thanks.
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to