[Qt-creator] Stepping down as maintainer of Qt Creator's C/C++ language support

2020-05-18 Thread Nikolai Kosjar

Hiya,

as this is my last month with the Qt Company, I'm stepping down as the 
maintainer of Qt Creator's C/C++ language support.


It was my pleasure to work with some extraordinary ladies and gentlemen. 
Thank you.


The Qt Company is interested in a successor. Until a long-term 
replacement is found/evolves, Christian Kandeler will keep an eye on the 
C/C++ language support.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Qt Creator 4.11 frequently becomes non-responsive

2020-01-06 Thread Nikolai Kosjar
On 12/22/19 2:06 AM, Adam Light wrote:
> 
> On Sat, Dec 21, 2019 at 4:30 PM Dmitry Volosnykh 
> mailto:dmitry.volosn...@gmail.com>> wrote:
> 
> Hi Adam, there's somewhat similar issue filed in Jira:
> https://bugreports.qt.io/browse/QTCREATORBUG-23336
> Initially, it is focused on macOS, but maybe you will find your
> experiences the same, then the status of this issue might be changed
> to a wider scope.
> 
> 
> Dmitry, thanks for the link, but I think that's a completely separate 
> problem. I'm actually not doing any debugging at all--I'm not even 
> running the application, just editing code and rebuilding.
> 
> Here is part of a stack trace I recorded. I clicked the X to close a 
> single file and Creator hung for 5 or more seconds. I was able to record 
> a trace the tail end of that hang, and here is the stack trace for the 
> Creator thread taking most of the time. The time column on the left is 
> in seconds.
> 
> 1.7382851   |- ntdll.dll!RtlUserThreadStart
> 1.7382851   |    kernel32.dll!BaseThreadInitThunk
> 1.7382851   |    Qt5Core.dll!
> 1.7382851   |    Qt5Core.dll!
> 1.7382851   |   CppTools4.dll!Utils::Internal::AsyncJob (__cdecl&)(QFutureInterface & 
> __ptr64,QSharedPointer,CppTools::BaseEditorDocumentParser::UpdateParams),QSharedPointer,CppTools::BaseEditorDocumentParser::UpdateParams
>  
> const & __ptr64>::run
> 1.7382851   |   
>   CppTools4.dll!CppTools::BaseEditorDocumentProcessor::runParser
> 1.7372606   |    |- CppTools4.dll!CppTools::BaseEditorDocumentParser::update
> 1.7372606   |    |   
>   CppTools4.dll!CppTools::BuiltinEditorDocumentParser::updateImpl
> 1.7176022   |    |    |- 
> CppTools4.dll!CppTools::Internal::CppSourceProcessor::run
> 1.7176022   |    |    |   
>   CppTools4.dll!CppTools::Internal::CppSourceProcessor::sourceNeeded
> 1.7176022   |    |    |    CPlusPlus4.dll!CPlusPlus::Preprocessor::run
> 1.7176022   |    |    |   
>   CPlusPlus4.dll!CPlusPlus::Preprocessor::preprocess
> 1.7176022   |    |    |    CPlusPlus4.dll!CPlusPlus::Preprocessor::lex
> 1.7176022   |    |    |   
>   CPlusPlus4.dll!CPlusPlus::Preprocessor::handlePreprocessorDirective
> 1.7176022   |    |    |   
>   CPlusPlus4.dll!CPlusPlus::Preprocessor::handleIncludeDirective
> 1.7176022   |    |    |   
>   CppTools4.dll!CppTools::Internal::CppSourceProcessor::sourceNeeded
> 1.7176022   |    |    |    CPlusPlus4.dll!CPlusPlus::Preprocessor::run
> 1.7176022   |    |    |   
>   CPlusPlus4.dll!CPlusPlus::Preprocessor::preprocess

Apparently the built-in preprocessor does some heavy work.

Closing the document should abort the preprocessor at the next #include 
directive it encounters. Until then, the UI blocks. In your case, it 
seems to take too much time until this point is reached.

Does your small file includes some insanely (possibly code-generated) 
huge header file?

You could try to make use of:

   Menu: Tools > Options > C++ > Code Model
 [x] Do not index files greater than _1MB_

This setting might explain the difference between your setups.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Fwd: [Development] Qt 5.14.0 and Qt Creator 4.11.0 released

2019-12-19 Thread Nikolai Kosjar
Hi!

Sorry for the late reply, I wasn't available until recently.

On 12/13/19 12:36 AM, Oleg Shalnev wrote:
> 1) Where is custom clang-tidy check rules.
> image.png

Custom diagnostic configurations for clang-tidy and clazy were moved to 
the Analyzer (ClangTools plugin). See Menu: Tools > Options > Analyzer > 
Clang Tools.

While clang-tidy and clazy diagnostics are not displayed anymore in the 
editor as annotations, you can start the analyzer for the current file now.

For more information and discussion, see

   https://bugreports.qt.io/browse/QTCREATORBUG-23348

> 2) clang code model works completely wrong. Don't find simple things.
> image.png

This regression is tracked by

   https://bugreports.qt.io/browse/QTCREATORBUG-23330

and the change

   https://codereview.qt-project.org/c/qt-creator/qt-creator/+/285042

is supposed to fix this. Once this is submitted, please verify with new 
snapshots that will be available at

   http://download.qt.io/snapshots/qtcreator/4.11/

> 3) After turning clang code mode off code highlights wrong too
> image.png

The old code model can't parse "[[nodiscard]]", I assume it's the same 
with Qt Creator 4.10.

> 4) no way to set clang+ccache kit. QtCreator forget settings back to gcc 
> after reload.
Can't say anything regarding this one. Did you create a bug report for it?

Nikolai


___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] LLVM/Clang version (commit) used for particular Qt Creator version

2019-09-24 Thread Nikolai Kosjar
On 9/24/19 10:16 AM, Nikolai Kosjar wrote:
> On 9/13/19 4:53 PM, Andrzej Telszewski wrote:
>> On 04/01/2019 16:36, Nikolai Kosjar wrote:
>>> You could ask the shipped clang binary:
>>>
>>> ${INSTALL_DIR}/libexec/qtcreator/clang/bin $ ./clang --version
>>> clang version 7.0.0 (git://code.qt.io/clang/clang.git
>>> 65ea1c5121bb4b4435d3765b5065003f47613d05)
>>> (git://code.qt.io/clang/llvm.git
>>> 301f81d7927dc13cf45e2e8daa8fee0ac87348dc)
>>
>> Hi,
>>
>> Checking for commit hash does not work anymore as of QtC 4.10.
>> That is, for whatever reason, the shipped clang binary does not display
>> the commit hash when invoked with _--version_ switch.
>>
>> Please advice.
> 
> We've moved to the mono repository of llvm/clang and that's a side
> effect of it. I can confirm that no sha1 is printed with version 8 of
> the mono repository. However, this seems to be fixed in version 9. So
> once we build/ship version 9 it will be there again.
> 
> Until then, here is the sha1 for Qt Creator 4.10:
> 
> https://code.qt.io/cgit/clang/llvm-project.git/commit/?h=release_80-based=b220298d60ddabe9bd9aabfafd78879ce9a810ba

The tag is also available now:

   https://code.qt.io/cgit/clang/llvm-project.git/tag/?h=qtcreator-4.10.0

> (Our mono repository is https://code.qt.io/clang/llvm-project.git,
> please don't use https://code.qt.io/clang/llvm anymore)
> 
> Nikolai
> ___
> Qt-creator mailing list
> Qt-creator@qt-project.org
> https://lists.qt-project.org/listinfo/qt-creator
> 

___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] LLVM/Clang version (commit) used for particular Qt Creator version

2019-09-24 Thread Nikolai Kosjar
On 9/13/19 4:53 PM, Andrzej Telszewski wrote:
> On 04/01/2019 16:36, Nikolai Kosjar wrote:
>> You could ask the shipped clang binary:
>>
>> ${INSTALL_DIR}/libexec/qtcreator/clang/bin $ ./clang --version
>> clang version 7.0.0 (git://code.qt.io/clang/clang.git
>> 65ea1c5121bb4b4435d3765b5065003f47613d05)
>> (git://code.qt.io/clang/llvm.git 
>> 301f81d7927dc13cf45e2e8daa8fee0ac87348dc)
> 
> Hi,
> 
> Checking for commit hash does not work anymore as of QtC 4.10.
> That is, for whatever reason, the shipped clang binary does not display 
> the commit hash when invoked with _--version_ switch.
> 
> Please advice.

We've moved to the mono repository of llvm/clang and that's a side 
effect of it. I can confirm that no sha1 is printed with version 8 of 
the mono repository. However, this seems to be fixed in version 9. So 
once we build/ship version 9 it will be there again.

Until then, here is the sha1 for Qt Creator 4.10:

https://code.qt.io/cgit/clang/llvm-project.git/commit/?h=release_80-based=b220298d60ddabe9bd9aabfafd78879ce9a810ba

(Our mono repository is https://code.qt.io/clang/llvm-project.git, 
please don't use https://code.qt.io/clang/llvm anymore)

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Problem with clang code model when cross-compiling with clang

2019-07-04 Thread Nikolai Kosjar
On 7/3/19 2:18 PM, Nikolai Kosjar wrote:
> On 6/28/19 1:42 AM, Christian Gagneraud wrote:
>> Hi there,
>>
>> QtCreator v4.9.1, from online installer.
>> x86_64 Ubuntu 18.04
>> clang-8 from https://apt.llvm.org
>> target: armv7a-custom-linux (g++-5.3.0)
>>
>> As an experiment, i'm currently cross-compiling our project with clang-8.
>> Since then, the clang-code model is broken.
>> I've noticed these asserts and error messages:
>> "The command \"/usr/bin/clang++-8\" terminated with exit code 1."
> 
> I'm adding some logging category that will provide more details for this
> one:
> 
> https://codereview.qt-project.org/c/qt-creator/qt-creator/+/266987

Submitted, one of the next snapshots at

   http://download.qt.io/snapshots/qtcreator/4.10/4.10.0-rc1/

should contain the change.

Activate the logging rule by starting Qt Creator in an environment 
containing

   QT_LOGGING_RULES=qtc.utils.synchronousprocess=true

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Problem with clang code model when cross-compiling with clang

2019-07-03 Thread Nikolai Kosjar
On 6/28/19 1:42 AM, Christian Gagneraud wrote:
> Hi there,
> 
> QtCreator v4.9.1, from online installer.
> x86_64 Ubuntu 18.04
> clang-8 from https://apt.llvm.org
> target: armv7a-custom-linux (g++-5.3.0)
> 
> As an experiment, i'm currently cross-compiling our project with clang-8.
> Since then, the clang-code model is broken.
> I've noticed these asserts and error messages:
> "The command \"/usr/bin/clang++-8\" terminated with exit code 1."

I'm adding some logging category that will provide more details for this 
one:

   https://codereview.qt-project.org/c/qt-creator/qt-creator/+/266987

 > ...
> And Finally:
> Parsing /current/source/file/in/editor.cpp failed: CXError_Failure
> Reparsing /current/source/file/in/editor.cpp failed: 3

The command line that we pass on to libclang might be totally broken. 
Please run Qt Creator within an environment containing

   QT_LOGGING_RULES=qtc.clangbackend.verboselib=true

to show the command line here.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] QtCreator on F29

2019-06-26 Thread Nikolai Kosjar
On 6/25/19 9:36 PM, Richard Kimberly Heck wrote:
> On 6/25/19 3:11 PM, Richard Kimberly Heck wrote:
>>
>> Hi, André! Hope you are well.
>>
>> On 6/19/19 5:10 PM, André Pönitz wrote:
>>> On Fri, Jun 14, 2019 at 10:12:52PM -0400, Richard Kimberly Heck wrote:
 Since upgrading to Fedora 29 (yes, I tend to be a bit behind), I've been
 having problems using QtCreator as I always have to work on LyX.
 Specifically, QtCreator fails to find a lot of included files, with the
 result that there are gazillions of 'parse errors' displayed in the
 editor. For example, our own generated config.h is not found, and
 QtCreator complains that none of the Qt headers are found.

 Any idea what has changed or what I might do? I've tried deleting all
 the *.creator files, etc.
>>> I guess there's more information on the actual versions needed.
>>>
>>> I tried current LyX + Qt Creator + Qt (all recent-ish git)
>>> with CMake and it built and run out-of-the-box.
>>
>> This is all on Fedora 29.
>>
>> About QtCreator says:
>>
>> Qt Creator 4.7.2
>>
>> Based on Qt 5.11.3 (GCC 8.2.1 20181215 (Red Hat 8.2.1-6), 64 bit)
>>
>> Qt itself is 5.11.3
>>
>> I've just cloned the LyX git repo into a fresh directory, and I have 
>> the same problem. The first and in a way biggest problem is that 
>> config.h is not being found. But nor are the Qt headers, still. I'm 
>> attaching a screenshot showing what I see.
>>
>> It is possible, of course, that it is a Fedora problem. The problem 
>> appeared when I upgraded to F29.
>>
> I've just downloaded Qt 4.9.1, and the problem with the Qt headers 
> persists. I also tried deleting (or moving) all of the QtCreator files 
> in ~/.config/. The weird thing is that compilation works fine. It's just 
> in the editor that the errors appear (which then causes all kinds of 
> other problems). For some reason, the Qt headers are just not being 
> found by QtCreator itself. (They are in /usr/include/qt5/.)
> 
> I have checked the "kit" and set the Qt Version to 
> /usr/lib64/qt5/bin/qmake-qt5. This reports Qt version 5.11.3, and the 
> "Details" section gives the expected info.
> 
> How does QtCreator try to find the Qt headers?

1) Regarding the missing config.h - as this is generated by the build 
system, you need to build. If you have, try re-opening e.g. GuiView.cpp

2) In projects mode, there is no warning icon in front of the kit name, 
correct? If there is one, what's the warning?

3) In your attached screenshot, there is a yellow warning icon in the 
editor toolbar, just before the symbol outline dropdown ("") - what does it warn about?

4) Open the problematic file and Menu: Tools > C++ > "Inspect C++ Code 
Model..." should provide you the list of include paths the code model 
gets (Top level tab: "Project Pats", bottom level tab: "Header Paths"). 
Maybe more essential include paths are missing?

5) Which cmake version are you using? I have cmake-3.14.5 and that seems 
to work fine once the build process generated config.h.

Nikolai



___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Find usages of contructor bug

2019-04-30 Thread Nikolai Kosjar
On 4/29/19 8:07 PM, Jonathan Bishop wrote:
> Hi,
> 
> Anyone have an update on this? I think it is bug #15018. Last I read is 
> that they were fixing this in clang but I am using 4.2 and it still is 
> not fixed.

No update. Clang indexer is still in the works.

This is This is https://bugreports.qt.io/browse/QTCREATORBUG-14228

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] QtCreator 4.9 and Clang Tidy Feedback

