Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt 5.0.1

Qt 5.0.1

Scheduled Pinned Locked Moved Qt Creator and other tools
4 Posts 2 Posters 1.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.
  • N Offline
    N Offline
    nymar
    wrote on last edited by
    #1

    Hello
    I have some questions to ask as a begginner

    1 / How to create own class and use it later (when I try it tells me no such file or directory)

    2 / Every time I have to include for each class but I learned that one can do include <QtGui> which should be sufficient

    3 / I use Qt 5.0.1 and every time I have to paste in the file. pro this
    "QT + = core gui
    GreaterThan (QT_MAJOR_VERSION 4): QT + = widgets "
    can I skip this task?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2
      • You could install the headers and libs into system directories (or better, add to PATH), but for casual development I would not recommend this. In general you need to include the header, and add both header and source to your .pro file - if you are using qmake.
      • See above. QtGui is probably installed on your machine, and even if it's not qmake will add necessary includes when you run it. You can add some more automated includes, see QtSerialPort implementation for example (or use .pri files).
      • No, it's required as long as you are using qmake. You can shorten this line to
        @
        QT += core gui widgets
        @
        if you really want to and are using Qt5 only.

      (Z(:^

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nymar
        wrote on last edited by
        #3

        Thx for help...and i would like if u u make it clearer about the first question because i'm a beginner and i didn't try it at all

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          If you are a beginner, then just copy the files over to your new project and add them to .pro file. Then you can use them with a simple
          @
          #include "mycopiedheader.h"
          @

          Installing stuff globally or modifying qmake variables is a bit more hardcore.

          (Z(:^

          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