//! [0] in Qt Source Code

//! [0] in Qt source code

Despite the common misconception, this is qdoc syntax, not doxygen. This comment is for documentation purposes in the Qt Project to mark example snippets to be rendered so. See the documentation and the corresponding code that implements this feature.

As an end user of Qt, you do not need to deal with it too much unless you start contributing to the Qt Project itself or you are trying to reuse qdoc for your own project, which would be admittedly odd at this point.

What does //! [0] mean in Qt C++ example code?

It is used in Qt for generating the web documentation from the source code. usually, wherever you find the //! [NUMBER], you will be able to see that piece of code in the web documentation.
Also, it is found at the end of the code, so the documentation generator tool can know which portion of the code goes where.

Of course, the //! tags are found in the source code, but not in the generated documentation. Otherwise, the documentation would become unreadable.

Why they have used this?
It begins with // (meaning it is a comment, so the compiler will ignore it), and they have added a "!" for the generator tool, so it can separate the code comments from the documentation info.

//![1] This line will be generated into the documentation explaining the following function
void somethingDifficult()
{
//This would be a normal comment, so not exported to documentation
}
//![1] Here we mark the end of the export to the documentation

Is Qt Creator source code not included in Qt Src?

Qt and Qt Creator are both developed inside the Qt Project, but are still two separate projects. Qt Creator depends on Qt, but not the other way around, one can use Qt perfectly fine without Qt Creator. They are released independently and with different versioning.

The "sources” package in the Qt installer refers to the Qt source code only, not to Qt Creator. In the installer you’re offered different versions of Qt, all with their own “sources” packages, but only one Qt Creator (the latest one).

You can find the Qt Creator source code in the Qt Download section (the source code archives end in .tar.xz/.tar.gz/.zip) or in the Git repository.

I can't step into qt source code on Windows

I have solved the problem after I downloaded Qt5.8.0 and installed it. Maybe the problem is just in Qt5.5.0 because of the incorrect pdb files downloaded from Qt official website.

Is there a easy way to protect, or revert Qt source code?

Thankfully my code is source controlled, I just reverted everything, would it be feasible/sensible to make a git repo for the Qt sources too? (I have the free version so I didn't think I could modify them anyway...?)

Feasible? Definitely. Sensible? Perhaps, assuming that by "make a git repo" you mean "cloning the official Qt repos from Git". It depends on how many times you plan on making the same renaming mistake. :D But seriously, I think there are benefits to building Qt yourself:

  • You can easily debug and check the implementation of API that you're using.
  • You can configure Qt to skip building stuff that you're not interested in.
  • You can easily patch Qt if there's a bug that you know of a fix for but hasn't been merged into Qt itself yet.

There are downsides too, though. You might run into build issues if you're using configure flags that the CI doesn't use (such as a -no-foo option). It can take a while to build depending on how many submodules you have and what kind of machine you're building on.

In general, if you're not using API that's in dev and not yet released, it's probably not worth bothering.

If you're still interested, this page has instructions for building Qt from Git:

https://wiki.qt.io/Building_Qt_5_from_Git

Is there a hidden setting that will prevent its sources from being modifiable, to stop me from doing this again?

Couldn't you set some permissions on the source directory? I've never had to do this, but have been bitten by it on unrelated occasions before, so I know it works. :D

I'm currently using the maintenance tool to install a newer version of Qt, but other than update or add/remove, there wasn't a re-install option that I could see, am I missing something?

Remove and add is your only option, I think. Otherwise, you can always keep a backup of the source by just copying the whole directory.



Related Topics



Leave a reply



Submit