2019-02-20 Thread Nikolai Kosjar
On 2/19/19 3:19 PM, Michael Jackson wrote:
> Started using the 4.9 betas last week and generally I like the 
> improvements. I do like the idea of moving the clang-tidy to the 
> “Analyze” menu in order to make it easier to get to.

It was already in that menu since version 4.7. And before that it was 
also there, but as "Clang Static Analyzer" :)

> Could we get a 
> “Clang-Tidy current File” (in the same idea as Beautifier plugin has 
> Clang-Format current file).

Sounds useful. https://bugreports.qt.io/browse/QTCREATORBUG-22008 was 
just created for this.

Another one that might be useful is "Analyze the touched files of last N 
commits."

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Clang code model issues

2019-02-08 Thread Nikolai Kosjar
Hi!

I've started to write inline comments (see below), but it got quite 
confusing. Here is the summary.

I see these main issues from all your references:

1) Several parse issues on or related to Windows.
   ==> We've changed the internal clang command line and this might fix 
some issues related to parsing. At least it fixed several things on 
Linux, like parsing some boost headers or parsing with _GNU_SOURCE. The 
best you can do now is to provide feedback to the reports with current 
4.9 snapshots. Qt Creator 4.9 release is scheduled for start of April.

2) Parse issues related to _GNU_SOURCE.
==> Fixed in Qt Creator 4.9.

3) Generic project and the inability to specify extra flags like 
language version.
==> Fixed in Qt Creator 4.9.

4) For a problematic #include, following #includes are not considered.
==> I will look into it.

Nikolai





On 2/8/19 9:11 AM, Julius Bullinger wrote:
> Hi, >
> it seems like there are more and more complains about the recent clang 
> model model changes:
> 
> Mailing list threads (cannot link, since the archive was broken):
> 
> * "Clang-Tidy and Clazy analyzer using '-D__cplusplus=199711L'" from 
> August 2018

Generic project. Qt Creator 4.9 allows to specify language version and 
other flags.

> * "Clang code model running in C++98 mode" from November 2018 
> (Disclaimer: started by myself)

That's your QTCREATORBUG-21765 from below (double).

> * "Clang processes not being stopped when killing a compile" from 
> January 2019

That's not related to the Clang Code Model.

> * "Qt creator + Clang model = major annoyance" from January 2019

There are multiple issues raised there...

> Bug reports:
> 
> * https://bugreports.qt.io/browse/QTCREATORBUG-21729 with several people 
> being affected
> * https://bugreports.qt.io/browse/QTCREATORBUG-21892

Possibly a regression in Clang. Will look into it.

> * https://bugreports.qt.io/browse/QTCREATORBUG-21765 (disclaimer: filed 
> by myself)
> * https://bugreports.qt.io/browse/QTCREATORBUG-21764
> * https://bugreports.qt.io/browse/QTCREATORBUG-21750
> * https://bugreports.qt.io/browse/QTCREATORBUG-21734

> * https://bugreports.qt.io/browse/QTCREATORBUG-21688

This is related to _GNU_SOURCE and seems to be resolved with 4.9.

> * https://bugreports.qt.io/browse/QTCREATORBUG-21685

The other reports I haven't commented on seem to be related to Windows.

> Blog post comments:
> 
> * 
> https://blog.qt.io/blog/2018/12/06/qt-creator-4-8-0-released/#comment-1206951 

Again the _GNU_SOURCE issue, same as QTCREATORBUG-21688 from above (double).

> * 
> https://blog.qt.io/blog/2018/12/06/qt-creator-4-8-0-released/#comment-1206998 

Two issues are mentioned:
* The QTCREATORBUG-21892 from the list above in which I will look into 
(double).
* Generic project and extra flags again, should be fine with Qt Creator 4.9.

> * 
> https://blog.qt.io/blog/2018/12/06/qt-creator-4-8-0-released/#comment-1207042 

> Some of them are said to be fixed in Creator 4.9, but I cannot confirm 
> that.

Re-open the corresponding reports and provide more information if 
necessary or create a separate report if your issue is different.

> It seems like there's major problems with bigger projects, older 
> compilers, external headers, and other "uncommon" configurations. That 
> makes QtC currently barely usable in these circumstances.
> 
> Is there a short-term plan for handling these issues?

Some issues are fixed with 4.9.

For others that are not easily reproducible feedback with current 4.9 is 
needed (or more information how to reproduce in the first place, like 
QTCREATORBUG-21729).

> And additionally, 
> could automatic testing be expanded to catch these early in the future?

I'll check.
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] How to force the code model to not inspect host system headers?

2019-01-30 Thread Nikolai Kosjar
On 1/29/19 5:22 PM, Charlie Turner wrote:
> Hello,
> 
> I have imported a project from existing sources. I have passed include 
> paths in .includes to a sysroot where things like math.h should 
> be resolved to.
> 
> Instead, code model decides to take such header from my host machine, 
> which causes all sorts of problems. How can I control the code model 
> search paths?

Hi Charlie!

The kit for the project might have the wrong compiler/toolchain set.

Set up a kit for the project with the corresponding compiler. You might 
need to add the compiler manually. Put only project related include 
paths into .includes, but no toolchain paths as these will be 
picked up from the kit's compiler.

Your could also set up a kit with no compiler. In that case you would 
put toolchain paths and project-related paths into .includes 
(full control), however, then you would also need to provide all the 
necessary macros in .config (toolchain macros, project macros).

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] LLVM/Clang version (commit) used for particular Qt Creator version

2019-01-21 Thread Nikolai Kosjar
On 1/20/19 10:31 AM, Andrzej Telszewski wrote:
> On 18/01/2019 15:54, Nikolai Kosjar wrote:
>> http://code.qt.io/cgit/clang/llvm.git/  has the following tags now:
>>
>>     qtcreator-4.8.0
>>     qtcreator-4.8.1
> 
> This is really cool news :)
> 
> Now, is there a way to download a tarball for the particular tag?

I don't know much about cgit, sorry.

Our build script does not create source tar balls, but this brings you 
quite close (except not being a tarball...):

   $ git clone -b qtcreator-4.8.1 --depth 1 --recursive 
https://code.qt.io/clang/llvm

> And if so, would cgit include submodules in the tarball?

I don't know either, but note that LLVM/Clang moves to a mono-repo. 
Eventually we will need to follow so that there will be no submodules 
anymore.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] LLVM/Clang version (commit) used for particular Qt Creator version

2019-01-18 Thread Nikolai Kosjar
On 1/8/19 6:53 PM, Andrzej Telszewski wrote:
>>> Maybe you could add git tags to point to the commit in use for a given
>>> QtC version?
>> I'll try to create the necessary tags.
> Any timeframe for that?
http://code.qt.io/cgit/clang/llvm.git/ has the following tags now:

   qtcreator-4.8.0
   qtcreator-4.8.1

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Qt creator + Clang model = major annoyance

2019-01-08 Thread Nikolai Kosjar
On 1/8/19 8:24 AM, Eike Ziller wrote:
> Two prominent server implementations for C++, Clangd and cquery are based on 
> libclang, so I’d expect some of the issues that we have (like with parsing 
> some Windows headers, file locking, getting it to use the right compiler 
> options, parsing speed) will simply be the same.

clangd does not use libclang. Anyway, this does not invalidate the above 
statement completely as there is some shared code.

>> I too have noticed QtC's recent versions slowing down. I used to think it 
>> was a cool add, but it's starting to get in the way. OR it could be that my 
>> expectations have increased and I rely on it more whereas it as a 
>> nice-to-have. But the slowdowns remove the value added.
> 
> Please definitely make sure that you use a configuration that does not 
> include any clang-tidy checks (Options > C++ > Code Model). Any of these 
> check should be considered “optional, only enable if they do not degrade 
> performance for you”.
> 
> I fell into the same trap recently, so I wonder what we could do to provide 
> users with better hints when this happens?

In Options > C++ > Code Model, where the diagnostic configuration for 
the code model is selected, we could display a warning if the 
configuration contains any checks for tidy/clazy.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Anyone getting sagfault messages in dmesg while using Creator 4.8?

2019-01-07 Thread Nikolai Kosjar
On 1/7/19 12:26 PM, Steve Atkins wrote:
>> On Dec 14, 2018, at 1:16 PM, Nikos Chantziaras  wrote:
>>
>> While using Creator 4.8 on Linux (Gentoo 64-bit), sometimes dmesg prints 
>> these:
>>
>> [ 5309.005887] clang-7[26656]: segfault at 8 ip 02da1ee8 sp 
>> 7ffecaac4100 error 4 in clang-7[40+4fbf000]
>> [ 5309.005893] Code: e8 4c 39 f7 0f 84 34 fd ff ff 48 8b 34 24 e8 ff f8 ff 
>> ff e9 26 fd ff ff 48 89 c7 48 8b 47 20 ba 01 00 00 00 66 0f 1f 44 00 00 <48> 
>> 8b 40 08 83 c2 01 48 83 e0 f8 75 f3 48 8b 44 24 18 39 50 28 0f
>> [ 5310.852181] clang-7[26658]: segfault at 8 ip 02da1ee8 sp 
>> 7ffdd83022e0 error 4 in clang-7[40+4fbf000]
>> [ 5310.852187] Code: e8 4c 39 f7 0f 84 34 fd ff ff 48 8b 34 24 e8 ff f8 ff 
>> ff e9 26 fd ff ff 48 89 c7 48 8b 47 20 ba 01 00 00 00 66 0f 1f 44 00 00 <48> 
>> 8b 40 08 83 c2 01 48 83 e0 f8 75 f3 48 8b 44 24 18 39 50 28 0f
>> [ 5320.971586] clang-7[26687]: segfault at 8 ip 02da1ee8 sp 
>> 7ffec51e4f70 error 4 in clang-7[40+4fbf000]
>> [ 5320.971592] Code: e8 4c 39 f7 0f 84 34 fd ff ff 48 8b 34 24 e8 ff f8 ff 
>> ff e9 26 fd ff ff 48 89 c7 48 8b 47 20 ba 01 00 00 00 66 0f 1f 44 00 00 <48> 
>> 8b 40 08 83 c2 01 48 83 e0 f8 75 f3 48 8b 44 24 18 39 50 28 0f
>> [ 5326.328998] clang-7[26695]: segfault at 8 ip 02da1ee8 sp 
>> 7fff7c4d2030 error 4 in clang-7[40+4fbf000]
>> [ 5326.329004] Code: e8 4c 39 f7 0f 84 34 fd ff ff 48 8b 34 24 e8 ff f8 ff 
>> ff e9 26 fd ff ff 48 89 c7 48 8b 47 20 ba 01 00 00 00 66 0f 1f 44 00 00 <48> 
>> 8b 40 08 83 c2 01 48 83 e0 f8 75 f3 48 8b 44 24 18 39 50 28 0f
>>
>> Anyone else getting this? This is the official Creator 4.8 64-bit Linux 
>> build installed using the online installer.
> 
> I get similar SEGVs on macOS. The clang backend is rather crashy, 
> particularly when the code in the editor isn't valid (because it's in the 
> process of being edited). The more recognizable errors look like memory 
> corruption or race conditions.

Doesn't the log messages mean that a process "clang-7" segfaulted? That 
is, rather a compiler invocation instead of the clangbackend?!

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Qt creator + Clang model = major annoyance

2019-01-07 Thread Nikolai Kosjar
On 1/6/19 6:55 PM, Michael Jackson wrote:
> One thing that I have noticed is that 
> if I turn off all the clang-tidy and clazy checks then the speed on 
> first opening is pretty decent (I’m on a 2012 Mac Pro with dual Xeon so 
> not the fastest CPUs in the world). 

Yes, the tidy/clazy checks contribute to the (re)parsing time.

The recommendation is to use the checks that are fast enough for you and 
your project and to run the heavy ones once in a while with Menu: 
Analyze > "Clang-Tidy and Clazy...".

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Qt creator + Clang model = major annoyance

2019-01-07 Thread Nikolai Kosjar
On 1/6/19 4:09 AM, Henry Skoglund wrote:
> My pet CCM hate right now: maintaining existing code with QSignalMapper, 
> code is 100% kosher but do you think I can press F1 to see 
> QSignalMapper's help text? No no, because QSignalMapper is deprecated 
> and thus you're not allowed to see the help text anymore :-(

You can work around that by adding -Wno-deprecated-declarations to your 
diagnostic configuration with the obvious disadvantages.

https://codereview.qt-project.org/#/c/249214/

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Qt creator + Clang model = major annoyance

2019-01-07 Thread Nikolai Kosjar
Hi!

On 1/5/19 2:17 AM, NIkolai Marchenko wrote:
> It's slow, sometimes taking 30+ seconds to react to F2

Some log would be useful. Please follow 
https://wiki.qt.io/Qt_Creator_Clang_Code_Model#Debugging and report.

> What's worse, it reacts to it once you gave up and navigated somewhere 
> manually and makes you suddenly type stuff in plces you won't expect.

I've started https://codereview.qt-project.org/#/c/249207/ to address 
this one.

> It's buggy, fails on boost and fails to produce a highlight on 
> everything that depends on it

Could you point me to the bug report?

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] LLVM/Clang version (commit) used for particular Qt Creator version

2019-01-04 Thread Nikolai Kosjar
On 12/15/18 6:12 PM, Andrzej Telszewski wrote:
> Hi,
> 
> I know that as of now, I should be using LLVM/Clang from:
> https://code.qt.io/clang/llvm
> 
> I've actually used it already, as stated in the building instructions, 
> that is:
> $ git clone -b release_70-based --recursive https://code.qt.io/clang/llvm
> 
> But I would like to ask, how can I find out, which particular commit in 
> the LLVM/Clang repo is used for a given Qt Creator version?
> 
> For kicks, please let me know, which commit was used for QtC 4.8?
> 
> But I would prefer not to ask this question every time a new version is 
> released, but rather somehow dig it out myself.

You could ask the shipped clang binary:

