forked from qt-creator/qt-creator
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
68 lines
1.6 KiB
C++
68 lines
1.6 KiB
C++
// Copyright (C) 2022 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
#include "contentlibrarymaterial.h"
|
|
|
|
namespace QmlDesigner {
|
|
|
|
ContentLibraryMaterial::ContentLibraryMaterial(QObject *parent,
|
|
const QString &name,
|
|
const QString &qml,
|
|
const TypeName &type,
|
|
const QUrl &icon,
|
|
const QStringList &files)
|
|
: QObject(parent), m_name(name), m_qml(qml), m_type(type), m_icon(icon), m_files(files) {}
|
|
|
|
bool ContentLibraryMaterial::filter(const QString &searchText)
|
|
{
|
|
if (m_visible != m_name.contains(searchText, Qt::CaseInsensitive)) {
|
|
m_visible = !m_visible;
|
|
emit materialVisibleChanged();
|
|
}
|
|
|
|
return m_visible;
|
|
}
|
|
|
|
QUrl ContentLibraryMaterial::icon() const
|
|
{
|
|
return m_icon;
|
|
}
|
|
|
|
QString ContentLibraryMaterial::qml() const
|
|
{
|
|
return m_qml;
|
|
}
|
|
|
|
TypeName ContentLibraryMaterial::type() const
|
|
{
|
|
return m_type;
|
|
}
|
|
|
|
QStringList ContentLibraryMaterial::files() const
|
|
{
|
|
return m_files;
|
|
}
|
|
|
|
bool ContentLibraryMaterial::visible() const
|
|
{
|
|
return m_visible;
|
|
}
|
|
|
|
bool ContentLibraryMaterial::setImported(bool imported)
|
|
{
|
|
if (m_imported != imported) {
|
|
m_imported = imported;
|
|
emit materialImportedChanged();
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
bool ContentLibraryMaterial::imported() const
|
|
{
|
|
return m_imported;
|
|
}
|
|
|
|
} // namespace QmlDesigner
|