[Qt-interest] qtoolbar

phil prentice philp.cheer at talktalk.net
Fri Sep 24 14:03:48 CEST 2010


Hi everyone

  I have a tool bar at the top of my window which has a QLineEdit box inserted 
into it.  i.e.

  m_networkLineEdit = new QLineEdit();
  // Set attributes.
  m_networkLineEdit->setReadOnly(true);
  m_networkLineEdit->setMaxLength(17); /* Allow max of 17 characters. */

  m_networkIdToolBar = addToolBar("");
  m_networkIdToolBar->addWidget(m_networkLabel);
  m_networkIdToolBar->addWidget(m_networkLineEdit);

  A number of other actions & widgets are also in the toolbar.

  I've also got separators in place as well.

  My question is what determines the size of the lineedit box in the toolbar.  
I've tryed various things like

  m_networkLineEdit->setFixedWidth(
        17 * m_networkLineEdit->fontMetrics().maxWidth()+20);

  to increase its size with no success.

  I've tryed increasing the 17 characters to 30 odd as well and again no 
success.

  I know that I can drag the separator to make it bigger, but I would like it 
to display all 17 characters.

  To be honest I think I have a fonts problem of some sort, because when I use 
wider screens, the same number of characters no longer fit in the widgets; 
but thats another question.

Thanks for your help
Phil

  


 



More information about the Qt-interest-old mailing list