forked from qt-creator/qt-creator
QmlDesigner: Use Window instead of Dialog
Change-Id: I9f7392788e96ed399f686caed41e30e8347b3665 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
import QtQuick.Window 2.15
|
||||||
|
|
||||||
|
Window {
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
import QtQuick 2.15
|
||||||
|
|
||||||
|
Window {
|
||||||
|
}
|
@@ -26,7 +26,6 @@
|
|||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Layouts 1.0
|
import QtQuick.Layouts 1.0
|
||||||
import QtQuickDesignerTheme 1.0
|
import QtQuickDesignerTheme 1.0
|
||||||
import QtQuick.Dialogs 1.3
|
|
||||||
import StudioTheme 1.0 as StudioTheme
|
import StudioTheme 1.0 as StudioTheme
|
||||||
import StudioControls 1.0 as StudioControls
|
import StudioControls 1.0 as StudioControls
|
||||||
|
|
||||||
@@ -559,12 +558,13 @@ Column {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onApply: {
|
onApplied : {
|
||||||
if (presetList.gradientData.stopsCount > 0) {
|
if (presetList.gradientData.stopsCount > 0) {
|
||||||
applyPreset();
|
applyPreset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onSaved: {
|
onSaved: {
|
||||||
gradientLine.savePreset();
|
gradientLine.savePreset();
|
||||||
presetList.updatePresets();
|
presetList.updatePresets();
|
||||||
@@ -588,7 +588,7 @@ Column {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
presetList.open()
|
presetList.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,19 +25,22 @@
|
|||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
import QtQuick.Dialogs 1.3
|
import Qt.labs.platform 1.1
|
||||||
import QtQuickDesignerTheme 1.0
|
import QtQuickDesignerTheme 1.0
|
||||||
import HelperWidgets 2.0
|
import HelperWidgets 2.0
|
||||||
import StudioControls 1.0 as StudioControls
|
import StudioControls 1.0 as StudioControls
|
||||||
import StudioTheme 1.0 as StudioTheme
|
import StudioTheme 1.0 as StudioTheme
|
||||||
|
|
||||||
Dialog {
|
|
||||||
|
HelperWindow {
|
||||||
id: dialogWindow
|
id: dialogWindow
|
||||||
width: 1200
|
width: 1200
|
||||||
height: 650
|
height: 650
|
||||||
title: qsTr("Gradient Picker")
|
title: qsTr("Gradient Picker")
|
||||||
|
|
||||||
signal saved
|
signal saved
|
||||||
|
signal applied
|
||||||
|
signal accepted
|
||||||
property alias gradientData: gradientPickerData
|
property alias gradientData: gradientPickerData
|
||||||
|
|
||||||
|
|
||||||
@@ -62,8 +65,6 @@ Dialog {
|
|||||||
GradientPresetDefaultListModel { id: defaultPresetListModel }
|
GradientPresetDefaultListModel { id: defaultPresetListModel }
|
||||||
GradientPresetCustomListModel { id: customPresetListModel }
|
GradientPresetCustomListModel { id: customPresetListModel }
|
||||||
|
|
||||||
standardButtons: Dialog.NoButton
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: -12
|
anchors.margins: -12
|
||||||
@@ -117,7 +118,7 @@ Dialog {
|
|||||||
id: deleteDialog
|
id: deleteDialog
|
||||||
visible: false
|
visible: false
|
||||||
modality: Qt.WindowModal
|
modality: Qt.WindowModal
|
||||||
standardButtons: Dialog.No | Dialog.Yes
|
buttons: StandardButton.No | StandardButton.Yes
|
||||||
title: qsTr("Delete preset?")
|
title: qsTr("Delete preset?")
|
||||||
text: qsTr("Are you sure you want to delete this preset?")
|
text: qsTr("Are you sure you want to delete this preset?")
|
||||||
onAccepted: customPresetListModel.deletePreset(customTabContent.deleteId)
|
onAccepted: customPresetListModel.deletePreset(customTabContent.deleteId)
|
||||||
@@ -129,9 +130,9 @@ Dialog {
|
|||||||
Layout.alignment: Qt.AlignBottom | Qt.AlignRight
|
Layout.alignment: Qt.AlignBottom | Qt.AlignRight
|
||||||
Layout.topMargin: 5
|
Layout.topMargin: 5
|
||||||
|
|
||||||
Button { id: buttonClose; text: qsTr("Close"); onClicked: { dialogWindow.reject(); } }
|
Button { id: buttonClose; text: qsTr("Close"); onClicked: { dialogWindow.hide(); } }
|
||||||
Button { id: buttonSave; text: qsTr("Save"); onClicked: { dialogWindow.saved(); } }
|
Button { id: buttonSave; text: qsTr("Save"); onClicked: { dialogWindow.saved(); } }
|
||||||
Button { id: buttonApply; text: qsTr("Apply"); onClicked: { dialogWindow.apply(); } }
|
Button { id: buttonApply; text: qsTr("Apply"); onClicked: { dialogWindow.applied(); dialogWindow.hide(); } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -72,11 +72,22 @@ void Quick2PropertyEditorView::registerQmlTypes()
|
|||||||
Tooltip::registerDeclarativeType();
|
Tooltip::registerDeclarativeType();
|
||||||
EasingCurveEditor::registerDeclarativeType();
|
EasingCurveEditor::registerDeclarativeType();
|
||||||
RichTextEditorProxy::registerDeclarativeType();
|
RichTextEditorProxy::registerDeclarativeType();
|
||||||
QUrl regExpUrl = QUrl::fromLocalFile(PropertyEditorQmlBackend::propertyEditorResourcesPath()
|
|
||||||
+ "/RegExpValidator.qml");
|
const QString resourcePath = PropertyEditorQmlBackend::propertyEditorResourcesPath();
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QUrl regExpUrl = QUrl::fromLocalFile(resourcePath + "/RegExpValidator.qml");
|
||||||
qmlRegisterType(regExpUrl, "HelperWidgets", 2, 0, "RegExpValidator");
|
qmlRegisterType(regExpUrl, "HelperWidgets", 2, 0, "RegExpValidator");
|
||||||
|
|
||||||
|
const QString qtPrefix = "/Qt6";
|
||||||
|
#else
|
||||||
|
const QString qtPrefix = "/Qt5";
|
||||||
#endif
|
#endif
|
||||||
|
qmlRegisterType(QUrl::fromLocalFile(resourcePath + qtPrefix + "HelperWindow.qml"),
|
||||||
|
"HelperWidgets",
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
"HelperWindow");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user