Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Porting old code to Qt4

Porting old code to Qt4

Scheduled Pinned Locked Moved Installation and Deployment
9 Posts 3 Posters 2.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.
  • C Offline
    C Offline
    ckluss
    wrote on last edited by
    #1

    Hi,

    I want to use old Qt code with Qt4 (because of Qt3Support). But the following code does not compile

    @QMetaData *slot_tbl = QMetaObject::new_metadata(1);
    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(1);
    slot_tbl[0].name = "slotRepositionText()";
    slot_tbl[0].ptr = (QMember)ov1_0;
    slot_tbl_access[0] = QMetaData::Public;@

    Can you give me a hint how to fix this?

    thx
    Christof

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

      Hi and welcome to devnet,

      Where does that code come from ?

      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
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Looks like auto-generated code to me?

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

          Looks also like it to me, that's why I wanted to know it's origin. It would be strange getting wrong code from moc even while porting.

          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
            ckluss
            wrote on last edited by
            #5

            Hi,

            thx for the fast reply. I want port the following code (from 2004) (Modelling Software) to Qt 4 (because of Qt3Support... otherwise Qt 5 :( )

            http://code.google.com/p/daisy-model/source/browse/trunk/qmain_moc.C

            Christof

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              That is indeed a generated file. No need to port it manually, it (or something like it with the same functionality) will be created for you automatically.

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

                In addition to what Andre said, you should also remove all moc files from your source tree.

                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
                  ckluss
                  wrote on last edited by
                  #8

                  many thanks again. It is not my source tree, but I'm trying to convince the maintainer

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    andre
                    wrote on last edited by
                    #9

                    In general: don't put generated files in a source repository. That includes the moc_.cpp files, but also ui_.h and qrc_*.cpp files, besides all that is created by the non-qt parts of your toolchain of course.

                    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