${INSTALL_DIR}/libexec/qtcreator/clang/bin $ ./clang --version
clang version 7.0.0 (git://code.qt.io/clang/clang.git 
65ea1c5121bb4b4435d3765b5065003f47613d05) 
(git://code.qt.io/clang/llvm.git 301f81d7927dc13cf45e2e8daa8fee0ac87348dc)

> Maybe you could add git tags to point to the commit in use for a given 
> QtC version?

I'll try to create the necessary tags.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] about the clang parser backend

2018-12-04 Thread Nikolai Kosjar
On 12/4/18 10:04 AM, René J.V. Bertin wrote:
> One advantage I see for using a server/client backend approach instead of 
> calling into libclang directly is that several IDE instances (sessions) could 
> share the same server, thus decreasing memory overhead (clang can be quite 
> memory hungry). Is there a technical reason why Creator doesn't do this but 
> instead starts session-specific backends(s)?

There is no technical reason for this. The session-specific approach was 
just the simplest one to implement.

I'm also not sure how popular the multiple-qtcreator-instances-running 
case is as it can be problematic for settings.

Whether you can save a significant amount of memory with a 
cross-session-backend depends on what data you keep in the backend and 
the degree of precision you go for.

For us, as the clangbackend manages the translation units of the files 
you have open in the editor, a translation unit is the dominating unit 
consuming memory and each translation unit is quite separate/isolated 
from another (that's how libclang works), and clangbackend does not deal 
with project-wide indexing, there is not much that could be shared right 
now.

Nikolai
___
Qt-creator mailing list
Qt-creator@lists.qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Snippents are not working well

2018-11-26 Thread Nikolai Kosjar
On 11/23/18 2:24 PM, Oleg Shall wrote:
> I use a lot of snippets. And some of my custom snippets are not working 
> in every places with QtC 4.8.rc1.
> Just look at the move example.

This should be fixed by https://codereview.qt-project.org/#/c/246548/

Nikolai
___
Qt-creator mailing list
Qt-creator@lists.qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Clang code model running in C++98 mode

2018-11-15 Thread Nikolai Kosjar
On 11/15/18 3:55 PM, Julius Bullinger wrote:
> Hi Nikolai
> 
> On 06.11.2018 12:19, Nikolai Kosjar wrote:
>> Recently there were some changes in that area. Could you please try
>> again with the updated snapshots for 4.8?
>>
>> http://download.qt.io/snapshots/qtcreator/4.8/4.8.0-beta2
> 
> I managed to built the latest 4.8 branch on my machine, and still got 
> the same issue:
> 
>>> I can't reproduce it with a smaller project, but is there any way I can
>>> debug this issue? Like get the options that are passed from qmake to the
>>> code model?
>>
>> A breakpoint in ProjectInfoGenerator::createProjectPart() should help,
>> especially on
>>
>> part->languageVersion = macroInspectionReport.languageVersion;
>>
> 
> On the first break after loading the project, 
> macroInspectionReport.languageVersion is CXX14 (7). On further breaks, 
> it's CXX98 (4).
> 
> I cannot find any differences in the respective qmake projects. The 
> flags.commandLineFlags that are passed are the following:
> 
> -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline /wd4503 /w14239 /FC 
> /D_LIntStatic /Zi /Fd -O2 -Zi -MD -Zc:strictStrings -W3 -w34100 
> -w34189 -w44996 /WX -EHsc
> 
> However, I found that in tcInfo.macroInspectionRunner, the "__cplusplus" 
> macro has a value of 199711L. This is from msvctoolchain.cpp, which 
> shows some information about the possible values:
> 
> // We want to detect the language version based on the predefined macros.
> // Unfortunately MSVC does not conform to standard when it comes to the 
> predefined
> // __cplusplus macro - it reports "199711L", even for newer language 
> versions.
> //
> // However:
> //   * For >= Visual Studio 2015 Update 3 predefines _MSVC_LANG which 
> has the proper value
> // of __cplusplus.
> // See 
> https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2017
>  
> 
> //   * For >= Visual Studio 2017 Version 15.7 __cplusplus is correct 
> once /Zc:__cplusplus
> // is provided on the command line. Then __cplusplus == _MSVC_LANG.
> // See 
> https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus
>  
> 
> //
> // We rely on _MSVC_LANG if possible, otherwise on some hard coded 
> language versions
> // depending on _MSC_VER.
> 
> We're still running MSVC 2013, which doesn't seem to be covered by this 
> exceptions. I tested opening the project with a MSVC 2017 Version 15.8 
> kit, and with that, the code model reports a C++ version of CXX17 
> (although it should be C++11)!
> 
> So, I guess this is a bug in Creator regarding C++ version detection 
> with MSVC 2013?

Looks like that, yes, please report.

For some reason the code path that checks _MSC_VER fails or is never 
executed. Or there is a bug in the macro cache.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Clang code model running in C++98 mode

2018-11-06 Thread Nikolai Kosjar
On 11/6/18 11:41 AM, Julius Bullinger wrote:
> Hi,
> 
> we have a medium-sized qmake project (about 300 .pri/.pro files), which 
> all contain "CONFIG += c++11". However, the clang code model doesn't 
> seem to catch that, and runs in C++98 mode regardless:
> 
> CTRL+Shift+F12 > Projects Parts > General > Language Version: CXX98
> 
> This causes hundreds of errors and warnings in the editor about C++11 
> extensions and unknown types. With the traditional code model, the 
> project is detected as C++11/14 correctlty.

Recently there were some changes in that area. Could you please try 
again with the updated snapshots for 4.8?

http://download.qt.io/snapshots/qtcreator/4.8/4.8.0-beta2

> I can't reproduce it with a smaller project, but is there any way I can 
> debug this issue? Like get the options that are passed from qmake to the 
> code model?

A breakpoint in ProjectInfoGenerator::createProjectPart() should help, 
especially on

part->languageVersion = macroInspectionReport.languageVersion;

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Formatting of "using" with structs

2018-10-22 Thread Nikolai Kosjar
On 10/19/18 12:50 PM, Andy wrote:
> Do I have something set incorrectly or is it just a bug?

Probably a bug. You could try the experimental ClangFormat plugin, but 
note that it does not honor the Qt Creator settings.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Find Usages of auto variable

2018-10-01 Thread Nikolai Kosjar

On 09/30/2018 08:12 PM, Jochen Becher wrote:

I am not sure if this is related to the new version 4.7.1 I just
installed but "Find Usages" does not work (anymore?) with auto
variables:

This is code from modelinglib:

void DFlatAssignmentVisitor::visitDClass(const DClass *klass)
{
 visitDObject(klass);
 auto target = dynamic_cast(m_target);
 QMT_ASSERT(target, return);
 target->setUmlNamespace(klass->umlNamespace());
 target->setTemplateParameters(klass->templateParameters());
 target->setTemplateDisplay(klass->templateDisplay());
 target->setMembers(klass->members());
 target->setShowAllMembers(klass->showAllMembers());
 target->setVisibleMembers(klass->visibleMembers());
}


Selecting "Find Usages" on "setUmlNamespace" (or any other method name)
does nothing. If I select "Find Usages" on the declaration of method
"setUmlNamespace" in DClass this usage and all other usages where an
auto variable is involved is not found.

If I replace "auto" with "DClass *" it works again (for this usage of
"setUmlNamespace"; not for the others where auto is still used).

Looks like "auto" is not supported with ClangCodeModel 4.7.1. Wasn't it
before?


"Find Usages" isn't ported to the ClangCodeModel, it still relies on the 
built-in code model. The indexing based on clang is in the works...



Other features of ClangCodeModel like error messages in editor text
(tested with "use of undeclared identifier") work.

Regards,

Jochen

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Still no help...

2018-05-17 Thread Nikolai Kosjar

On 05/16/2018 04:15 PM, Jason H wrote:

I have reverted to using the help button on the left pane. Why isn't F1 working?
I have help installed.. it works on some projects but not others.


What do you mean by "help button on the left pane"?
For which code? (C++? QML/JS?)


Is there a way to troubleshoot what fails when I press F1?


For the clang code model, you can start Qt Creator within a run time 
environment containing


  QT_LOGGING_RULES=qtc.clangcodemodel.hover=true

to see debugging output when doing a mouse hover on e.g. identifiers. 
This will query the help data base, basically triggering the F1 code 
path (the tooltip will contain a F1 symbol do indicate that F1 can be 
pressed to go to documentation). A sucessfull run looks like this:


  qtc.clangcodemodel.hover: Requesting tooltip info at 68
  qtc.clangcodemodel.hover: Processing tooltip info "QCoreApplication"
  qtc.clangcodemodel.hover: Querying help manager with 
"QCoreApplication" "QCoreApplication" ClassOrNamespace

  qtc.clangcodemodel.hover:   Match!

Please put answer to these questions and the failing example into a bug 
report.


Note that the clang code model is more sensitive to invalid code than 
the built-in one. Error recovery is not that great.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator 4.6 & editor messages

2018-04-10 Thread Nikolai Kosjar

Please file bug reports with these problems and your answers below.

On 04/09/2018 05:17 PM, Andy wrote:

Thanks Nikolai.

1) I obviously have a disconnect with the code model and includes 
somehow. I have no idea how to find that or fix it. I've played with the 
code model inspector but can't fix the issue.


2) The smallest example would be this lib that I forked a short while ago:

https://github.com/asmaloney/libE57Format 
<https://github.com/asmaloney/libE57Format>


When I open that, turn off tidy and clazy, and navigate to 
src/E57FoundationImpl.cpp for example - the scrollbar is almost solid 
red with "errors"


Does the project build fine for you?
Are the include paths correct in the code model inspector? (tab "Project 
Parts", sub tab "Header Paths")



3) I do not get any messages about clangbackend crashing

4) Fairly frequently I have (unrecoverable) hangs when trying to 
(right-click) "Follow Symbol Under Cursor"


Does the hang happen if you open the menu, or if you click on the 
"Follow Symbol Under Cursor"?


5) Sometimes when doing "Rename symbol under the cursor" (via keyboard), 
the search/replace results show the wrong symbol (often a 
previously-searched symbol)

>

6) I sent another email to the list about the Clang Static Analyzer failing

7) etc...

I looked for any old compilers (via homebrew) in my paths) - none.

So basically nothing seems to be working for me and I can't figure out 
why :-)


Any suggestions on where to look to determine the cause(s) of the 
problem(s)?


(macOS 10.12.6, Apple LLVM version 9.0.0 (clang-900.0.39.2), Qt Creator 
installed via maintenance tool)


Thank you!


---
Andy Maloney  // https://asmaloney.com
twitter ~ @asmaloney <https://twitter.com/asmaloney>


On Wed, Apr 4, 2018 at 2:25 AM, Nikolai Kosjar <nikolai.kos...@qt.io 
<mailto:nikolai.kos...@qt.io>> wrote:


On 29.03.2018 15:46, Andy wrote:

It makes the editor very, very noisy to the point of being
unusable. (And then there are the long pauses where I can't do
anything & have to guess if it's going to come back to me or
just hang - trying to isolate.)


If all clazy and tidy checks are deactivated and it still feels
sluggish, the clangbackend might be crashing (and restarting again)
- do you see any hints in the "General Messages" pane at the bottom?


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org <mailto:Qt-creator@qt-project.org>
http://lists.qt-project.org/mailman/listinfo/qt-creator
<http://lists.qt-project.org/mailman/listinfo/qt-creator>




___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator 4.6 & editor messages

2018-04-04 Thread Nikolai Kosjar

On 29.03.2018 15:46, Andy wrote:
It makes the editor very, very noisy to the point of being unusable. 
(And then there are the long pauses where I can't do anything & have to 
guess if it's going to come back to me or just hang - trying to isolate.)


If all clazy and tidy checks are deactivated and it still feels 
sluggish, the clangbackend might be crashing (and restarting again) - do 
you see any hints in the "General Messages" pane at the bottom?


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator 4.6 & editor messages

2018-04-04 Thread Nikolai Kosjar

On 28.03.2018 20:58, Andy wrote:
> When I get a message (warning/error) in the editor, how do I know which
> it came from?

Usually by looking at the diagnostic name / command line option that is 
also provided:


For clazy, the diagnostics typically include "clazy" in the diagnostic 
command line switch that comes with the diagnostic text, e.g.:


   ...diagnostic text [-Wclazy-copyable-polymorpic]

For tidy, if you have "modernize-*" enabled, then related diagnostics 
start with that prefix.


The rest will come from clang itself.

> I just turned on clang-tidy and clazy (some of the options) and
> something is pointing at things like "QApplication::processEvents();"
> and telling me that there is no matching function call. I guess
> something isn't recognizing default arguments, but... what? Code model?
> Clang-tidy? Clazy?

That sounds as if the code model does not get the correct macros and 
include paths from the project manager.


Please report a preferably minimal example project to reproduce.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] How set __cplusplus more than 201103L in QtC Editor?

2018-01-03 Thread Nikolai Kosjar

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



02.01.2018 20:51, Карелин Павел пишет:



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

On 1. Jan 2018, at 18:39, Карелин Павел  wrote:



01.01.2018 20:34,timur.kris...@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.



--
Pavel



___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator



___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] How set __cplusplus more than 201103L in QtC Editor?

2018-01-03 Thread Nikolai Kosjar

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, Карелин Павел<hka...@yandex.ru>  wrote:



01.01.2018 20:34,timur.kris...@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.


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

Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator




___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator







___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Clang Model plugin interface

2018-01-02 Thread Nikolai Kosjar

On 12/15/2017 05:11 PM, Antonio Di Monaco wrote:

Hi,

I'm writing a Qt Creator plugin to support our own custom build process.

My issue is that I cannot find a way to interact with the Clang Code 
Model plugin, in order to pass to it specific compile options (in my 
case, it's --gcc-toolchain).


In detail, my plugin automates the kit creation, in order to find out 
the custom compiler, debugger, and all other stuff we need to build, 
including our build tool. I'm populating the CppTools::RawProjectsParts 
data structure according
to the specific toolchain that has been selected by the user (that could 
be a Clang, GCC or MSVC compiler), and everything works fine, as long as 
I work with the built-in C++ Code Model.


When I activate the Clang Code Model and GCC profile is activated, as 
the same CppTools::RawProjectsParts data is accessed (is it true or did 
I miss something?), I encounter a failure, cause if I add the 
"--gcc-toolchain" parameter, Clang model works, but the built-in fails. 
And if not, of course the opposite happens, and I'd like to have both 
running.


I'd like just to interact with the Clang Code Model at "run-time" and, 
behind the scene, add my mandatory options to it, without asking the 
user for a UI settings change (also cause the path passed to the 
"gcc-toolchain" parameter changes according to the profile selected by 
the user).


My question is: is there an interface, or anything similar, that I can 
use in order to add such parameters to clang model only? I could also 
change the Qt Creator code, but I'd like to go for the clean way, if 
there's any.


Thanks for your help!
A.


Hi!

There is no interface for this right now. All the information for the 
libclang command line come from the RawProjectsParts and the diagnostic 
options the user has configured. Currently, no concrete options are 
forwardable directly with RawProjectsPart because libclang might now 
understand them, depending on your toolchain


There is CppModelManager::updateCompilerCallDataForProject(), which 
basically allows to set a command line, but it's used for the clang 
static analyzer plugin (not the clang code model) and the qbs project 
only so far.


I suggest that you modify the Qt Creator code to suit your needs and 
then push it for review.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Load external memcheck xml file from new plugin

2017-12-06 Thread Nikolai Kosjar

On 12/06/2017 12:49 PM, Hannes Domani via Qt-creator wrote:

Hello

I have written a plugin (for windows) that starts the current application with 
a tool that creates a memcheck xml file as output.
Is there a way to load this xml file programmatically into the already 
available MemcheckTool window?


The current MemcheckTool::loadExternalXmlLogFile() pop ups a file open 
dialog. You would need to adapt/overload that one and also make it 
accessible from your plugin.


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] SyntaxHighlighting + Bison/FLex

