Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, February 2007
QComboBox in a Grid: text is clipped


Message 1 in thread

Hi,

I am using a grid to vertically line a set of "label-value pairs".  The label-value pairs are one of:
    label + line edit
    label + combo box (non editable)
    label + spin box
    
The grid contains 2 columns (labels are in column 0, "values" in column 1).  The reason I am using a grid is for the ability to align the items inside (the labels need to be right justified, the values left justified).  

I am seeing that the combo boxes in the grid are sized in a way that some of the text is clipped.  Some of the combo boxes have choices with longer strings that what is shown.  When you popup the combo box view, those longer strings are also clipped.  

I have tried calling QComboBox::sizeAdjustPolicy with QComboBox::AdjustToContents, and its still clips the strings.  

Does anyone know how to make sure that the combo box is sized properly ?

I have tried setMinimimWidth(combo->width()) after the widget is completely created.  In this case the strings displaying the current choices aren't clipped, but when you pop up the combo view, they are still clipped, so this isn't an optimal solution.

Any help is greatly appreciated.

Thanks,
Susan
 
_____________________________ 
Susan Macchia 
mailto:susan@xxxxxxxxxxxx 
http://www.smacchia.net 
_____________________________ 





--
 [ signature omitted ] 

Message 2 in thread

Forgot to mention that the style is Plastique.  I am not seeing the same behavior in Windows or Motif.

----- Original Message ----
From: Susan Macchia <susan@xxxxxxxxxxxx>
To: qt-interest@xxxxxxxxxxxxx
Sent: Monday, February 26, 2007 3:20:06 PM
Subject: QComboBox in a Grid: text is clipped

Hi,

I am using a grid to vertically line a set of "label-value pairs".  The label-value pairs are one of:
    label + line edit
    label + combo box (non editable)
    label + spin box
    
The grid contains 2 columns (labels are in column 0, "values" in column 1).  The reason I am using a grid is for the ability to align the items inside (the labels need to be right justified, the values left justified).  

I am seeing that the combo boxes in the grid are sized in a way that some of the text is clipped.  Some of the combo boxes have choices with longer strings that what is shown.  When you popup the combo box view, those longer strings are also clipped.  

I have tried calling QComboBox::sizeAdjustPolicy with QComboBox::AdjustToContents, and its still clips the strings.  

Does anyone know how to make sure that the combo box is sized properly ?

I have tried setMinimimWidth(combo->width()) after the widget is completely created.  In this case the strings displaying the current choices aren't clipped, but when you pop up the combo view, they are still clipped, so this isn't an optimal solution.

Any help is greatly appreciated.

Thanks,
Susan
 
_____________________________ 
Susan Macchia 
mailto:susan@xxxxxxxxxxxx 
http://www.smacchia.net 
_____________________________ 








--
 [ signature omitted ]