TylrRC
TylrRC

Reputation: 103

How to load a Git clone into QtCreator

I'm very new to using any sort of version control with QtCreator, so I'm sure I'm just making a rookie mistake, but here goes:

I am able to create a clone of a repository (https://github.com/dsacre/klick.git). All of the files are there. The problem lies with getting this clone into QtCreator for me to mess around with.

I go about making a clone through File -> New File or Project -> Import Project -> Git Clone

I enter https://github.com/dsacre/klick.git on the "Repository" line and then hit Next.

The following text is then displayed:

Cloning into 'klick'...
remote: Counting objects: 1223, done.        
remote: Total 1223 (delta 0), reused 0 (delta 0), pack-reused 1223        
Receiving objects: 100% (1223/1223), 407.30 KiB | 29.00 KiB/s, done.
Resolving deltas: 100% (923/923), done.
Checking connectivity... done.
Succeeded.

Then, when I click Finish, a dialog box appears, saying "Failed to open project in /home/tylrrc/klick" and "No file to open found in /home/tylrrc/klick". When I look in /home/tylrrc, I can see /klick and all of the files it contains.

What am I doing wrong here?

Does QtCreator require a special type of file to be present in a project before it can open it?

Upvotes: 2

Views: 5548

Answers (2)

Duck Dodgers
Duck Dodgers

Reputation: 3461

In addition to Vladimir's answer, there is a built-in automatic way to do this.

You can import the project.

  1. Click File->New File or Project .... This will open the following dialog. Select the option Import Project->Import Existing Project, as shown below.

enter image description here

  1. Next give the name and path (/home/tylrrc/klick in your case) for your project.

enter image description here

  1. You can select if you would like particular file extensions to be included or excluded from the view/project. If you are not sure, (and probably for most simple projects), it is enough to just go ahead with the defaults suggested by QtCreator.

enter image description here

  1. Finally include (or not) your Qt project files to the Git repo.

enter image description here

Depending on how simple your project structure is, you may be able to build your project now from within QtCreator.

EDIT:

I noted that the build-system used in the project is scons. As per the documentation on this page, the above import steps should work for you.

Upvotes: 1

Vladimir Bershov
Vladimir Bershov

Reputation: 2832

Does QT require a special type of file to be present in a project before it can open it?

Yes, any Qt project must has a *.pro file: http://doc.qt.io/qt-5/qmake-project-files.html

Therefore you need to create new empty project in QtCreator: File -> New File or Project -> Application -> Qt Widgets/Console Application. Then you should add the files which you have downloaded:

enter image description here

Upvotes: 0

Related Questions