Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Can i disable RTTI?

    QML and Qt Quick
    4
    14
    670
    Loading More Posts
    • 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.
    • C
      ChrisPanda last edited by

      Hello guys? Do you know how to disable RTTI?

      J.Hilk 1 Reply Last reply Reply Quote 0
      • J.Hilk
        J.Hilk Moderators @ChrisPanda last edited by J.Hilk

        @ChrisPanda said in Can i disable RTTI?:

        Do you know how to disable RTTI?

        yes


        darn can't leave it at a yes, why do you want to disable it? And I assume its essential for Qt's internal classes and methods in the first case.

        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct

        Qt Needs YOUR vote: https://bugreports.qt.io/browse/QTQAINFRA-4121


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply Reply Quote 2
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          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 Reply Quote 2
          • C
            ChrisPanda last edited by ChrisPanda

            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 Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              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 Reply Quote 0
              • C
                ChrisPanda @SGaist last edited by

                @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 Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  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 Reply Quote 0
                  • C
                    ChrisPanda last edited by

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

                    1 Reply Last reply Reply Quote 0
                    • SGaist
                      SGaist Lifetime Qt Champion last edited by

                      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 Reply Quote 3
                      • C
                        ChrisPanda last edited by ChrisPanda

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

                        1 Reply Last reply Reply Quote 0
                        • C
                          ChrisPanda last edited by

                          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 Reply Quote 0
                          • SGaist
                            SGaist Lifetime Qt Champion last edited by

                            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 Reply Quote 0
                            • C
                              ChrisPanda last edited by

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

                              JonB 1 Reply Last reply Reply Quote 0
                              • JonB
                                JonB @ChrisPanda last edited by

                                @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 Reply Quote 0
                                • First post
                                  Last post