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. QT Project refactoring / General questions about qt project structures

QT Project refactoring / General questions about qt project structures

Scheduled Pinned Locked Moved Unsolved General and Desktop
subdirsstructurec++
3 Posts 3 Posters 387 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.
  • B Offline
    B Offline
    BeneG
    wrote on last edited by
    #1

    Hey guys,

    I am working on a larger qt project, that I should refactor. At the moment this project is a single pro file with a lot of qml and image files. Since we could only use qml and no c++ till now (because of some historical reasons in the old application structure). From now on we want to use QT to improve the performance by for example creating our own models. For that I want to restructure the project a bit.

    I informed myself a little on what is the best approach for this. My final take is to use a subdir project. It should look a bit like the following:

    /Application/Application.pro
    /Application/app/app.pro
    /Application/app/app.qrc
    /Application/app/...qml
    /Application/libs/charts/charts.pro
    /Application/libs/utils/utils.pro

    Does this project structure makes sense? In the end we would have some libs that contain qt/qml modules that I can import in the app. The charts lib for example would be a shared plugin lib that is used by the application. The charts lib provide some models from C++ and some charts from qml.

    Does it make sense to abstract everything in its own lib. Because I always want to import them from qml using import Application.Charts 1.0 or import Application.Utils 1.0. Does it make sense to stay with qmake or should I switch to cmake? Currently we are using QT5 but with the refactoring we could also switch to QT6.

    I also tried to set up a project with a plugin lib and and an app.pro but I failed to get it running. I always get some new errors. Does anyone know some good resources about this? I find it hard to get good resources or even just an simple example project.

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

      Hi and welcome to devnet,

      To your last question, yes you should move to CMake. There have been new features added in Qt 6 that will likely be of use for your project but that are only available through cmake.

      As for examples... maybe check some of the KDE's core projects. They already use CMake and some mix QML and C++.

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