Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
26bcf961
Kaydet (Commit)
26bcf961
authored
May 25, 2018
tarafından
Katarina Behrens
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Dispatch commands from menus for real
Change-Id: I01997caa22e14c1350bd83100edb74397ebab5d7
üst
b971f2cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
Qt5Menu.hxx
vcl/inc/qt5/Qt5Menu.hxx
+2
-1
Qt5Menu.cxx
vcl/qt5/Qt5Menu.cxx
+18
-3
No files found.
vcl/inc/qt5/Qt5Menu.hxx
Dosyayı görüntüle @
26bcf961
...
...
@@ -42,6 +42,7 @@ public:
virtual
void
SetSubMenu
(
SalMenuItem
*
pSalMenuItem
,
SalMenu
*
pSubMenu
,
unsigned
nPos
)
override
;
virtual
void
SetFrame
(
const
SalFrame
*
pFrame
)
override
;
const
Qt5Frame
*
GetFrame
()
const
;
Qt5Menu
*
GetTopLevel
();
virtual
void
CheckItem
(
unsigned
nPos
,
bool
bCheck
)
override
;
virtual
void
EnableItem
(
unsigned
nPos
,
bool
bEnable
)
override
;
virtual
void
ShowItem
(
unsigned
nPos
,
bool
bShow
)
override
;
...
...
@@ -56,7 +57,7 @@ public:
Qt5MenuItem
*
GetItemAtPos
(
unsigned
nPos
)
{
return
maItems
[
nPos
];
}
private
slots
:
void
DispatchCommand
();
void
DispatchCommand
(
Qt5MenuItem
*
pQItem
);
};
class
Qt5MenuItem
:
public
SalMenuItem
...
...
vcl/qt5/Qt5Menu.cxx
Dosyayı görüntüle @
26bcf961
...
...
@@ -114,7 +114,8 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu )
// leaf menu
QAction
*
pAction
=
pQMenu
->
addAction
(
toQString
(
aText
)
);
pAction
->
setShortcut
(
toQString
(
nAccelKey
.
GetName
(
GetFrame
()
->
GetWindow
())
)
);
connect
(
pAction
,
&
QAction
::
triggered
,
this
,
&
Qt5Menu
::
DispatchCommand
);
connect
(
pAction
,
&
QAction
::
triggered
,
this
,
[
this
,
pSalMenuItem
]{
DispatchCommand
(
pSalMenuItem
);
}
);
}
}
}
...
...
@@ -156,6 +157,14 @@ void Qt5Menu::GetSystemMenuData( SystemMenuData* pData )
{
}
Qt5Menu
*
Qt5Menu
::
GetTopLevel
()
{
Qt5Menu
*
pMenu
=
this
;
while
(
pMenu
->
mpParentSalMenu
)
pMenu
=
pMenu
->
mpParentSalMenu
;
return
pMenu
;
}
const
Qt5Frame
*
Qt5Menu
::
GetFrame
()
const
{
SolarMutexGuard
aGuard
;
...
...
@@ -165,9 +174,15 @@ const Qt5Frame* Qt5Menu::GetFrame() const
return
pMenu
?
pMenu
->
mpFrame
:
nullptr
;
}
void
Qt5Menu
::
DispatchCommand
()
void
Qt5Menu
::
DispatchCommand
(
Qt5MenuItem
*
pQItem
)
{
SAL_WARN
(
"vcl.qt5"
,
"menu triggered"
);
if
(
pQItem
)
{
Qt5Menu
*
pSalMenu
=
pQItem
->
mpParentMenu
;
Qt5Menu
*
pTopLevel
=
pSalMenu
->
GetTopLevel
();
pTopLevel
->
GetMenu
()
->
HandleMenuCommandEvent
(
pSalMenu
->
GetMenu
(),
pQItem
->
mnId
);
SAL_WARN
(
"vcl.qt5"
,
"menu triggered "
<<
pQItem
->
mnId
);
}
}
void
Qt5Menu
::
NativeItemText
(
OUString
&
rItemText
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment