--- vcl/unx/inc/kde_headers.h	1 Aug 2006 10:27:42 -0000	1.2
+++ vcl/unx/inc/kde_headers.h	21 Aug 2006 16:05:40 -0000
@@ -58,12 +58,7 @@
 #include <qlineedit.h>
 #include <qlistview.h>
 #include <qmainwindow.h>
-
-/* Ugly hack to be able to access QMenuItem::is_enabled */
-#define private public
 #include <qmenudata.h>
-#undef private
-
 #include <qpaintdevice.h>
 #include <qpainter.h>
 #include <qpushbutton.h>
--- vcl/unx/kde/salnativewidgets-kde.cxx	1 Aug 2006 10:28:33 -0000	1.16
+++ vcl/unx/kde/salnativewidgets-kde.cxx	21 Aug 2006 16:05:40 -0000
@@ -204,12 +204,20 @@ class WidgetPainter
         */
         QMenuBar     *m_pMenuBar;
 
+        /** Identifiers of menu bar items.
+         */
+        int           m_nMenuBarEnabledItem, m_nMenuBarDisabledItem;
+
         /** Cached popup menu.
 
           @see m_pPushButton
         */
         QPopupMenu   *m_pPopupMenu;
 
+        /** Identifiers of popup menu items.
+         */
+        int           m_nPopupMenuEnabledItem, m_nPopupMenuDisabledItem;
+
 	// TODO other widgets
 
     public:
@@ -742,8 +750,8 @@ BOOL WidgetPainter::drawStyledWidget( QW
         }
         else if ( nPart == PART_MENU_ITEM )
         {
-            QMenuItem qMenuItem;
-            qMenuItem.is_enabled = bool( nStyle & QStyle::Style_Enabled );
+            int nMenuItem = ( nStyle & QStyle::Style_Enabled )? m_nMenuBarEnabledItem: m_nMenuBarDisabledItem;
+            QMenuItem *pMenuItem = static_cast<QMenuBar*>( pWidget )->findItem( nMenuItem );
 
             if ( nStyle & QStyle::Style_Selected )
                 nStyle |= QStyle::Style_Active | QStyle::Style_Down | QStyle::Style_HasFocus;
@@ -751,13 +759,13 @@ BOOL WidgetPainter::drawStyledWidget( QW
             kapp->style().drawControl( QStyle::CE_MenuBarItem,
                     &qPainter, pWidget, qRect,
                     pWidget->colorGroup(), nStyle,
-                    QStyleOption( &qMenuItem ) );
+                    QStyleOption( pMenuItem ) );
         }
     }
     else if ( strcmp( "QPopupMenu", pClassName ) == 0 )
     {
-        QMenuItem qMenuItem;
-        qMenuItem.is_enabled = bool( nStyle & QStyle::Style_Enabled );
+        int nMenuItem = ( nStyle & QStyle::Style_Enabled )? m_nPopupMenuEnabledItem: m_nPopupMenuDisabledItem;
+        QMenuItem *pMenuItem = static_cast<QPopupMenu*>( pWidget )->findItem( nMenuItem );
 
         if ( nStyle & QStyle::Style_Selected )
             nStyle |= QStyle::Style_Active;
@@ -765,7 +773,7 @@ BOOL WidgetPainter::drawStyledWidget( QW
         kapp->style().drawControl( QStyle::CE_PopupMenuItem,
                 &qPainter, pWidget, qRect,
                 pWidget->colorGroup(), nStyle,
-                QStyleOption( &qMenuItem, 0, 0 ) );
+                QStyleOption( pMenuItem, 0, 0 ) );
     }
     else
 	return FALSE;
@@ -1068,7 +1076,15 @@ QToolButton *WidgetPainter::toolButton( 
 QMenuBar *WidgetPainter::menuBar( const Region& rControlRegion)
 {
     if ( !m_pMenuBar )
-	m_pMenuBar = new QMenuBar( NULL, "menu_bar" );
+    {
+        m_pMenuBar = new QMenuBar( NULL, "menu_bar" );
+
+        m_nMenuBarEnabledItem = m_pMenuBar->insertItem( "" );
+        m_nMenuBarDisabledItem = m_pMenuBar->insertItem( "" );
+
+        m_pMenuBar->setItemEnabled( m_nMenuBarEnabledItem, true );
+        m_pMenuBar->setItemEnabled( m_nMenuBarDisabledItem, false );
+    }
 
     QRect qRect = region2QRect( rControlRegion );
 
@@ -1081,7 +1097,15 @@ QMenuBar *WidgetPainter::menuBar( const 
 QPopupMenu *WidgetPainter::popupMenu( const Region& rControlRegion)
 {
     if ( !m_pPopupMenu )
-	m_pPopupMenu = new QPopupMenu( NULL, "popup_menu" );
+    {
+        m_pPopupMenu = new QPopupMenu( NULL, "popup_menu" );
+
+        m_nPopupMenuEnabledItem = m_pPopupMenu->insertItem( "" );
+        m_nPopupMenuDisabledItem = m_pPopupMenu->insertItem( "" );
+
+        m_pPopupMenu->setItemEnabled( m_nPopupMenuEnabledItem, true );
+        m_pPopupMenu->setItemEnabled( m_nPopupMenuDisabledItem, false );
+    }
 
     QRect qRect = region2QRect( rControlRegion );
 
