Commit 3994e698 authored by Tobias Naetterlund's avatar Tobias Naetterlund Committed by Tobias Nätterlund

BlackBerry: Refactored BarDescriptorDocument

The BarDescriptorDocument now operates directly on the underlying
QDomDocument, and is much better at keeping the tags on their original
lines. Any new values are appended to the end of the document.

A generic API is provided for changing the values inside the document,
BarDescriptorDocument::setValue(..).

BarDescriptorDocument no longer depends on the BarDescriptorEditorWidget, which
should make it easier to implement splitting of the editor.

Task-number: QTCREATORBUG-11012

Change-Id: Icfd681e3af016ea819b99b8cad2cede46600e910
Reviewed-by: Nicolas Arnaud-Cormos's avatarNicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: default avatarMehdi Fekari <mfekari@blackberry.com>
Reviewed-by: default avatarRafael Roquetto <rafael.roquetto@kdab.com>
parent 717e384b
This diff is collapsed.
......@@ -33,8 +33,10 @@
#define QNX_INTERNAL_BARDESCRIPTORDOCUMENT_H
#include <coreplugin/textdocument.h>
#include <utils/environment.h>
#include <QDomNode>
#include <QDomDocument>
#include <QMetaType>
namespace Qnx {
namespace Internal {
......@@ -44,16 +46,44 @@ public:
QString source;
QString destination;
bool entry;
bool operator==(const BarDescriptorAsset &asset) const
{
return source == asset.source && destination == asset.destination;
}
};
class BarDescriptorEditorWidget;
class BarDescriptorDocumentAbstractNodeHandler;
typedef QList<BarDescriptorAsset> BarDescriptorAssetList;
class BarDescriptorDocument : public Core::TextDocument
{
Q_OBJECT
Q_ENUMS(Tag)
public:
explicit BarDescriptorDocument(BarDescriptorEditorWidget *editorWidget);
enum Tag {
id = 0,
versionNumber,
buildId,
name,
description,
icon,
splashScreens,
asset,
aspectRatio,
autoOrients,
systemChrome,
transparent,
arg,
action,
env,
author,
publisher,
authorId
};
explicit BarDescriptorDocument(QObject *parent = 0);
~BarDescriptorDocument();
bool open(QString *errorString, const QString &fileName);
......@@ -71,19 +101,43 @@ public:
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
QString xmlSource() const;
bool loadContent(const QString &xmlSource, QString *errorMessage = 0, int *errorLine = 0);
bool loadContent(const QString &xmlCode, bool setDirty, QString *errorMessage = 0, int *errorLine = 0);
QVariant value(Tag tag) const;
signals:
void changed(BarDescriptorDocument::Tag tag, const QVariant &value);
public slots:
void setValue(BarDescriptorDocument::Tag tag, const QVariant &value);
private:
void registerNodeHandler(BarDescriptorDocumentAbstractNodeHandler *nodeHandler);
BarDescriptorDocumentAbstractNodeHandler *nodeHandlerForDomNode(const QDomNode &node);
void removeUnknownNodeHandlers();
QString stringValue(const QString &tagName) const;
void setStringValue(const QString &tagName, const QString &value);
QList<BarDescriptorDocumentAbstractNodeHandler *> m_nodeHandlers;
QStringList childStringListValue(const QString &tagName, const QString &childTagName) const;
void setChildStringListValue(const QString &tagName, const QString &childTagName, const QStringList &stringList);
BarDescriptorEditorWidget *m_editorWidget;
QStringList stringListValue(const QString &tagName) const;
void setStringListValue(const QString &tagName, const QStringList &stringList);
BarDescriptorAssetList assets() const;
void setAssets(const BarDescriptorAssetList &assets);
QList<Utils::EnvironmentItem> environment() const;
void setEnvironment(const QList<Utils::EnvironmentItem> &environment);
void emitAllChanged();
bool m_dirty;
QDomDocument m_barDocument;
};
} // namespace Internal
} // namespace Qnx
Q_DECLARE_METATYPE(Qnx::Internal::BarDescriptorAssetList)
Q_DECLARE_METATYPE(QList<Utils::EnvironmentItem>)
Q_DECLARE_METATYPE(Qnx::Internal::BarDescriptorDocument::Tag)
#endif // QNX_INTERNAL_BARDESCRIPTORDOCUMENT_H
This diff is collapsed.
/**************************************************************************
**
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
**
** Contact: BlackBerry (qt@blackberry.com)
** Contact: KDAB (info@kdab.com)
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QNX_INTERNAL_BARDESCRIPTORDOCUMENTNODEHANDLERS_H
#define QNX_INTERNAL_BARDESCRIPTORDOCUMENTNODEHANDLERS_H
#include <QDomNode>
#include <QSharedPointer>
namespace Qnx {
namespace Internal {
class BarDescriptorEditorWidget;
class BarDescriptorEditorAssetsWidget;
class BarDescriptorEditorAuthorInformationWidget;
class BarDescriptorEditorEntryPointWidget;
class BarDescriptorEditorEnvironmentWidget;
class BarDescriptorEditorGeneralWidget;
class BarDescriptorEditorPackageInformationWidget;
class BarDescriptorEditorPermissionsWidget;
class BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentAbstractNodeHandler(BarDescriptorEditorWidget *editorWidget);
virtual ~BarDescriptorDocumentAbstractNodeHandler();
virtual bool canHandle(const QDomNode &node) const = 0;
bool handle(const QDomNode &node);
virtual QDomNode toNode(QDomDocument &doc) const = 0;
void clear();
int order() const;
protected:
BarDescriptorEditorPackageInformationWidget *packageInformationWidget() const;
BarDescriptorEditorAuthorInformationWidget *authorInformationWidget() const;
BarDescriptorEditorEntryPointWidget *entryPointWidget() const;
BarDescriptorEditorGeneralWidget *generalWidget() const;
BarDescriptorEditorPermissionsWidget *permissionsWidget() const;
BarDescriptorEditorEnvironmentWidget *environmentWidget() const;
BarDescriptorEditorAssetsWidget *assetsWidget() const;
virtual bool fromNode(const QDomNode &node) = 0;
bool canHandleSimpleTextElement(const QDomNode &node, const QString &tagName) const;
QString loadSimpleTextElement(const QDomNode &node);
QDomElement createSimpleTextElement(QDomDocument &doc, const QString &tagName, const QString &textValue) const;
private:
BarDescriptorEditorWidget *m_editorWidget;
int m_order;
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentIdNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentIdNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentVersionNumberNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentVersionNumberNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentBuildIdNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentBuildIdNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentApplicationNameNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentApplicationNameNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentApplicationDescriptionNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentApplicationDescriptionNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentApplicationIconNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentApplicationIconNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentSplashScreenNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentSplashScreenNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentAssetNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentAssetNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentInitialWindowNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentInitialWindowNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentActionNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentActionNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentArgNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentArgNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentEnvNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentEnvNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentAuthorNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentAuthorNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentAuthorIdNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentAuthorIdNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
};
// ----------------------------------------------------------------------------
class BarDescriptorDocumentUnknownNodeHandler : public BarDescriptorDocumentAbstractNodeHandler
{
public:
BarDescriptorDocumentUnknownNodeHandler(BarDescriptorEditorWidget *editorWidget);
bool canHandle(const QDomNode &node) const;
QDomNode toNode(QDomDocument &doc) const;
protected:
bool fromNode(const QDomNode &node);
private:
QDomNode m_node;
};
} // namespace Internal
} // namespace Qnx
#endif // QNX_INTERNAL_BARDESCRIPTORDOCUMENTNODEHANDLERS_H
......@@ -56,10 +56,10 @@ namespace Internal {
BarDescriptorEditor::BarDescriptorEditor()
{
m_file = new BarDescriptorDocument(this);
BarDescriptorEditorWidget *editorWidget = new BarDescriptorEditorWidget(this);
setWidget(editorWidget);
m_file = new BarDescriptorDocument(editorWidget);
connect(editorWidget, SIGNAL(changed()), m_file, SIGNAL(changed()));
m_toolBar = new QToolBar(editorWidget);
......@@ -106,7 +106,15 @@ BarDescriptorEditor::BarDescriptorEditor()
bool BarDescriptorEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
{
QTC_ASSERT(fileName == realFileName, return false);
return m_file->open(errorString, fileName);
bool result = m_file->open(errorString, fileName);
if (result) {
BarDescriptorEditorWidget *editorWidget = qobject_cast<BarDescriptorEditorWidget *>(widget());
QTC_ASSERT(editorWidget, return false);
editorWidget->setFilePath(fileName);
}
return result;
}
Core::IDocument *BarDescriptorEditor::document()
......@@ -142,31 +150,6 @@ void BarDescriptorEditor::setActivePage(BarDescriptorEditor::EditorPage page)
BarDescriptorEditorWidget *editorWidget = qobject_cast<BarDescriptorEditorWidget *>(widget());
QTC_ASSERT(editorWidget, return);
int prevPage = editorWidget->currentIndex();
if (prevPage == page)
return;
if (page == Source) {
editorWidget->setXmlSource(m_file->xmlSource());
updateCursorPosition();
} else if (prevPage == Source) {
TaskHub::clearTasks(Constants::QNX_TASK_CATEGORY_BARDESCRIPTOR);
QString errorMsg;
int errorLine;
if (!m_file->loadContent(editorWidget->xmlSource(), &errorMsg, &errorLine)) {
TaskHub::addTask(Task::Error, errorMsg, Constants::QNX_TASK_CATEGORY_BARDESCRIPTOR,
Utils::FileName::fromString(m_file->filePath()), errorLine);
TaskHub::requestPopup();
foreach (QAction *action, m_actionGroup->actions())
if (action->data().toInt() == Source)
action->setChecked(true);
return;
}
}
m_cursorPositionAction->setVisible(page == Source);
editorWidget->setCurrentIndex(page);
}
......
......@@ -32,10 +32,12 @@
#include "bardescriptoreditorabstractpanelwidget.h"
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
#include <QCheckBox>
#include <QComboBox>
#include <QLineEdit>
#include <QSignalMapper>
#include <QTextEdit>
using namespace Qnx;
......@@ -44,40 +46,86 @@ using namespace Qnx::Internal;
BarDescriptorEditorAbstractPanelWidget::BarDescriptorEditorAbstractPanelWidget(QWidget *parent) :
QWidget(parent)
{
m_signalMapper = new QSignalMapper(this);
connect(m_signalMapper, SIGNAL(mapped(int)), this, SLOT(handleSignalMapped(int)));
}
void BarDescriptorEditorAbstractPanelWidget::setValue(BarDescriptorDocument::Tag tag, const QVariant &value)
{
if (m_blockedSignals.contains(tag))
return;
blockSignalMapping(tag);
updateWidgetValue(tag, value);
unblockSignalMapping(tag);
}
void BarDescriptorEditorAbstractPanelWidget::setComboBoxBlocked(QComboBox *comboBox, int index)
void BarDescriptorEditorAbstractPanelWidget::addSignalMapping(BarDescriptorDocument::Tag tag, QObject *object, const char *signal)
{
bool blocked = comboBox->blockSignals(true);
comboBox->setCurrentIndex(index);
comboBox->blockSignals(blocked);
m_signalMapper->setMapping(object, tag);
connect(object, signal, m_signalMapper, SLOT(map()));
}
void BarDescriptorEditorAbstractPanelWidget::setCheckBoxBlocked(QCheckBox *checkBox, bool checked)
void BarDescriptorEditorAbstractPanelWidget::blockSignalMapping(BarDescriptorDocument::Tag tag)
{
bool blocked = checkBox->blockSignals(true);
checkBox->setChecked(checked);
checkBox->blockSignals(blocked);
m_blockedSignals.prepend(tag);
}
void BarDescriptorEditorAbstractPanelWidget::setLineEditBlocked(QLineEdit *lineEdit, const QString &text)
void BarDescriptorEditorAbstractPanelWidget::unblockSignalMapping(BarDescriptorDocument::Tag tag)
{
bool blocked = lineEdit->blockSignals(true);
lineEdit->setText(text);
lineEdit->blockSignals(blocked);
BarDescriptorDocument::Tag removedTag = m_blockedSignals.takeFirst();
QTC_CHECK(removedTag == tag);
}
void BarDescriptorEditorAbstractPanelWidget::setTextEditBlocked(QTextEdit *textEdit, const QString &text)
void BarDescriptorEditorAbstractPanelWidget::updateWidgetValue(BarDescriptorDocument::Tag tag, const QVariant &value)
{
bool blocked = textEdit->blockSignals(true);
textEdit->setPlainText(text);
textEdit->blockSignals(blocked);
QObject *object = m_signalMapper->mapping(static_cast<int>(tag));
if (!object)
return;
if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(object))
lineEdit->setText(value.toString());
else if (QTextEdit *textEdit = qobject_cast<QTextEdit *>(object))
textEdit->setPlainText(value.toString());
else if (Utils::PathChooser *pathChooser = qobject_cast<Utils::PathChooser *>(object))
pathChooser->setPath(value.toString());
else if (QComboBox *comboBox = qobject_cast<QComboBox *>(object))
comboBox->setCurrentIndex(comboBox->findData(value.toString()));
else if (QCheckBox *checkBox = qobject_cast<QCheckBox *>(object))
checkBox->setChecked(value.toBool());
else
QTC_CHECK(false);
}
void BarDescriptorEditorAbstractPanelWidget::setPathChooserBlocked(Utils::PathChooser *pathChooser, const QString &path)
void BarDescriptorEditorAbstractPanelWidget::emitChanged(BarDescriptorDocument::Tag tag)
{
bool blocked = pathChooser->blockSignals(true);
pathChooser->setPath(path);
pathChooser->blockSignals(blocked);
QObject *sender = m_signalMapper->mapping(tag);
if (!sender)
return;
if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(sender))
emit changed(tag, lineEdit->text());
else if (QTextEdit *textEdit = qobject_cast<QTextEdit *>(sender))
emit changed(tag, textEdit->toPlainText());
else if (Utils::PathChooser *pathChooser = qobject_cast<Utils::PathChooser *>(sender))
emit changed(tag, pathChooser->path());
else if (QComboBox *comboBox = qobject_cast<QComboBox *>(sender))
emit changed(tag, comboBox->itemData(comboBox->currentIndex()));
else if (QCheckBox *checkBox = qobject_cast<QCheckBox *>(sender))
emit changed(tag, checkBox->isChecked());
else
QTC_CHECK(false);
}
void BarDescriptorEditorAbstractPanelWidget::handleSignalMapped(int id)
{
BarDescriptorDocument::Tag tag = static_cast<BarDescriptorDocument::Tag>(id);
if (m_blockedSignals.contains(tag))
return;
blockSignalMapping(tag);
emitChanged(tag);
unblockSignalMapping(tag);
}
......@@ -34,6 +34,8 @@
#include <QWidget>
#include "bardescriptordocument.h"
namespace Utils {
class PathChooser;
}
......@@ -42,6 +44,8 @@ QT_BEGIN_NAMESPACE
class QCheckBox;
class QComboBox;
class QLineEdit;
class QSignalMapper;
class QStringListModel;
class QTextEdit;
QT_END_NAMESPACE
......@@ -54,17 +58,26 @@ class BarDescriptorEditorAbstractPanelWidget : public QWidget
public:
explicit BarDescriptorEditorAbstractPanelWidget(QWidget *parent = 0);
virtual void clear() = 0;
public slots:
void setValue(BarDescriptorDocument::Tag tag, const QVariant &value);
signals:
void changed();
void changed(BarDescriptorDocument::Tag tag, const QVariant &value);
protected:
void setComboBoxBlocked(QComboBox *comboBox, int index);
void setCheckBoxBlocked(QCheckBox *checkBox, bool checked);
void setLineEditBlocked(QLineEdit *lineEdit, const QString &text);
void setTextEditBlocked(QTextEdit *textEdit, const QString &text);
void setPathChooserBlocked(Utils::PathChooser *pathChooser, const QString &path);
virtual void updateWidgetValue(BarDescriptorDocument::Tag tag, const QVariant &value);
virtual void emitChanged(BarDescriptorDocument::Tag tag);
void addSignalMapping(BarDescriptorDocument::Tag tag, QObject *object, const char *signal);
void blockSignalMapping(BarDescriptorDocument::Tag tag);
void unblockSignalMapping(BarDescriptorDocument::Tag tag);
private slots:
void handleSignalMapped(int id);
private:
QSignalMapper *m_signalMapper;
QList<BarDescriptorDocument::Tag> m_blockedSignals;
};
} // namespace Internal
......
......@@ -57,7 +57,10 @@ BarDescriptorEditorAssetsWidget::BarDescriptorEditorAssetsWidget(QWidget *parent
connect(m_ui->addAsset, SIGNAL(clicked()), this, SLOT(addNewAsset()));
connect(m_ui->removeAsset, SIGNAL(clicked()), this, SLOT(removeSelectedAsset()));
connect(m_assetsModel, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(updateEntryCheckState(QStandardItem*)));
connectAssetsModel();
addSignalMapping(BarDescriptorDocument::asset, m_assetsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
addSignalMapping(BarDescriptorDocument::asset, m_assetsModel, SIGNAL(rowsInserted(QModelIndex,int,int)));
addSignalMapping(BarDescriptorDocument::asset, m_assetsModel, SIGNAL(rowsRemoved(QModelIndex,int,int)));
}
BarDescriptorEditorAssetsWidget::~BarDescriptorEditorAssetsWidget()
......@@ -67,37 +70,27 @@ BarDescriptorEditorAssetsWidget::~BarDescriptorEditorAssetsWidget()
void BarDescriptorEditorAssetsWidget::clear()
{
// We can't just block signals, as the view depends on them
disconnectAssetsModel();
blockSignalMapping(BarDescriptorDocument::asset);
m_assetsModel->removeRows(0, m_assetsModel->rowCount());
connectAssetsModel();
unblockSignalMapping(BarDescriptorDocument::asset);
}
void BarDescriptorEditorAssetsWidget::addAsset(const BarDescriptorAsset &asset)
QStandardItemModel *BarDescriptorEditorAssetsWidget::assetsModel() const
{
disconnectAssetsModel();
addAssetInternal(asset);
connectAssetsModel();
return m_assetsModel;
}