Discussion:
[Qt-creator] How set __cplusplus more than 201103L in QtC Editor?
Карелин Павел
2018-01-01 17:17:25 UTC
Permalink
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
t***@gmail.com
2018-01-01 17:34:04 UTC
Permalink
Did you try with the clang code model?
Post by Карелин Павел
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
http://lists.qt-project.org/mailman/listinfo/qt-creator
Карелин Павел
2018-01-01 17:39:14 UTC
Permalink
Post by t***@gmail.com
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.
Post by t***@gmail.com
Post by Карелин Павел
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
http://lists.qt-project.org/mailman/listinfo/qt-creator
Eike Ziller
2018-01-02 08:40:54 UTC
Permalink
Post by t***@gmail.com
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
Post by t***@gmail.com
Post by Карелин Павел
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
http://lists.qt-project.org/mailman/listinfo/qt-creator
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Карелин Павел
2018-01-02 17:51:17 UTC
Permalink
Post by Eike Ziller
Post by t***@gmail.com
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.
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 ;)
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"};
}


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

BR, Pavel.
Post by Eike Ziller
Post by t***@gmail.com
Post by Карелин Павел
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
http://lists.qt-project.org/mailman/listinfo/qt-creator
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Nikolai Kosjar
2018-01-03 08:12:07 UTC
Permalink
Post by Eike Ziller
Post by t***@gmail.com
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.
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.
Now the std::condition_variable highlighting correctly.
So far I have decided to stop on it variant.
BR, Pavel.
Post by Eike Ziller
Post by t***@gmail.com
Post by Карелин Павел
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
http://lists.qt-project.org/mailman/listinfo/qt-creator
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Карелин Павел
2018-01-03 09:48:46 UTC
Permalink
Post by Nikolai Kosjar
Post by Карелин Павел
Post by Eike Ziller
Post by Карелин Павел
Post by t***@gmail.com
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.
Post by Nikolai Kosjar
Post by Карелин Павел
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
Post by Карелин Павел
C++ > Code Model. But yes, it would be probably a good idea to use a
different set of warning options for system includes/headers.
Post by Карелин Павел
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?
Post by Nikolai Kosjar
Post by Карелин Павел
Now the std::condition_variable highlighting correctly.
So far I have decided to stop on it variant.
BR, Pavel.
Post by Eike Ziller
Post by Карелин Павел
Post by t***@gmail.com
Post by Карелин Павел
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
http://lists.qt-project.org/mailman/listinfo/qt-creator
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Nikolai Kosjar
2018-01-03 16:01:42 UTC
Permalink
Post by Карелин Павел
Post by Nikolai Kosjar
Post by Eike Ziller
Post by Карелин Павел
Post by t***@gmail.com
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.
Post by Nikolai Kosjar
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.
Post by Карелин Павел
Post by Nikolai Kosjar
Now the std::condition_variable highlighting correctly.
So far I have decided to stop on it variant.
BR, Pavel.
Post by Eike Ziller
Post by Карелин Павел
Post by t***@gmail.com
Post by Карелин Павел
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
http://lists.qt-project.org/mailman/listinfo/qt-creator
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Карелин Павел
2018-01-03 09:16:16 UTC
Permalink
Post by Карелин Павел
Post by Eike Ziller
Post by t***@gmail.com
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.
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 ;)
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"};
}
Now the std::condition_variable highlighting correctly.
So far I have decided to stop on it variant.
BR, Pavel.
Eike, there is still a question: the native Code Model will be
supported? Or in the future will remain only Clang Code Model?

--
Pavel
Nikolai Kosjar
2018-01-03 16:08:26 UTC
Permalink
Post by Карелин Павел
Post by Eike Ziller
Post by t***@gmail.com
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.
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 ;)
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"};
}
Now the std::condition_variable highlighting correctly.
So far I have decided to stop on it variant.
BR, Pavel.
Eike, there is still a question: the native Code Model will be
supported? Or in the future will remain only Clang Code Model?
The Clang Code Model will gradually take over. The support for the
built-in code model is already limited now.
Post by Карелин Павел
--
Pavel
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Loading...