Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Announcements
  4. QtCreator plugin for cppcheck, krazy and other tools
Forum Updated to NodeBB v4.3 + New Features

QtCreator plugin for cppcheck, krazy and other tools

Scheduled Pinned Locked Moved Announcements
40 Posts 10 Posters 30.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tobias.hunger
    wrote on 19 Mar 2013, 19:56 last edited by
    #4

    How does it work technically? Is your plugin parsing the output of those tools and inserts the issues itself or is it using the task list plugin to display the list of issues?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cmazieri
      wrote on 19 Mar 2013, 21:45 last edited by
      #5

      When --qtc-plugin is NOT present, it just prints out the commands output "cppcheck" or "krazy"

      When --qtc-plugin is present, it does:

      parses the command output generating a tasks files,

               see http://qt-project.org/doc/qtcreator-2.6/creator-task-lists.html
      

      call qtcreator back using the options: -client -pid, passing the tasks file, then qtcreator opens the tasks file and put the content into issues pane

      After few time removes the tasks file

      So, if you execute the "qpt" outside qtcreator using --qtc-plugin it should also works.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on 20 Mar 2013, 09:49 last edited by
        #6

        Cool, thanks for the information.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          angeFran
          wrote on 11 Apr 2013, 16:36 last edited by
          #7

          Hi,
          Is your plugin supposed to compile under Windows?

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cmazieri
            wrote on 11 Apr 2013, 17:43 last edited by
            #8

            Yes, I took some care of it.

            But I have not tested it since I do not use Windows.

            If you have any problem let me know.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              angeFran
              wrote on 11 Apr 2013, 18:19 last edited by
              #9

              my compiler doesn't seem to find include file
              #include <unistd.h>

              As far as I understand, it's a unix file only

              1 Reply Last reply
              0
              • C Offline
                C Offline
                cmazieri
                wrote on 11 Apr 2013, 18:29 last edited by
                #10

                YES, it is, try to remove this line.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  angeFran
                  wrote on 12 Apr 2013, 12:33 last edited by
                  #11

                  by removing that line, I have the following error

                  qcommandline.cpp:32:
                  error: C2491: 'QCommandLine::helpEntry' : definition of dllimport static data member not allowed

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    cmazieri
                    wrote on 12 Apr 2013, 19:05 last edited by
                    #12

                    I am using this module QCommandLine, it is also open source and I got it from http://xf.iksaif.net/dev/qcommandline.html.

                    I am sorry, I am not able to help at this point unless I try to compile on Windows, I do not have any Windows compiler.

                    I think that is in the link process and you are close to compile it.

                    Once you get it compiled, qmake and qtcreator must be in the PATH in order to work.

                    Try to research about this problem or contact the QCommandLine author.

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      bruceoutdoors
                      wrote on 3 Jun 2013, 11:21 last edited by
                      #13

                      I would recommend it, but given the hassle to set things up I'd give 4/5 stars. In addition to the manual, using windows there are couple of things to bear in mind:

                      • in the arguments field during setting up, be aware that unless you set cppcheck in your environment paths, "--tool=cppcheck" does not work. You'll need to set the directory:

                      @--qtc-plugin --tool="C:/Cppcheck-1.55/cppcheck.exe" %{CurrentProject:FilePath} @

                      • You'll need to set an environment paths to QtCreator(usually in C:\Qt\Qt5.0.2\Tools\QtCreator\bin). Without this the warning messages from cppcheck does not show up in the issues pane

                      • Don't use cppcheck 1.60. In qpt 0.7, it doesn't work. I got things running with cppcheck 1.55.

                      And thus, a happy user of QtProjectTool! :D

                      !https://lh6.googleusercontent.com/-byu0-9Dqaro/UayAScAJ3gI/AAAAAAAABWc/nw5Ld_YStvw/w617-h585-no/QtProjectTool+Screenshot.png(QtProjectTool running in windows 7)!

                      windows 7 32bit, Qt 5.0.2 MinGW, cppcheck 1.55

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        cmazieri
                        wrote on 3 Jun 2013, 20:17 last edited by
                        #14

                        OK, Thanks.

                        I got a Windows machine and I am able to work on that now.

                        qpt 0.8 version will work better on Windows and the manual will be updated.

                        1 Reply Last reply
                        0
                        • j1eloJ Offline
                          j1eloJ Offline
                          j1elo
                          wrote on 18 Jun 2013, 14:02 last edited by
                          #15

                          Not a very good method for tool version check:
                          you are getting the numeric part and blindly converting to double. Well, it's a bit optimistic assumption that a version number will be a valid numeric value!

                          In fact, now that cppcheck went up to version 1.60.1, QPT happily states that "Tool cppcheck-gui requires a minimal version 1.55".

                          1 Reply Last reply
                          0
                          • C Offline
                            C Offline
                            cmazieri
                            wrote on 18 Jun 2013, 14:23 last edited by
                            #16

                            It is a bug and will be fixed soon.

                            As a work around try to edit the configuration file, qpt prints the path of the configuration file when it starts.
                            It is usually located at $HOME/.config/QtProjectTool/qpt.ini

                            try to clear the minimal version line, change:

                            Mininal_version_USE_only_digist_and_dot_it_will_be_converted_to_float=1.58

                            to

                            Mininal_version_USE_only_digist_and_dot_it_will_be_converted_to_float=

                            That should work.

                            1 Reply Last reply
                            0
                            • j1eloJ Offline
                              j1eloJ Offline
                              j1elo
                              wrote on 18 Jun 2013, 14:44 last edited by
                              #17

                              I did it the other way :)
                              Created a QByteArray w2 where to copy all the numbers without any punctuation sign. So 1.60.1 ends up being 1601 which is greater than 1.55
                              Maybe it's a good idea for version checking (I didn't stop to think about implications of doing this... it was just a workaround)

                              1 Reply Last reply
                              0
                              • C Offline
                                C Offline
                                cmazieri
                                wrote on 20 Jul 2013, 17:37 last edited by
                                #18

                                Hello,

                                Version 0.8 has been released with some improvements, see "RELEASE NOTES":http://sourceforge.net/projects/qtprojecttool/files/RELEASE_NOTES.txt/download

                                1 Reply Last reply
                                0
                                • C Offline
                                  C Offline
                                  cmazieri
                                  wrote on 20 Jul 2013, 17:46 last edited by
                                  #19

                                  Version 0.8 has been released with some improvements, the main work was done to have a better Windows version.

                                  See "RELEASE NOTES":http://sourceforge.net/projects/qtprojecttool/files/RELEASE_NOTES.txt/download

                                  1 Reply Last reply
                                  0
                                  • L Offline
                                    L Offline
                                    last5bits
                                    wrote on 21 Aug 2013, 09:06 last edited by
                                    #20

                                    Thank you for your tool! But I get question marks in the file paths with non-latin letters (e.g. cyrillic letters)
                                    @$qpt -A CET.pro

                                    /home/alex/Projects/??????/src/main.cpp
                                    /home/alex/Projects/??????/src/mainwindow.cpp
                                    /home/alex/Projects/??????/src/mainwindow.h@

                                    1 Reply Last reply
                                    0
                                    • C Offline
                                      C Offline
                                      cmazieri
                                      wrote on 21 Aug 2013, 15:46 last edited by
                                      #21

                                      Hi,

                                      Are you using version 0.8 ?

                                      send me your project file and the right path it should bring,

                                      I will take a look on that.

                                      Thanks, Carlos

                                      1 Reply Last reply
                                      0
                                      • L Offline
                                        L Offline
                                        last5bits
                                        wrote on 22 Aug 2013, 13:04 last edited by
                                        #22

                                        Yes, the version is 0.8. I sent you a tarball, thanks for your fast respond

                                        1 Reply Last reply
                                        0
                                        • C Offline
                                          C Offline
                                          cmazieri
                                          wrote on 22 Aug 2013, 23:26 last edited by
                                          #23

                                          Hi, it has been fixed (not published yet)

                                          bq. ./qpt -A /home/carlos/tmp/projects/qpt_tests/Проекты/КириллическоеИмяПроекта/hello.pro
                                          /home/carlos/tmp/projects/qpt_tests/Проекты/КириллическоеИмяПроекта/hello.cpp

                                          But, I am afraid cppcheck does not handle unicode paths:

                                          /usr/bin/cppcheck --platform=unix32 -I . -f -q --template '{file}:{line}:{id}:{message}' --inline-suppr --enable=style --enable=unusedFunction --suppress=missingInclude:* --inconclusive --file-list=/tmp/qt_temp.Lh2660

                                          cppcheck: error: could not find or open any of the paths given.

                                          I use full pathname for files, I will try using relative pathnames.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved