amlwwalker / got-qt

A framework for building cross platform GUI interfaces in Go and QML
MIT License
300 stars 14 forks source link

Worked ok until I got here ... #3

Closed gcstang closed 6 years ago

gcstang commented 6 years ago

Update the path in qt/main.go stored as the variable topLevel to the new path of your project. This is an absolute build path currently set to this project, as opposed to yours.

Is this my project where I originally built it or under src/amlwwalker/ ?

I get this error: can't load package: package amlwwalker/ex_qt: no Go files in $GOPATH/src/amlwwalker/ex_qt

amlwwalker commented 6 years ago

yeah absolutely, that is hardcoded to the current project so you need to change the path to your project. Basically point it at the directory containing the QML that you want it to monitor for hotloading.

Does that make sense? Keep me updated, this has only been tested by me so far, so any feedback on the steps would be great.

FYI I plan on improving anything that is nasty about setup (for instance setting the topLevel path) so if you have any ideas, or make any generic changes would be great to know!

EDIT:

I just looked at your error. You have set your top level path to: $GOPATH/src/amlwwalker/ex_qt apparently. Looks like you are missing github.com (unless you actually have put this project straight in src?? Check the path and make sure it does indeed exist as you have it written

amlwwalker commented 6 years ago

Can I close this?

gcstang commented 6 years ago

As per your instructions: ` MacOS:export OSTYPE=darwin

export PROJECTNAME=myproject

cd $GOPATH/src/amlwwalker

git clone https://github.com/amlwwalker/got-qt

cp -r got-qt $PROJECTNAME

cd $PROJECTNAME `

I exported OSTYPE exported the name of my project tried to cd but that didn't exist so I created it mkdir $GOPATH/src/amlwwalker etc...

amlwwalker commented 6 years ago

Thanks for this, I went through the process myself. Just to note, if you clone a repository from github, it won't create the directory structure you see on github. In Go, its good practice to store each project (from github or wherever) under the matching directory structure. So if you clone github.com/amlwwalker/got-qt into your $GOPATH/src you won't get github.com/amlwwalker made automatically, you do need to create the structure. This is good practice as imports will expect the right structure locally. So yes, you would have needed to create github.com and amlwwalker directories yourself (unless I setup go get which I haven't yet) In the second last line of your comment on this issue, mkdir $GOPATH/src/amlwwalker is therefore incorrect as the github.com directory is missing from your directory structure. Try and match mine otherwise yes, you will have loads of changes to make to my project. I recommend keeping structure for all go projects you clone.

OK... onto the actual setup:

The instructions are pretty generic in the README as things tend to differ slightly, however I noticed I had left one step out which will be necessary, before running qtdeploy test desktop you would have needed to cd qt. I've also added a youtube video of me going through this part of the process. Note my directory paths incase that is different for you. (Also note in my demo, I do not change the topLevel path away from the got-qt qml path, so you still need to do that so that it is looking at your projects QML files, rather than got-qt's QML files). youtube link here I recommend you turn on english subtitles as I have added some viewing tips

You can see the changes I made to the readme as a result of this issue here: https://github.com/amlwwalker/got-qt/commit/491c5a7fadd28a3f86d4203f0b48fe93da98134c#diff-04c6e90faac2675aa89e2176d2eec7d8L137

amlwwalker commented 6 years ago

Hey @gcstang I've added automated build scripts u can read the conversation here https://github.com/amlwwalker/got-qt/issues/4

or just go to the instructions here: https://github.com/amlwwalker/got-qt/blob/master/MAKEFILE.md I've just pushed it into master