[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdepim/kaddressbook
From:       David Faure <dfaure () kdab ! net>
Date:       2008-06-09 22:00:59
Message-ID: 200806100001.00019.dfaure () kdab ! net
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic