How to download examples
-
Hi,
So, I'm trying to teach myself and and I'm wanting to download some of the examples:
https://doc.qt.io/qt-5/all-examples.htmlI found the source code and tried creating a standard Qt Widgets application, then dropping the code into newly-created files of the same name.
Unfortunately, when I tried to run the code, the error panel lit up like a Christmas tree and the list of errors was longer than my arm.
A little difficult to debug/fix code that I'm still only learning myself!So, instead of copying the text into files, is there a way to simply bulk download the whole project, such that it should self-contained and able to be run cleanly without too much drama?
Thanks.
-
Either they're installed with Qt Crator and the Qt installer or your can download them from https://code.qt.io/cgit/qt/qtbase.git/tree/examples/ - the link is at the bottom on every example page.
-
Can you be more specific about what the link looks like?
If I click on the file itself, I get the code displayed.
If I right-click on the file, it wants to save as an HTML file.
I see no button/link on any of these pages that would indicate that clicking would download the project and files.Thanks.
-
Either use git to download the whole qt repo or click on the 'plain' link on every file.
-
@Uberlinc said in How to download examples:
So, I'm trying to teach myself and and I'm wanting to download some of the examples
Rather than download examples from the Internet, it is much easier to search for the examples in the Qt Creator IDE instead.
what do you mean by "... use git"?
Again, if you use Qt Creator then you don't need to worry about this.
But anyway, git is an important tool for software developers. Learn it in your spare time (remember this is completely separate from the Qt examples): https://git-scm.com/
-
@Uberlinc said in How to download examples:
what do you mean by "... use git"?
Git is a version control manager (it was created by the same guy that created Linux to keep the Linux code in order), you can download it here: https://git-scm.com/ but it's not that newcomers friendly on its own so i suggest you use an interface client.
IMHO the best is https://gitextensions.github.io/ but, if you are not on windows, you might prefer something like https://www.gitkraken.com/ -
@JKSH said in How to download examples:
Again, if you use Qt Creator then you don't need to worry about this.
I am actually using Qt-Creator on Xubuntu.
As part of the install, I tried to run an apt install of something that looks like examples but it appears to have failed.Are there examples within the actual Qt Creator?
If so, how does one access them?Thanks.
-
@Uberlinc said in How to download examples:
Are there examples within the actual Qt Creator?
If so, how does one access them?Yes. https://doc.qt.io/qtcreator/creator-build-example-application.html
I am actually using Qt-Creator on Xubuntu.
As part of the install, I tried to run an apt install of something that looks like examples but it appears to have failed.You need to do one of the following:
- Work out why it failed and fix it, so that you can install the examples from apt. OR
- Install Qt and Qt Creator from the official installer: https://www.qt.io/download-open-source
-
anyone still having trouble downloading examples, can find it here:
https://code.qt.io/cgit/qt/qtbase.git/bottom left you will find.
git://code.qt.io/qt/qtbase.git
http://code.qt.io/qt/qtbase.git
https://code.qt.io/qt/qtbase.gituse git client to download.