This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
class LambdaAndroidActivityResultReceiver : public QObject, public QAndroidActivityResultReceiver | |
{ | |
public: | |
LambdaAndroidActivityResultReceiver(T callback) : m_callback{callback} {} | |
void handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data) override { | |
Q_UNUSED(receiverRequestCode) | |
m_callback(resultCode, data); | |
deleteLater(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "colattachedtype.h" | |
#include <QQuickItem> | |
#include <QQuickWindow> | |
#include <QQmlInfo> | |
ColAttachedType::ColAttachedType(QObject* parent) : | |
QObject{parent}, | |
m_item{qobject_cast<QQuickItem*>(parent)} | |
{ | |
if (!m_item) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
SequentialAnimation { | |
id: root | |
property QtObject target | |
property string fadeProperty: "scale" | |
property int fadeDuration: 150 | |
property alias outValue: outAnimation.to | |
property alias inValue: inAnimation.to | |
property alias outEasingType: outAnimation.easing.type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.6 | |
import QtQuick.Layouts 1.0 | |
import Qt.labs.controls 1.0 | |
import QtQuick.Layouts 1.3 | |
import MouseProxy 0.1 | |
ApplicationWindow { | |
visible: true | |
width: 640 | |
height: 480 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.7 | |
import QtQuick.Controls 2.0 | |
import QtQuick.Window 2.2 | |
ApplicationWindow { | |
visible: true | |
width: 640 | |
height: 480 | |
title: "Bootstrap test : " + ["xs", "sm", "md", "lg"][thresholdIndex(this)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
/*! | |
\qmltype AreaTester | |
\brief A component that highlights the aera of a given component. | |
The AreaTester component is a simple component to troubleshoot what area occupies an other component. | |
You can use this component like this to highlights its parent's area. | |
\qml | |
Item { | |
id: itemToHighlight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
Item { | |
id: root | |
height: 0 | |
default property alias data: contentItem.data | |
property ListView _listView: parent.parent | |
property Item _adjacentItem: { _listView.contentY; return _listView.itemAt(0, y); } | |
property bool _adjacentItemIsLastOfSection: _adjacentItem ? _adjacentItem.ListView.section !== _adjacentItem.ListView.nextSection && _adjacentItem !== _listView.contentItem.children[0] : false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.7 | |
import QtQuick.Controls 2.0 | |
ApplicationWindow { | |
visible: true | |
width: 640 | |
height: 480 | |
ListView { | |
id: listView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sections = document.querySelectorAll(".sg-section"); | |
var ul = document.createElement('ul'); | |
sections[0].parentNode.insertBefore(ul, sections[0]); | |
for (var i=0; i < sections.length; ++i) { var elem = sections[i].children[0]; var li = document.createElement('li'); li.innerHTML='<a href="#'+elem.id+'">'+elem.textContent+'</a>'; ul.appendChild(li); } |