Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Visual Studio Qt Plugin: C++/MOC Item Type change
Forum Updated to NodeBB v4.3 + New Features

Visual Studio Qt Plugin: C++/MOC Item Type change

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 2 Posters 809 Views 2 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.
  • W Offline
    W Offline
    WWebber
    wrote on last edited by WWebber
    #1

    I converted a .PRO to a .VCXPROJ and experience a weird behavior. One (just one!) of the QT .CPP files always "changes on its own" to be compiled by MOC instead of using C/C++ compiler. This file is part of a .UI/.H/.CPP bundle. Then I always get weird file access denied errors..

    The .VCXPROJ/.SLN is always kept open, but sometimes I open QT Designer.

    Who is changing this in background and how can I supress this automatic change?

    Edit: I re-imported the .PRO file from scratch again, and the suspicious file is set to MOC compilation by default!! What is in this file, that the imported thinks, it is a MOC instead of a simple CPP file?

    1 Reply Last reply
    0
    • W WWebber

      @SGaist said in Visual Studio Qt Plugin: C++/MOC Item Type change:

      Hi,

      You might want to share the content of that file otherwise it's pretty much crystal ball debugging.
      The .pro file content may also help understand what is going on.

      Both are pretty large, but nothing special. The UI of the suspicious file is a simple QDialog as many others I am using - in the same project. I wonder why "somebody" is changing the "Item Type C/C++ compiler" of an entry in the VCXPROJ at all?

      Edit: It changes, when I open the CPP file and save it to disk! How can I supress this change??

      W Offline
      W Offline
      WWebber
      wrote on last edited by
      #4

      @WWebber

      Unbelieveable !! Got it !!
      Somewhere in the code in a '#if false / #endif' block there is a Q_OBJECT which gets recognized totally wrong !

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        You might want to share the content of that file otherwise it's pretty much crystal ball debugging.

        The .pro file content may also help understand what is going on.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        W 1 Reply Last reply
        1
        • SGaistS SGaist

          Hi,

          You might want to share the content of that file otherwise it's pretty much crystal ball debugging.

          The .pro file content may also help understand what is going on.

          W Offline
          W Offline
          WWebber
          wrote on last edited by WWebber
          #3

          @SGaist said in Visual Studio Qt Plugin: C++/MOC Item Type change:

          Hi,

          You might want to share the content of that file otherwise it's pretty much crystal ball debugging.
          The .pro file content may also help understand what is going on.

          Both are pretty large, but nothing special. The UI of the suspicious file is a simple QDialog as many others I am using - in the same project. I wonder why "somebody" is changing the "Item Type C/C++ compiler" of an entry in the VCXPROJ at all?

          Edit: It changes, when I open the CPP file and save it to disk! How can I supress this change??

          W 1 Reply Last reply
          0
          • W WWebber

            @SGaist said in Visual Studio Qt Plugin: C++/MOC Item Type change:

            Hi,

            You might want to share the content of that file otherwise it's pretty much crystal ball debugging.
            The .pro file content may also help understand what is going on.

            Both are pretty large, but nothing special. The UI of the suspicious file is a simple QDialog as many others I am using - in the same project. I wonder why "somebody" is changing the "Item Type C/C++ compiler" of an entry in the VCXPROJ at all?

            Edit: It changes, when I open the CPP file and save it to disk! How can I supress this change??

            W Offline
            W Offline
            WWebber
            wrote on last edited by
            #4

            @WWebber

            Unbelieveable !! Got it !!
            Somewhere in the code in a '#if false / #endif' block there is a Q_OBJECT which gets recognized totally wrong !

            1 Reply Last reply
            1
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #5

              Funny, the next thing I had in mind was about Q_OBJECT :)

              Glad you found out and thanks for sharing !

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              W 1 Reply Last reply
              1
              • SGaistS SGaist

                Funny, the next thing I had in mind was about Q_OBJECT :)

                Glad you found out and thanks for sharing !

                W Offline
                W Offline
                WWebber
                wrote on last edited by
                #6

                @SGaist said in Visual Studio Qt Plugin: C++/MOC Item Type change:

                Funny, the next thing I had in mind was about Q_OBJECT :)

                I hate it, if 'programmers' automatically change something without any notification, which I manually set correctly!

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  Can you share that ifdef snippet ?

                  I remember issues in the old time with that kind of construct.

                  Which version of Qt are you using ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  W 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Can you share that ifdef snippet ?

                    I remember issues in the old time with that kind of construct.

                    Which version of Qt are you using ?

                    W Offline
                    W Offline
                    WWebber
                    wrote on last edited by
                    #8

                    @SGaist
                    I reported this bug in: https://bugreports.qt.io/browse/QTVSADDINBUG-855

                    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