Commit 8af523cb authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.PropertyEditor: adding support for url



Now url properties get a nice file browser when the sheet
is generated.

Change-Id: Ife4ab3081d92a5ccfab3c3d529de12c22f98d51a
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@digia.com>
parent 1c556968
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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.
**
****************************************************************************/
import QtQuick 1.0
import Bauhaus 1.0
QWidget { //This is a special spinBox that does color coding for states
id: urlEdit
property bool enabled: true
property variant backendValue;
property variant baseStateFlag;
minimumHeight: 22;
layout: HorizontalLayout {
spacing: 4
FileWidget {
enabled: (isBaseState || backendValues.id.value != "") && urlEdit.enabled
fileName: backendValue.value;
onFileNameChanged: {
backendValue.value = fileName;
}
itemNode: anchorBackend.itemNode
showComboBox: false
}
}
}
......@@ -45,3 +45,4 @@ Transformation 1.0 Transformation.qml
Type 1.0 Type.qml
VerticalLayout 1.0 VerticalLayout.qml
Visibility 1.0 Visibility.qml
UrlEdit 1.0 UrlEdit.qml
......@@ -11,9 +11,13 @@ AutoTypes {
sourceFile: "RealEditorTemplate.qml"
}
Type {
typeNames: ["string", "QString", "QUrl", "url"]
typeNames: ["string", "QString"]
sourceFile: "StringEditorTemplate.qml"
}
Type {
typeNames: ["QUrl", "url"]
sourceFile: "UrlEditorTemplate.qml"
}
Type {
typeNames: ["bool", "boolean"]
sourceFile: "BooleanEditorTemplate.qml"
......
QWidget {
layout: HorizontalLayout {
Label {
text: "%1"
toolTip: "%1"
}
UrlEdit {
backendValue: backendValues.%2
baseStateFlag: isBaseState
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment