forked from qt-creator/qt-creator
QmlDesigner: Do not show items not available fot QtForMCU
Change-Id: Ia61634a5108db51b49241fd58b73ab71e9e5e2e8 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -33,6 +33,9 @@
|
|||||||
#include <nodehints.h>
|
#include <nodehints.h>
|
||||||
#include <nodemetainfo.h>
|
#include <nodemetainfo.h>
|
||||||
|
|
||||||
|
#include <designdocument.h>
|
||||||
|
#include <qmldesignerplugin.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -197,9 +200,45 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
|
|||||||
forceVisiblity = isItem;
|
forceVisiblity = isItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DesignDocument *designDocument = QmlDesignerPlugin::instance()
|
||||||
|
->documentManager()
|
||||||
|
.currentDesignDocument();
|
||||||
|
|
||||||
if (valid
|
if (designDocument && designDocument->isQtForMCUsProject()) {
|
||||||
&& (isItem || forceVisiblity) //We can change if the navigator does support pure QObjects
|
const QList<TypeName> blockTypes = {"QtQuick.AnimatedImage",
|
||||||
|
"QtQuick.BorderImage",
|
||||||
|
"QtQuick.FocusScope",
|
||||||
|
"QtQuick.TextInput",
|
||||||
|
"QtQuick.TextEdit",
|
||||||
|
"QtQuick.Flow",
|
||||||
|
"QtQuick.Grid",
|
||||||
|
"QtQuick.GridView",
|
||||||
|
"QtQuick.Controls.ButtonGroup",
|
||||||
|
"QtQuick.Controls",
|
||||||
|
"QtQuick.Controls.Container",
|
||||||
|
"QtQuick.Controls.DelayButton",
|
||||||
|
"QtQuick.Controls.ComboBox",
|
||||||
|
"QtQuick.Controls.Frame",
|
||||||
|
"QtQuick.Controls.GroupBox",
|
||||||
|
"QtQuick.Controls.ItemDelegate",
|
||||||
|
"QtQuick.Controls.SpinBox",
|
||||||
|
"QtQuick.Controls.RadioDelegate",
|
||||||
|
"QtQuick.Controls.RoundButton",
|
||||||
|
"QtQuick.Controls.ScrollView",
|
||||||
|
"QtQuick.Controls.RangeSlider",
|
||||||
|
"QtQuick.Controls.ToolBar",
|
||||||
|
"QtQuick.Controls.TooButton",
|
||||||
|
"QtQuick.Controls.TabBar",
|
||||||
|
"QtQuick.Controls.TabButton",
|
||||||
|
"QtQuick.Controls.SwitchDelegate",
|
||||||
|
"QtQuick.Controls.TextArea",
|
||||||
|
"QtQuick.Controls.TextField"};
|
||||||
|
|
||||||
|
if (blockTypes.contains(entry.typeName()))
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (valid && (isItem || forceVisiblity) //We can change if the navigator does support pure QObjects
|
||||||
&& (entry.requiredImport().isEmpty()
|
&& (entry.requiredImport().isEmpty()
|
||||||
|| model->hasImport(entryToImport(entry), true, true))) {
|
|| model->hasImport(entryToImport(entry), true, true))) {
|
||||||
QString itemSectionName = entry.category();
|
QString itemSectionName = entry.category();
|
||||||
|
Reference in New Issue
Block a user