2024-11-18 09:33:05 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
2024-08-06 14:58:12 +02:00
|
|
|
/*
|
|
|
|
* 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/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QtInstanceButton.hxx>
|
|
|
|
|
2024-10-24 00:03:33 +02:00
|
|
|
#include <vcl/qt/QtUtils.hxx>
|
|
|
|
|
2024-10-25 10:37:07 +02:00
|
|
|
// Name of QObject property to indicate whether a click handler
|
|
|
|
// was set on the QPushButton: If that property is set and has a value
|
|
|
|
// of true, then a custom click handler is set, otherwise not.
|
|
|
|
const char* const PROPERTY_CLICK_HANDLER_SET = "click-handler-set";
|
|
|
|
|
2024-08-06 14:58:12 +02:00
|
|
|
QtInstanceButton::QtInstanceButton(QPushButton* pButton)
|
|
|
|
: QtInstanceWidget(pButton)
|
|
|
|
, m_pButton(pButton)
|
|
|
|
{
|
|
|
|
assert(m_pButton);
|
2024-08-06 15:28:58 +02:00
|
|
|
|
|
|
|
connect(m_pButton, &QPushButton::clicked, this, &QtInstanceButton::buttonClicked);
|
2024-08-06 14:58:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void QtInstanceButton::set_label(const OUString& rText)
|
|
|
|
{
|
tdf#162696 qt weld: Do GUI things in main thread
Creating or modifying native Qt UI elements needs
to happen in the main thread.
This commit takes care of the obvious cases where
such interaction happens.
Otherwise, the tdf#162696 scenario triggers asserts
like the following with a Qt debug build:
ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp, line 958
terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'
Fatal exception: Signal 6
Stack:
#0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
#1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
#2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
#3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
#4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7fdb05455590]
#5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
#6 raise at ./signal/../sysdeps/posix/raise.c:27
#7 abort at ./stdlib/abort.c:81
#8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7fdb050a1a3d]
#9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7fdb050b306a]
#10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
#11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7fdaf0eed562]
#12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
#13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
#14 QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:959
#15 QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:878
#16 QDialog::QDialog(QDialogPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:377
#17 QMessageBox::QMessageBox(QWidget*) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:838
#18 QtInstance::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&) at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtInstance.cxx:825
#19 Application::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&, vcl::ILibreOfficeKitNotifier const*) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:224
#20 dp_gui::DialogHelper::installExtensionWarn(std::basic_string_view<char16_t, std::char_traits<char16_t>>) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_dialog2.cxx:371
#21 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:477
#22 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
#23 dp_manager::ExtensionManager::checkInstall(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1315
#24 dp_manager::ExtensionManager::doChecksForAddExtension(com::sun::star::uno::Reference<com::sun::star::deployment::XPackageManager> const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:565
#25 dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:655
#26 non-virtual thunk to dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:0
#27 dp_gui::ExtensionCmdQueue::Thread::_addExtension(rtl::Reference<dp_gui::(anonymous namespace)::ProgressCmdEnv> const&, rtl::OUString const&, rtl::OUString const&, bool) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:864
#28 dp_gui::ExtensionCmdQueue::Thread::execute() at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:738
#29 salhelper::Thread::run() at /home/michi/development/git/libreoffice/salhelper/source/thread.cxx:39
#30 threadFunc at /home/michi/development/git/libreoffice/include/osl/thread.hxx:190
#31 osl_thread_start_Impl(void*) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:245
#32 start_thread at ./nptl/pthread_create.c:447
#33 clone3 at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80
Change-Id: Ifa84a038fc56f34958cd732caeb9c436b48b3c75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172642
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-08-30 10:12:21 +02:00
|
|
|
SolarMutexGuard g;
|
2024-09-27 09:08:43 +02:00
|
|
|
QtInstance& rQtInstance = GetQtInstance();
|
|
|
|
if (!rQtInstance.IsMainThread())
|
tdf#162696 qt weld: Do GUI things in main thread
Creating or modifying native Qt UI elements needs
to happen in the main thread.
This commit takes care of the obvious cases where
such interaction happens.
Otherwise, the tdf#162696 scenario triggers asserts
like the following with a Qt debug build:
ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp, line 958
terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'
Fatal exception: Signal 6
Stack:
#0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
#1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
#2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
#3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
#4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7fdb05455590]
#5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
#6 raise at ./signal/../sysdeps/posix/raise.c:27
#7 abort at ./stdlib/abort.c:81
#8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7fdb050a1a3d]
#9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7fdb050b306a]
#10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
#11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7fdaf0eed562]
#12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
#13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
#14 QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:959
#15 QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:878
#16 QDialog::QDialog(QDialogPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:377
#17 QMessageBox::QMessageBox(QWidget*) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:838
#18 QtInstance::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&) at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtInstance.cxx:825
#19 Application::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&, vcl::ILibreOfficeKitNotifier const*) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:224
#20 dp_gui::DialogHelper::installExtensionWarn(std::basic_string_view<char16_t, std::char_traits<char16_t>>) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_dialog2.cxx:371
#21 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:477
#22 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
#23 dp_manager::ExtensionManager::checkInstall(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1315
#24 dp_manager::ExtensionManager::doChecksForAddExtension(com::sun::star::uno::Reference<com::sun::star::deployment::XPackageManager> const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:565
#25 dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:655
#26 non-virtual thunk to dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:0
#27 dp_gui::ExtensionCmdQueue::Thread::_addExtension(rtl::Reference<dp_gui::(anonymous namespace)::ProgressCmdEnv> const&, rtl::OUString const&, rtl::OUString const&, bool) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:864
#28 dp_gui::ExtensionCmdQueue::Thread::execute() at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:738
#29 salhelper::Thread::run() at /home/michi/development/git/libreoffice/salhelper/source/thread.cxx:39
#30 threadFunc at /home/michi/development/git/libreoffice/include/osl/thread.hxx:190
#31 osl_thread_start_Impl(void*) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:245
#32 start_thread at ./nptl/pthread_create.c:447
#33 clone3 at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80
Change-Id: Ifa84a038fc56f34958cd732caeb9c436b48b3c75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172642
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-08-30 10:12:21 +02:00
|
|
|
{
|
2024-09-27 09:08:43 +02:00
|
|
|
rQtInstance.RunInMainThread([&] { set_label(rText); });
|
tdf#162696 qt weld: Do GUI things in main thread
Creating or modifying native Qt UI elements needs
to happen in the main thread.
This commit takes care of the obvious cases where
such interaction happens.
Otherwise, the tdf#162696 scenario triggers asserts
like the following with a Qt debug build:
ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp, line 958
terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'
Fatal exception: Signal 6
Stack:
#0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
#1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
#2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
#3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
#4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7fdb05455590]
#5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
#6 raise at ./signal/../sysdeps/posix/raise.c:27
#7 abort at ./stdlib/abort.c:81
#8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7fdb050a1a3d]
#9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7fdb050b306a]
#10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
#11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7fdaf0eed562]
#12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
#13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
#14 QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:959
#15 QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:878
#16 QDialog::QDialog(QDialogPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:377
#17 QMessageBox::QMessageBox(QWidget*) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:838
#18 QtInstance::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&) at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtInstance.cxx:825
#19 Application::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&, vcl::ILibreOfficeKitNotifier const*) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:224
#20 dp_gui::DialogHelper::installExtensionWarn(std::basic_string_view<char16_t, std::char_traits<char16_t>>) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_dialog2.cxx:371
#21 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:477
#22 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
#23 dp_manager::ExtensionManager::checkInstall(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1315
#24 dp_manager::ExtensionManager::doChecksForAddExtension(com::sun::star::uno::Reference<com::sun::star::deployment::XPackageManager> const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:565
#25 dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:655
#26 non-virtual thunk to dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:0
#27 dp_gui::ExtensionCmdQueue::Thread::_addExtension(rtl::Reference<dp_gui::(anonymous namespace)::ProgressCmdEnv> const&, rtl::OUString const&, rtl::OUString const&, bool) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:864
#28 dp_gui::ExtensionCmdQueue::Thread::execute() at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:738
#29 salhelper::Thread::run() at /home/michi/development/git/libreoffice/salhelper/source/thread.cxx:39
#30 threadFunc at /home/michi/development/git/libreoffice/include/osl/thread.hxx:190
#31 osl_thread_start_Impl(void*) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:245
#32 start_thread at ./nptl/pthread_create.c:447
#33 clone3 at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80
Change-Id: Ifa84a038fc56f34958cd732caeb9c436b48b3c75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172642
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-08-30 10:12:21 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-08-06 14:58:12 +02:00
|
|
|
assert(m_pButton);
|
|
|
|
m_pButton->setText(toQString(rText));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QtInstanceButton::set_image(VirtualDevice* /*pDevice*/)
|
|
|
|
{
|
|
|
|
assert(false && "Not implemented yet");
|
|
|
|
}
|
|
|
|
|
|
|
|
void QtInstanceButton::set_image(const css::uno::Reference<css::graphic::XGraphic>& /*rImage*/)
|
|
|
|
{
|
|
|
|
assert(false && "Not implemented yet");
|
|
|
|
}
|
|
|
|
|
2024-10-24 00:03:33 +02:00
|
|
|
void QtInstanceButton::set_from_icon_name(const OUString& rIconName)
|
2024-08-06 14:58:12 +02:00
|
|
|
{
|
2024-10-24 00:03:33 +02:00
|
|
|
SolarMutexGuard g;
|
|
|
|
GetQtInstance().RunInMainThread([&] {
|
|
|
|
QPixmap aIcon = loadQPixmapIcon(rIconName);
|
|
|
|
m_pButton->setIcon(aIcon);
|
|
|
|
});
|
2024-08-06 14:58:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
OUString QtInstanceButton::get_label() const
|
|
|
|
{
|
tdf#162696 qt weld: Do GUI things in main thread
Creating or modifying native Qt UI elements needs
to happen in the main thread.
This commit takes care of the obvious cases where
such interaction happens.
Otherwise, the tdf#162696 scenario triggers asserts
like the following with a Qt debug build:
ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp, line 958
terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'
Fatal exception: Signal 6
Stack:
#0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
#1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
#2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
#3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
#4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7fdb05455590]
#5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
#6 raise at ./signal/../sysdeps/posix/raise.c:27
#7 abort at ./stdlib/abort.c:81
#8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7fdb050a1a3d]
#9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7fdb050b306a]
#10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
#11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7fdaf0eed562]
#12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
#13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
#14 QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:959
#15 QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:878
#16 QDialog::QDialog(QDialogPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:377
#17 QMessageBox::QMessageBox(QWidget*) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:838
#18 QtInstance::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&) at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtInstance.cxx:825
#19 Application::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&, vcl::ILibreOfficeKitNotifier const*) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:224
#20 dp_gui::DialogHelper::installExtensionWarn(std::basic_string_view<char16_t, std::char_traits<char16_t>>) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_dialog2.cxx:371
#21 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:477
#22 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
#23 dp_manager::ExtensionManager::checkInstall(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1315
#24 dp_manager::ExtensionManager::doChecksForAddExtension(com::sun::star::uno::Reference<com::sun::star::deployment::XPackageManager> const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:565
#25 dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:655
#26 non-virtual thunk to dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:0
#27 dp_gui::ExtensionCmdQueue::Thread::_addExtension(rtl::Reference<dp_gui::(anonymous namespace)::ProgressCmdEnv> const&, rtl::OUString const&, rtl::OUString const&, bool) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:864
#28 dp_gui::ExtensionCmdQueue::Thread::execute() at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:738
#29 salhelper::Thread::run() at /home/michi/development/git/libreoffice/salhelper/source/thread.cxx:39
#30 threadFunc at /home/michi/development/git/libreoffice/include/osl/thread.hxx:190
#31 osl_thread_start_Impl(void*) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:245
#32 start_thread at ./nptl/pthread_create.c:447
#33 clone3 at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80
Change-Id: Ifa84a038fc56f34958cd732caeb9c436b48b3c75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172642
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-08-30 10:12:21 +02:00
|
|
|
SolarMutexGuard g;
|
2024-09-27 09:08:43 +02:00
|
|
|
QtInstance& rQtInstance = GetQtInstance();
|
|
|
|
if (!rQtInstance.IsMainThread())
|
tdf#162696 qt weld: Do GUI things in main thread
Creating or modifying native Qt UI elements needs
to happen in the main thread.
This commit takes care of the obvious cases where
such interaction happens.
Otherwise, the tdf#162696 scenario triggers asserts
like the following with a Qt debug build:
ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp, line 958
terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'
Fatal exception: Signal 6
Stack:
#0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
#1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
#2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
#3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
#4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7fdb05455590]
#5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
#6 raise at ./signal/../sysdeps/posix/raise.c:27
#7 abort at ./stdlib/abort.c:81
#8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7fdb050a1a3d]
#9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7fdb050b306a]
#10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
#11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7fdaf0eed562]
#12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
#13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
#14 QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:959
#15 QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:878
#16 QDialog::QDialog(QDialogPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:377
#17 QMessageBox::QMessageBox(QWidget*) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:838
#18 QtInstance::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&) at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtInstance.cxx:825
#19 Application::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&, vcl::ILibreOfficeKitNotifier const*) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:224
#20 dp_gui::DialogHelper::installExtensionWarn(std::basic_string_view<char16_t, std::char_traits<char16_t>>) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_dialog2.cxx:371
#21 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:477
#22 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
#23 dp_manager::ExtensionManager::checkInstall(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1315
#24 dp_manager::ExtensionManager::doChecksForAddExtension(com::sun::star::uno::Reference<com::sun::star::deployment::XPackageManager> const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:565
#25 dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:655
#26 non-virtual thunk to dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:0
#27 dp_gui::ExtensionCmdQueue::Thread::_addExtension(rtl::Reference<dp_gui::(anonymous namespace)::ProgressCmdEnv> const&, rtl::OUString const&, rtl::OUString const&, bool) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:864
#28 dp_gui::ExtensionCmdQueue::Thread::execute() at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:738
#29 salhelper::Thread::run() at /home/michi/development/git/libreoffice/salhelper/source/thread.cxx:39
#30 threadFunc at /home/michi/development/git/libreoffice/include/osl/thread.hxx:190
#31 osl_thread_start_Impl(void*) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:245
#32 start_thread at ./nptl/pthread_create.c:447
#33 clone3 at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80
Change-Id: Ifa84a038fc56f34958cd732caeb9c436b48b3c75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172642
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-08-30 10:12:21 +02:00
|
|
|
{
|
|
|
|
OUString sLabel;
|
2024-09-27 09:08:43 +02:00
|
|
|
rQtInstance.RunInMainThread([&] { sLabel = get_label(); });
|
tdf#162696 qt weld: Do GUI things in main thread
Creating or modifying native Qt UI elements needs
to happen in the main thread.
This commit takes care of the obvious cases where
such interaction happens.
Otherwise, the tdf#162696 scenario triggers asserts
like the following with a Qt debug build:
ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp, line 958
terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'
Fatal exception: Signal 6
Stack:
#0 sal::backtrace_get(unsigned int) at /home/michi/development/git/libreoffice/sal/osl/unx/backtraceapi.cxx:42
#1 (anonymous namespace)::printStack(int) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:289
#2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:330
#3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at /home/michi/development/git/libreoffice/sal/osl/unx/signal.cxx:427
#4 /lib/x86_64-linux-gnu/libc.so.6(+0x3f590) [0x7fdb05455590]
#5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44 (discriminator 1)
#6 raise at ./signal/../sysdeps/posix/raise.c:27
#7 abort at ./stdlib/abort.c:81
#8 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a3d) [0x7fdb050a1a3d]
#9 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xb306a) [0x7fdb050b306a]
#10 std::unexpected() in /lib/x86_64-linux-gnu/libstdc++.so.6
#11 /home/michi/development/git/qt5/qtbase/lib/libQt6Core.so.6(+0xed562) [0x7fdaf0eed562]
#12 QMessageLogger::fatal() const at /home/michi/development/git/qt5/qtbase/src/corelib/global/qlogging.cpp:901
#13 qt_assert_x(char const*, char const*, char const*, int) at /home/michi/development/git/qt5/qtbase/src/corelib/global/qassert.cpp:0
#14 QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:959
#15 QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:878
#16 QDialog::QDialog(QDialogPrivate&, QWidget*, QFlags<Qt::WindowType>) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qdialog.cpp:377
#17 QMessageBox::QMessageBox(QWidget*) at /home/michi/development/git/qt5/qtbase/src/widgets/dialogs/qmessagebox.cpp:838
#18 QtInstance::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&) at /home/michi/development/git/libreoffice/vcl/qt6/../qt5/QtInstance.cxx:825
#19 Application::CreateMessageDialog(weld::Widget*, VclMessageType, VclButtonsType, rtl::OUString const&, vcl::ILibreOfficeKitNotifier const*) at /home/michi/development/git/libreoffice/vcl/source/window/builder.cxx:224
#20 dp_gui::DialogHelper::installExtensionWarn(std::basic_string_view<char16_t, std::char_traits<char16_t>>) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_dialog2.cxx:371
#21 dp_gui::(anonymous namespace)::ProgressCmdEnv::handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:477
#22 dp_misc::interactContinuation(com::sun::star::uno::Any const&, com::sun::star::uno::Type const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, bool*, bool*) at /home/michi/development/git/libreoffice/desktop/source/deployment/misc/dp_interact.cxx:114
#23 dp_manager::ExtensionManager::checkInstall(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:1315
#24 dp_manager::ExtensionManager::doChecksForAddExtension(com::sun::star::uno::Reference<com::sun::star::deployment::XPackageManager> const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage> const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&, com::sun::star::uno::Reference<com::sun::star::deployment::XPackage>&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:565
#25 dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:655
#26 non-virtual thunk to dp_manager::ExtensionManager::addExtension(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::task::XAbortChannel> const&, com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> const&) at /home/michi/development/git/libreoffice/desktop/source/deployment/manager/dp_extensionmanager.cxx:0
#27 dp_gui::ExtensionCmdQueue::Thread::_addExtension(rtl::Reference<dp_gui::(anonymous namespace)::ProgressCmdEnv> const&, rtl::OUString const&, rtl::OUString const&, bool) at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:864
#28 dp_gui::ExtensionCmdQueue::Thread::execute() at /home/michi/development/git/libreoffice/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:738
#29 salhelper::Thread::run() at /home/michi/development/git/libreoffice/salhelper/source/thread.cxx:39
#30 threadFunc at /home/michi/development/git/libreoffice/include/osl/thread.hxx:190
#31 osl_thread_start_Impl(void*) at /home/michi/development/git/libreoffice/sal/osl/unx/thread.cxx:245
#32 start_thread at ./nptl/pthread_create.c:447
#33 clone3 at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80
Change-Id: Ifa84a038fc56f34958cd732caeb9c436b48b3c75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172642
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-08-30 10:12:21 +02:00
|
|
|
return sLabel;
|
|
|
|
}
|
|
|
|
|
2024-08-06 14:58:12 +02:00
|
|
|
assert(m_pButton);
|
|
|
|
return toOUString(m_pButton->text());
|
|
|
|
}
|
|
|
|
|
|
|
|
void QtInstanceButton::set_font(const vcl::Font& /*rFont*/)
|
|
|
|
{
|
|
|
|
assert(false && "Not implemented yet");
|
|
|
|
}
|
|
|
|
|
|
|
|
void QtInstanceButton::set_custom_button(VirtualDevice* /*pDevice*/)
|
|
|
|
{
|
|
|
|
assert(false && "Not implemented yet");
|
|
|
|
}
|
|
|
|
|
2024-10-25 10:37:07 +02:00
|
|
|
void QtInstanceButton::connect_clicked(const Link<Button&, void>& rLink)
|
|
|
|
{
|
|
|
|
weld::Button::connect_clicked(rLink);
|
|
|
|
m_pButton->setProperty(PROPERTY_CLICK_HANDLER_SET, QVariant::fromValue(rLink.IsSet()));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QtInstanceButton::hasCustomClickHandler(QAbstractButton& rButton)
|
|
|
|
{
|
|
|
|
QVariant aProp = rButton.property(PROPERTY_CLICK_HANDLER_SET);
|
|
|
|
if (!aProp.isValid())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
assert(aProp.canConvert<bool>());
|
|
|
|
return aProp.toBool();
|
|
|
|
}
|
|
|
|
|
tdf#130857 qt weld: Hold SolarMutex in QtInstanceButton::buttonClicked
Hold the SolarMutex when calling the button clicked
handler.
Otherwise, opening Writer's "Tools" -> "Footnote/Endnote Settings"
dialog and closing with the "OK" button triggers an assert when
using native Qt widgets (i.e. with env var
SAL_VCL_QT_USE_WELDED_WIDGETS=1 set).
Backtrace:
1 __pthread_kill_implementation pthread_kill.c 44 0x7ffff789de5c
2 __pthread_kill_internal pthread_kill.c 78 0x7ffff789debf
3 __GI_raise raise.c 26 0x7ffff7849c82
4 __GI_abort abort.c 79 0x7ffff78324f0
5 __assert_fail_base assert.c 94 0x7ffff7832418
6 __assert_fail assert.c 103 0x7ffff7842592
7 ImplDbgTestSolarMutex dbggui.cxx 35 0x7fffeec2eb1e
8 DbgTestSolarMutex debug.cxx 54 0x7ffff6d2bee0
9 SwModify::Add calbck.cxx 174 0x7fffbe3b9f49
10 SwClient::SwClient calbck.hxx 428 0x7fffbe3be8bb
11 sw::ListenerEntry::ListenerEntry calbck.hxx 241 0x7fffbe3be845
12 std::construct_at<sw::ListenerEntry, SwClient *, SwModify *&> stl_construct.h 97 0x7fffbe3be80f
13 std::allocator_traits<std::allocator<sw::ListenerEntry>>::construct<sw::ListenerEntry, SwClient *, SwModify *&> alloc_traits.h 571 0x7fffbe3be5ec
14 std::__cxx1998::vector<sw::ListenerEntry>::_M_realloc_append<SwClient *, SwModify *&> vector.tcc 634 0x7fffbe3be5ec
15 std::__cxx1998::vector<sw::ListenerEntry>::emplace_back<SwClient *, SwModify *&> vector.tcc 123 0x7fffbe3be3ca
16 std::vector<sw::ListenerEntry>::emplace_back<SwClient *, SwModify *&> vector 599 0x7fffbe3bd80a
17 sw::WriterMultiListener::StartListening calbck.cxx 262 0x7fffbe3bb65d
18 SwEndNoteInfo::GetCharFormat docftn.cxx 166 0x7fffbe6911c1
19 (anonymous namespace)::lcl_ResetPoolIdForDocAndSync docftn.cxx 186 0x7fffbe69130b
20 SwEndNoteInfo::SetCharFormat docftn.cxx 193 0x7fffbe691223
21 SwEndNoteOptionPage::FillItemSet docfnote.cxx 342 0x7fffa88bdb58
22 SwFootNoteOptionDlg::OkHdl docfnote.cxx 60 0x7fffa88bb484
23 SwFootNoteOptionDlg::LinkStubOkHdl docfnote.cxx 55 0x7fffa88bb19d
24 Link<weld::Button&, void>::Call link.hxx 111 0x7fffe4732de1
25 weld::Button::signal_clicked weld.hxx 1519 0x7fffe47323ac
26 QtInstanceButton::buttonClicked QtInstanceButton.cxx 102 0x7fffe473076c
27 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtInstanceButton:: *)()>::call(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *)::{lambda()#1}::operator()() const qobjectdefs_impl.h 127 0x7fffe47332b1
28 QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtInstanceButton:: *)()>::call(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *)::{lambda()#1}>(void * *, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtInstanceButton:: *)()>::call(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *)::{lambda()#1}&&) qobjectdefs_impl.h 65 0x7fffe47331e9
29 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtInstanceButton:: *)()>::call(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *) qobjectdefs_impl.h 126 0x7fffe473311b
30 QtPrivate::FunctionPointer<void (QtInstanceButton:: *)()>::call<QtPrivate::List<>, void>(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *) qobjectdefs_impl.h 174 0x7fffe473309d
31 QtPrivate::QCallableObject<void (QtInstanceButton:: *)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void * *, bool *) qobjectdefs_impl.h 545 0x7fffe4732fc6
32 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 461 0x7fffe385ace2
33 doActivate<false> qobject.cpp 4127 0x7fffe3919054
34 QMetaObject::activate qobject.cpp 4187 0x7fffe390ecf3
35 QAbstractButton::clicked moc_qabstractbutton.cpp 396 0x7fffe1a24d79
36 QAbstractButtonPrivate::emitClicked qabstractbutton.cpp 381 0x7fffe1a24c77
37 QAbstractButtonPrivate::click qabstractbutton.cpp 374 0x7fffe1a24ad1
38 QAbstractButton::mouseReleaseEvent qabstractbutton.cpp 976 0x7fffe1a25fbf
39 QWidget::event qwidget.cpp 8967 0x7fffe189d44d
40 QAbstractButton::event qabstractbutton.cpp 933 0x7fffe1a25ddc
41 QPushButton::event qpushbutton.cpp 684 0x7fffe1b9c251
42 QApplicationPrivate::notify_helper qapplication.cpp 3296 0x7fffe17e1989
43 QApplication::notify qapplication.cpp 2774 0x7fffe17e366d
44 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1124 0x7fffe3843cca
45 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1582 0x7fffe3844c09
46 QApplicationPrivate::sendMouseEvent qapplication.cpp 2355 0x7fffe17e22a7
47 QWidgetWindow::handleMouseEvent qwidgetwindow.cpp 667 0x7fffe18dc2ff
48 QWidgetWindow::event qwidgetwindow.cpp 299 0x7fffe18daab5
49 QApplicationPrivate::notify_helper qapplication.cpp 3296 0x7fffe17e1989
50 QApplication::notify qapplication.cpp 3247 0x7fffe17e58bd
51 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1124 0x7fffe3843cca
52 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1582 0x7fffe3844c09
53 QGuiApplicationPrivate::processMouseEvent qguiapplication.cpp 2465 0x7fffe267ee7a
54 QGuiApplicationPrivate::processWindowSystemEvent qguiapplication.cpp 2192 0x7fffe267e036
55 QWindowSystemInterface::sendWindowSystemEvents qwindowsysteminterface.cpp 1113 0x7fffe27640ed
56 QWindowSystemInterface::flushWindowSystemEvents qwindowsysteminterface.cpp 1082 0x7fffe2763f9e
57 QtWaylandClient::QWaylandDisplay::flushRequests qwaylanddisplay.cpp 511 0x7fffdfea8575
58 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *)::{lambda()#1}::operator()() const qobjectdefs_impl.h 127 0x7fffdfec3cf5
59 QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *)::{lambda()#1}>(void * *, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *)::{lambda()#1}&&) qobjectdefs_impl.h 65 0x7fffdfec3c1d
60 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *) qobjectdefs_impl.h 126 0x7fffdfec3b3f
61 QtPrivate::FunctionPointer<void (QtWaylandClient::QWaylandDisplay:: *)()>::call<QtPrivate::List<>, void>(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *) qobjectdefs_impl.h 174 0x7fffdfec3ab1
62 QtPrivate::QCallableObject<void (QtWaylandClient::QWaylandDisplay:: *)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void * *, bool *) qobjectdefs_impl.h 545 0x7fffdfec39db
63 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 461 0x7fffe385ace2
64 QMetaCallEvent::placeMetaCall qobject.cpp 621 0x7fffe390376c
65 QObject::event qobject.cpp 1420 0x7fffe39055c0
66 QApplicationPrivate::notify_helper qapplication.cpp 3296 0x7fffe17e1989
67 QApplication::notify qapplication.cpp 3247 0x7fffe17e58bd
68 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1124 0x7fffe3843cca
69 QCoreApplication::sendEvent qcoreapplication.cpp 1568 0x7fffe3844b79
70 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1923 0x7fffe38464b4
71 QCoreApplication::sendPostedEvents qcoreapplication.cpp 1755 0x7fffe38449a1
72 postEventSourceDispatch qeventdispatcher_glib.cpp 246 0x7fffe3e2e311
73 ?? 0x7fffea30c7df
74 ?? 0x7fffea30ea17
75 g_main_context_iteration 0x7fffea30f180
76 QEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 399 0x7fffe3e2d50b
77 QPAEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 89 0x7fffe2f59238
78 QtInstance::ImplYield QtInstance.cxx 464 0x7fffe4709672
79 QtInstance::DoYield QtInstance.cxx 475 0x7fffe470c6f1
80 ImplYield svapp.cxx 385 0x7fffeed0fed6
81 Application::Yield svapp.cxx 473 0x7fffeed0f86f
82 Application::Execute svapp.cxx 360 0x7fffeed0f650
83 desktop::Desktop::Main app.cxx 1679 0x7ffff7b2696b
84 ImplSVMain svmain.cxx 228 0x7fffeed30756
85 SVMain svmain.cxx 246 0x7fffeed32349
86 soffice_main sofficemain.cxx 121 0x7ffff7ba04ba
87 sal_main main.c 51 0x555555555a6d
88 main main.c 49 0x555555555a47
Change-Id: I23aab31c981483830245130cbd06991c1732fc5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176355
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-10 19:19:02 +01:00
|
|
|
void QtInstanceButton::buttonClicked()
|
|
|
|
{
|
|
|
|
SolarMutexGuard g;
|
|
|
|
signal_clicked();
|
|
|
|
}
|
2024-08-06 15:28:58 +02:00
|
|
|
|
2024-11-18 09:33:05 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|