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. copy - add src files + resources into projects
Forum Updated to NodeBB v4.3 + New Features

copy - add src files + resources into projects

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 1 Posters 2.9k 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.
  • ekkescornerE Offline
    ekkescornerE Offline
    ekkescorner
    Qt Champions 2016
    wrote on last edited by
    #1

    while preparing a blog artictle for BlackBerry 10 devs HowTo use Qt Creator for Qt 5.6 vs Eclipse Momentics (Cascades, Qt 4.8) I'm having some questions if I understood it right how QtCreator is doing "things"

    1. copy / paste resources
      Having two projects open and want to copy some icons from project A to project B
      In Momentics I would mark some files from project A tree, then copy and in project B tree paste them.
      This seems not to work with Qt Creator.
      Is this the right way:
      go to the file system
      copy files from A to B (per ex. copy images/arrow.png, images/arrow@2x.png,...)
      if not exist create the images subfolder
      then back to Qt Creator
      select qml.qrc, add existing files, select the images and then they appear in qml.qrc and are under control of Qt Creator
      am I right that there's no automatical sync with file system ? so renaming, delete, add must be done from inside Qt Creator ?

    2. qml.qrc and QML
      looked at some samples and also if creating a new Qt Quick application,
      the main.qml was automatically and ONLY inside the qml.qrc file
      found another example - gallery from Qt 5.6 qt.labs.controls - where gallery.qml was visible inside the gallery.qrc
      and below the Resources folder there also was a QML folder also containing the same gallery.qrc
      what does this mean ?
      how will this be done ?
      what's the recommended way to deal with .qml files and .qrc

    3. copy/paste src code
      if I want to copy/paste .cpp, .h source files from another project,
      I have to do it the same way as with resources descirbed above ?

    4. code generated from outside the project
      I'm working on a DSL to generate code from a model into a project
      (already done for Momentics/Cascades, now working to make this generator x-platform for Qt 5.6 mobile - will be open source)
      I'm generating the code into a subfolder /src-gen
      would it be ok to generate a .pri with HEADERS and SOURCES and include this into my .pro

    thanks for helping
    don't want to provide wrong recipes HowTo deal with copying / adding resources and src files into QtCreator projects

    BTW: only targeted for mobile development, starting with android, then ios, later win10. Qt 5.6 with qt.labs.controls is a great starting point.

    ekke ... Qt Champion 2016 | 2024 ... mobile business apps
    5.15 --> 6.8 https://t1p.de/ekkeChecklist
    QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

    1 Reply Last reply
    0
    • ekkescornerE Offline
      ekkescornerE Offline
      ekkescorner
      Qt Champions 2016
      wrote on last edited by
      #2

      preparing a blog series to help BlackBerry Cascades Devs with experience HowTo use Eclipse Momentics to start using QtCreator.

      would be cool to get some infos / hints to see if I understood it right - don't want to give wrong advice

      thanks.

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
      5.15 --> 6.8 https://t1p.de/ekkeChecklist
      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

      1 Reply Last reply
      0
      • ekkescornerE Offline
        ekkescornerE Offline
        ekkescorner
        Qt Champions 2016
        wrote on last edited by
        #3

        got question 2 about .qrc and QML answered:

        if placing the .qml files not only inside .qrc, but also as OTHER_FILES in .pro will cause Qt Creator to display these files under QML in a hierarchical way much better looking as the structure inside .qrc.
        So it's worth to sync both 'lists'

        still waiting for answers of the other questions.
        thx.

        ekke ... Qt Champion 2016 | 2024 ... mobile business apps
        5.15 --> 6.8 https://t1p.de/ekkeChecklist
        QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

        1 Reply Last reply
        0
        • ekkescornerE Offline
          ekkescornerE Offline
          ekkescorner
          Qt Champions 2016
          wrote on last edited by
          #4

          got answers from creator mailing list.

          1. copy/paste resources:
          Actually if you open the qrc file in an editor in Qt Creator (e.g. “Open in Editor” from context menu in project tree, or through locator (ctrl+k)),
          and choose Add > Files there, then you are asked if you want to copy the files to the location of the qrc file if the files that you choose are not already located there.

          3. copy/paste src code:
          Qt Creator does not provide “file explorer” functionalities (beside the remove and rename, which are there because they are actually .pro/.pri file editing features).
          Note that there are e.g. “Show in Explorer/Finder” in the context menu for nodes in the project tree.

          4. generated code:
          That sounds like a sensible approach to me. (Note that you should use $$PWD/..... to refer to files with a relative to the .pri file).

          now I can go on and prepare my blog

          ekke ... Qt Champion 2016 | 2024 ... mobile business apps
          5.15 --> 6.8 https://t1p.de/ekkeChecklist
          QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

          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