return true;
}
-void FormWindow::setContents(QIODevice *dev)
+bool FormWindow::setContents(QIODevice *dev, QString *errorMessageIn /* = 0 */)
{
UpdateBlocker ub(this);
clearSelection();
QDesignerResource r(this);
QWidget *w = r.load(dev, formContainer());
- setMainContainer(w);
- emit changed();
+ if (w) {
+ setMainContainer(w);
+ emit changed();
+ }
+ if (errorMessageIn)
+ *errorMessageIn = r.errorString();
+ return w != 0;
}
-void FormWindow::setContents(const QString &contents)
+bool FormWindow::setContents(const QString &contents)
{
+ QString errorMessage;
QByteArray data = contents.toUtf8();
QBuffer b(&data);
- if (b.open(QIODevice::ReadOnly))
- setContents(&b);
+ const bool success = b.open(QIODevice::ReadOnly) && setContents(&b, &errorMessage);
+ if (!success && !errorMessage.isEmpty())
+ designerWarning(errorMessage);
+ return success;
}
void FormWindow::layoutContainer(QWidget *w, int type)
virtual void setFileName(const QString &fileName);
virtual QString contents() const;
- virtual void setContents(const QString &contents);
- virtual void setContents(QIODevice *dev);
+ virtual bool setContents(QIODevice *dev, QString *errorMessage = 0);
+ virtual bool setContents(const QString &);
virtual QDir absoluteDir() const;
QDesignerResource::QDesignerResource(FormWindow *formWindow) :
QEditorFormBuilder(formWindow->core()),
m_formWindow(formWindow),
- m_topLevelSpacerCount(0),
m_copyWidget(false),
m_selected(0),
m_resourceBuilder(new QDesignerResourceBuilder(m_formWindow->core(), m_formWindow->pixmapCache(), m_formWindow->iconCache()))
{
+ // Check language unless extension present (Jambi)
+ QDesignerFormEditorInterface *core = m_formWindow->core();
+ if (const QDesignerLanguageExtension *le = qt_extension<QDesignerLanguageExtension*>(core->extensionManager(), core))
+ d->m_language = le->name();
+
setWorkingDirectory(formWindow->absoluteDir());
setResourceBuilder(m_resourceBuilder);
setTextBuilder(new QDesignerTextBuilder());
void QDesignerResource::save(QIODevice *dev, QWidget *widget)
{
- m_topLevelSpacerCount = 0;
-
QAbstractFormBuilder::save(dev, widget);
-
- if (QSimpleResource::warningsEnabled() && m_topLevelSpacerCount != 0) {
- const QString message = QApplication::translate("Designer", "This file contains top level spacers.<br>"
- "They have <b>NOT</b> been saved into the form.");
- const QString infoMessage = QApplication::translate("Designer", "Perhaps you forgot to create a layout?");
-
- core()->dialogGui()->message(widget->window(), QDesignerDialogGuiInterface::TopLevelSpacerMessage,
- QMessageBox::Warning, messageBoxTitle(), message, infoMessage,
- QMessageBox::Ok);
- }
}
void QDesignerResource::saveDom(DomUI *ui, QWidget *widget)
}
}
-namespace {
- enum LoadPreCheck { LoadPreCheckFailed, LoadPreCheckVersion3, LoadPreCheckVersionMismatch, LoadPreCheckOk };
- // Pair of major, minor
- typedef QPair<int, int> UiVersion;
-}
-
-static UiVersion uiVersion(const QString &attr)
-{
- const QStringList versions = attr.split(QLatin1Char('.'));
- if (versions.empty())
- return UiVersion(-1, -1);
-
- bool ok = false;
- UiVersion rc(versions.at(0).toInt(&ok), 0);
-
- if (!ok)
- return UiVersion(-1, -1);
-
- if (versions.size() > 1) {
- const int minorVersion = versions.at(1).toInt(&ok);
- if (ok)
- rc.second = minorVersion;
- }
- return rc;
-}
-
-// Read version and language attributes of an <UI> element.
-static bool readUiAttributes(QIODevice *dev, QString *errorMessage,
- QString *version,
- QString *language)
-{
- const QString uiElement = QLatin1String("ui");
- const QString versionAttribute = QLatin1String("version");
- const QString languageAttribute = QLatin1String("language");
- QXmlStreamReader reader(dev);
- // Read up to first element
- while (!reader.atEnd()) {
- if (reader.readNext() == QXmlStreamReader::StartElement) {
- const QStringRef tag = reader.name();
- if (reader.name().compare(uiElement, Qt::CaseInsensitive) == 0) {
- const QXmlStreamAttributes attributes = reader.attributes();
- if (attributes.hasAttribute(versionAttribute))
- *version = attributes.value(versionAttribute).toString();
- if (attributes.hasAttribute(languageAttribute))
- *language = attributes.value(languageAttribute).toString();
- return true;
- } else {
- *errorMessage = QCoreApplication::translate("Designer", "Invalid UI file: The root element <ui> is missing.");
- return false;
-
- }
- }
- }
- *errorMessage = QCoreApplication::translate("Designer", "An error has occurred while reading the UI file at line %1, column %2: %3")
- .arg(reader.lineNumber()).arg(reader.columnNumber()).arg(reader.errorString());
- return false;
-}
-
-// While loading a file, check language, version and extra extension
-static LoadPreCheck loadPrecheck(QDesignerFormEditorInterface *core,
- QIODevice *dev,
- QString *errorMessage, QString *versionString)
-{
- QString language;
- // Read attributes of <ui> and rewind
- if (!readUiAttributes(dev, errorMessage, versionString, &language)) {
- // XML error: Mimick the behaviour occurring if an XML error is
- // detected later on, report to warning log and have embedding
- // application display a dialog.
- designerWarning(*errorMessage);
- errorMessage->clear();
- return LoadPreCheckFailed;
- }
- dev->seek(0);
-
- // Check language unless extension present (Jambi)
- if (!language.isEmpty() && !qt_extension<QDesignerLanguageExtension*>(core->extensionManager(), core)) {
- if (language.toLower() != QLatin1String("c++")) {
- // Jambi?!
- *errorMessage = QApplication::translate("Designer", "This file cannot be read because it was created using %1.").arg(language);
- return LoadPreCheckFailed;
- }
- }
-
- // Version
- if (!versionString->isEmpty()) {
- const UiVersion version = uiVersion(*versionString);
- switch (version.first) {
- case 3:
- return LoadPreCheckVersion3;
- case 4:
- break;
- default:
- *errorMessage = QApplication::translate("Designer", "This file was created using Designer from Qt-%1 and cannot be read.").arg(*versionString);
- return LoadPreCheckVersionMismatch;
- }
- }
- return LoadPreCheckOk;
-}
-
QWidget *QDesignerResource::load(QIODevice *dev, QWidget *parentWidget)
{
- // Run loadPreCheck for version and language
- QString errorMessage;
- QString version;
- switch (loadPrecheck(core(), dev, &errorMessage, &version)) {
- case LoadPreCheckFailed:
- case LoadPreCheckVersionMismatch:
- if (!errorMessage.isEmpty())
- core()->dialogGui()->message(parentWidget->window(), QDesignerDialogGuiInterface::FormLoadFailureMessage,
- QMessageBox::Warning, messageBoxTitle(), errorMessage, QMessageBox::Ok);
- return 0;
- case LoadPreCheckVersion3: {
- QWidget *w = 0;
- QByteArray ba;
- if (runUIC( m_formWindow->fileName(), UIC_ConvertV3, ba, errorMessage)) {
- QBuffer buffer(&ba);
- buffer.open(QIODevice::ReadOnly);
- w = load(&buffer, parentWidget);
- if (w) {
- // Force the form to pop up a save file dialog
- m_formWindow->setFileName(QString());
- } else {
- errorMessage = QApplication::translate("Designer", "The converted file could not be read.");
- }
- }
- if (w) {
- const QString message = QApplication::translate("Designer",
- "This file was created using Designer from Qt-%1 and"
- " will be converted to a new form by Qt Designer.").arg(version);
- const QString infoMessage = QApplication::translate("Designer",
- "The old form has not been touched, but you will have to save the form"
- " under a new name.");
-
- core()->dialogGui()->message(parentWidget->window(),
- QDesignerDialogGuiInterface::UiVersionMismatchMessage,
- QMessageBox::Information, messageBoxTitle(), message, infoMessage,
- QMessageBox::Ok);
- return w;
- }
-
- const QString message = QApplication::translate("Designer",
- "This file was created using Designer from Qt-%1 and "
- "could not be read:\n%2").arg(version).arg(errorMessage);
- const QString infoMessage = QApplication::translate("Designer",
- "Please run it through <b>uic3 -convert</b> to convert "
- "it to Qt-4's ui format.");
- core()->dialogGui()->message(parentWidget->window(), QDesignerDialogGuiInterface::FormLoadFailureMessage,
- QMessageBox::Warning, messageBoxTitle(), message, infoMessage,
- QMessageBox::Ok);
- return 0;
- }
-
- case LoadPreCheckOk:
- break;
- }
QWidget *w = QEditorFormBuilder::load(dev, parentWidget);
- if (w) // Store the class name as 'reset' value for the main container's object name.
+ if (w) // Store the class name as 'reset' value for the main container's object name.
w->setProperty("_q_classname", w->objectName());
return w;
}
{
if (ui_layoutItem->kind() == DomLayoutItem::Spacer) {
const DomSpacer *domSpacer = ui_layoutItem->elementSpacer();
- const QHash<QString, DomProperty*> properties = propertyMap(domSpacer->elementProperty());
Spacer *spacer = static_cast<Spacer*>(core()->widgetFactory()->createWidget(QLatin1String("Spacer"), parentWidget));
if (domSpacer->hasAttributeName())
changeObjectName(spacer, domSpacer->attributeName());
if (!item)
return 0;
- if (qobject_cast<Spacer*>(widget) && m_copyWidget == false) {
- ++m_topLevelSpacerCount;
+ if (qobject_cast<Spacer*>(widget) && m_copyWidget == false)
return 0;
- }
const QDesignerWidgetDataBaseInterface *wdb = core()->widgetDataBase();
QDesignerWidgetDataBaseItemInterface *widgetInfo = 0;
if (DomWidget *ui_page = createDom(page, ui_widget)) {
ui_widget_list.append(ui_page);
} else {
- if (QSimpleResource::warningsEnabled())
- designerWarning(msgUnmanagedPage(core(), widget, i, page));
+ designerWarning(msgUnmanagedPage(core(), widget, i, page));
}
}
if (DomWidget *ui_page = createDom(page, ui_widget)) {
ui_widget_list.append(ui_page);
} else {
- if (QSimpleResource::warningsEnabled())
- designerWarning(msgUnmanagedPage(core(), widget, i, page));
+ designerWarning(msgUnmanagedPage(core(), widget, i, page));
}
}
}
DomWidget *ui_page = createDom(page, ui_widget);
if (!ui_page) {
- if (QSimpleResource::warningsEnabled())
- designerWarning(msgUnmanagedPage(core(), widget, i, page));
+ designerWarning(msgUnmanagedPage(core(), widget, i, page));
continue;
}
QList<DomProperty*> ui_attribute_list;
DomWidget *ui_page = createDom(page, ui_widget);
if (!ui_page) {
- if (QSimpleResource::warningsEnabled())
- designerWarning(msgUnmanagedPage(core(), widget, i, page));
+ designerWarning(msgUnmanagedPage(core(), widget, i, page));
continue;
}
bool saveRelative() const;
void setSaveRelative(bool relative);
- virtual QWidget *load(QIODevice *dev, QWidget *parentWidget = 0);
+ virtual QWidget *load(QIODevice *dev, QWidget *parentWidget);
protected:
using QEditorFormBuilder::create;
QHash<QString, QString> m_qt_to_internal;
QStack<QLayout*> m_chain;
QHash<QDesignerWidgetDataBaseItemInterface*, bool> m_usedCustomWidgets;
- int m_topLevelSpacerCount;
bool m_copyWidget;
QWidget *m_selected;
class QDesignerResourceBuilder *m_resourceBuilder;
#include <qdesigner_formbuilder_p.h>
#include <qdesigner_utils_p.h>
#include <iconloader_p.h>
-#include <qsimpleresource_p.h>
#include <previewmanager_p.h>
#include <codedialog_p.h>
#include <qdesigner_formwindowmanager_p.h>
QFile::remove(backupFile);
}
-bool QDesignerActions::writeOutForm(QDesignerFormWindowInterface *fw, const QString &saveFile)
+bool QDesignerActions::writeOutForm(QDesignerFormWindowInterface *fw, const QString &saveFile, bool check)
{
Q_ASSERT(fw && !saveFile.isEmpty());
if (fi.exists())
backupFile = createBackup(saveFile);
+ if (check) {
+ const QStringList problems = fw->checkContents();
+ if (!problems.isEmpty())
+ QMessageBox::information(fw->window(), tr("Qt Designer"), problems.join(QLatin1String("<br>")));
+ }
+
QString contents = fw->contents();
if (qdesigner_internal::FormWindowBase *fwb = qobject_cast<qdesigner_internal::FormWindowBase *>(fw)) {
if (fwb->lineTerminatorMode() == qdesigner_internal::FormWindowBase::CRLFLineTerminator)
QStringList tmpFiles;
QMap<QString, QString> backupMap;
QDir backupDir(m_backupPath);
- const bool warningsEnabled = qdesigner_internal::QSimpleResource::setWarningsEnabled(false);
for (int i = 0; i < count; ++i) {
QDesignerFormWindow *fw = m_workbench->formWindow(i);
QDesignerFormWindowInterface *fwi = fw->editor();
file.close();
}
}
- qdesigner_internal::QSimpleResource::setWarningsEnabled(warningsEnabled);
if(!tmpFiles.isEmpty()) {
const QStringList backupFiles = backupDir.entryList(QDir::Files);
if(!backupFiles.isEmpty()) {
bool saveForm(QDesignerFormWindowInterface *fw);
bool readInForm(const QString &fileName);
- bool writeOutForm(QDesignerFormWindowInterface *formWindow, const QString &fileName);
+ bool writeOutForm(QDesignerFormWindowInterface *formWindow, const QString &fileName, bool check = true);
QActionGroup *fileActions() const;
QActionGroup *recentFilesActions() const;
QDesignerFormWindow * QDesignerWorkbench::loadForm(const QString &fileName,
bool detectLineTermiantorMode,
- bool *uic3Converted,
QString *errorMessage)
{
QFile file(fileName);
}
if (!file.open(QFile::ReadOnly|QFile::Text)) {
- *errorMessage = tr("The file <b>%1</b> could not be opened.").arg(file.fileName());
+ *errorMessage = tr("The file <b>%1</b> could not be opened: %1").arg(file.fileName(), file.errorString());
return 0;
}
-
// Create a form
QDesignerFormWindowManagerInterface *formWindowManager = m_core->formWindowManager();
// Temporarily set the file name. It is needed when converting a UIC 3 file.
// In this case, the file name will we be cleared on return to force a save box.
editor->setFileName(fileName);
- editor->setContents(&file);
+
+ if (!editor->setContents(&file, errorMessage)) {
+ removeFormWindow(formWindow);
+ formWindowManager->removeFormWindow(editor);
+ m_core->metaDataBase()->remove(editor);
+ return 0;
+ }
if (qdesigner_internal::FormWindowBase *fwb = qobject_cast<qdesigner_internal::FormWindowBase *>(editor))
fwb->setLineTerminatorMode(mode);
break;
}
- if (!editor->mainContainer()) {
- removeFormWindow(formWindow);
- formWindowManager->removeFormWindow(editor);
- m_core->metaDataBase()->remove(editor);
- *errorMessage = tr("The file <b>%1</b> is not a valid Designer UI file.").arg(file.fileName());
- return 0;
- }
- *uic3Converted = editor->fileName().isEmpty();
// Did user specify another (missing) resource path -> set dirty.
const bool dirty = editor->property("_q_resourcepathchanged").toBool();
editor->setDirty(dirty);
QDesignerFormWindow * QDesignerWorkbench::openForm(const QString &fileName, QString *errorMessage)
{
- bool uic3Converted;
- QDesignerFormWindow *rc =loadForm(fileName, true, &uic3Converted, errorMessage);
+ QDesignerFormWindow *rc = loadForm(fileName, true, errorMessage);
if (!rc)
return 0;
-
- if (!uic3Converted)
- rc->editor()->setFileName(fileName);
+ rc->editor()->setFileName(fileName);
rc->firstShow();
return rc;
}
const QString &editorFileName,
QString *errorMessage)
{
- bool uic3Converted;
- QDesignerFormWindow *rc =loadForm(templateFileName, false, &uic3Converted, errorMessage);
+ QDesignerFormWindow *rc = loadForm(templateFileName, false, errorMessage);
if (!rc)
return 0;
- if (!uic3Converted)
- rc->editor()->setFileName(editorFileName);
-
+ rc->editor()->setFileName(editorFileName);
rc->firstShow();
return rc;
}
QDesignerFormWindowManagerInterface *formWindowManager() const;
void closeAllToolWindows();
QDesignerToolWindow *widgetBoxToolWindow() const;
- QDesignerFormWindow *loadForm(const QString &fileName, bool detectLineTermiantorMode, bool *uic3Converted, QString *errorMessage);
+ QDesignerFormWindow *loadForm(const QString &fileName, bool detectLineTermiantorMode, QString *errorMessage);
void resizeForm(QDesignerFormWindow *fw, const QWidget *mainContainer) const;
void saveGeometriesForModeChange();
void saveGeometries(QDesignerSettings &settings) const;
*/
/*!
- \fn virtual void QDesignerFormWindowInterface::setContents(QIODevice *device)
+ \fn virtual QStringList QDesignerFormWindowInterface::checkContents() const
- Sets the form's contents using data obtained from the given \a device.
+ Performs checks on the current form and returns a list of richtext warnings
+ about potential issues (for example, top level spacers on unlaid-out forms).
+
+ IDE integrations can call this before handling starting a save operation.
+
+ \since 5.0
+*/
+
+/*!
+ \fn virtual bool QDesignerFormWindowInterface::setContents(QIODevice *device, QString *errorMessage = 0)
+
+ Sets the form's contents using data obtained from the given \a device and returns whether
+ loading succeeded. If it fails, the error message is returned in \a errorMessage.
Data can be read from QFile objects or any other subclass of QIODevice.
*/
*/
/*!
- \fn virtual void QDesignerFormWindowInterface::setContents(const QString &contents)
+ \fn virtual bool QDesignerFormWindowInterface::setContents(const QString &contents)
Sets the contents of the form using data read from the specified
- \a contents string.
+ \a contents string and returns whether the operation succeeded.
\sa contents()
*/
virtual QDir absoluteDir() const = 0;
virtual QString contents() const = 0;
- virtual void setContents(QIODevice *dev) = 0;
+ virtual QStringList checkContents() const = 0;
+ virtual bool setContents(QIODevice *dev, QString *errorMessage = 0) = 0;
virtual Feature features() const = 0;
virtual bool hasFeature(Feature f) const = 0;
virtual void selectWidget(QWidget *w, bool select = true) = 0;
virtual void setGrid(const QPoint &grid) = 0;
virtual void setFileName(const QString &fileName) = 0;
- virtual void setContents(const QString &contents) = 0;
+ virtual bool setContents(const QString &contents) = 0;
virtual void editWidgets() = 0;
void activateResourceFilePaths(const QStringList &paths, int *errorCount = 0, QString *errorMessages = 0);
public:
virtual ~QDesignerLanguageExtension() {}
+ /*!
+ Returns the name to be matched against the "language" attribute of the <ui> element.
+
+ \since 5.0
+ */
+
+ virtual QString name() const = 0;
+
virtual QDialog *createFormWindowSettingsDialog(QDesignerFormWindowInterface *formWindow, QWidget *parentWidget) = 0;
virtual QDesignerResourceBrowserInterface *createResourceBrowser(QWidget *parentWidget) = 0;
tempFormFile.close();
// Run uic
QByteArray rc;
- if (!runUIC(tempFormFileName, UIC_GenerateCode, rc, *errorMessage))
+ if (!runUIC(tempFormFileName, rc, *errorMessage))
return false;
*code = QString::fromUtf8(rc);
return true;
#include "grid_p.h"
#include "deviceprofile_p.h"
#include "qdesigner_utils_p.h"
-
-#include "qsimpleresource_p.h"
+#include "spacer_widget_p.h"
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/QDesignerContainerExtension>
QTimer::singleShot(0, action, SIGNAL(triggered()));
}
-QString FormWindowBase::fileContents() const
+QStringList FormWindowBase::checkContents() const
{
- const bool oldValue = QSimpleResource::setWarningsEnabled(false);
- const QString rc = contents();
- QSimpleResource::setWarningsEnabled(oldValue);
- return rc;
+ if (!mainContainer())
+ return QStringList(tr("Invalid form"));
+ // Test for non-laid toplevel spacers, which will not be saved
+ // as not to throw off uic.
+ QStringList problems;
+ foreach (const Spacer *spacer, mainContainer()->findChildren<Spacer *>()) {
+ if (spacer->parentWidget() && !spacer->parentWidget()->layout()) {
+ problems.push_back(tr("<p>This file contains top level spacers.<br>"
+ "They will <b>not</b> be saved.</p><p>"
+ "Perhaps you forgot to create a layout?</p>"));
+ break;
+ }
+ }
+ return problems;
}
} // namespace qdesigner_internal
QVariantMap formData();
void setFormData(const QVariantMap &vm);
- // Return contents without warnings. Should be 'contents(bool quiet)'
- QString fileContents() const;
+ virtual QStringList checkContents() const;
// Deprecated
virtual QPoint grid() const;
m_deviceProfile.style();
}
-QWidget *QDesignerFormBuilder::createWidgetFromContents(const QString &contents, QWidget *parentWidget)
-{
- QByteArray data = contents.toUtf8();
- QBuffer buffer(&data);
- buffer.open(QIODevice::ReadOnly);
- return load(&buffer, parentWidget);
-}
-
QWidget *QDesignerFormBuilder::create(DomUI *ui, QWidget *parentWidget)
{
m_mainWidget = true;
QDesignerFormBuilder builder(fw->core(), EnableScripts, deviceProfile);
builder.setWorkingDirectory(fw->absoluteDir());
- const bool warningsEnabled = QSimpleResource::setWarningsEnabled(false);
QByteArray bytes = fw->contents().toUtf8();
- QSimpleResource::setWarningsEnabled(warningsEnabled);
QBuffer buffer(&bytes);
buffer.open(QIODevice::ReadOnly);
Mode mode,
const DeviceProfile &deviceProfile = DeviceProfile());
- QWidget *createWidgetFromContents(const QString &contents, QWidget *parentWidget = 0);
-
virtual QWidget *createWidget(DomWidget *ui_widget, QWidget *parentWidget = 0)
{ return QFormBuilder::create(ui_widget, parentWidget); }
return action;
}
- QDESIGNER_SHARED_EXPORT bool runUIC(const QString &fileName, UIC_Mode mode, QByteArray& ba, QString &errorMessage)
+ QDESIGNER_SHARED_EXPORT bool runUIC(const QString &fileName, QByteArray& ba, QString &errorMessage)
{
- QStringList argv;
- QString binary = QLibraryInfo::location(QLibraryInfo::BinariesPath);
- binary += QDir::separator();
- switch (mode) {
- case UIC_GenerateCode:
- binary += QLatin1String("uic");
- break;
- case UIC_ConvertV3:
- binary += QLatin1String("uic3");
- argv += QLatin1String("-convert");
- break;
- }
- argv += fileName;
+ const QString binary = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/uic");
QProcess uic;
- uic.start(binary, argv);
+ uic.start(binary, QStringList(fileName));
if (!uic.waitForStarted()) {
errorMessage = QApplication::translate("Designer", "Unable to launch %1.").arg(binary);
return false;
QDESIGNER_SHARED_EXPORT QAction *preferredEditAction(QDesignerFormEditorInterface *core, QWidget *managedWidget);
// Convenience to run UIC
-enum UIC_Mode { UIC_GenerateCode, UIC_ConvertV3 };
-QDESIGNER_SHARED_EXPORT bool runUIC(const QString &fileName, UIC_Mode mode, QByteArray& ba, QString &errorMessage);
+QDESIGNER_SHARED_EXPORT bool runUIC(const QString &fileName, QByteArray& ba, QString &errorMessage);
// Find a suitable variable name for a class.
QDESIGNER_SHARED_EXPORT QString qtify(const QString &name);
return QString();
}
-bool QSimpleResource::setWarningsEnabled(bool warningsEnabled)
-{
- const bool rc = m_warningsEnabled;
- m_warningsEnabled = warningsEnabled;
- return rc;
-}
-
-bool QSimpleResource::warningsEnabled()
-{
- return m_warningsEnabled;
-}
-
// Custom widgets handling helpers
// Add unique fake slots and signals to lists
QDesignerFormEditorInterface *core,
DomWidget *ui_widget, QWidget *widget,
bool applyState);
- // Enable warnings while saving. Turn off for backups.
- static bool setWarningsEnabled(bool warningsEnabled);
- static bool warningsEnabled();
// Return the script returned by the CustomWidget codeTemplate API
static QString customWidgetScript(QDesignerFormEditorInterface *core, QObject *object);
static QString customWidgetScript(QDesignerFormEditorInterface *core, const QString &className);