tdf#130857 qt weld: Make opt-in for now
Except for the simple message dialogs created in QtInstance::CreateMessageDialog, disable the use of native Qt dialogs by default for now, and only use those if the user explicitly opts in to use them by setting the SAL_VCL_QT_USE_WELDED_WIDGETS environment variable. While those dialogs declared as supported in QtInstanceBuilder::IsUIFileSupported are meant to be fully functional, they are only a small subset of all LO dialogs and not all properties for widgets are evaluated by QtBuilder at this point in time (e.g. not all spacing, margins, text formatting properties,...). Therefore, default to VclBuilder again for now in order to have a more consistent visual appearance for dialogs with the Qt-based VCL plugins. This can be reconsidered in the future, but at least for 25.2, sticking to VclBuilder by default seems reasonable to me. Change-Id: I7b275d3d3759093a6680327faeb3b86d7c623cea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176013 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
+3
-1
@@ -68,7 +68,9 @@ will be used to write the log under `instdir/uitest/`.
|
||||
* `SAL_VCL_QT_NO_FONTCONFIG` - ignore fontconfig provided font substitutions
|
||||
* `SAL_VCL_QT_NO_NATIVE` - disable `QStyle`'d controls
|
||||
* `SAL_VCL_QT_USE_QFONT` - use `QFont` for text layout and rendering (default is to use cairo)
|
||||
* `SAL_VCL_QT_NO_WELDED_WIDGETS` - disable the use of welded Qt widgets, reverts to previous VCL widget behavior
|
||||
* `SAL_VCL_QT_USE_WELDED_WIDGETS` - enable use of welded Qt widgets also for dialogs created from .ui files
|
||||
* `SAL_VCL_QT_NO_WELDED_WIDGETS` - disable the use of welded Qt widgets completely (also for simple message
|
||||
dialogs), reverts to previous VCL widget behavior
|
||||
|
||||
## Mac
|
||||
|
||||
|
||||
@@ -830,7 +830,10 @@ QWidget* QtInstance::GetNativeParentFromWeldParent(weld::Widget* pParent)
|
||||
std::unique_ptr<weld::Builder>
|
||||
QtInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile)
|
||||
{
|
||||
if (!QtData::noWeldedWidgets() && QtInstanceBuilder::IsUIFileSupported(rUIFile))
|
||||
// for now, require explicitly enabling use of QtInstanceBuilder via SAL_VCL_QT_USE_WELDED_WIDGETS
|
||||
static const bool bUseWeldedWidgets = (getenv("SAL_VCL_QT_USE_WELDED_WIDGETS") != nullptr);
|
||||
if (bUseWeldedWidgets && !QtData::noWeldedWidgets()
|
||||
&& QtInstanceBuilder::IsUIFileSupported(rUIFile))
|
||||
{
|
||||
QWidget* pQtParent = GetNativeParentFromWeldParent(pParent);
|
||||
return std::make_unique<QtInstanceBuilder>(pQtParent, rUIRoot, rUIFile);
|
||||
|
||||
Reference in New Issue
Block a user