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. [SOLVED] Compiling error : 'QTextEdit' Does not name a type
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Compiling error : 'QTextEdit' Does not name a type

Scheduled Pinned Locked Moved Installation and Deployment
10 Posts 2 Posters 7.5k 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.
  • Y Offline
    Y Offline
    ysing
    wrote on last edited by
    #1

    Hello, I am working on a small project using Qt 5.3.1. I have included <QtWidgets> at the beginning , but while the declaration of a QTextEdit variable this error occurs : ' 'QTextEdit' does not name a type.'

    I also tried to replace #include<QtWidgets> with #include<QTextEdit> but this didn't solve the problem.

    Can anybody help me?

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

      Hi,

      Did you also add

      @QT += widgets@

      to your pro file ?

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

        Yes, to note I the problem is there only with QTextEdit .

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

          Can you show the code where it happens ?

          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
          • Y Offline
            Y Offline
            ysing
            wrote on last edited by
            #5

            Thank you SGaist the problem was solved.

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

              How was it solved ?

              Since it's working, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

              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
              • Y Offline
                Y Offline
                ysing
                wrote on last edited by
                #7

                Ok SGaist I made a some modifications the header files ( I have two header files in total):

                1. In the first header file,
                  I replaced #include<QtGui> with :
                  #include<QDialog>
                  #include<QTextEdit>
                  #include<QPushButton>
                  #include<QVBoxLayout>

                2. In the second header file, I replaced #include<QtGui> with #include<QtWidgets>

                that's all :)

                But how can I update the thread title to [solved] ?

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

                  While it is fine for test code, you should not use module wide includes, it pulls in every class from the module and one side effect is that it slows down compilation time.

                  To edit the thread title, just edit your original post and there you can change the title :)

                  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
                  • Y Offline
                    Y Offline
                    ysing
                    wrote on last edited by
                    #9

                    Thank you very much but I have three other questions:

                    1. what does deploy locally means exactly?
                    2. where can I find Qt Command Prompt?
                      3)How can I open Qt Linguist?
                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      You're welcome

                      1. Deploy on your computer
                      2. Start Menu -> Qt Version -> Command Prompt (something similar)
                      3. Start Menu -> Qt Version -> Linguist (again something similar)

                      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

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved