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

List:       kde-commits
Subject:    kdelibs/kdeui
From:       Waldo Bastian <bastian () kde ! org>
Date:       2003-11-17 16:08:41
[Download RAW message or body]

CVS commit by waba: 

Make it possible to plug KSelectAction as a main-menu.
Reviewed by David.


  M +20 -0     kactionclasses.cpp   1.331


--- kdelibs/kdeui/kactionclasses.cpp  #1.330:1.331
@@ -680,4 +680,24 @@ int KSelectAction::plug( QWidget *widget
     return containerCount() - 1;
   }
+  else if ( widget->inherits("QMenuBar") )
+  {
+    // Create the PopupMenu and store it in m_menu
+    (void)popupMenu();
+
+    QMenuBar* menu = static_cast<QMenuBar*>( widget );
+    int id = menu->insertItem( text(), d->m_menu, -1, index );
+
+    if ( !isEnabled() )
+        menu->setItemEnabled( id, false );
+
+    QString wth = whatsThis();
+    if ( !wth.isEmpty() )
+        menu->setWhatsThis( id, wth );
+
+    addContainer( menu, id );
+    connect( menu, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );
+
+    return containerCount() - 1;
+  }
 
   kdWarning() << "Can not plug KAction in " << widget->className() << endl;


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

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