Qt Forum

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

    Solved Forward declaration error inside include qtableview.h

    General and Desktop
    forward declaration qheaderview building error qt sources
    3
    5
    1122
    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.
    • S
      smillmorel last edited by

      Hello.
      I'm trying to build this program using Qt Creator but during compilation I get this error:
      0_1538406707681_Screenshot_20181001_111116.png

      The compiler is calling incomplete type class QHeaderView and directs the problem to the forward declaration of QHeaderView inside qtableview.h. I have no idea what could be causing this since qtableview.h is a file from Qt sources. Nothing has been modified inside those files.
      Any help would be appreciated.

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        Just include QHeaderView in your cpp file.

        (Z(:^

        1 Reply Last reply Reply Quote 1
        • sierdzio
          sierdzio Moderators last edited by

          Just include QHeaderView in your cpp file.

          (Z(:^

          1 Reply Last reply Reply Quote 1
          • S
            smillmorel last edited by

            It worked, thanks.
            Don't really know what happended there, but it did work.
            Thank you very much.

            sierdzio 1 Reply Last reply Reply Quote 0
            • sierdzio
              sierdzio Moderators @smillmorel last edited by sierdzio

              @smillmorel said in Forward declaration error inside include qtableview.h:

              Don't really know what happended there, but it did work.

              There is no magic to it. Some Qt classes only forward declare the classes they use internally. If you use them in your code, you need to include them on your side.

              (Z(:^

              A 1 Reply Last reply Reply Quote 1
              • A
                Am_HSS @sierdzio last edited by

                @sierdzio hhhhh

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post