forked from qt-creator/qt-creator
QmlDesigner: Add support for Dialog
Change-Id: I8a2972f80ae79835018870eda7b11a817353bf94 Task-numbner: QTCREATORBUG-22120 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
51
share/qtcreator/qml/qmlpuppet/mockfiles/Dialog.qml
Normal file
51
share/qtcreator/qml/qmlpuppet/mockfiles/Dialog.qml
Normal file
@@ -0,0 +1,51 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.1
|
||||
|
||||
Rectangle {
|
||||
property string title
|
||||
|
||||
property var clickedButton
|
||||
|
||||
property var modality
|
||||
property var standardButtons
|
||||
|
||||
property alias contentItem: contentArea
|
||||
|
||||
property int maximumWidth: 0
|
||||
property int minimumWidth: 0
|
||||
|
||||
property int maximumHeight: 0
|
||||
property int minimumHeight: 0
|
||||
|
||||
Item {
|
||||
id: contentArea
|
||||
anchors.top: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.top
|
||||
}
|
||||
}
|
@@ -622,10 +622,12 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
|
||||
|| typeName == "QtQuick.Controls/Drawer"
|
||||
|| typeName == "QtQuick.Controls/Dialog"
|
||||
|| typeName == "QtQuick.Controls/Menu"
|
||||
|| typeName == "QtQuick.Controls/Pane"
|
||||
|| typeName == "QtQuick.Controls/ToolTip")
|
||||
polishTypeName = "QtQuick/Item";
|
||||
|
||||
const QHash<QString, QString> mockHash = {{"QtQuick.Controls/SwipeView","qrc:/qtquickplugin/mockfiles/SwipeView.qml"}};
|
||||
const QHash<QString, QString> mockHash = {{"QtQuick.Controls/SwipeView","qrc:/qtquickplugin/mockfiles/SwipeView.qml"},
|
||||
{"QtQuick.Dialogs/Dialog","qrc:/qtquickplugin/mockfiles/Dialog.qml"}};
|
||||
|
||||
QObject *object = nullptr;
|
||||
|
||||
|
@@ -6,5 +6,6 @@
|
||||
<file>mockfiles/Window.qml</file>
|
||||
<file>mockfiles/SwipeView.qml</file>
|
||||
<file>mockfiles/GenericBackend.qml</file>
|
||||
<file>mockfiles/Dialog.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@@ -204,6 +204,7 @@ void StatesEditorView::checkForWindow()
|
||||
{
|
||||
if (m_statesEditorWidget)
|
||||
m_statesEditorWidget->showAddNewStatesButton(!rootModelNode().metaInfo().isSubclassOf("QtQuick.Window.Window")
|
||||
&& !rootModelNode().metaInfo().isSubclassOf("QtQuick.Dialogs.Dialog")
|
||||
&& !rootModelNode().metaInfo().isSubclassOf("QtQuick.Window.Popup"));
|
||||
}
|
||||
|
||||
|
@@ -1550,6 +1550,7 @@ bool NodeMetaInfo::isGraphicalItem() const
|
||||
{
|
||||
return isSubclassOf("QtQuick.Item")
|
||||
|| isSubclassOf("QtQuick.Window.Window")
|
||||
|| isSubclassOf("QtQuick.Dialogs.Dialog")
|
||||
|| isSubclassOf("QtQuick.Controls.Popup");
|
||||
}
|
||||
|
||||
|
@@ -54,6 +54,9 @@ bool QmlItemNode::isItemOrWindow(const ModelNode &modelNode)
|
||||
if (modelNode.metaInfo().isSubclassOf("QtQuick.Window.Window") && modelNode.isRootNode())
|
||||
return true;
|
||||
|
||||
if (modelNode.metaInfo().isSubclassOf("QtQuick.Dialogs.Dialog") && modelNode.isRootNode())
|
||||
return true;
|
||||
|
||||
if (modelNode.metaInfo().isSubclassOf("QtQuick.Controls.Popup"))
|
||||
return true;
|
||||
|
||||
|
Reference in New Issue
Block a user