Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Can i disable RTTI?
Qt 6.12 LTS is out! See what's new in the release blog

Can i disable RTTI?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
14 Posts 4 Posters 5.7k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #3

    Hi and welcome to devnet,

    Do you mean add "-fno-rtti" to the compiler flags ?

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

    1 Reply Last reply
    2
    • C Offline
      C Offline
      ChrisPanda
      wrote on last edited by ChrisPanda
      #4

      I am using MSVC and i want to disable it to remove my classes name in compile time. I am happy that there is so many helpful members here

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

        Are you using Qt Creator or Visual Studio directly ?

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

        C 1 Reply Last reply
        0
        • SGaistS SGaist

          Are you using Qt Creator or Visual Studio directly ?

          C Offline
          C Offline
          ChrisPanda
          wrote on last edited by
          #6

          @SGaist I am using qt creator sir and i am developing qml quick application. is there any problem if i do that?

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

            That depends on how you want to use these classes. Out of curiosity. Why do you want to disable RTTI for that application ?

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

            1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisPanda
              wrote on last edited by
              #8

              Just for educational purpose. I just want to remove my classes name

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

                Based on this page of the VS documentation, you would need to add "/GR-" to the compiler flags. But its goal is not to hide anything. It just does not generate some additional information.

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

                1 Reply Last reply
                3
                • C Offline
                  C Offline
                  ChrisPanda
                  wrote on last edited by ChrisPanda
                  #10

                  d90fb734-92e9-4264-9684-a665b37a3a08-image.png I add it like this sir but not working :'(

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    ChrisPanda
                    wrote on last edited by
                    #11

                    still i can see some RTTI

                    45f1fcc6-d0df-4af3-b100-4443a5b5b7b9-image.png

                    config:

                    29a442be-a1f3-4c27-84d8-7bda3ddfb611-image.png

                    heres the output
                    3fe3148a-48a5-41ed-aad5-4fcc8565aa80-image.png

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

                      You are removing the negation of the option.

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

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        ChrisPanda
                        wrote on last edited by
                        #13

                        Sorry sir but i dont understand, can you please explain it sir?

                        JonBJ 1 Reply Last reply
                        0
                        • C ChrisPanda

                          Sorry sir but i dont understand, can you please explain it sir?

                          JonBJ Offline
                          JonBJ Offline
                          JonB
                          wrote on last edited by
                          #14

                          @ChrisPanda
                          You have added

                          QMAKE_CXXFLAGS -= /GR-
                          

                          Note that you have used -=. That removes the option. But @SGaist wants you to add that option:

                          QMAKE_CXXFLAGS += /GR-
                          

                          Note the +=!

                          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
                          • Unsolved