PATCH: use KGuiItem::toolTip and KGuiItem::whatsThis in KPushButton

Sebastian Trueg trueg at k3b.org
Wed Jan 7 09:55:17 GMT 2004


Hi,

may I commit? Or is there a reason why these are not used?

Cheers,
Sebastian


--- kpushbutton.cpp     24 Sep 2003 17:27:09 -0000      1.22
+++ kpushbutton.cpp     7 Jan 2004 09:53:18 -0000
@@ -19,6 +19,8 @@

 #include <kglobalsettings.h>
 #include <qdragobject.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
 #include <kconfig.h>
 #include <kglobal.h>

@@ -98,6 +100,11 @@ void KPushButton::init( const KGuiItem &

     setSizePolicy( QSizePolicy( QSizePolicy::Minimum, 
QSizePolicy::Minimum ) );

+    if( !item.toolTip().isEmpty() )
+      QToolTip::add( this, item.toolTip() );
+    if( !item.whtsThis().isEmpty() )
+      QWhatsThis::add( this, item.whatsThis() );
+
     if (kapp)
     {
        connect( kapp, SIGNAL( settingsChanged(int) ),




More information about the kde-core-devel mailing list