diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-05-09 14:34:24 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-06-01 10:06:30 +0200 |
commit | 33c5d209ba3a5555a97640e3874c713b053d7c47 (patch) | |
tree | fcc456738e64a853aa46f4b242eb881db70a73b5 | |
parent | 621a9066cdb738f86ea2108da4ce10e3a248707b (diff) |
Basic ops (add, remove) with native menu items
nothing's visible yet
Change-Id: Iee9d31ecdb931e64016f8430b51b619a39528726
-rw-r--r-- | vcl/qt5/Qt5Menu.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 2471f779c463..5a3753b6433a 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -10,6 +10,8 @@ #include "Qt5Frame.hxx" #include "Qt5Menu.hxx" +#include <vcl/svapp.hxx> + Qt5Menu::Qt5Menu( bool bMenuBar ) : mpVCLMenu( nullptr ), mpParentSalMenu( nullptr ), @@ -20,6 +22,7 @@ Qt5Menu::Qt5Menu( bool bMenuBar ) : Qt5Menu::~Qt5Menu() { + maItems.clear(); } bool Qt5Menu::VisibleMenuBar() @@ -29,10 +32,21 @@ bool Qt5Menu::VisibleMenuBar() void Qt5Menu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) { + SolarMutexGuard aGuard; + Qt5MenuItem *pItem = static_cast<Qt5MenuItem*>( pSalMenuItem ); + + if ( nPos == MENU_APPEND ) + maItems.push_back( pItem ); + else + maItems.insert( maItems.begin() + nPos, pItem ); + + pItem->mpParentMenu = this; } void Qt5Menu::RemoveItem( unsigned nPos ) { + SolarMutexGuard aGuard; + maItems.erase( maItems.begin() + nPos ); } void Qt5Menu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) |