From kde-commits Mon Jun 09 22:00:59 2008 From: David Faure Date: Mon, 09 Jun 2008 22:00:59 +0000 To: kde-commits Subject: Re: KDE/kdepim/kaddressbook Message-Id: <200806100001.00019.dfaure () kdab ! net> X-MARC-Message: https://marc.info/?l=kde-commits&m=121305211603434 On Monday 09 June 2008, Tobias Koenig wrote: > +  QPushButton *button = new QPushButton( "", parent ); > +  button->hide(); > + > +  const QSize buttonSize = parent->style()->sizeFromContents( QStyle::CT_PushButton, &opt, > +                           fm.size( Qt::TextShowMnemonic, " X - X " ).expandedTo( QApplication::globalStrut() ), > +                           button ); > +  delete button; Are you sure you need a hidden button in order to call CT_PushButton? The whole point of the qt4 style API is that you don't -have- to specify a widget. Doesn't this work with 0 as the last argument of the sizeFromContents call? -- David Faure, faure@kde.org, dfaure@kdab.net KDE/KOffice developer, Qt consultancy projects Klarälvdalens Datakonsult AB, Platform-independent software solutions