Skip to content

Instantly share code, notes, and snippets.

@mhoeher
mhoeher / main.cpp
Last active February 26, 2019 19:29
QML: Error "qml: Failed to load showdown.js: SyntaxError: Maximum statement or expression depth exceeded" when using some 3rd party JavaScript libraries
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
@mhoeher
mhoeher / main.cpp
Created May 11, 2018 20:15
Global functions in QML
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "myapi.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
@mhoeher
mhoeher / main.cpp
Last active May 8, 2018 10:38
QFileSystemModel
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QFileSystemModel>
class FileSystemModel : public QFileSystemModel
{
public:
explicit FileSystemModel(QObject *parent = nullptr) : QFileSystemModel(parent) {}
import QtQuick 2.0
import QtQuick.Controls 2.0
Row {
id: root
property var func: null
Button {
text: qsTr("Func 1")
@mhoeher
mhoeher / font-weight-comfortaa.qml
Created April 6, 2018 21:44
QML Font Weights - Comparison Comfortaa - Font Awesome
import QtQuick 2.9
import QtQuick.Controls 2.2
ApplicationWindow {
Component.onCompleted: {
console.debug(comfortaaLight.name);
console.debug(comfortaaRegular.name);
console.debug(comfortaaBold.name);
show();
}
@mhoeher
mhoeher / mxe-qt-win32-build.log
Created December 17, 2017 12:42
MXE Qt 5.10 Build Fails for Win32 Shared Target
make[1]: Entering directory '/opt/mxe-x64-shared'
uname -a
Linux e8857637113a 4.14.5-300.fc27.x86_64 #1 SMP Mon Dec 11 16:00:36 UTC 2017 x86_64 GNU/Linux
git log --pretty=tformat:"%H - %s [%ar] [%d]" -1
091a03535342376b646f7d3af969adf6bf9d099c - Update packages.json & build-matrix.html [25 hours ago] [ (HEAD -> master, origin/master, origin/HEAD)]
lsb_release -a 2>/dev/null || sw_vers 2>/dev/null || true
autoconf --version 2>/dev/null | head -1
autoconf (GNU Autoconf) 2.69
automake --version 2>/dev/null | head -1
automake (GNU automake) 1.15