Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Starting with QT - source and header files
Forum Updated to NodeBB v4.3 + New Features

Starting with QT - source and header files

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 376 Views 2 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.
  • A Offline
    A Offline
    Anna Honorey
    wrote on last edited by
    #1

    Hello
    I have started learning QT from scratch by myself, as well as C++ and I don't have much experience. I am using the documentation but it's also sometimes complicated and doesn't clear everything.
    What I haven't found anywhere, is the explanation about the source and header files. How are they connected? What should I write where?
    Sorry for the dumb question but it would really help me now.

    ? Pl45m4P 2 Replies Last reply
    0
    • A Anna Honorey

      Hello
      I have started learning QT from scratch by myself, as well as C++ and I don't have much experience. I am using the documentation but it's also sometimes complicated and doesn't clear everything.
      What I haven't found anywhere, is the explanation about the source and header files. How are they connected? What should I write where?
      Sorry for the dumb question but it would really help me now.

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @Anna-Honorey

      basically you put the declarations in the headers (so that other files can refer to these declarations) and you implement the details in the sources.

      When discovering new stuff I rather recommend that you go on tutorials rather than documentation, they don't replace each other. While a good documentation lists all the details, the tutorial rather focuses on the essentials.

      What I recommend you is find some beginner's C++ tutorial first (you fill find many on the web or many videos on youtube, at your convenience).

      1 Reply Last reply
      0
      • A Anna Honorey

        Hello
        I have started learning QT from scratch by myself, as well as C++ and I don't have much experience. I am using the documentation but it's also sometimes complicated and doesn't clear everything.
        What I haven't found anywhere, is the explanation about the source and header files. How are they connected? What should I write where?
        Sorry for the dumb question but it would really help me now.

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #3

        @Anna-Honorey

        Hi and welcome,

        this is indeed very basic C++. You should learn that first (or while learning Qt) otherwise you will have a hard time learning and understanding Qt C++.

        Header and source files are there because of multiple things.
        It helps to organize your code and separates your implementation of classes and function from their declaration.
        As you might have seen, this is just a "standard". You might come across short programs, which only have a main.cpp, where everything is declared and used. The main.cpp is the main entry point for your C++ program.

        How are they connected?

        You #include <test.h> your header in your test.cpp to use the function declared there.

        This article may help

        • https://cplusplus.com/articles/Gw6AC542/

        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        1 Reply Last reply
        0
        • C Offline
          C Offline
          CPPUIX
          wrote on last edited by
          #4
          This post is deleted!
          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