summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2018-05-16 11:37:09 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2018-06-01 10:06:30 +0200
commitf174739d36b61422bd86a3c756c84ae87aa5a4ac (patch)
tree18ce21669a8fe0d8200ec55746ad3323132c0d66 /vcl
parentaae09b331b5645b458556543d02b60266a3e68d0 (diff)
Top-level native menubar items are now visible
Change-Id: I6746b4a41a99c75234e64ab48ce81ea97333da04
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/qt5/Qt5Menu.hxx1
-rw-r--r--vcl/qt5/Qt5Menu.cxx19
-rw-r--r--vcl/qt5/Qt5Widget.cxx1
3 files changed, 20 insertions, 1 deletions
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()