2016-05-10 09:43:49 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
// This file is automatically generated by github.com/lordwelch/qml/cmd/genqrc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"github.com/lordwelch/qml"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
var r *qml.Resources
|
|
|
|
var err error
|
2017-09-20 17:36:57 -07:00
|
|
|
if true /*os.Getenv("QRC_REPACK") == "1"*/ {
|
2016-05-10 09:43:49 -07:00
|
|
|
err = qrcRepackResources()
|
|
|
|
if err != nil {
|
|
|
|
panic("cannot repack qrc resources: " + err.Error())
|
|
|
|
}
|
|
|
|
r, err = qml.ParseResources(qrcResourcesRepacked)
|
|
|
|
} else {
|
|
|
|
r, err = qml.ParseResourcesString(qrcResourcesData)
|
|
|
|
}
|
|
|
|
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
|
|
|
|
}
|
|
|
|
rp.Add(filepath.ToSlash(path), data)
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
qrcResourcesRepacked = rp.Pack().Bytes()
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var qrcResourcesRepacked []byte
|
|
|
|
var qrcResourcesData = "qres\x00\x00\x00\x01\x00\x00F\x9d\x00\x00\x00\x14\x00\x00E\xeb\x00\x00\x1cjimport QtQuick 2.4\nimport QtQuick.Dialogs 1.2\nimport QtQuick.Controls 1.3\nimport QtQuick.Window 2.0\nimport \"qml\"\nimport QtQuick.Layouts 1.0\n\nApplicationWindow {\n id: applicationWindow1\n title: \"Presentation App\"\n visible: true\n objectName: \"applicationWindow1\"\n minimumWidth: 500\n minimumHeight: 500\n width: 1000\n height: 600\n property bool cls: false\n\n\n /*function getFileDialogUrl() {\n return\n }*/\n onClosing: if (!cls) {\n close.accepted = false\n }\n\n FileDialog {\n id: imgpicker\n // @disable-check M16\n title: \"Choose an image for this slide\"\n // @disable-check M16\n objectName: \"imgpicker\"\n }\n\n AboutDialog {\n id: aboutDialog\n }\n\n Action {\n id: aboutAction\n text: \"About\"\n onTriggered: aboutDialog.open()\n }\n\n menuBar: MenuBar {\n Menu {\n title: \"&File\"\n MenuItem {\n text: \"Close\"\n shortcut: StandardKey.Quit\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 Menu {\n objectName: \"mnuCtx\"\n title: \"new image...\"\n MenuItem {\n objectName: \"mnuImgPick\"\n text: \"new Image...\"\n onTriggered: imgpicker.open()\n }\n }\n\n SplitView {\n id: mainSlider\n objectName: \"mainSlider\"\n anchors.right: parent.right\n anchors.bottom: parent.bottom\n anchors.top: parent.top\n anchors.left: parent.left\n anchors.rightMargin: 0\n anchors.bottomMargin: 0\n anchors.leftMargin: 0\n anchors.topMargin: 0\n orientation: Qt.Horizontal\n onResizingChanged: col1.width = gridData.width / 2\n\n Rectangle {\n id: gridRect\n objectName: \"gridRect\"\n width: 300\n color: \"#00000000\"\n border.width: 4\n anchors.left: parent.left\n anchors.leftMargin: 0\n anchors.bottom: parent.bottom\n anchors.bottomMargin: 0\n anchors.top: parent.top\n anchors.topMargin: 0\n property int count: 0\n\n ScrollView {\n id: scview\n anchors.fill: parent\n anchors.margins: 4\n horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff\n verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn\n\n SplitView {\n id: gridData\n objectName: \"gridData\"\n width: scview.width - 1\n height: gridRect.count * 101\n\n Rectangle {\n id: col1\n objectName: \"col1\"\n width: gridData.width / 2\n color: \"#00000000\"\n transformOrigin: Item.TopLeft\n border.width: 0\n Rectangle {\n id: textEdit\n property int cell\n x: 232\n y: 622\n objectName: \"textEdit\"\n width: 200\n height: 200\n color: \"#ffffff\"\n visible: false\n property bool txt: tr
|