[Qt-interest] Simple question regarding QCheckBox

Patric userqt at gmail.com
Mon Jun 29 21:32:38 CEST 2009


Thank you Ben,
I'll check this out !

Regards,
Patric

----- Original Message ----- 
From: "Ben Swerts" <benswerts at telenet.be>
To: <qt-interest at trolltech.com>
Sent: Monday, June 29, 2009 8:07 PM
Subject: Re: [Qt-interest] Simple question regarding QCheckBox


>
>> Hi all,
>> is there a way to center the content of QComboBox? I think I can't use 
>> the
>> align attribute of the stylesheets and I can't find any additional 
>> options
>> in the class.
>
> Hi Patric,
>
> You can do that as follows:
>
> - set the QComboBox's QLineEdit in editable mode:
>
>  combo->lineEdit()->setEditable(true);
>
> - and readonly again:
>
>  combo->lineEdit()->setReadOnly(true);
>
> - change its alignment:
>
>  combo->lineEdit()->setAlignment(Qt::AlignXXX);
>
> - change the alignment of all entries in the QComboBox:
>
>  for(int i = 0; i > comboBox->count(); ++i)
>    combo->setItemData(i, Qt::AlignXXX, Qt::TextAlignmentRole);
>
>
> Hope this (untested code) helps.
> Greets,
>
>
> Ben
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 




More information about the Qt-interest-old mailing list