Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:rhabacker:branches:windows:mingw:win64
mingw64-libqt4
0001-designer-Add-command-line-option-refresh-t...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-designer-Add-command-line-option-refresh-to-update-u.patch of Package mingw64-libqt4
From 7f4d11762c6e5d216bfb0b102f92e1b384990ea2 Mon Sep 17 00:00:00 2001 From: Ralf Habacker <ralf.habacker@freenet.de> Date: Tue, 4 Feb 2020 15:13:31 +0100 Subject: [PATCH] designer: Add command line option '-refresh' to update ui files --- tools/designer/src/designer/qdesigner.cpp | 14 +++++++++++++- tools/designer/src/designer/qdesigner.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/designer/src/designer/qdesigner.cpp b/tools/designer/src/designer/qdesigner.cpp index 8a0d9985a6..930520cca9 100644 --- a/tools/designer/src/designer/qdesigner.cpp +++ b/tools/designer/src/designer/qdesigner.cpp @@ -45,6 +45,7 @@ #include "qdesigner_server.h" #include "qdesigner_settings.h" #include "qdesigner_workbench.h" +#include "qdesigner_formwindow.h" #include "mainwindow.h" #include <qdesigner_propertysheet_p.h> @@ -205,6 +206,10 @@ bool QDesigner::parseCommandLineArgs(QStringList &fileNames, QString &resourceDi QDesignerPropertySheet::setInternalDynamicPropertiesEnabled(true); break; } + if (argument == QLatin1String("-refresh")) { + m_refresh = true; + break; + } const QString msg = QString::fromUtf8("** WARNING Unknown option %1").arg(argument); qWarning("%s", qPrintable(msg)); } while (false); @@ -255,7 +260,14 @@ void QDesigner::initialize() const QFileInfo fi(fileName); if (fi.exists() && fi.isRelative()) fileName = fi.absoluteFilePath(); - m_workbench->readInForm(fileName); + if (m_refresh) { + QString error; + QDesignerFormWindow *w = m_workbench->openForm(fileName, &error); + m_workbench->writeOutForm(w->editor(), fileName); + m_workbench->removeFormWindow(w); + } else + m_workbench->readInForm(fileName); + } } if ( m_workbench->formWindowCount()) diff --git a/tools/designer/src/designer/qdesigner.h b/tools/designer/src/designer/qdesigner.h index 37bf8728a3..58a32b32dd 100644 --- a/tools/designer/src/designer/qdesigner.h +++ b/tools/designer/src/designer/qdesigner.h @@ -95,6 +95,7 @@ private: QString m_initializationErrors; QString m_lastErrorMessage; bool m_suppressNewFormShow; + bool m_refresh{false}; }; QT_END_NAMESPACE -- 2.16.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor