diff options
Diffstat (limited to 'tools/designer/src/lib/shared')
4 files changed, 15 insertions, 1 deletions
diff --git a/tools/designer/src/lib/shared/qdesigner_formbuilder.cpp b/tools/designer/src/lib/shared/qdesigner_formbuilder.cpp index 454439eba5..5e3a9b6c45 100644 --- a/tools/designer/src/lib/shared/qdesigner_formbuilder.cpp +++ b/tools/designer/src/lib/shared/qdesigner_formbuilder.cpp @@ -83,6 +83,7 @@ QT_BEGIN_NAMESPACE +#ifndef QT_FORMBUILDER_NO_SCRIPT static QString summarizeScriptErrors(const QFormScriptRunner::Errors &errors) { QString rc = QCoreApplication::translate("QDesignerFormBuilder", "Script errors occurred:"); @@ -92,6 +93,7 @@ static QString summarizeScriptErrors(const QFormScriptRunner::Errors &errors) } return rc; } +#endif namespace qdesigner_internal { @@ -108,6 +110,7 @@ QDesignerFormBuilder::QDesignerFormBuilder(QDesignerFormEditorInterface *core, m_mainWidget(true) { Q_ASSERT(m_core); +#ifndef QT_FORMBUILDER_NO_SCRIPT // Disable scripting in the editors. QFormScriptRunner::Options options = formScriptRunner()->options(); switch (m_mode) { @@ -120,6 +123,7 @@ QDesignerFormBuilder::QDesignerFormBuilder(QDesignerFormEditorInterface *core, break; } formScriptRunner()-> setOptions(options); +#endif } QString QDesignerFormBuilder::systemStyle() const @@ -400,6 +404,7 @@ QWidget *QDesignerFormBuilder::createPreview(const QDesignerFormWindowInterface WidgetFactory::applyStyleToTopLevel(wf->getStyle(styleToUse), widget); } } +#ifndef QT_FORMBUILDER_NO_SCRIPT // Check for script errors *scriptErrors = builder.formScriptRunner()->errors(); if (!scriptErrors->empty()) { @@ -407,6 +412,7 @@ QWidget *QDesignerFormBuilder::createPreview(const QDesignerFormWindowInterface delete widget; return 0; } +#endif // Fake application style sheet by prepending. (If this doesn't work, fake by nesting // into parent widget). if (!appStyleSheet.isEmpty()) { diff --git a/tools/designer/src/lib/shared/qsimpleresource.cpp b/tools/designer/src/lib/shared/qsimpleresource.cpp index 64e690f342..3c7f0322ac 100644 --- a/tools/designer/src/lib/shared/qsimpleresource.cpp +++ b/tools/designer/src/lib/shared/qsimpleresource.cpp @@ -81,8 +81,10 @@ QSimpleResource::QSimpleResource(QDesignerFormEditorInterface *core) : workingDirectory += QDir::separator(); workingDirectory += QLatin1String(".designer"); setWorkingDirectory(QDir(workingDirectory)); +#ifndef QT_FORMBUILDER_NO_SCRIPT // Disable scripting in the editors. formScriptRunner()-> setOptions(QFormScriptRunner::DisableScripts); +#endif } QSimpleResource::~QSimpleResource() diff --git a/tools/designer/src/lib/shared/scriptdialog.cpp b/tools/designer/src/lib/shared/scriptdialog.cpp index f46c40a927..340bc826f4 100644 --- a/tools/designer/src/lib/shared/scriptdialog.cpp +++ b/tools/designer/src/lib/shared/scriptdialog.cpp @@ -49,7 +49,9 @@ #include <QtGui/QHBoxLayout> #include <QtGui/QDialogButtonBox> #include <QtGui/QMessageBox> +#ifdef QT_SCRIPT_LIB #include <QtScript/QScriptEngine> +#endif QT_BEGIN_NAMESPACE @@ -112,12 +114,16 @@ variables <i>widget</i> and <i>childWidgets</i>, respectively."); const QString script = trimmedScript(); if (script.isEmpty()) return true; +#ifdef QT_SCRIPT_LIB QScriptEngine scriptEngine; if (scriptEngine.canEvaluate(script)) return true; m_dialogGui->message(this, QDesignerDialogGuiInterface::ScriptDialogMessage, QMessageBox::Warning, windowTitle(), tr("Syntax error"), QMessageBox::Ok); return false; +#else + return true; +#endif } } // namespace qdesigner_internal diff --git a/tools/designer/src/lib/shared/shared.pri b/tools/designer/src/lib/shared/shared.pri index 8ed051a5a2..570b2080a0 100644 --- a/tools/designer/src/lib/shared/shared.pri +++ b/tools/designer/src/lib/shared/shared.pri @@ -1,6 +1,6 @@ INCLUDEPATH += $$PWD -QT += script +contains(QT_CONFIG, script): QT += script include($$QT_SOURCE_TREE/tools/shared/qtpropertybrowser/qtpropertybrowser.pri) include($$QT_SOURCE_TREE/tools/shared/deviceskin/deviceskin.pri) |