2017-11-23 Thread Nikolai Kosjar

On 11/23/2017 07:29 AM, JeremY Larrieu wrote:

Hello,

I'm working on making a plugin to support a specific language: Anubis.

I've started the highlighting part and I saw that QtCreator is making 
syntax highlighting line by line instead of making it "globally" for the 
whole file.


I just wanna know, how can I use the Bison/Flex files, used to check 
syntax for Anubis language, to make syntax highlighting in QtCreator.
Knowing that most of the tokens declared in the Flex file can be 
multiline, making a lexer, working line by line, able to detect those 
tokens is hard and the code is too "verbose".


I've tried to adapt what I've found in Bison/Flex files to make a syntax 
highlighter, but it's really painful and it makes further updates harder.
If I was able to apply highlighting on the whole file (not line by 
line), it were simpler and I could use it to make some other 
functionalities at the same time: code completion, code analysis, symbol 
detection, ...


Do you have an idea on how I can make syntax highlighting without 
rewriting a full lexer ?


Thanks in advance.

Jeremy


Hi!

I guess you've found TextEditor::SyntaxHighlighter, which does the line 
by line highlighting with highlightBlock(). For C++ and multi-line 
tokens (e.g. C comments) we call our custom lexer for the current line 
with the lexer state from the line before. If flex provides such a state 
based yylex() equivalent, this might work.


The alternative is to use 
SemanticHighlighter::incrementalApplyExtraAdditionalFormats(). With this 
one, you can for example start parsing in a worker thread and provide 
the highlighting information as a stream of 
TextEditor::HighlightingResult items.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator 4.2.0 - Blank outline for some C++ files in imported autotools project

2017-11-20 Thread Nikolai Kosjar
Do you have symbols in the locator for the file? "C++ Symbols in Current 
Document" -  Ctrl+K, dot (.), space

Activating the clang code model might provide some useful diagnostic/hints. 
http://doc.qt.io/qtcreator/creator-clang-codemodel.html#activating-clang-code-model

Please report at http://bugreports.qt.io/

Nikolai


From: Qt-creator  on 
behalf of OmegaPhil 
Sent: Friday, November 17, 2017 6:54:31 PM
To: qt-creator@qt-project.org
Subject: [Qt-creator] Qt Creator 4.2.0 - Blank outline for some C++ files in 
imported autotools project

I'm looking at curve-view.cpp
(https://git.xfce.org/panel-plugins/xfce4-hardware-monitor-plugin/tree/src/curve-view.cpp),
and the Outline is blank on the left (and '' is shown on the
top bar).

Looking at Tools -> C++ -> Inspect C++ Code Model... -> Snapshots and
Documents: Current Editor's Snapshot, the bottom Symbols tab has useful
symbols, and there is no Diagnostic Messages or Undefined Macros output.
Same for other listed snapshots.

As a normal user, is there any way for me to investigate why Qt Creator
(presumably) doesn't like the file?

Thanks for any help.

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] [Development] Nominating Lorenz Haas for approver

2017-11-06 Thread Nikolai Kosjar

On 11/05/2017 06:00 PM, André Hartmann wrote:

Hello all,

I'd like to nominate Lorenz Haas for approver status.

Lorenz has been contributing to Qt and Qt Creator since spring 2013. He 
has provided some high quality patches to Creators C++ Editor and is the 
author of Creators Beautifier plugin.


He is actively reviewing patches in these areas, and recently started 
contributing to and reviewing others patches for Qt OPC UA and MQTT also.


These are his own contributions:
https://codereview.qt-project.org/#/q/owner:%22Lorenz+Haas%22,n,z

and these are his reviews:
https://codereview.qt-project.org/#/q/reviewer:%22Lorenz+Haas%22,n,z

Best regards,
André
___
Development mailing list
developm...@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


+1!

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Clang Static Analyzer does not find STL headers

2017-11-05 Thread Nikolai Kosjar

On 11/04/2017 03:03 PM, Christian Gagneraud wrote:

On 5 November 2017 at 01:40, Benjamin TERRIER <b.terr...@gmail.com> wrote:

2017-11-03 18:07 GMT+01:00 Nikolai Kosjar <nikolai.kos...@qt.io>:


There is not much configuration for the clang static analyzer.

Please create a bug report with:
  * used versions of Qt Creator and configured clang version for the analyzer
  * whether this already happens with a "normal" toolchain. If not, please
provide some information how to set up your used toolchain.


Hi Nikolai, Benjamin

What is a "normal toolchain", Boot2Qt, Yocto, Qbs or own QtC sauce?


Hi!

I've just meant a tool chain targeting the desktop. The one that you get 
as auto-detected "Desktop Kit" if you install Qt + Qt Creator.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Clang Static Analyzer does not find STL headers

2017-11-03 Thread Nikolai Kosjar

On 11/03/2017 11:06 AM, Benjamin TERRIER wrote:

Hi,

I have an arm-none-eabi gcc toolchain. I have successfully configured Qt Creator
to use it in a Kit and was able to use it to build QBS projects.

However, when I try to run the static analyzer, clang does not find
the standard headers:

 main.cpp:9:10: fatal error: 'cstring' file not found

A solution is to add the include paths of the standard headers in the
QBS project:

 cpp.includePaths: [
 ".../toolchain/arm/arm-gnu-toolchain/arm-none-eabi/include/c++/6.3.1",
 ".../toolchain/arm/arm-gnu-toolchain/arm-none-eabi/include",
 ]

But this is a bit ugly.

Is there some configuration I missed (I guess not since the build
works), or is it a known bug ?


There is not much configuration for the clang static analyzer.

Please create a bug report with:
 * used versions of Qt Creator and configured clang version for the 
analyzer
 * whether this already happens with a "normal" toolchain. If not, 
please provide some information how to set up your used toolchain.


Thanks,
   Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Unit testing private parts of shared libraries

2017-10-17 Thread Nikolai Kosjar

On 10/16/2017 06:57 PM, Elvis Stansvik wrote:

Hi all,

(Posting this as a new thread instead of necroposting to my old thread
about the design of Qt Creator [1], which did end with some
discussions about testing.)

I'm working on some tests for my own application, and started thinking
about unit testing of private parts of shared libraries (think the
_p.h/_p.cpp parts). Such parts are normally not exported AFAIK (in the
visibility attribute sense). This becomes a problem if you link the
unit tests dynamically against the code under test, as the tests won't
be able to see those symbols.

So it seems to me there is only a few options:

  1. Exporting the private parts after all,
  2. Adding the sources of the code under test to the unit tests,
  3. ?

1 is not really good, as you export more than you really have to. But
I guess it's not so bad after all, since you a) have to include _p.h
to get at them and b) they're normally called PrivateSomething or
InternalSomething, both of which should tell you you're doing
something bad. 2 is not really good either though, as you really want
to test the code as shipped, not as compiled as part of your test.


Note that while "test the code as shipped" is very valuable, it does not 
scale very well (if used exclusively) - in the long run it can take 
quite some time to run those tests. If they take too long, you will less 
often run them as you probably should (or they can help you) and forget 
it at times. Eventually you might find they even stay in your way :>


That's why some proposed definitions of "unit testing" go to the extreme 
and use test doubles (fake, stub, mock...) where possible. "test the 
code as shipped"-tests are then considered as integration tests and are 
in quantity significantly less then those light-weight "mocked" unit 
tests. Downside with those unit tests are the needed extra 
interfaces/templates and what not which can make the real code look more 
complicated/abstract than actually necessary.



I had a quick look at Qt Creator because I know you folks are seasoned
developers, and it looks like you've gone with option 1. For example,
ExtensionSystem::Internal::PluginSpecPrivate is exported, and I guess
the reason is you want to be able to unit test it?

I just wanted to ask in case you have any other ideas or better ways
to let unit tests access things that are normally not exported?

Thanks in advance,
Elvis

[1] http://lists.qt-project.org/pipermail/qt-creator/2017-September/006712.html
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator



___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Use the clang static analyzer from an imported project

2017-10-16 Thread Nikolai Kosjar

On 10/11/2017 02:35 PM, Charlie Turner wrote:

I've imported an existing project, and configured the
.{includes,files,config} files to the point where I get
good jump to definition / highlight and such.

However, when I run the static analyzer, it gives an error,

error: openssl/aes.h: No such file or directory
  #include 
   ^~~

In the editor, that line is not underlined, it lives in a buildroot
directory that I have added to my .includes file. Is the
analyzer aware of this information? What else can I try to get it past
this error?


Note that the clang static analyzer is not really supported [1] for a 
generic project since it usually does not provide enough information for 
clang. However, an invocation of the analyzer is not prohibited since 
you still might get it working (depending on your project...) with the 
correct set of macros/includes.


Checking with Qt Creator 4.4.0 and the current version from the 4.5 
branch, I see that directories from .includes are forwarded 
to the analyzer invocation here. If you have something small and 
reproducible, please report and attach it.


Nikolai


[1] 
http://doc.qt.io/qtcreator/creator-clang-static-analyzer.html#supported-project-types-and-tool-chains

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Is it possible to fix QTCREATORBUG-11259 in Qt Creator 4.5?

2017-10-16 Thread Nikolai Kosjar

On 10/10/2017 04:01 AM, Vincent Hui wrote:

Hello,

QTCREATORBUG-11259 was reported for more than 3 and half years. It is 
about auto type deduction. Is it possible to fix QTCREATORBUG-11259 in 
Qt Creator 4.5? Now there are 17 people voting for this issue.


I've started work on this and plan to finish it for Qt Creator 4.6. The 
release schedule for 4.5 was a bit too tight to get this properly 
implemented.


https://codereview.qt-project.org/#/c/198572/

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] 4.4 Freezes/crashes

2017-09-11 Thread Nikolai Kosjar

On 09/08/2017 09:52 PM, Andy wrote:

Just wondering if anyone else is experiencing freezes with 4.4?

I'm on macOS 10.12.6. It's not reproducible (at least I haven't figured 
out the pattern yet).


It seems to happen (occasionally) when I right-click to get a context 
menu on a symbol. Keyboard does not respond, mouse doesn't respond in 
the text area, but I can select menu items (which don't do anything 
because it's frozen).


Eventually it either crashes or I have to force quit.


There is

  https://bugreports.qt.io/browse/QTCREATORBUG-18856

to track this. Please provide additional information there, especially, 
some debugging output would be helpful. How to get debugging output is 
described here:


  https://wiki.qt.io/Qt_Creator_Clang_Code_Model#Debugging

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator beautifier plugin vs. built-in code style

2017-08-23 Thread Nikolai Kosjar

On 08/22/2017 04:26 PM, Timur Kristóf wrote:

That's why I asked this in the first place. It would be nice to see
clang-format fully integrated and the legacy code formatter/indenter
thrown out.

Is that on the radar?


I'll certainly look into it sooner or later.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator beautifier plugin vs. built-in code style

2017-08-22 Thread Nikolai Kosjar

On 08/22/2017 03:33 PM, Andy wrote:

Cool - thanks Eike!

Is there a way to turn that on per-project? I don't see anything in the 
project settings for that. Aside from my own work, I work on several 
open-source projects and switch back-and-forth frequently. Unfortunately 
I'm not in a position to force them to use the One True Format...


Another suggestion - it would be very useful to be able to read the 
clang-format config per-project from a file (".clang-format.cfg?"). 
(Does this already exist too?) This would help avoid misconfiguration 
when several developers are on the same codebase.


Menu: Tools > Options > Beautifier > Clang Format:
Use predefined style: File

This will search for e.g. .clang-format in the parent directories.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator beautifier plugin vs. built-in code style

2017-08-22 Thread Nikolai Kosjar

On 08/21/2017 08:18 PM, Timur Kristóf wrote:

Hi,

I noticed that the built-in code style options somewhat clash with the
beautifier plugin. (I notice that the code style settings don't affect
the beautifier plugin at all, and the beautifier settings are rather
rudimentary at the moment.)

What are the long-term plans in this regard?

Do you guys intend to improve the built-in code styling, or do you want
to eventually replace it with either the beautifier or something based
on clang-format?

Evaluation is on-going :)

I'm playing around with clang-format for the Qt Creator code base to see 
whether it can replace our built-in code style use cases and how well it 
can handle our code style/formatting.


Some general observations:

1. Qt Creator has a built-in *indenter*, handling/controlling whitespace 
before the first token of a line.


2. clang-format does this and more:
 * it handles/controls whitespace everywhere, also taking a maximum 
column count into account
 * it can e.g. also sort your includes and add comments at the closing 
curly brace of namespaces: "} // namespace X".


3. The beautifier-plugin for clang-format allows to format the entire 
file or text selections of it. Changed lines are properly indicated by 
red vertical stripes in the left editor margin, which is cool. The 
plugin does not yet make use of the -cursor argument, which allows to 
format the AST at cursor position and probably would be useful/needed to 
replace current on-enter-indendation.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Howto enlarge the number of entries in the circular paste buffer?

2017-08-17 Thread Nikolai Kosjar

On 08/17/2017 09:28 AM, Wilhelm wrote:

is the number of entries in the circular paste buffer fixed to 10?

Or is there a configuration item for it? If any, Where?


It's hardcoded to 10.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] QtC 4.3 on macOS 10.12.5

2017-06-27 Thread Nikolai Kosjar

On 06/27/2017 10:12 AM, Andy wrote:

Thanks for pointing the indexing info out - I didn't know that was
there. Is there a way to completely re-index a project if I need to in
the future?


If you close and re-open the project, it will be re-indexed again.

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] QtC 4.3 on macOS 10.12.5

2017-06-27 Thread Nikolai Kosjar

On 06/26/2017 09:34 PM, Andy wrote:

I had to get one of those "new" Macs with the touch bar thingy as an
emergency replacement for an older Pro.

I just fired up a project to work on it with Creator 4.3 and have run
into a couple of problems that seem to be related to the code model.

1) F4 isn't switching properly between header and source (though F2 to
Follow Symbol works)
2) "Find Usages" doesn't find them all - only in the source & header,
not the rest of the project

I have "Clang Code Model" active in the plugins but it doesn't seem to
make a difference if it's on or not.

This project is over a decade old, so I don't think it's anything I've
done to it...

Any suggestions? It makes it almost unusable for me because I use those
two features heavily. Is there some other setting I'm missing somewhere?

Thanks!


Which type of project is this? Does it work with a mini project of the 
same type?


So your operating system changed. I'm wondering if this could be related 
to the file system (settings).


