[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5

Katarina Behrens Katarina.Behrens at cib.de
Wed May 16 09:38:39 UTC 2018


 vcl/inc/qt5/Qt5Menu.hxx |    1 +
 vcl/qt5/Qt5Menu.cxx     |   19 +++++++++++++++++++
 vcl/qt5/Qt5Widget.cxx   |    1 -
 3 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit f93a07b5215f68f7c54a7012c2c4c2e2de0c2012
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Wed May 16 11:37:09 2018 +0200

    Top-level native menubar items are now visible
    
    Change-Id: I6746b4a41a99c75234e64ab48ce81ea97333da04

diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx
index 1c0f03b3342c..1d1048881fbc 100644
--- a/vcl/inc/qt5/Qt5Menu.hxx
+++ b/vcl/inc/qt5/Qt5Menu.hxx
@@ -28,6 +28,7 @@ private:
     QMenuBar*                    mpQMenuBar;
 
     void ActivateAllSubMenus( Menu* pMenuBar );
+    void Update();
 
 public:
     Qt5Menu( bool bMenuBar );
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index 4869a78b8a05..b82b525462c0 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -69,6 +69,8 @@ void Qt5Menu::SetFrame( const SalFrame* pFrame )
         mpQMenuBar = pMainWindow->menuBar();
 
     ActivateAllSubMenus( mpVCLMenu );
+
+    Update();
 }
 
 void Qt5Menu::ActivateAllSubMenus( Menu* pMenuBar )
@@ -85,6 +87,23 @@ void Qt5Menu::ActivateAllSubMenus( Menu* pMenuBar )
     }
 }
 
+void Qt5Menu::Update()
+{
+    Menu* pVCLMenu = mpVCLMenu;
+
+    for ( sal_Int32 nItem = 0; nItem < static_cast<sal_Int32>(GetItemCount()); nItem++ )
+    {
+        Qt5MenuItem *pSalMenuItem = GetItemAtPos( nItem );
+        sal_uInt16 nId = pSalMenuItem->mnId;
+        OUString aText = pVCLMenu->GetItemText( nId );
+
+        if (mbMenuBar && mpQMenuBar)
+        {
+             mpQMenuBar->addMenu( toQString(aText) );
+        }
+    }
+}
+
 void Qt5Menu::ShowItem( unsigned nPos, bool bCheck )
 {
 }
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 8d910434b600..5331d32000a8 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -464,7 +464,6 @@ private:
         : QMainWindow(Q_NULLPTR, f), maMixin(&rFrame)
     {
         Init();
-        ParentClassT::menuBar()->addMenu("ExperimentMenu");
     }
 
     void Init()


More information about the Libreoffice-commits mailing list