Discussion:
[Qt-creator] copy/add resources / src files
ekke
2016-02-25 10:16:52 UTC
Permalink
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 - don't know if I understood it right how QtCreator is
doing "things"

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/***@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

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 described above ?

code generated from outside the project
I'm working on a DSL to generate code from an Eclipse Xtext model
into a Qt 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 src-gen.pri with HEADERS and SOURCES
and include this file 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
--
ekke (ekkehard gentz)

independent software architect
international development native mobile business apps
BlackBerry 10 | Qt Mobile (Android, iOS)
workshops - trainings - bootcamps

*BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner*

max-josefs-platz 30, D-83022 rosenheim, germany
mailto:***@ekkes-corner.org
blog: http://ekkes-corner.org
apps and more: http://appbus.org

twitter: @ekkescorner
skype: ekkes-corner
LinkedIn: http://linkedin.com/in/ekkehard/
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490
Ziller Eike
2016-02-25 12:46:35 UTC
Permalink
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 - don't know if I understood it right how QtCreator is doing "things"
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.
go to the file system
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
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.
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 described above ?
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.
code generated from outside the project
I'm working on a DSL to generate code from an Eclipse Xtext model into a Qt 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 src-gen.pri with HEADERS and SOURCES and include this file into my .pro ?
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).

Br, Eike
thanks for helping
don't want to provide wrong recipes HowTo deal with copying / adding resources and src files into QtCreator projects
--
ekke (ekkehard gentz)
independent software architect
international development native mobile business apps
BlackBerry 10 | Qt Mobile (Android, iOS)
workshops - trainings - bootcamps
BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
max-josefs-platz 30, D-83022 rosenheim, germany
blog: http://ekkes-corner.org
apps and more: http://appbus.org
skype: ekkes-corner
LinkedIn: http://linkedin.com/in/ekkehard/
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
--
Eike Ziller, Principle Software Engineer - The Qt Company GmbH

The Qt Company GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
ekke
2016-02-25 13:21:00 UTC
Permalink
Hi Eike,

just tried adding ressources from another project as you described - worked.
thx.
never would have found this alone ;-)
(and from J-P Nurmi in the meantime I learned that I have to add
resource files in .pro to OTHER_FILES+= to get a better tree view)

for copying src files now I'll use this workflow:
-- source project... show in finder, mark .cpp / .hpp, copy
-- target project... show in finder, paste

then I have to manually add to .pro the names of copied cpp under SOURCES+=
correct ?

thx

ekke
Post by Ziller Eike
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 - don't know if I understood it right how QtCreator is doing "things"
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.
go to the file system
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
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.
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 described above ?
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.
code generated from outside the project
I'm working on a DSL to generate code from an Eclipse Xtext model into a Qt 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 src-gen.pri with HEADERS and SOURCES and include this file into my .pro ?
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).
Br, Eike
thanks for helping
don't want to provide wrong recipes HowTo deal with copying / adding resources and src files into QtCreator projects
--
ekke (ekkehard gentz)
Ziller Eike
2016-02-26 09:28:29 UTC
Permalink
Post by ekke
Hi Eike,
just tried adding ressources from another project as you described - worked.
thx.
never would have found this alone ;-)
(and from J-P Nurmi in the meantime I learned that I have to add
resource files in .pro to OTHER_FILES+= to get a better tree view)
-- source project... show in finder, mark .cpp / .hpp, copy
-- target project... show in finder, paste
then I have to manually add to .pro the names of copied cpp under SOURCES+=
correct ?
Or use “Add existing..."

Br, Eike
Post by ekke
thx
ekke
Post by Ziller Eike
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 - don't know if I understood it right how QtCreator is doing "things"
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.
go to the file system
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
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.
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 described above ?
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.
code generated from outside the project
I'm working on a DSL to generate code from an Eclipse Xtext model into a Qt 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 src-gen.pri with HEADERS and SOURCES and include this file into my .pro ?
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).
Br, Eike
thanks for helping
don't want to provide wrong recipes HowTo deal with copying / adding resources and src files into QtCreator projects
--
ekke (ekkehard gentz)
--
Eike Ziller, Principle Software Engineer - The Qt Company GmbH

The Qt Company GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
Konstantin Tokarev
2016-02-26 09:35:46 UTC
Permalink
Post by ekke
Hi Eike,
just tried adding ressources from another project as you described - worked.
thx.
never would have found this alone ;-)
I also find this new functionality (resource contents integrated into project tree) quite confusing. I often have qrcs with hundreds of files, and project tree representation is almost useless as compared to old resource editor, but it's no more possible to open resource editor with double click.
Post by ekke
(and from J-P Nurmi in the meantime I learned that I have to add
resource files in .pro to OTHER_FILES+= to get a better tree view)
-- source project... show in finder, mark .cpp / .hpp, copy
-- target project... show in finder, paste
then I have to manually add to .pro the names of copied cpp under SOURCES+=
correct ?
thx
ekke
 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 - don't know if I understood it right how QtCreator is doing "things"
 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.
     go to the file system
     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
 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.
 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 described above ?
 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.
 code generated from outside the project
     I'm working on a DSL to generate code from an Eclipse Xtext model into a Qt 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 src-gen.pri with HEADERS and SOURCES and include this file into my .pro ?
 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).
 Br, Eike
 thanks for helping
 don't want to provide wrong recipes HowTo deal with copying / adding resources and src files into QtCreator projects
 --
 ekke (ekkehard gentz)
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
--
Regards,
Konstantin
Continue reading on narkive:
Loading...