Skip to content

Instantly share code, notes, and snippets.

View FadeBehavior.qml
import QtQuick 2.15
import QtQml 2.15
Behavior {
id: root
property QtObject fadeTarget: targetProperty.object
property string fadeProperty: "scale"
property int fadeDuration: 150
property string easingType: "Quad"
View bibinding.cpp
#include "bibinding.h"
#include <QDebug>
QQmlProperty BiBinding::source() const
{
return m_source;
}
void BiBinding::setSource(const QQmlProperty& source)
{
View DebounceBinding.qml
import QtQuick 2.9
Binding {
id: root
property int delay: 500
property alias value: root._delayedValue
property alias _actualValue: root.value
property var _delayedValue
View Rect.qml
Rect {
radius: Math.min(width, height) / 2
}
View ReorderDelegate.qml
import QtQuick 2.0
MouseArea {
id: root
property Item draggedParent: parent ? parent.parent || parent : null
property var modelIndex: typeof model !== "undefined" ? model.index : undefined
signal move(int from, int to)
property bool dropEnabled: true
property bool dropBlocked: false
View DragScrollHelper.qml
import QtQuick 2.7
Item {
id: root
property Flickable flickable: parent
anchors.fill: parent
property MouseArea mouseArea
readonly property bool active: flickable && (mouseArea ? mouseArea.drag.active : false)
View NavigationDrawer.qml
import QtQuick 2.4
Item {
id: root
default property alias data: contentItem.data
readonly property bool showing: listView.currentIndex === 0
property double peekWidth: 48
property double touchWidth: 32
property double paneWidth: Math.min(root.width - 128, 640)
Text { text: paneWidth }
View gist:9a78c74808b8a652d17ce3ba98e09cf4
import QtQuick 2.0
SequentialAnimation {
id: root
property QtObject target
property string fadeProperty: "opacity"
property int fadeDuration: 150
property alias outValue: outAnimation.to
property alias inValue: inAnimation.to
property alias outEasingType: outAnimation.easing.type
View TextRectangle.qml
import QtQuick 2.7
Rectangle {
property alias textItem: textItem
property alias text: textItem.text
property alias textColor: textItem.color
property alias maxWidth: textItem.width
property alias maxHeight: textItem.height