On 01/03/2018 10:48 AM, Карелин Павел wrote:


03.01.2018 11:12, Nikolai Kosjar пишет:
On 01/02/2018 06:51 PM, Карелин Павел wrote:


02.01.2018 11:40, Eike Ziller пишет:

On 1. Jan 2018, at 18:39, Карелин Павел<[email protected]>  wrote:



01.01.2018 20:34,[email protected]  пишет:
Did you try with the clang code model?
I use the GCC compiler only. Is it possible to use the clang model in this case? In addition, I have a fairly old OS: Ubuntu 14.04.
Which compiler you use for compiling your code does not really matter for the decision on the code model that you use in Qt Creator (except possibly in borderline cases that you probably do not care about...). Even compiler specific defines should be correctly identifying your compiler to be GCC when you specify this in the kit. So you should definitely try the Clang code model - it handles many template situations and most C++11/14/17 situations much better than the built-in model.

Br, Eike
a) Failed to build the  "Clang Code Model" plugin on my system (Kubuntu 14.04). Cause: On "my" system can install llvm-3.9, but I do not have the file /usr/lib/llvm-3.9/include/llvm-s/Inndex.h, so the validation of the clanProbes does not work.

You probably need to install the dev package, too. Try libclang-3.9-dev.
Thanks, it helped.

b) I installed the pre-build QtC 4.5.0. ClangCode model - works. The std::condition_variable highlighting correctly, but many warnings from system header-files that I would prefer not to see. I assume that the system header-files are written correctly ;)

Note that you can adapt the warnings options in Menu: Tools > Options > C++ > Code Model. But yes, it would be probably a good idea to use a different set of warning options for system includes/headers.

c) I decided to dwell on the original version, but slightly modified. I add "-std=c++11" in the function languageOption()

static const QStringList languageOption(Core::Id languageId)
{
     if (languageId == Constants::C_LANGUAGE_ID)
         return {"-x", "c"};
     return {"-x", "c++", "-std=c++11"};
}

That's of course a hack :) The project manager is supposed to find out the version.
М-м-м...  In what way does the project manager now find out about c++11 support in current project? Is it working now?

I'm not to familiar in that area, but IIRC it depends on the project manager. Either it's derived from some language version property in the project files or from the "-std=XYZ" option of the compiler invocation if the project manager has access to it.

If nothing of this is passed on to the code model, the highest supported version is assumed, which is C++17 for the Clang Code Model and some limited C++11 for the built-in code model.

Now the std::condition_variable highlighting correctly.
So far I have decided to stop on it variant.

BR, Pavel.


On Mon, 2018-01-01 at 20:17 +0300, Карелин Павел wrote:
Hi! I congratulate all with come New year!

In my project I use std::condition_variable. But using std::condition_variable is not very convenient, since its methods are not available in the QtC editor. See picture in attachment.
How to make std::condition_variable methods accessible?
I use QtC 4.5 gitrev: 30bd05b792259a559e98c6a19035f7b6adaac1ce

--
BR, Pavel Karelin
_______________________________________________
Qt-creator mailing list

[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator



_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator




_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator

Reply via email to