Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@oKcerG
oKcerG / ContactList.qml
Last active December 13, 2022 22:38
An experiment trying to recreate Google's Android contact list in QML
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQml 2.2
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
// DEMO VIDEO : https://gfycat.com/WarlikeImportantAmericanrobin
ApplicationWindow {
visible: true
@oKcerG
oKcerG / scrolling-indicator.qml
Last active December 13, 2022 22:38
QML Alphabet Scrolling indicator POC
import QtQuick 2.7
import QtQuick.Controls 2.0
ApplicationWindow {
visible: true
width: 640
height: 480
ListView {
id: listView
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"
@oKcerG
oKcerG / bibinding.cpp
Created August 11, 2020 08:09
BiBinding
#include "bibinding.h"
#include <QDebug>
QQmlProperty BiBinding::source() const
{
return m_source;
}
void BiBinding::setSource(const QQmlProperty& source)
{
import QtQuick 2.9
Binding {
id: root
property int delay: 500
property alias value: root._delayedValue
property alias _actualValue: root.value
property var _delayedValue
Rect {
radius: Math.min(width, height) / 2
}
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
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)
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 }