office-gobmx/vcl/CustomTarget_qt6_moc.mk
Michael Weghorn a54abf77c4 tdf#130857 qt weld: Support asnyc running of msg dialogs
Implement methods required to run a welded Qt message dialog
asynchronously: `QtInstanceMessageDialog::runAsync` and
`QtInstanceMessageDialog::response`.

Run the dialog asynchronously using `QDialog::open` and
connect to the `QDialog::finished` signal to be notified
when the dialog gets closed.

Similar to how the gtk-based implementation, use local
variables for the `std::shared_ptr`s and reset the members
right away, not only at the end of the slot, since resetting
the relevant one set in the corresponding `runAsync` overload
will result in the object getting deallocated, thus the members
can no longer be accessed safely.

Take the solar mutex before calling the callback function
as that seems to be expected (e.g. otherwise triggers an assert
for the below example where the callback functions
modifies VCL widgets).

With this in place, running welded Qt message dialogs
asynchronously works instead of not showing up at all, e.g.

1) start Writer with qt6 VCL plugin and without
   `SAL_VCL_QT_NO_WELDED_WIDGETS` set
2) open "File" -> "Properties" -> "Security"
3) click the "Protect..." button
4) enter 2 different passwords and press "OK" button

Change-Id: Ic1b1bfc7d89c1be8a9f9dee59bc86cf3da37a280
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162948
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-02-04 07:01:14 +01:00

39 lines
1.7 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_CustomTarget_CustomTarget,vcl/qt6))
$(call gb_CustomTarget_get_target,vcl/qt6) : \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtClipboard.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtFilePicker.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtFrame.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtInstance.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtInstanceMessageDialog.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtMainWindow.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtMenu.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtObject.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtTimer.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtWidget.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtXAccessible.moc \
# For now, the headers in vcl/inc/qt6 just '#include' the ones
# in 'vcl/inc/qt5'.
# Since moc does not process classes from the included headers,
# it needs to be run on the headers in the qt5 dir.
# That will have to be adapted in case the qt6 VCL plugin
# uses "own" headers
$(call gb_CustomTarget_get_workdir,vcl/qt6)/%.moc : \
$(SRCDIR)/vcl/inc/qt5/%.hxx \
| $(call gb_CustomTarget_get_workdir,vcl/qt6)/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1)
$(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),MOC)
$(MOC6) $< -o $@
$(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),MOC)
# vim: set noet sw=4: