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. How to divide a larger project in Qt C++

How to divide a larger project in Qt C++

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 827 Views
  • 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.
  • EatonCodeE Offline
    EatonCodeE Offline
    EatonCode
    wrote on last edited by
    #1

    Hi all.

    I have always been a C# programmer who has used some C++ (mainly C# wrappers that interact with C++) in my current project but I want to learn how to use Qt so I can create my app for other OS types.

    I have been playing around with the samples and tutorials that come with Qt.

    Currently I have a semi large project in C# I would like to try to convert to Qt C++.

    In C# I have learned to separate logic so it's easy to maintain and debug. For Example instead of having your database SQL queries all over the place you can create a class in 1 place and use that when needed.. If I ever had a SQL issue I knew what section I should start looking.

    http://www.eatoncode.com/resources/shareit/TrafficBrowser_MasterSolution_-_Microsoft_Visual_Studio_2016-10-25_19.17.15.png

    I would like to do this in Qt C+ if it's possible. I have looked at a few examples that Qt provides and I don't really see any good examples of larger projects. So I wonder if it's a preference or a specific reason why. I am hoping and guessing it's to be simplistic.

    I loaded a larger example in Qt.

    http://www.eatoncode.com/resources/shareit/RibbonControls.pro_qtitanribbon_Qt_Creator_2016-10-25_19.24.36.png

    I see that you can include .pri files inside .pro files... you can even call other .pri files from .pri files.. but what I don't understand is how to create a .pri file.

    Am I on the right track to separate my logic? Or am I going about it wrong and there is an easier way ? At the end of the day I want a project that's easy to maintain and understand.

    This might be a totally noobie question that I should already know, but I don't so I am asking how do you handle your larger project ?

    Thanks,
    David

    raven-worxR 1 Reply Last reply
    0
    • EatonCodeE EatonCode

      Hi all.

      I have always been a C# programmer who has used some C++ (mainly C# wrappers that interact with C++) in my current project but I want to learn how to use Qt so I can create my app for other OS types.

      I have been playing around with the samples and tutorials that come with Qt.

      Currently I have a semi large project in C# I would like to try to convert to Qt C++.

      In C# I have learned to separate logic so it's easy to maintain and debug. For Example instead of having your database SQL queries all over the place you can create a class in 1 place and use that when needed.. If I ever had a SQL issue I knew what section I should start looking.

      http://www.eatoncode.com/resources/shareit/TrafficBrowser_MasterSolution_-_Microsoft_Visual_Studio_2016-10-25_19.17.15.png

      I would like to do this in Qt C+ if it's possible. I have looked at a few examples that Qt provides and I don't really see any good examples of larger projects. So I wonder if it's a preference or a specific reason why. I am hoping and guessing it's to be simplistic.

      I loaded a larger example in Qt.

      http://www.eatoncode.com/resources/shareit/RibbonControls.pro_qtitanribbon_Qt_Creator_2016-10-25_19.24.36.png

      I see that you can include .pri files inside .pro files... you can even call other .pri files from .pri files.. but what I don't understand is how to create a .pri file.

      Am I on the right track to separate my logic? Or am I going about it wrong and there is an easier way ? At the end of the day I want a project that's easy to maintain and understand.

      This might be a totally noobie question that I should already know, but I don't so I am asking how do you handle your larger project ?

      Thanks,
      David

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @EatonCode said in How to divide a larger project in Qt C++:

      I see that you can include .pri files inside .pro files... you can even call other .pri files from .pri files.. but what I don't understand is how to create a .pri file.

      A .pri file isn't any different from a .pro file. They are just named differently to mark them as include files.
      The best bigger project how to separate code is Qt source code itself ;)
      There you can see and check the pro files of the different (sub-)modules how they include their stuff. Then the rest is just "learning" qmake variables.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      5

      • Login

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