Was your project indexed? When opening the project, you should see a 
"Parsing C/C++ Files" progress bar (might be collapsed) on the bottom 
right. You could also check the indexed files: Menu:Tools>C++>"Inspect 
C++ Code Model..." - in the "Snapshot and Documents" tab, choose 
"Global/Indexing Snapshot" and check whether the typical files you are 
working with are there.


If that looks good, please create a report at https://bugreports.qt.io/ 
with a minimal project to reproduce.


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator Clang Code Model with compile_commands.json

2017-06-16 Thread Nikolai Kosjar

On 06/16/2017 10:31 AM, Bryan Bennetts wrote:

Hi guys,

It was suggested that I redirect my Qt Forum Question

 to
this mailing list.

Essentially I am wondering if it is feasible to get the Clang Code Model
within Qt Creator reading a compile_commands.json file for its
configuration.


While there is some libclang API to read a compilation database, we do 
not use it. We rely on the information from the project manager plugins 
(qbs, cmake, qmake, ...).


Note that in the general case it's not possible to just forward the 
compiler flags to (lib)clang. While this might work well if your 
compiler is clang or gcc (since clang tries to mimic its interface), 
parse errors in header files might affect you one or the other way.


Still, having an option to rely on compile_commands.json is certainly 
valuable. Please create a suggestion at https://bugreports.qt.io/


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] comment blocks settings in qt creator

2017-05-12 Thread Nikolai Kosjar

On 05/12/2017 08:49 AM, André Hartmann wrote:

Hi,

Am 12.05.2017 um 08:22 schrieb Nikolai Kosjar:

On 04/24/2017 01:56 PM, Sadanand Ugare wrote:

Hi,

In qt creator is it possible to change content of comment blocks.

eg:

/*!
  *
  * \param data
  * \param options
  * \return
  */

here instead of "param" i can have "outparam". If possible then please
give me the detailed procedure to change the content.


