forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/8.0' into 9.0" into 9.0
This commit is contained in:
@@ -253,6 +253,10 @@ Rectangle {
|
|||||||
property bool tinyMode: Constants.thumbnailSize <= Constants.thumbnailBreak
|
property bool tinyMode: Constants.thumbnailSize <= Constants.thumbnailBreak
|
||||||
|
|
||||||
property int currentStateInternalId: 0
|
property int currentStateInternalId: 0
|
||||||
|
// Using an int instead of a bool, because when opening a menu on one state and without closing
|
||||||
|
// opening a menu on another state will first trigger the open of the new popup and afterwards
|
||||||
|
// the close of the old popup. Using an int keeps track of number of opened popups.
|
||||||
|
property int menuOpen: 0
|
||||||
|
|
||||||
// This timer is used to delay the current state animation as it didn't work due to the
|
// This timer is used to delay the current state animation as it didn't work due to the
|
||||||
// repeaters item not being positioned in time resulting in 0 x and y position if the grids
|
// repeaters item not being positioned in time resulting in 0 x and y position if the grids
|
||||||
@@ -655,7 +659,7 @@ Rectangle {
|
|||||||
required property var extendString
|
required property var extendString
|
||||||
|
|
||||||
function setPropertyChangesVisible(value) {
|
function setPropertyChangesVisible(value) {
|
||||||
stateThumbnail.propertyChangesVisible = value
|
stateThumbnail.setPropertyChangesVisible(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
width: Constants.thumbnailSize
|
width: Constants.thumbnailSize
|
||||||
@@ -797,10 +801,18 @@ Rectangle {
|
|||||||
|
|
||||||
hasWhenCondition: delegateRoot.hasWhenCondition
|
hasWhenCondition: delegateRoot.hasWhenCondition
|
||||||
|
|
||||||
scrollViewActive: horizontalBar.active || verticalBar.active
|
blockDragHandler: horizontalBar.active || verticalBar.active
|
||||||
|
|| root.menuOpen
|
||||||
|
|
||||||
dragParent: scrollView
|
dragParent: scrollView
|
||||||
|
|
||||||
|
onMenuOpenChanged: {
|
||||||
|
if (stateThumbnail.menuOpen)
|
||||||
|
root.menuOpen++
|
||||||
|
else
|
||||||
|
root.menuOpen--
|
||||||
|
}
|
||||||
|
|
||||||
// Fix ScrollView taking over the dragging event
|
// Fix ScrollView taking over the dragging event
|
||||||
onGrabbing: {
|
onGrabbing: {
|
||||||
frame.interactive = false
|
frame.interactive = false
|
||||||
|
@@ -46,7 +46,7 @@ Item {
|
|||||||
property alias menuChecked: menuButton.checked
|
property alias menuChecked: menuButton.checked
|
||||||
property bool baseState: false
|
property bool baseState: false
|
||||||
property bool isTiny: false
|
property bool isTiny: false
|
||||||
property bool propertyChangesVisible: false
|
property bool propertyChangesVisible: propertyChangesModel.propertyChangesVisible
|
||||||
property bool isChecked: false
|
property bool isChecked: false
|
||||||
|
|
||||||
property bool hasExtend: false
|
property bool hasExtend: false
|
||||||
@@ -55,7 +55,8 @@ Item {
|
|||||||
|
|
||||||
property bool hasWhenCondition: false
|
property bool hasWhenCondition: false
|
||||||
|
|
||||||
property bool scrollViewActive: false
|
property bool menuOpen: stateMenu.opened
|
||||||
|
property bool blockDragHandler: false
|
||||||
|
|
||||||
property Item dragParent
|
property Item dragParent
|
||||||
|
|
||||||
@@ -79,6 +80,11 @@ Item {
|
|||||||
return statesEditorModel.hasAnnotation(root.internalNodeId)
|
return statesEditorModel.hasAnnotation(root.internalNodeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setPropertyChangesVisible(value) {
|
||||||
|
root.propertyChangesVisible = value
|
||||||
|
propertyChangesModel.setPropertyChangesVisible(value)
|
||||||
|
}
|
||||||
|
|
||||||
onIsTinyChanged: {
|
onIsTinyChanged: {
|
||||||
if (root.isTiny) {
|
if (root.isTiny) {
|
||||||
buttonGrid.rows = 2
|
buttonGrid.rows = 2
|
||||||
@@ -91,7 +97,7 @@ Item {
|
|||||||
|
|
||||||
DragHandler {
|
DragHandler {
|
||||||
id: dragHandler
|
id: dragHandler
|
||||||
enabled: !root.baseState && !root.extendedState && !root.scrollViewActive
|
enabled: !root.baseState && !root.extendedState && !root.blockDragHandler
|
||||||
onGrabChanged: function (transition, point) {
|
onGrabChanged: function (transition, point) {
|
||||||
if (transition === PointerDevice.GrabPassive
|
if (transition === PointerDevice.GrabPassive
|
||||||
|| transition === PointerDevice.GrabExclusive)
|
|| transition === PointerDevice.GrabExclusive)
|
||||||
@@ -314,6 +320,9 @@ Item {
|
|||||||
Column {
|
Column {
|
||||||
id: column
|
id: column
|
||||||
|
|
||||||
|
property bool hoverEnabled: false
|
||||||
|
onPositioningComplete: column.hoverEnabled = true
|
||||||
|
|
||||||
// Grid sizes
|
// Grid sizes
|
||||||
property int gridSpacing: 20
|
property int gridSpacing: 20
|
||||||
property int gridRowSpacing: 5
|
property int gridRowSpacing: 5
|
||||||
@@ -353,7 +362,7 @@ Item {
|
|||||||
Item {
|
Item {
|
||||||
id: section
|
id: section
|
||||||
property int animationDuration: 120
|
property int animationDuration: 120
|
||||||
property bool expanded: false
|
property bool expanded: propertyModel.expanded
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
width: stateBackground.innerWidth
|
width: stateBackground.innerWidth
|
||||||
@@ -415,6 +424,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
section.expanded = !section.expanded
|
section.expanded = !section.expanded
|
||||||
|
propertyModel.setExpanded(section.expanded)
|
||||||
if (!section.expanded)
|
if (!section.expanded)
|
||||||
section.forceActiveFocus()
|
section.forceActiveFocus()
|
||||||
root.focusSignal()
|
root.focusSignal()
|
||||||
@@ -518,6 +528,8 @@ Item {
|
|||||||
Repeater {
|
Repeater {
|
||||||
model: propertyModel
|
model: propertyModel
|
||||||
|
|
||||||
|
onModelChanged: column.hoverEnabled = false
|
||||||
|
|
||||||
delegate: ItemDelegate {
|
delegate: ItemDelegate {
|
||||||
id: propertyDelegate
|
id: propertyDelegate
|
||||||
|
|
||||||
@@ -527,7 +539,7 @@ Item {
|
|||||||
|
|
||||||
width: stateBackground.innerWidth - 2 * column.gridPadding
|
width: stateBackground.innerWidth - 2 * column.gridPadding
|
||||||
height: 26
|
height: 26
|
||||||
hoverEnabled: true
|
hoverEnabled: column.hoverEnabled
|
||||||
|
|
||||||
onClicked: root.focusSignal()
|
onClicked: root.focusSignal()
|
||||||
|
|
||||||
@@ -560,7 +572,7 @@ Item {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
id: propertyDelegateMouseArea
|
id: propertyDelegateMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: column.hoverEnabled
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.focusSignal()
|
root.focusSignal()
|
||||||
propertyModel.removeProperty(
|
propertyModel.removeProperty(
|
||||||
@@ -717,7 +729,7 @@ Item {
|
|||||||
onClone: root.clone()
|
onClone: root.clone()
|
||||||
onExtend: root.extend()
|
onExtend: root.extend()
|
||||||
onRemove: root.remove()
|
onRemove: root.remove()
|
||||||
onToggle: root.propertyChangesVisible = !root.propertyChangesVisible
|
onToggle: root.setPropertyChangesVisible(!root.propertyChangesVisible)
|
||||||
onResetWhenCondition: statesEditorModel.resetWhenCondition(root.internalNodeId)
|
onResetWhenCondition: statesEditorModel.resetWhenCondition(root.internalNodeId)
|
||||||
onEditAnnotation: {
|
onEditAnnotation: {
|
||||||
statesEditorModel.setAnnotation(root.internalNodeId)
|
statesEditorModel.setAnnotation(root.internalNodeId)
|
||||||
|
@@ -293,6 +293,7 @@ void MaterialBrowserView::refreshModel(bool updateImages)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_widget->clearSearchFilter();
|
||||||
m_widget->materialBrowserModel()->setMaterials(materials, m_hasQuick3DImport);
|
m_widget->materialBrowserModel()->setMaterials(materials, m_hasQuick3DImport);
|
||||||
|
|
||||||
if (updateImages) {
|
if (updateImages) {
|
||||||
|
@@ -123,6 +123,7 @@ void PropertyChangesModel::setModelNodeBackend(const QVariant &modelNodeBackend)
|
|||||||
m_view->registerPropertyChangesModel(this);
|
m_view->registerPropertyChangesModel(this);
|
||||||
|
|
||||||
emit modelNodeBackendChanged();
|
emit modelNodeBackendChanged();
|
||||||
|
emit propertyChangesVisibleChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertyChangesModel::reset()
|
void PropertyChangesModel::reset()
|
||||||
@@ -138,6 +139,20 @@ int PropertyChangesModel::count() const
|
|||||||
return rowCount();
|
return rowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
constexpr AuxiliaryDataKeyDefaultValue propertyChangesVisibleProperty{AuxiliaryDataType::Temporary,
|
||||||
|
"propertyChangesVisible",
|
||||||
|
false};
|
||||||
|
}
|
||||||
|
void PropertyChangesModel::setPropertyChangesVisible(bool value)
|
||||||
|
{
|
||||||
|
m_modelNode.setAuxiliaryData(propertyChangesVisibleProperty, value);
|
||||||
|
}
|
||||||
|
bool PropertyChangesModel::propertyChangesVisible() const
|
||||||
|
{
|
||||||
|
return m_modelNode.auxiliaryDataWithDefault(propertyChangesVisibleProperty).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
void PropertyChangesModel::registerDeclarativeType()
|
void PropertyChangesModel::registerDeclarativeType()
|
||||||
{
|
{
|
||||||
qmlRegisterType<PropertyChangesModel>("HelperWidgets", 2, 0, "PropertyChangesModel");
|
qmlRegisterType<PropertyChangesModel>("HelperWidgets", 2, 0, "PropertyChangesModel");
|
||||||
|
@@ -42,6 +42,8 @@ class PropertyChangesModel : public QAbstractListModel
|
|||||||
Q_PROPERTY(int count READ count NOTIFY countChanged)
|
Q_PROPERTY(int count READ count NOTIFY countChanged)
|
||||||
Q_PROPERTY(QVariant modelNodeBackendProperty READ modelNodeBackend WRITE setModelNodeBackend
|
Q_PROPERTY(QVariant modelNodeBackendProperty READ modelNodeBackend WRITE setModelNodeBackend
|
||||||
NOTIFY modelNodeBackendChanged)
|
NOTIFY modelNodeBackendChanged)
|
||||||
|
Q_PROPERTY(bool propertyChangesVisible READ propertyChangesVisible NOTIFY
|
||||||
|
propertyChangesVisibleChanged)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
Target = Qt::DisplayRole,
|
Target = Qt::DisplayRole,
|
||||||
@@ -62,11 +64,15 @@ public:
|
|||||||
void reset();
|
void reset();
|
||||||
int count() const;
|
int count() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE void setPropertyChangesVisible(bool value);
|
||||||
|
Q_INVOKABLE bool propertyChangesVisible() const;
|
||||||
|
|
||||||
static void registerDeclarativeType();
|
static void registerDeclarativeType();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void modelNodeBackendChanged();
|
void modelNodeBackendChanged();
|
||||||
void countChanged();
|
void countChanged();
|
||||||
|
void propertyChangesVisibleChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariant modelNodeBackend() const;
|
QVariant modelNodeBackend() const;
|
||||||
|
@@ -117,6 +117,7 @@ void PropertyModel::setModelNodeBackend(const QVariant &modelNodeBackend)
|
|||||||
|
|
||||||
setupModel();
|
setupModel();
|
||||||
emit modelNodeBackendChanged();
|
emit modelNodeBackendChanged();
|
||||||
|
emit expandedChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertyModel::setExplicit(bool value)
|
void PropertyModel::setExplicit(bool value)
|
||||||
@@ -149,6 +150,20 @@ void PropertyModel::removeProperty(const QString &name)
|
|||||||
m_modelNode.removeProperty(name.toUtf8());
|
m_modelNode.removeProperty(name.toUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
constexpr AuxiliaryDataKeyDefaultValue expandedProperty{AuxiliaryDataType::Temporary,
|
||||||
|
"propertyModelExpanded",
|
||||||
|
false};
|
||||||
|
}
|
||||||
|
void PropertyModel::setExpanded(bool value)
|
||||||
|
{
|
||||||
|
m_modelNode.setAuxiliaryData(expandedProperty, value);
|
||||||
|
}
|
||||||
|
bool PropertyModel::expanded() const
|
||||||
|
{
|
||||||
|
return m_modelNode.auxiliaryDataWithDefault(expandedProperty).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
void PropertyModel::registerDeclarativeType()
|
void PropertyModel::registerDeclarativeType()
|
||||||
{
|
{
|
||||||
qmlRegisterType<PropertyModel>("HelperWidgets", 2, 0, "PropertyModel");
|
qmlRegisterType<PropertyModel>("HelperWidgets", 2, 0, "PropertyModel");
|
||||||
|
@@ -39,6 +39,7 @@ class PropertyModel : public QAbstractListModel
|
|||||||
|
|
||||||
Q_PROPERTY(QVariant modelNodeBackendProperty READ modelNodeBackend WRITE setModelNodeBackend
|
Q_PROPERTY(QVariant modelNodeBackendProperty READ modelNodeBackend WRITE setModelNodeBackend
|
||||||
NOTIFY modelNodeBackendChanged)
|
NOTIFY modelNodeBackendChanged)
|
||||||
|
Q_PROPERTY(bool expanded READ expanded NOTIFY expandedChanged)
|
||||||
|
|
||||||
enum { Name = Qt::DisplayRole, Value = Qt::UserRole, Type };
|
enum { Name = Qt::DisplayRole, Value = Qt::UserRole, Type };
|
||||||
|
|
||||||
@@ -55,10 +56,14 @@ public:
|
|||||||
Q_INVOKABLE void setRestoreEntryValues(bool value);
|
Q_INVOKABLE void setRestoreEntryValues(bool value);
|
||||||
Q_INVOKABLE void removeProperty(const QString &name);
|
Q_INVOKABLE void removeProperty(const QString &name);
|
||||||
|
|
||||||
|
Q_INVOKABLE void setExpanded(bool value);
|
||||||
|
Q_INVOKABLE bool expanded() const;
|
||||||
|
|
||||||
static void registerDeclarativeType();
|
static void registerDeclarativeType();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void modelNodeBackendChanged();
|
void modelNodeBackendChanged();
|
||||||
|
void expandedChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariant modelNodeBackend() const;
|
QVariant modelNodeBackend() const;
|
||||||
|
@@ -129,9 +129,11 @@ EasingCurveDialog::EasingCurveDialog(const QList<ModelNode> &frames, QWidget *pa
|
|||||||
resize(QSize(1421, 918));
|
resize(QSize(1421, 918));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EasingCurveDialog::initialize(const QString &curveString)
|
void EasingCurveDialog::initialize(const PropertyName &propName, const QString &curveString)
|
||||||
{
|
{
|
||||||
EasingCurve curve;
|
EasingCurve curve;
|
||||||
|
m_easingCurveProperty = propName;
|
||||||
|
|
||||||
if (curveString.isEmpty()) {
|
if (curveString.isEmpty()) {
|
||||||
QEasingCurve qcurve;
|
QEasingCurve qcurve;
|
||||||
qcurve.addCubicBezierSegment(QPointF(0.2, 0.2), QPointF(0.8, 0.8), QPointF(1.0, 1.0));
|
qcurve.addCubicBezierSegment(QPointF(0.2, 0.2), QPointF(0.8, 0.8), QPointF(1.0, 1.0));
|
||||||
@@ -150,11 +152,19 @@ void EasingCurveDialog::runDialog(const QList<ModelNode> &frames, QWidget *paren
|
|||||||
EasingCurveDialog dialog(frames, parent);
|
EasingCurveDialog dialog(frames, parent);
|
||||||
|
|
||||||
ModelNode current = frames.last();
|
ModelNode current = frames.last();
|
||||||
|
PropertyName propName;
|
||||||
|
|
||||||
if (current.hasBindingProperty("easing.bezierCurve"))
|
NodeMetaInfo metaInfo = current.metaInfo();
|
||||||
dialog.initialize(current.bindingProperty("easing.bezierCurve").expression());
|
if (metaInfo.hasProperty("easing"))
|
||||||
else
|
propName = "easing.bezierCurve";
|
||||||
dialog.initialize("");
|
else if (metaInfo.hasProperty("easingCurve"))
|
||||||
|
propName = "easingCurve.bezierCurve";
|
||||||
|
|
||||||
|
QString expression;
|
||||||
|
if (!propName.isEmpty() && current.hasBindingProperty(propName))
|
||||||
|
expression = current.bindingProperty(propName).expression();
|
||||||
|
|
||||||
|
dialog.initialize(propName, expression);
|
||||||
|
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
@@ -177,7 +187,7 @@ bool EasingCurveDialog::apply()
|
|||||||
return view->executeInTransaction("EasingCurveDialog::apply", [this](){
|
return view->executeInTransaction("EasingCurveDialog::apply", [this](){
|
||||||
auto expression = m_splineEditor->easingCurve().toString();
|
auto expression = m_splineEditor->easingCurve().toString();
|
||||||
for (const auto &frame : std::as_const(m_frames))
|
for (const auto &frame : std::as_const(m_frames))
|
||||||
frame.bindingProperty("easing.bezierCurve").setExpression(expression);
|
frame.bindingProperty(m_easingCurveProperty).setExpression(expression);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@ class EasingCurveDialog : public QDialog
|
|||||||
public:
|
public:
|
||||||
EasingCurveDialog(const QList<ModelNode> &frames, QWidget *parent = nullptr);
|
EasingCurveDialog(const QList<ModelNode> &frames, QWidget *parent = nullptr);
|
||||||
|
|
||||||
void initialize(const QString &curveString);
|
void initialize(const PropertyName &propName, const QString &curveString);
|
||||||
|
|
||||||
static void runDialog(const QList<ModelNode> &frames, QWidget *parent = nullptr);
|
static void runDialog(const QList<ModelNode> &frames, QWidget *parent = nullptr);
|
||||||
|
|
||||||
@@ -58,6 +58,8 @@ private:
|
|||||||
QLabel *m_label = nullptr;
|
QLabel *m_label = nullptr;
|
||||||
|
|
||||||
QList<ModelNode> m_frames;
|
QList<ModelNode> m_frames;
|
||||||
|
|
||||||
|
PropertyName m_easingCurveProperty;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
Reference in New Issue
Block a user