2016-05-10 09:43:49 -07:00
|
|
|
package main
|
|
|
|
|
2018-02-07 10:00:10 -08:00
|
|
|
// This file is automatically generated by github.com/limetext/qml-go/cmd/genqrc
|
2016-05-10 09:43:49 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
|
2018-02-07 10:00:10 -08:00
|
|
|
"github.com/limetext/qml-go"
|
2016-05-10 09:43:49 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
var r *qml.Resources
|
|
|
|
var err error
|
2018-02-07 10:06:52 -08:00
|
|
|
err = qrcRepackResources()
|
|
|
|
if err != nil {
|
|
|
|
panic("cannot repack qrc resources: " + err.Error())
|
2016-05-10 09:43:49 -07:00
|
|
|
}
|
2018-02-07 10:06:52 -08:00
|
|
|
r, err = qml.ParseResources(qrcResourcesRepacked)
|
2016-05-10 09:43:49 -07:00
|
|
|
if err != nil {
|
|
|
|
panic("cannot parse bundled resources data: " + err.Error())
|
|
|
|
}
|
|
|
|
qml.LoadResources(r)
|
|
|
|
}
|
|
|
|
|
|
|
|
func qrcRepackResources() error {
|
|
|
|
subdirs := []string{"qml"}
|
|
|
|
var rp qml.ResourcesPacker
|
|
|
|
for _, subdir := range subdirs {
|
|
|
|
err := filepath.Walk(subdir, func(path string, info os.FileInfo, err error) error {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if info.IsDir() {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
data, err := ioutil.ReadFile(path)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2019-05-06 03:15:55 -07:00
|
|
|
if filepath.Ext(info.Name()) == ".conf" {
|
|
|
|
rp.Add("/", data)
|
|
|
|
} else {
|
|
|
|
rp.Add(filepath.ToSlash(path), data)
|
|
|
|
}
|
2016-05-10 09:43:49 -07:00
|
|
|
return nil
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
qrcResourcesRepacked = rp.Pack().Bytes()
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var qrcResourcesRepacked []byte
|
2019-05-06 03:15:55 -07:00
|
|
|
var qrcResourcesData = "qres\x00\x00\x00\x01\x00\x00X\xed\x00\x00\x00\x14\x00\x00W\xdb\x00\x00\x026import QtQuick 2.4\n\nListModel {\n id: nestedModel\n objectName: \"nestedModel\"\n function get1() {\n console.log(get(0))\n return get(0)\n }\n ListElement {\n title: \"Cars\"\n collapsed: true\n subItems: [\n ListElement {\n itemName: \"tst\"\n },\n ListElement {\n itemName: \"Tota\"\n },\n ListElement {\n itemName: \"vy\"\n },\n ListElement {\n itemName: \"Audio Adrenaline\"\n }\n ]\n }\n}\n\x00\x00\x01\xfdimport QtQuick 2.4\n\nImage {\n id: img\n antialiasing: true\n source: \"image://images/\"\n objectName: \"cellImg\"\n property int index: 0\n height: 100\n transformOrigin: Item.TopLeft\n fillMode: Image.PreserveAspectFit\n anchors.right: parent.right\n anchors.left: parent.left\n //cache: false\n MouseArea {\n id: cellMouse\n hoverEnabled: true\n enabled: true\n objectName: \"cellMouse\"\n anchors.fill: parent\n acceptedButtons: Qt.AllButtons\n }\n}\n\x00\x00\x1e.import QtQuick 2.4\nimport QtQuick.Controls 1.3\nimport QtQuick.Layouts 1.1\nimport QtQuick.Dialogs 1.2\n\nApplicationWindow {\n minimumHeight: 480\n minimumWidth: 640\n\n ColorDialog {\n id: textClrDialog\n //objectname: \"textClrDialog\"\n title: \"Please choose a color for the text\"\n showAlphaChannel: true\n }\n\n ColorDialog {\n id: outlineClrDialog\n //objectname: \"outlineClrDialog\"\n title: \"Please choose a color for the text\"\n showAlphaChannel: true\n }\n\n menuBar: MenuBar {\n Menu {\n title: \"&File\"\n MenuItem {\n text: \"Close\"\n }\n }\n Menu {\n title: \"&Edit\"\n MenuItem {\n text: \"quick edit\"\n objectName: \"mnuEdit\"\n }\n }\n\n Menu {\n title: \"Window\"\n\n MenuItem {\n text: \"Display\"\n objectName: \"mnuDisplay\"\n }\n }\n\n Menu {\n title: \"&Help\"\n MenuItem {\n //action: aboutAction\n }\n }\n }\n\n RowLayout {\n id: rowLayout1\n enabled: true\n smooth: true\n antialiasing: true\n anchors.fill: parent\n\n RowLayout {\n id: rowlayout3\n Layout.fillHeight: true\n Layout.alignment: Qt.AlignTop\n Layout.maximumWidth: 225\n\n ColumnLayout {\n id: columnlayout2\n Layout.alignment: Qt.AlignLeft | Qt.AlignTop\n Layout.fillHeight: true\n\n Label {\n id: label1\n text: qsTr(\"Verses\")\n Layout.alignment: Qt.AlignLeft | Qt.AlignTop\n }\n ListView {\n id: lstVerses\n objectName: \"lstVerses\"\n clip: true\n highlight: Rectangle {\n color: \"lightsteelblue\"\n radius: 5\n }\n width: 110\n Layout.fillHeight: true\n Layout.alignment: Qt.AlignLeft | Qt.AlignTop\n focus: true\n keyNavigationWraps: true\n boundsBehavior: Flickable.StopAtBounds\n model: go.verseLen\n\n delegate: Item {\n x: 5\n width: 80\n height: 40\n\n Text {\n text: go.verses(index)\n anchors.verticalCenter: parent.verticalCenter\n font
|