Do I understand you correctly, that you want to have the auto-generated
code (after typing /** above a function) containing "\param"
replaced with "\outparam" instead?


Reading [1], it seems the syntax is \param[in], \param[out] and
\param[inout].


Ahh, right. So it's doxygen :)

You meant [2].

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] comment blocks settings in qt creator

2017-05-12 Thread Nikolai Kosjar

On 04/24/2017 01:56 PM, Sadanand Ugare wrote:

Hi,

In qt creator is it possible to change content of comment blocks.

eg:

/*!
  *
  * \param data
  * \param options
  * \return
  */

here instead of "param" i can have "outparam". If possible then please
give me the detailed procedure to change the content.


Do I understand you correctly, that you want to have the auto-generated 
code (after typing /** above a function) containing "\param" 
replaced with "\outparam" instead?


Currently that is not possible. The known/generated commands are hard 
coded in [1]. Also, I do not see such a doxygen command at [2]. You are 
probably dealing with another documentation language than doxygen?


You might want to create a feature request / "Suggestion" at 
https://bugreports.qt.io/ .


Nikolai


[1] src/plugins/cpptools/doxygengenerator.cpp
[2] https://www.stack.nl/~dimitri/doxygen/manual/commands.html
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator: unknown warning group on Q_OBJECT using clang code model

2017-03-20 Thread Nikolai Kosjar

On 03/14/2017 02:03 PM, Carel Combrink wrote:

Hi,

I have just switched over to to using the ClangCodeModel in Qt Creator
4.2.1 but get the following warning on the O_OBJECT macro (see attached
image):
Lexical or Preprocessor Issue
20:5 warning unknown warning group '-Wsuggest-override', ignored.
...

Is this a known issue? I have looked through the bugreports but can't
seem to find anything.


This is https://bugreports.qt.io/browse/QTCREATORBUG-17460

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] My small wish-list

2017-02-24 Thread Nikolai Kosjar

Hi!

Some of these are addressed now (see below). For the others, please 
create reports/suggestions.


On 02/24/2017 06:52 AM, Ch'Gans wrote:

* From the context menu on a 'Q_PROPERTY' macro, entry 'Generate
missing Q_PROPERTY members...'
 - use emit (memberValue) instead of emit (parameterValue):
   sometimes the member value will be different from the parameter
value, it is then easy to forget to replace the generated 'emit
(parameterValue);' with 'emit (memberValue);', for the case where the
code stays as-is, emit (memberValue) is synonym for emit
(parameterValue):, so no regression here


https://codereview.qt-project.org/#/c/186638/


 - very minor: the sub-menu entry ends with '...' which traditionally
means that a pop-up dialog will show up, which is not the case.


https://codereview.qt-project.org/#/c/186634/


From the context menu on a the name of a class declaration:
 - It would be nice to add an entry 'Generate all missing Q_PROPERTY
members', which as you bet is the same as above but applied to all
Q_PROPERTY.


That's https://codereview.qt-project.org/#/c/171969/ , except that it 
will be triggerable on the class name.


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] QtCreator 4.2 cannot parse qobject.h?

2016-12-15 Thread Nikolai Kosjar

On 12/15/2016 09:40 AM, Guenter Schwann wrote:

Hi,

I upgraded to QtCreator 4.2. And I'm using the clang code model.
I get the following warning when opening a file:

"The code model could not parse an included file, which might lead to slow or
incorrect code completion and highlighting, for example"

When showing the details
qobject.h:427:7 error: expected '.'

The line is public Q_SLOTS:

It's on Windows as well as on Linux. With a qmake and as well with a cmake
project.
Any idea how to get rid of that warning? Or even better how to avoid/fix the
error?


Hmm, I don't see this. Please create a report for the C/C++ Component at

https://bugreports.qt.io/

with some debugging output - see 
https://wiki.qt.io/Qt_Creator_Clang_Code_Model. State also your used 
Kit/Toolchain.


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Bundling clang (for code model) with qt-creator package

2016-12-12 Thread Nikolai Kosjar

On 12/12/2016 03:13 AM, Andrzej Telszewski wrote:

*1) Configure, build and temporarily install LLVM:*

$ tar xvf llvm-3.9.0.src.tar.xz
$ mv llvm-3.9.0.src llvm-src
$ cd llvm-src/tools
$ tar xvf cfe-3.9.0.src.tar.xz
$ mv cfe-3.9.0.src clang
$ cd -
$ cd llvm-src

$ mkdir build
$ cd build
$ cmake \
-DCMAKE_INSTALL_PREFIX=/tmp/llvm-ins \
-DCMAKE_BUILD_TYPE=Release \
-G "Unix Makefiles" \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_TARGETS_TO_BUILD="X86" \
..
  $ make
  $ make install
  $ # We disabled building of all the tools, but we still need some.
  $ make llvm-config
  $ cp -a bin/llvm-config /tmp/llvm-ins/bin
$ cd -

Questions:
1. In build_clang.py, depending on "bitness" (which I guess is x86 vs
x86_64), you set -DLLVM_TARGETS_TO_BUILD=X86 in the case of 32 bits and
-DLLVM_TARGETS_TO_BUILD=AArch64 in the case of 64 bits. Why is it so? In
particular, why AArch64?
2. As you can see, I passed some additional flags (not found in
build_clang.py), like -DLLVM_BUILD_TOOLS=OFF, mainly to shorten the
build time. Can you think of any troubles I might get with the cmake
configuration as you see above?


I'm not know what exactly LLVM_BUILD_TOOLS=OFF excludes. But at least 
the clang soures are located in a "tools" directory within LLVM 
(${LLVM_SOURCE}/tools/clang), so you might want to double check whether 
the clang executable was really build (needed for the clang static 
analyzer).


Except the clang executables and llvm-config no other executable from 
LLVM should be required.



3. Are there any important flags missing compared to the ones generated
by build_clang.py?


No.

Note also that nowadays Qt Creator's README.md includes instructions to 
get/build llvm/clang:


  http://code.qt.io/cgit/qt-creator/qt-creator.git/tree/README.md
  Section "## Get LLVM/Clang for the Clang Code Model"


4. Are there any other flags that would be worth adding? Please note
that I removed -DCMAKE_C_FLAGS and -DCMAKE_CXX_FLAGS for clarity, I
actually have them in my real build/packaging script.


If you find other flags worth adding, share them with us :)


When it comes to build_clang.py, this script expects some environment
variables, like PKG_NODE_ROOT, CLANG_BRANCH, and more:
1. Where do they come from? How can I get them? :-)
2. How can I determine which exact versions of software and any other
flags you used to create the given QTC release?
3. There is apply_patches(): how can I know if you applied some patches
and if so, where can I find them?

*2) Configure, build and temporarily install QTC:*

$ tar xvf qt-creator-opensource-src-4.2.0-rc1.tar.xz
$ cd qt-creator-opensource-src-4.2.0-rc1
$ qmake-qt5 qtcreator.pro \
QTC_PREFIX=/usr \
IDE_LIBRARY_BASENAME=lib \
LLVM_INSTALL_DIR=/tmp/llvm-ins \
QBS_INSTALL_DIR=/usr
$ make
$ make install INSTALL_ROOT=/tmp/qtc-ins
$ make docs
$ make install_docs INSTALL_ROOT=/tmp/qtc-ins

$ # Install LLVM/Clang bits needed for running QTC.
$ mkdir -p /tmp/qtc-ins/usr/libexec/qtcreator/clang/bin
$ cp -a /tmp/llvm-ins/bin/clang
/tmp/qtc-ins/usr/libexec/qtcreator/clang/bin
$ cp -a /tmp/llvm-ins/bin/clang-3.9
/tmp/qtc-ins/usr/libexec/qtcreator/clang/bin
$ mkdir -p /tmp/qtc-ins/usr/lib/qtcreator
$ cp -a /tmp/llvm-ins/lib/libclang.so* /tmp/qtc-ins/usr/lib/qtcreator
$ mkdir -p /tmp/qtc-ins/usr/libexec/qtcreator/clang/lib/clang
$ cp -a /tmp/llvm-ins/lib/clang/*
/tmp/qtc-ins/usr/libexec/qtcreator/clang/lib/clang

Questions:
1. In deployqt.py, you tweak rpath-s, but I found that simply copying
libclang into /tmp/qtc-ins/usr/lib/qtcreator just works. So is this step
necessary? As a side note, I'm only bundling clang, as all the other
libraries (including Qt) are already installed system-wide.

*3. I create the package out of /tmp/qtc-ins and I'm done.*

General question:
Have I missed something? ;-)

Some final notes:
- I'm building on x86_64 system,
- both Clang Code Model and Clang Static Analyzer seem to work just fine
with the described build/install instructions,
- although I tried hard not to make a mistake, there might be some
somewhere. I extracted and tweaked the commands from my build script for
clarity. Anyways, the build and packaging works as expected using my
build script.

I know I asked quite some count of questions.
Thanks in advance for the help!



___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator for Linux Kernel Development

2016-11-30 Thread Nikolai Kosjar

On 11/29/2016 08:23 PM, Jason A. Donenfeld wrote:

Hi Nikolai,

On Tue, Nov 29, 2016 at 9:55 AM, Nikolai Kosjar <nikolai.kos...@qt.io> wrote:

Should work with the Clang Code Model, Qt Creator from the current 4.2
branch.

The corresponding report was
https://bugreports.qt.io/browse/QTCREATORBUG-15590.



Okay, in that case, I'll wait until 4.2 for it. One question:
PRECOMPILED_HEADER -- will this take a list, or only a single value?


Providing a list, the code model gets a list :)

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator for Linux Kernel Development

2016-11-30 Thread Nikolai Kosjar

On 11/29/2016 08:21 PM, Jason A. Donenfeld wrote:
> Hi Marco,
>
> I'll start compiling a list for you, so that I can give you something
> more useful than my last message. For starters, here's one bug found
> within seconds:
>
> 1. Open a file in the project. All seems fine.
> 2. Ctrl click on a function that points to somewhere in the Linux
> kernel headers.

What you see until here is only syntax highlighting. The file was not 
yet fully parsed.


> 3. Close that file. Now there are all sorts of non-nonsensical clang
> errors in the original file.

File was parsed in the meanwhile, semantic highlighting kicked in. Looks 
like your macro definitions and/or include paths are probably not yet 
correct.


Regarding the slow parsing, some debugging output could reveal why it's 
so slow:


https://wiki.qt.io/Qt_Creator_Clang_Code_Model#Debugging

Please provide the output as a report at https://bugreports.qt.io/ .

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Bundling clang (for code model) with qt-creator package

2016-08-31 Thread Nikolai Kosjar

On 08/31/2016 06:07 AM, Andrzej Telszewski wrote:

On 29/08/16 08:40, Nikolai Kosjar wrote:

On 08/28/2016 03:05 AM, Andrzej Telszewski wrote:

As mentioned here:
https://blog.qt.io/blog/2016/08/25/qt-creator-4-1-0-released/ it might
be valuable to use clang 3.8.1 with Qt Creator 4.1.0.

But my system's llvm package is at version 3.8.0 and will stay like that
for quite some time.


Note that there is hardly any difference between llvm 3.8.0 and 3.8.1
when it comes to the clang code model. The changes between 3.8.0 and
3.8.1 look all backend-specific, but we use only the frontend.

For some reason the mentioned patch in the blog post is not part of the
official 3.8.1 release, but of our shipped build.



What would be your suggestion as of using 3.8.1 (when it comes to the
code model of course)?
Does it make any sense to switch to it or is it fine to stay with 3.8.0?
Please note, I'm targeting Linux platform only, so the MSVC patch is
irrelevant for me.


At least I'm not aware of any change between llvm 3.8.0 and 3.8.1 that 
would make a difference for the code model - however, that does not mean 
a lot.


In case of doubt, use what we use/recommend/ship except there is a good 
reason not to.


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Bundling clang (for code model) with qt-creator package

2016-08-29 Thread Nikolai Kosjar

Hi!

On 08/28/2016 03:05 AM, Andrzej Telszewski wrote:

Hi,

As mentioned here:
https://blog.qt.io/blog/2016/08/25/qt-creator-4-1-0-released/ it might
be valuable to use clang 3.8.1 with Qt Creator 4.1.0.

But my system's llvm package is at version 3.8.0 and will stay like that
for quite some time.


Note that there is hardly any difference between llvm 3.8.0 and 3.8.1 
when it comes to the clang code model. The changes between 3.8.0 and 
3.8.1 look all backend-specific, but we use only the frontend.


For some reason the mentioned patch in the blog post is not part of the 
official 3.8.1 release, but of our shipped build.



As I don't want to update the system's llvm, I would like to package
version 3.8.1 of llvm together with qt-creator, for the purpose of Code
Model (is there anything else internal to Qt Creator that uses llvm?).


The Clang Static Analyzer plugin needs the clang executable + the 
intrinsics headers (currently installed, e.g. for Linux at 
${QTCREATOR_INSTALL_ROOT}/share/qtcreator/cplusplus/clang/3.8.1/include).



I see two solutions:
1. Create separate package for llvm, something like "qt-creator-llvm"
that installs under non-system wide directory and then, when building Qt
Creator, adjust LLVM_INSTALL_DIR to point to that directory.
2. Create single package containing both llvm and Qt Creator.

Solution 1) is straightforward, in that I can first build and install
qt-creator-llvm and then build and install qt-creator.

Solution 2) requires that I can somehow point the qt-creator
LLVM_INSTALL_DIR to the temporary directory where the llvm has been
installed for the purpose of packaging. But once the packaging has been
finished, LLVM_INSTALL_DIR has to point to a different directory,
relative to the package installation directory and not package creation
directory.

I would much preferred the second solution.
So the question is: is it possible?


I'm not sure I understand the requirements needed for this, but we do 
this is already for our official packages.


Build Qt Creator with LLVM_INSTALL_DIR set and install it (see link 
below). The relevant parts of the LLVM_INSTALL_DIR will be copied over 
to Qt Creator's installation directory (+ adapting the rpath etc.).



http://wiki.qt.io/Building_Qt_Creator_from_Git#Installing_Qt_Creator_.28optional.29


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Bug? Lightbulb changes wrong file - not in project

2016-08-24 Thread Nikolai Kosjar

On 08/23/2016 08:44 PM, Jason H wrote:

I had two projects open. One with a platformshimandroid.[h,cpp] and one with 
platformshim_android.[h,cpp]

In one project I changed this:
explicit PlatformShimImpl(QObject* parent=0); // platformshim_android.h
to
explicit PlatformShimImpl(Interfaces flags, QObject* parent=0); // 
platformshim_android.h

And I got the light bulb. I clicked it, and it changed platformshimandroid.cpp, 
a file in another project. (I now use _ in the filename)
It should have matched to platformshim_android.cpp in the SAME project.


Dear Jason,

please report such things at the bug tracker:

   https://bugreports.qt.io/

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Macro definition position in code model

2016-07-25 Thread Nikolai Kosjar

Hi ho!

On 07/22/2016 11:08 PM, Jochen Becher wrote:

currently I am working on a new feature for QtCreator. I need to
analyze the C++ source code (non preprocessed) very precisely. Seems to
be difficult because I couldn't find the token stream of the non-
preprocessed source code.


Yup, the preprocessor lexer runs on demand (Preprocessor::preprocess), 
the tokens are not pre-generated.


Side note: The c++ lexer, operating on preprocessed code, will 
pre-generate tokens (TranslationUnit::parse). Those tokens will be 
released together with the AST after CppModelManager::documentUpdated is 
emitted.



I tried to use the information from CppTools::SemanticInfo. It gives me
most of the info I need but not in a simple token stream.


If needed, the token stream is generated on demand, at least for small 
scopes like "current line". See e.g. the use of SimpleLexer in 
CppHighlighter::highlightBlock or CodeFormatter::tokenizeBlock.



Analyzing the macro definitions I found that CPlusPlus::Macro is
inconsistent: the utf16CharOffset() points to the start of the macro
name while the length() includes the #define token. So I can neither
know the start of the #define token nor the end of the macro definition
(because I do not know how many whitespaces were skipped between
#define and macro name).

Today Macro::length() is used only once and only to compare the values
from two Macro entities. Thus I could fix the length() to not include
the #define token and whitespaces.

But unfortunately that still does not give me the start of the #define
token. Shall I include another offset in Macro pointing to that #define
token start or is there any other simple way (instead of parsing the
source code myself) to find this #define token start position?


Hmm, your code would be the only client and it would increase the memory 
consumption (probably not significant). Not sure whether that's worth it 
- is the exact position really necessary? E.g. for FollowSymbol we 
position the cursor simply on the start of #define line.


If you can access the source code without reading the file from disk 
(e.g. because it's an opened document), then use SimpleLexer for 
Macro::line() or even inspect the line manually? Finding the 'd' in 
"#d" shouldn't be too expensive.



BTW: Is there a simple way to get the full token stream of the non-
preprocessed code?


No, see above, the stream is not pre-generated.

> I wouldn't like to start the preprocessor though this might be a 
solution.


I don't see how this would help, you probably meant the lexer?!

Nikolai


___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Autocompletion of 0.0 to 0->0 in QtCreator 4.x series

2016-06-23 Thread Nikolai Kosjar

On 06/23/2016 10:36 AM, Eike Ziller wrote:

On Jun 22, 2016, at 20:05, Murphy, Sean  wrote:


At what point is the bug that autocompletes 0.0 to 0->0 going to be
fixed? Just curious? Those of us writing scientific codes where we
initialize our floats/doubles to actual values are really effected by
this bug.


What version(s) are you seeing this in? I'm using Qt Creator 4.0.0,
based on 5.6.0 on Windows and I don't see the behavior you're describing.
If I type "0." the period stays a period, and then I can type the next 0 and
still get "0.0".

Sean


4.0.1, 4.0.2, 4.0.3 all nightlies from download.qt.io. Running on OS X
10.10.4 with the latest Xcode for that OS.

Maybe it is how I have a settings configured?


Maybe? I just switched over to OS X, downloaded the official Qt 5.7.0 with
Qt 4.0.2, opened an existing project I had, and typed "0." and it was NOT
autocorrected to "0->". Is there another step you're doing that I'm missing?

I also tried with a new project (Qt Widget Application) with the same result.

OS X version 10.11.5, Xcode 7.3.1 if that helps.


I think this only happens with the Clang code model, so you’d need to turn that on 
(About Plugins… > ClangCodeModel) to see the issue.


Correct :)

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Autocompletion of 0.0 to 0->0 in QtCreator 4.x series

2016-06-23 Thread Nikolai Kosjar

On 06/22/2016 05:46 PM, Mike Jackson wrote:

At what point is the bug that autocompletes 0.0 to 0->0 going to be
fixed? Just curious?


The following fixes might end up in a 4.0.2 release, if such a release 
is going to happen:


https://codereview.qt-project.org/#/c/163364/
https://codereview.qt-project.org/#/c/163404/

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Nightly 4.0.0RC Code Model does not work?

2016-05-09 Thread Nikolai Kosjar

On 05/06/2016 02:59 PM, Mike Jackson wrote:

I was just curious if anyone else that runs the nightly Creator 4.0.0RC
builds has had any issues with the code model kicking in for their code.
When opening my sources none of the syntax coloring or completions work
any more. I am running a build from 4/26/2016 that seems to run just
fine. I was wanting to keep up with the nightlies but this has been
going on for about a week or so now. I have tried trashing all of my
Creator preferences, project files (CMakeLists.txt.user), rebuilding,
clean check outs but nothing seems to be working. Just curious if I was
missing something obvious.'


Please acquire some debugging output 
(https://wiki.qt.io/Qt_Creator_Clang_Code_Model#Debugging) and create a 
bug report.


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Looking for Enums with Locator

2016-04-20 Thread Nikolai Kosjar

On 04/15/2016 08:23 AM, Prav wrote:

Hi, Tobias.


That is what we have JIRA for. You sort the list by priority and start working.

Got it. Thanks!

I was trying to see this list and also found
list like
https://bugreports.qt.io/browse/QTCREATORBUG-15157?jql=project%20%3D%20QTCREATORBUG%20AND%20component%20%3D%20"C%2FC%2B%2B%2FObj-C%2B%2B%20Support"%20AND%20resolution%20%3D%20Unresolved%20AND%20fixVersion%20%3D%20"Qt%20Creator%204.0.0%20(4.0%20branch)"%20ORDER%20BY%20priority%20DESC
which I opened from
https://bugreports.qt.io/browse/QTCREATORBUG/component/19201/?selectedTab=com.atlassian.jira.jira-projects-plugin:component-issues-panel

What is the meaning of this list?


The "Fix Version" field of those reports was used as a "TODO for 4.0" 
marker.


I've cleared that field for the list since some reports are not feasible 
anymore for 4.0 and/or they need reevalution.


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Looking for Enums with Locator

2016-04-13 Thread Nikolai Kosjar

On 04/12/2016 11:30 AM, Prav wrote:

Hi, Nikolai.


it seems that there is support for enum declaration... but not for enum
values (not yet?) ...

Correct.

Ok. I see. Does  it  make sense for you to add enum values in Locator? ... From 
my experience enum-values seems to be used same or
even more frequently in programs


I'm fine with making enum values "locatable", though personally I 
haven't missed them.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Looking for Enums with Locator

2016-04-12 Thread Nikolai Kosjar

On 04/12/2016 08:21 AM, Jan Krause wrote:

it seems that there is support for enum declaration... but not for enum
values (not yet?) ...


Correct.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] It's time to fix double redundant quotes

2016-03-09 Thread Nikolai Kosjar

2. If backspacing over a double quote, do not remove both double quotes.


Agree, see above.


https://codereview.qt-project.org/#/c/151822/
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] It's time to fix double redundant quotes

2016-03-09 Thread Nikolai Kosjar

Hi!

Let me summarize for myself and others the ways we can add quotes to 
some text. Default settings are assumed, the relevant one is:


 [x] Automatically insert matching characters.


a) Insert quote before text:
  Type: "foo
  This results in: "foo"
  The closing quote was added after typing the initial ".
  Looks fine.

b) Insert quotes afterwards by using selection.
   1. Type: foo bar
   2. Select the typed text
   3. Hit "
  This results in: "foo bar"
  Looks fine.

c) Insert quotes afterwards by starting with the closing quote
  You have: foo bar
  Type: "
  This results in: foo bar""
  Ops 1: The second " was not intended.
  Hit backspace.
  Ops 2: Both quotes are removed and you are the beginning again.


Note that if you hit " and another one is added, your cursor is then 
between the quotes: "|". Hitting backspace here removes then both 
quotes. If the cursor is behind both quotes (e.g. you've moved it there 
manually), only one quote is removed. This also applies to () and [], 
but not to {} (thinking of lambdas we probably should include that one, 
too).


Although the option in the settings is named "Automatically insert 
matching characters" it seems to also handle the removal of the pairs, 
at least when the cursor is in-between. We probably should change this 
if we do not introduce further options.


I agree that we should address the "Ops 2" from above, that is not 
removing both quotes if the cursor is in-between them. This will make it 
inconsistent when looking at () and [], but I think that's justified in 
this case. The problem here is the single quote by itself - you can't 
tell whether it's an opening or closing one without further information 
(typing ')' does not add you the opening one automatically).


Regarding "Ops 1", I don't think we can reliably detect whether the 
users inserts an opening or closing quote. Your heuristic is not enough:


On 03/08/2016 11:10 PM, Jason H wrote:

Fundamentally, I want to changes to the behavior:
1. If the character after the cursor is not whitespace, do NOT double quote ("")


Would break case a) from above for e.g. function arguments:

foo(|)
foo(|,1)


2. If backspacing over a double quote, do not remove both double quotes.


Agree, see above.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Clang Code Model completion not working

2016-03-01 Thread Nikolai Kosjar

Hi!

On 02/28/2016 12:11 PM, Andrzej Telszewski wrote:

Hi,

Qt Creator: 3.5.1
OS: Linux
...
Unfortunately, the completion does not work for me, that is, there is
neither pop-up for functions, classes nor the class members.

Have I misconfigured something?


If you already see diagnostic warnings from libclang, then that's unlikely.

Please create a bug report with answers to:

1) Does it work with current Qt Creator snapshots? Snapshots are 
available at http://download.qt.io/snapshots/qtcreator/master/latest . 
If it fails, the remaining questions assume that you use the snapshot 
version.


2) Does it already fail for a main.cpp of a "Qt Console Application" 
(from Creator's wizard)?


3) Start Qt Creator from a terminal as follows, trigger completion and 
wait for a while. What's the generated output?


  $ QT_LOGGING_RULES="qtc.clangcodemodel.ipc=true" ./qtcreator

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Parse macro arguments for Spell Checking

2016-02-01 Thread Nikolai Kosjar

Hi!

On 01/26/2016 09:03 PM, Carel Combrink wrote:

} else {
 // Read source code from disk...
}

The above works well, thank you. Regarding the "Read source code from
disk... " comment, when will it happen that the editor documents would
not be open? From my understanding the model manager will open the
document with a call to CppTools::CppModelManager::updateSourceFiles().
If this is correct then I do not need to worry about this case.


There are no editor documents (and thus no unpreprocessed source code) 
if you e.g. open a project. All files of a project and all their 
includes are indexed and CppModelManager::documentUpdated() is emitted 
for each, but no editor is opened automatically (except when you use 
sessions or the wizards).


If your plugin operates only on opened documents, don't worry.

(Side note: CppModelManager::updateSourceFiles() will just re-index the 
given files, there is no relation to editor documents).



To convert to line/column,
document->translationUnit()->getPosition(...) should help you.
...
Am I doing something wrong?


No, that's me, sorry! TranslationUnit::getPosition() and friends should 
be used for positions coming from the unpreprocessed code, e.g. AST 
nodes, but that's not the case for the macro uses.


I see two options:

a) Live with what Document::MacroUse provides. Scan the line (and maybe 
the next) for literals yourself. You might need to count the '(', ')' 
etc. to determine when the macro invocation ends. Note that '(' could be 
eaten by a macro.


b) Use Snapshot::preprocessedDocument(), which makes use of the 
FastPreprocessor. In the resulting document macro function invocations 
look like function calls so that you can use an ASTVisitor to find the 
call and inspect it argument (expressions). Or as a more general 
approach, don't look for the MacroUse at all and try to find all 
StringLiteralASTs in the AST from the document of 
Snapshot::preprocessedDocument(). If you go this way, avoid calling 
Snapshot::preprocessedDocument() in the main/gui thread since it might 
take a while for bigger documents.



Note that we are focusing on the clang code model, so in the long
run the code we are speaking about here will vanish or be replaced.

I am assuming that even though the code model is planned to be replaced
with the clang code model there would still be an interface into the
model. Regarding my SpellChecker plugin, if this move happens I want to
still be able to allow for picking up spelling mistakes, thus I would
then need to interface to the code model that the clang processor built
up. Do you have any suggestions or comments around this and where I
might start to look if I want to start porting my plugin to make use of
this?


Currently there is no infrastructure to support your use case, but I can 
think of two options:


a) Your could create a plugin for clang itself which then reports spell 
checking issues as normal diagnostics. The clang code model will pick 
them up automatically. Maybe there is already such a plugin for clang 
out there? Haven't googled.


But...we use libclang, which does not load other clang plugins in its 
current version. But...I saw a patch somewhere on the llvm code review 
to change that.


b) If we will have a data base for the symbols (and literals) you could 
query it.


As you see, that's all still up in the air...


As mentioned, I was hoping to start with the process to integrate my
plugin into Qt Creator once the above issue is solved, what is your
recommendations around this? Should I wait for the clang code model
before I attempt this or would it still be a good idea to start the
integration using the old code model?


See above, it can take a while. Also, for the time being, parts of the 
built-in code mode still run if the clang code model is active. So your 
plugin might be already valuable also for clang code model users. And 
you also don't add/expose new API for your plugin, so I'm fine if it get 
integrated as soon as you have resolved that bug.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator 3.5.1 - Managing priority of includes for code parsing

2016-02-01 Thread Nikolai Kosjar

On 01/29/2016 07:43 PM, OmegaPhil wrote:

So.. Qt Creator works up until you build the kernel ;)


Could you please create a bug report with all the steps needed to 
reproduce the problem (copy/pate instructions would be great)? I'm not 
familiar with kernel development/building, so this would help a lot.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Qt Creator 3.5.1 - Managing priority of includes for code parsing

2016-01-25 Thread Nikolai Kosjar

Hi!

On 01/22/2016 08:51 PM, OmegaPhil wrote:

I currently use Qt Creator as a code editor (not building etc) for a
number of codebases, via importing generic projects. Currently working
with the kernel code, I noticed that the default behaviour of code
parsing is to use the system kernel headers rather than those in the
codebase.

Looking at the .includes file, all directories are present, however Qt
Creator still says it can't find some headers, and the ones it can find
come from /usr/include (by hovering over #include). Is there a way to
tell Qt Creator to prioritise the project includes?


The includes in your .includes shouldn't be ignored and 
this seems to work fine here with Qt Creator 3.5.1 and Qt Creator from 
the master branch.


Note that the includes come from your project (*.includes) and the 
toolchain. Thus, "/usr/include" probably comes from the latter.


You probably need to configure the right toolchain for your Kit. You 
also can set an invalid toolchain (e.g. a custom toolchain created with 
no compiler path) so only the include directories from the project's 
*.includes will be used.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Parse macro arguments for Spell Checking

2016-01-22 Thread Nikolai Kosjar

Hi!

On 01/19/2016 09:20 PM, Carel Combrink wrote:

What I am struggling with is to get the argument before the macro is
replaced/expanded.
Say I have the following on line 46:

QStringstringLiteral=QStringLiteral("AStringLiteralwirthspelligmistakes");
...
Now the issue: How do I get the actual argument:
"AStringLiteralwirthspelligmistakes"


Use the offsets/positions from Document::Block with the unpreprocessed 
source code to extract the arguments as strings. The arguments are not 
stored separately to save memory.


You can get the unpreprocessed source code with e.g.

auto *cppModelManager = CppModelManager::instance();
auto *cppEditorDocument = 
cppModelManager->cppEditorDocument(document->fileName());

if (cppEditorDocument) {
// Editor is opened and can provide us the source code...
const QByteArray source = cppEditorDocument->contents();
const uint end =  block.bytesEnd() - block.bytesBegin();
qDebug() << "Argument:" << source.mid(block.bytesBegin(), end);
} else {
// Read source code from disk...
}


The second thing I will then need to do is to underline any spelling
mistakes, so I would need to get the line and column number if possible,
of the misspelled word before expanded.


To convert to line/column, document->translationUnit()->getPosition(...) 
should help you.


Note that we are focusing on the clang code model, so in the long run 
the code we are speaking about here will vanish or be replaced.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Settings for naming conventions

2016-01-15 Thread Nikolai Kosjar

On 01/14/2016 08:57 PM, Jochen Becher wrote:

Hi Nikolai,

the solution you prefer (= my first proposal) is of course the easiest
implementation. I only wondered if naming conventions is really related
that much to coding style (which is more about whitespaces and
indentation) that we want to handle it with the same settings class.


There is nothing yet in CppCodeStyleSettings, that's true. But in 
general naming conventions are regarded as part of the coding style:


https://doc-snapshots.qt.io/qtcreator-extending/coding-style.html#class-member-names

https://google.github.io/styleguide/cppguide.html#Naming

http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly


So I will go for your proposal.


OK.


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Settings for naming conventions

2016-01-13 Thread Nikolai Kosjar

Hi again,

let me enumerate your requirements and propose something addressing those.


Requirements:

 R1. Global and per project settings
 R2. API working on those settings, converting names
 R3. Settings/API used by:
- Wizards
- Refactoring Code
- Text Editor to validate identifiers


Proposal:

Enhance CppTools::CppCodeStyleSettings with the specific C++ settings 
you need. This is fine since naming conventions are usually part of 
coding styles/rules. This does not introduces anything in the text 
editor, but uses the infrastructure that is provided by it and the 
project explorer (CppCodeStyleSettings are managed by 
CppCodeStylePreferences, which is a TextEditor::ICodeStylePreferences). 
Thus, you get R1 for free.


For R2, just introduce and export your new class in cpptools. This class 
uses CppTools::CppCodeStyleSettings.


Regarding R3:
CppCodeStyleSettings is already exported and can be used.

* Wizards - The plugins of the wizard that wants to use the settings/api 
obviously needs to depend on cpptools. Is this a problem for the wizards 
you had in mind?


* Refactoring Code - No problem since this is already in cpptools 
itself. qmljstools depends on cpptools and thus could also access the 
settings.


* Text Editor to validate identifiers - A virtual function in e.g. 
TextEditorWidget could serve this? And the specific editors have access 
to their settings.


Something along the lines could also be done for QML/JS or other 
languages (e.g. in the projects mode you can already switch the language 
for the coding style).


Would this work?


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Use #pragma once as default instead of header guards

2016-01-13 Thread Nikolai Kosjar

On 01/13/2016 01:52 PM, Joerg Bornemann wrote:

Still, as it came up, this argument raises the interesting question what
will happen to users of the clang code model that cannot switch to
(non-standard) pragma once for this or that reason?

What would it take to fix this problem? Can we work around it? Can we
provide an upstream fix?


A fix from Erik is pending for review at http://reviews.llvm.org/D15994 
, but so far there were no comments.



Apart from that, I did not understand the problem at all.
The opening #ifndef does match the #endif, doesn't it?
If "matches" means "is balanced with" at least.


As far as I understand:

The preamble includes everything up to the very first declaration (not 
including it). Now the rule seems to be that a preamble is only 
generated if the preprocessor conditions are balanced *within* the 
preamble. In the given example #ifndef is in the preamble region, but 
not #endif.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Settings for naming conventions

2016-01-12 Thread Nikolai Kosjar

On 01/09/2016 05:28 PM, Jochen Becher wrote:

Hi,

I would like to implement naming convention settings for QtCreator. For
many C++ element identifiers (e.g. namespace, class, attributes,
methods, getter, setters, boolean getters, local variables etc) the
user can define a naming convention build from a prefix, a name style
(e.g. lowerCamelCase, UpperCamelCase etc) and a suffix. This settings
can be defined globally and per project. A simply API allows fetching
the base name of an identifier (a list of strings building the middle
part of the identifier) or converting an identifier from one naming
convention into another.

The settings should be used in wizards, refactorings (e.g. create
setters and getters from attributes) or validating identifiers in text
editor.


Sounds great!


I would add the new settings to the cpptools plugin but I am not sure
about the preferred design:

1. I could extend the coding style settings which are connected to the
TextEditor by design (realization of a codiong style interface) but
naming conventions are not aligned to the TextEditor in the same manner
as coding style are.

2. I could implement a new settings class which is loosely coupled to
the cpptools plugin like e.g. the todo plugin settings.

3. Or I could implement a new settings class which is strongly coupled
to the cpptools plugin.

What do you prefer? Do you have a different preferred design in mind?


Could you elaborate a bit on 2. and 3.? What would be the difference? 
How does "strongly coupled" look like in this case?


The integration into current code style settings as seen by the user in 
the options dialog (Menu: Tools > Options > C++ > Tab: Code Style) and 
the projects mode (Projects Mode: Code Style) seems appropriate. Since 
CppCodeStylePreferences and CppCodeStyleSettings are already exported, I 
don't see a problem enhancing those. This is for C++.


Now, if there is substantial overlap with QML / Qt Quick or other 
languages, this probably should be put somewhere into the text editor 
itself. For instance, we put all the highlighting settings into one 
central place (Options > Text Editor > Fonts & Colors), covering general 
thingies, but also C++ and QML. This corresponds to your first option?


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] 3.6rc1 can't change errors underline

2015-12-09 Thread Nikolai Kosjar

On 12/03/2015 08:31 PM, Gena Bug wrote:

Noticed that 3.6rc1 marks syntax errors by single underline, not wavy,
no matter what is set in color scheme...


Fixed in current 3.6. Now the Error and Warning format is applied to the 
diagnostics in the editor.


Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] clang code model, markers and messages

2015-11-05 Thread Nikolai Kosjar

On 11/02/2015 03:23 PM, Nikolai Kosjar wrote:

Hi!

On 10/30/2015 04:34 PM, Cristian Tibirna wrote:

I activated the clang code model for C++ source files. I start seen
red error ("stop" hexagons (why not octagons?)) on the left border
of the editor at lines that contain C++ errors.


So far the icons are stolen from the project explorer plugin. We need
custom ones so it's possible to tell apart code model diagnostics from
actual build diagnostics.

(hexagons? They are octagons here...)


Aha, somebody updated the icons in the master branch. That's why you see 
hexagons...


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Clang Code Model Questions

2015-10-30 Thread Nikolai Kosjar

Hi!

On 10/21/2015 03:33 PM, Mike Jackson wrote:

I have been using the nightly builds of 3.5.1 and now 3.6.0 and it
seems the editor is still running into hanging issues when the
source file has anything other than trivial codes. I started trying
to profile the code in an attempt to learn how/where the issue might
be and if it is our own code base that is causing the issues.Most I
have noticed is that “clangbackend” spins up and QtCreator hangs with
a spinning beach ball for 5~10 seconds overtime I try to have a
completion pop up. This makes the editor pretty much unusable.


When exactly does it start to hang? If you trigger completion? Is it
reproducible? The communication with the backend is asynchronous, it
shouldn't block the UI. Are you sure that the blocking does not occur
with the built-in code model for the same code and the same use case?

Please provide answers to this questions in a bug report.


I just wanted to try to get a feel for where QtCreator was going and
what the timelines are so that I can gauge how I will develop codes
going forward.


The current focus lies on proper/usable highlighting, diagnostics and 
completions from clang. Later indexing will be addressed, but that's 
another story. For concrete questions, just ask.



I generally like what I see with the newer features being added to
QtCreator and want to keep using it but our code base, for what ever
reason, just seems to give the clang code model fits when trying to
complete our functions.


Again, the best you can do is to create proper bug reports.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] #ifdef Linux - code coloring

2015-09-14 Thread Nikolai Kosjar


On 09/09/2015 10:20 AM, Charalambos wrote:
> Eike Ziller  writes:
>
>> Hm, I can reproduce that when setting a Qt from the mingw 4.5.1
>> packages.
>> You can work around the problem by making sure that your MinGW\bin
>> path is in your PATH variable.
>> Everywhere in QtCreator we add the correct mingw path to commands that
>> are called from creator, except when determining the toolchains
>> defines and include paths...
>> Thank you a lot!
>>
>> ++ Eike
>>
>
> Hi Eike,
>
> I am having the same problem. I am running Qt 5.5 with mingw32_492 compiler
> and Q_OS_WIN or WIN32 or WIN64 are not set for me. How can i resolve this 
> issue?
>
> I read your answer but i have to say my PATH variable already contains the
> full path to the compiler. Any ideas on how to resolve my problem?

What's your build system / project type?

Seems to work fine here with the Qt Creator from the Qt 5.5 mingw32_492 
package using that Kit:
1. Create a "Qt Console Application" from the Wizard
2. Add to main.cpp:

--8<
#ifdef Q_OS_WIN
void defined_Q_OS_WIN;
#endif

#ifdef WIN32
void defined_WIN32;
#endif

#ifdef WIN64
void defined_WIN64;
#endif
--8<

Only the code for WIN64 is greyed out.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] qbs detection of Clang is broken

2015-09-04 Thread Nikolai Kosjar
On 08/31/2015 11:16 PM, Jochen Becher wrote:
> Hi,
>
> when I compile qtcreator.qbs I get an error message about a missing
> header file . I have clang installed (gnome-ubuntu
> 15.04) but not libclang-3.6.dev. The detection of qmake build works
> better; it recognizes that I do not have the needed files installed.
>
> Should I create a bug report or is there any good reason for this
> difference between qmake and qbs builds?

There is no good reason, https://codereview.qt-project.org/#/c/125075 
should fix it [3.5 branch].

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] #if 0 not evaluated?

2015-08-31 Thread Nikolai Kosjar
Hi!

On 08/31/2015 10:30 AM, alexis jeandet wrote:
> Ok I think I understood, I would expect no syntax coloration, but I got
> this(see attachment). In fact it's not obvious when the corresponding
> code is quite big you don't see so well. Wouldn't it be better to make
> it like comments? I attached also what I get with gedit, it may be
> hardcoded since only the first one is detected, isn't it better to gray
> the code?
>
> Anyway sorry for my mistake, there is no bug.

At times even ifdeffed out code needs to be edited and then the syntax 
highlighting helps a bit.

Note that you can customize the colors at Menu: Tools > Options... > 
Text Editor (on the left) > Tab: "Font & Colors" - the relevant entry is 
"Disabled Code".

> Le lundi 31 août 2015 à 09:37 +0200, alexis jeandet a écrit :
>> Hi,
>>
>> I'm using Qt creator 3.4.2 built with Qt 5.5.0, the one distributed
>> with Fedora 22. I also use the Qt creator's builtin code model(same
>> issue with clang).
>> Maybe it disappear in QTC 3.5, I will check with 3.5 then fill a
>> bugreport.
>>
>> Best regards,
>> Alexis.
>> Le lundi 31 août 2015 à 05:20 +, Stenger Christian a écrit :
>>> Hi,
>>>
>>> I cannot reproduce the mentioned issue with neither 3.5 branch nor
>>> master, no matter if I'm using Qt Creator's builtin code model nor
>>> using experimental Clang code model. Checked the mentioned file as
>>> well as others.
>>>
>>> Could you please try to provide more information (QC version, OS,
>>> Code model, ...) and file a bugreport at https://bugreports.qt.io (
>>> Co
>>> mponents: C/C++ support).
>>>
>>> Kind regards,
>>> Сhristian
>>>
>>>
>>> 
>>> From:
>>> qt-creator-bounces+christian.stenger=theqtcompany@qt-project.or
>>> g
>>> >> rg
 on behalf of alexis jeandet 
>>> Sent: Saturday, August 29, 2015 11:58 AM
>>> To: qt-creator
>>> Subject: [Qt-creator] #if 0 not evaluated?
>>>
>>> Hi,
>>>
>>> I saw a weird behavior, a "#if 0" isn't expanded as it should be,
>>> the
>>> code isn't grayed is it a bug?
>>> Here is the file where I found this behavior:
>>> https://github.com/codekipper/linux-sunxi/blob/audio_mainlining/sou
>>> nd
>>> /s
>>> oc/sunxi/sunxi-i2s.c#L236
>>>
>>> I tried on other files, I get the same behavior.
>>>
>>> Best regards,
>>> Alexis.
>>> ___
>>> Qt-creator mailing list
>>> Qt-creator@qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>> ___
>>> Qt-creator mailing list
>>> Qt-creator@qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>> ___
>> Qt-creator mailing list
>> Qt-creator@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>
>>
>> ___
>> Qt-creator mailing list
>> Qt-creator@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qt-creator
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] entire signature in fucntions using code completion

2015-08-28 Thread Nikolai Kosjar
On 08/27/2015 11:11 PM, Freddy Martinez Garcia wrote:
 Thre is any plugin or any way to show the entire signature for each
 method and function when code completion is trigger ??

Hola!

What exactly do you mean by entire? Would you like to have the fully 
qualified name, e.g. with all the namespaces?

Saludos,
Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Tab UI in Projects mode to TreeView

2015-08-04 Thread Nikolai Kosjar
On 08/03/2015 05:21 PM, Ziller Eike wrote:

 On Aug 3, 2015, at 4:48 PM, Kosjar Nikolai nikolai.kos...@theqtcompany.com 
 wrote:

 On 08/03/2015 02:46 PM, Ziller Eike wrote:
 Qt Creator-style would possibly be to replace the top level tab bar (the 
 project selection) with a combo box?

 This would add one extra click to switch the current/active project and to 
 inspect how many and/or which projects are open. I can live with that.

 The remaining tab bar (Build  Run, Editor, ...) could still be too wide. So 
 what do we do with that one?

 1) ...transform it into a list view. However, I already have 7 entries there 
 and this will be problematic for displays/resolutions with limited vertical 
 space.

 2) ...move the items to the corresponding projects in the combobox (as sub 
 items). Disadvantages:
 a) To switch to another project, you would need to visually skip several sub 
 items (Build  Run, Editor, ...) of the current project.
 b) If you switch to a concrete item of another project, e.g. (Editor), you 
 would implicitly switch the project, too. This might be not that obvious.

 Especially 2b) is also true for using a tree view, as long as the selected 
 project in projects mode defines the startup project.

Yup. That could be mitigated by a proper visual representation, e.g. by 
giving the project node and its sub items a frame and/or background 
color that is different from other non-current projects. It would help 
for the tree view, but not for the combo box (since after choosing one 
item in the combo box, all alternatives will be hidden).

I would prefer to keep switching between projects and project setting 
pages separate and to pick up already familiar ui/controls where 
applicable, thus:

* Switch projects with a combo box on the top.
* Switch project setting pages with a list/tree view on the left (like 
in the options page)

The list view on the left wouldn't take so much more space if we move 
the bigger project settings page icons, e.g. hammer/play button for 
BuildRun, into the list view. We could also shorten some project 
setting page names, e.g. some of them end with Settings (Clang 
Settings, To-Do Settings), which is superfluous.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Tab UI in Projects mode to TreeView

2015-08-03 Thread Nikolai Kosjar
On 08/03/2015 02:46 PM, Ziller Eike wrote:
  Qt Creator-style would possibly be to replace the top level tab bar 
(the project selection) with a combo box?

This would add one extra click to switch the current/active project and 
to inspect how many and/or which projects are open. I can live with that.

The remaining tab bar (Build  Run, Editor, ...) could still be too 
wide. So what do we do with that one?

1) ...transform it into a list view. However, I already have 7 entries 
there and this will be problematic for displays/resolutions with limited 
vertical space.

2) ...move the items to the corresponding projects in the combobox (as 
sub items). Disadvantages:
  a) To switch to another project, you would need to visually skip 
several sub items (Build  Run, Editor, ...) of the current project.
  b) If you switch to a concrete item of another project, e.g. 
(Editor), you would implicitly switch the project, too. This might be 
not that obvious.


Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Where to find more information from Clang indexing errors

2015-07-31 Thread Nikolai Kosjar
Hi again!

On 07/30/2015 04:41 PM, Michael Jackson wrote:
  Also are there certain arguments that QtCreator uses with libClang? 
Things like -Wall or something that has an equivalent clang command line 
argument? Maybe if I put those into my compile specification I can have 
my compiler produce the same warnings?

When it comes to defines and include paths we mostly pass in to libclang 
what the project manager plugin (qmake, qbs, cmake) provides us with. 
There are no special warning options that we add, however, currently no 
warning options are passed along, either. If the compiler is clang or 
gcc, we probably should forward warning options to libclang.

You will see the command line arguments to libclang from the logging 
categories output on stdout/stderr of Qt Creator. Note that you can't 
always copy/paste this to command line and compare - your installed 
llvm/clang might have different system header and framework include 
paths. Therefore, if possible, always try to reduce to a file without 
any includes.

  Also, how can I force QtCreator to reindex my project? Is there a 
file somewhere that I can delete?

The clang code model does not (yet) create an index. It only provides 
highlighting with diagnostics and completion. You might want to close 
and reopen the file.

  The July 30 build seems slightly better in the fact that I don't get 
the red squiggly under lines any more BUT the code completion does not 
work for those functions. for example, the line of code has all the same 
default text color which is different that the lines above and below 
it where my custom colors are used for objects and methods and variables.

Then please reduce to a minimal example and report :)

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Where to find more information from Clang indexing errors

2015-07-30 Thread Nikolai Kosjar
Hi!

Enable the following logging categories [1] to get output from libclang:

   qtc.clangcodemodel.clangeditordocumentparser=true
   qtc.clangcodemodel.verboserun=true

Here is how you can help:
  * Do not use the mailing list for bug reports.
  * Create a report at https://bugreports.qt.io/ with the generated output from
the logging categories.
  * Attach a minimal project that exhibits the bug so I have sth. *concrete* I
can work with.

The code snippet and context you provided are not enough.

The Qt Creator 3.5 rc1 snapshots come with libClang is 3.6, [2] tells me that
XCode 5.x comes with LLVM based on 3.3/3.4. Although that might make a
difference, I doubt it's that for this concrete case.

Nikolai

[1] http://doc.qt.io/qt-5/qloggingcategory.html#configuring-categories
[2] https://en.wikipedia.org/wiki/Xcode#Toolchain_versions

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Issue parsing QStringLiteral() in SpellChecker Plugin

2015-07-28 Thread Nikolai Kosjar
Hiya!

On 07/25/2015 10:30 PM, Carel Combrink wrote:
 Due to the expansion of the macro, I am finding it rather hard to get the 
 position of the words as the user sees it, not my plugin. For example if I 
 have a mistake on line: 8, Col: 63 (reported by QtC), my parser sees 2 
 instances of the word at (10:65) and (10:232).

I don't know how you get the line and column information, but you should use
the get* functions of CPlusPlus::TranslationUnit for this.

Consider to what QStringLiteral(hello there) might expand to:

 auto s = ([]() - QString { enum { Size = sizeof(u hello there)/2 - 1 
}; static const QStaticStringDataSize qstring_literal = { { { { (-1) } }, 
Size, 0, 0, sizeof(QStringData) }, u hello there }; QStringDataPtr holder = 
{ qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); 
return qstring_literal_temp; }());

The following code will report 4 string literals (note the u), assuming that
document comes from CppTools::CppModelManager::documentUpdated():

   if (TranslationUnit *translationUnit = document-translationUnit()) {
   for (unsigned i = 0; i  translationUnit-tokenCount(); ++i) {
   const Token t = translationUnit-tokenAt(i);
   if (t.isStringLiteral()  t.expanded()) {
   unsigned line, column;
   translationUnit-getTokenStartPosition(i, line, column);
   qDebug()  String:  t.spell()  at line:  line  
column:  column;
   }
   }
   }

output:
23 String:  at line: 9 column: 41
24 String: hello there at line: 7 column: 29
63 String:  at line: 9 column: 177
64 String: hello there at line: 7 column: 29

That's OK. You just have to ignore the duplicates. And note that u is a token
consisting of 3 utf16chars and you probably also want to ignore this one.

 I have started searching and looked a bit at the  WrapStringLiteral class 
 (part of CppQuickfixes) and it seems like the WrapStringLiteral::analyze() 
 function can do what I need. I am not sure how to use this, or implement 
 something similar.

Note that the quickfixes do operate on a slightly different document than the
one that is emitted via CppModelManager::documentUpdated(). So you can't use
that code.

 PS: I will also be very grateful if this solution can be used to also know 
 which strings are translatable strings (enclosed in tr()).

The fast/simple solution that will work most of the time in Qt projects: Check
for the tr and ( tokens before the string literal token. Note that it will
already fail for e.g.: MyClass tr(lala);

The slower/correct solution involves:
  1. Finding the CallAST for tr(). Choose one of:
   1.a Use an ASTVisitor for this and override visit(CallAST *ast)
   See CheckSymbols::visit(CallAST *ast) for an example.
   1.b Use ASTPath - see how it's used in cppquickfixes.cpp
   See how ASTPath is used in cppquickfixes.cpp (interface.path()).
  2. Making a lookup on the tr to ensure it's the right one.

Remove the optimization line in src/libs/cplusplus/cplusplus.pro and rebuild
for a better debugging experience.

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Tab UI in Projects mode to TreeView

2015-07-21 Thread Nikolai Kosjar
Hiya!

On 07/21/2015 10:05 AM, de Sousa Diana wrote:
 ... , because I'm in the process of making re-designed proposals for the 
 whole Qt Creator UI.

Are there any major problems with the current UI?
In which direction does the re-design go?

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] method signature

2015-07-02 Thread Nikolai Kosjar
Hi!

On 07/01/2015 05:06 AM, Freddy Martinez wrote:
 guys, there is any way or any qt-creator plugin who let me show the
 entire signature in the code completion ??

 i’ll like this feature some day… at less, let the user decide if he want
 the actual code completion or someone with more info…

Please elaborate on entire signature, preferably with an example. What 
gets shown now and what would you like to see?

 is some advice for the coming versions

Note that you can also report suggestions (not only bugs) at

https://bugreports.qt.io/

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Clang Code Model and Performance

2015-06-25 Thread Nikolai Kosjar
Hi!

On 06/24/2015 06:35 PM, Michael Jackson wrote:
  My question is more aimed at “ …. is this slowness to be expected” or 
“.. we know about it and we are actively trying to speed it up.”.

It's the latter :)

  I am wondering if libraries that are heavily templated like Boost, 
ITK and Eigen slow the completion down.

Probably, though not sure to which degree since it also depends on point 
you trigger the completion.

Expect improvements in the coming weeks.

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Clang Code model can not find libClang 3.6

2015-06-22 Thread Nikolai Kosjar
Hi!

On 06/19/2015 03:44 PM, Michael Jackson wrote:
  Just tried the QtCreator 3.5 Beta and tried to load the Clang code 
model and it says that it can not load libClang.

There is not 3.5 beta yet, it's planned for w27 (~Jun 30 2015) [1], so 
I'm wondering which version you are actually using. Latest snapshots? 
Current Qt Creator from the 3.5 branch?

  Could someone remind me of the wiki page that has the instructions on 
how to get the Clang code model up and running?

http://doc.qt.io/qtcreator/creator-clang-codemodel.html#building-clang-code-model-plugin


[1] http://wiki.qt.io/Qt_Creator_Releases

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] NimPlugin: autocompletion

2015-05-22 Thread Nikolai Kosjar
On 05/22/2015 08:30 AM, Ziller Eike wrote:
 On May 22, 2015, at 12:46 AM, Filippo Cucchetto filippocucche...@gmail.com 
 wrote:
 ...maybe with an overall vision about how they relate to each other...

 The simplest example that you can find, is probably ProFileEditor, which 
 provides completion simply based on a fixed list of keywords.

See also http://doc-snapshots.qt.io/qtcreator-extending/codeassist.html

Nikolai
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] CppTools::ProjectInfo project sources and include paths

2015-02-03 Thread Nikolai Kosjar
Hi!

On Mon, 02. Feb 16:51, Roman Nikiforov wrote:
 The problem is that if I have conditions in qmake .pro file and some
 sources and include paths are added only for special configuration, I still
 get all source files from ProjectInfo, but include paths only for active
 configuration. Consequently Lint cannot resolve some includes and stops
 with error.

At the end of the day, your observation describes what the code model
needs. All project files are passed in so they can be indexed (as far
as possible) so that their symbols show up in the locator or e.g.
Search Symbols. Providing more include paths than for the current
build configuration could lead to subtle/unexpected side effects.

Note that in general you can't just assume that a project is
buildable/analyzable for all configuration since e.g. some headers
are only available on certain platforms. That is, getting all include
paths wouldn't help you here for the general case. It seems better to
analyze only the files that are part of the current build
configuration.

[For qmake projects:]
Unfortunately I don't see a way how to find out whether a file is part
of the current build configuration or not. We get the files via e.g.

pro-variableValue(CppSourceVar)

in QmakeProject::updateCppCodeModel() and this seem to contain *all*
files of the project, independent of the configuration.

@Daniel: Is there a way to get only the files that are selected by the
build configuration?

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Nomating Przemyslaw Gorszkowski as approver

2015-02-02 Thread Nikolai Kosjar
On Fri, 30. Jan 11:00, Orgad Shaneh wrote:
 I'd like to nominate Przemyslaw as approver.
 ... 
 He resolved some of the most annoying bugs, and handled many complicated
 use-cases.

He also monitors the bugtracker and asks where he can help out.

+1!

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Offset issue with CPlusPlus::TranslationUnit::getPosition()

2015-01-28 Thread Nikolai Kosjar
Hi!

On Tue, 27. Jan 21:10, Carel Combrink wrote:
 Is this a bug or am I doing something wrong?

The C++ lexer got UTF-8 support in Qt Creator 3.2, so I strongly
encourage you to build your plugin against Qt Creator 3.2 or even
better the current version, which is 3.3.

Note that 

void getPosition(unsigned utf16charOffset,
 unsigned *line,
 unsigned *column = 0,
 const StringLiteral **fileName = 0) const;


expects an UTF-16 offset, but you seem to mix it up with byte offsets
(you pass in token.bytesBegin() to tokenizeWords()).

This plugin looks nice, please think about upstreaming it.

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] How to make QtCreator to show pop-up documentation of my functions?

2015-01-28 Thread Nikolai Kosjar
Hi!

On Wed, 28. Jan 12:55, mat //common mail wrote:
 Is it possible when I place the mouse pointer over *my *function/class it
 shows a pop-up with description, taken from the docs in the comment above
 the function/class?

Currently there is no such functionality, but we do have such a
suggestion in the bugtracker: 

https://bugreports.qt.io/browse/QTCREATORBUG-8056

Nikolai

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


  1   2   >