Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
Thanks for the link. I have checked out the C++ code example on Github before. But it is just kinda frustrating to see that the examples are mostly from 5 years ago and so much have changed. Also, for the add_raster_layer example in particular, I setup the whole project on my computer and try to add a layer, it reports an invalid layer. So right now, I have no idea what to change in order for the code to work. Nejia wrote > To write QGIS C++ plugin see : > http://download.osgeo.org/qgis/doc/manual/qgis-1.1.0_coding-compilation_guide_en.pdf > (2.2 Programming a QGIS C++ Plugin in four steps) > And you can find some C++ plugin examples here: > https://github.com/qgis/QGIS-Code-Examples and > https://github.com/qgis/QGIS-Code-Examples/tree/master/4_adding_rasters_to_canvas > > Regards, > Nejia > > -Message d'origine- > De : > qgis-developer-bounces@.osgeo > [mailto: > qgis-developer-bounces@.osgeo > ] De la part de eliu1234 > Envoyé : lundi 24 novembre 2014 17:52 > À : > qgis-developer@.osgeo > Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis > application with QtCreator and MSVC2008 on Windows > > QgisInterface is an abstract class. How are you initializing it? Or do > you just declare it and add a raster layer directly? Because from that > link, I see the addRasterLayer method is a pure virtual function and > QgisInterface is abstract class. I want to add this layer into a > QgsMapCanvas, how should I do that? > > Also, is it possible for you to test my code before to see if it works on > your system? > QgsRasterLayer * rlayer = new > QgsRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true","raster";); > qDebug() << rlayer->isValid(); > > > Nejia wrote >> QgisInterface *m_ptInterface; >> See >> http://qgis.org/api/2.6/classQgisInterface.html#a808a34b507a8c4204d607 >> a5857d62748 >> >> Regards, >> Nejia >> >> -Message d'origine- >> De : > >> qgis-developer-bounces@.osgeo > >> [mailto: > >> qgis-developer-bounces@.osgeo > >> ] De la part de eliu1234 >> Envoyé : vendredi 21 novembre 2014 21:36 À : > >> qgis-developer@.osgeo > >> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >> application with QtCreator and MSVC2008 on Windows >> >> What is the m_ptInterface in your code? >> >> >> Nejia wrote >>> I use the same environment of Qgis to write c++ plugins: >>> http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master >>> / >>> doc/INSTALL.html#toc14 >>> >>> to add raster layer: >>> m_ptInterface->addRasterLayer("http://server.arcgisonline.com/ArcGIS/ >>> r est/services/World_Imagery/MapServer?f=json&pretty=true","raster"); >>> >>> Regards, >>> Nejia >>> >>> -Message d'origine- >>> De : >> >>> qgis-developer-bounces@.osgeo >> >>> [mailto: >> >>> qgis-developer-bounces@.osgeo >> >>> ] De la part de eliu1234 >>> Envoyé : jeudi 20 novembre 2014 21:40 À : >> >>> qgis-developer@.osgeo >> >>> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >>> application with QtCreator and MSVC2008 on Windows >>> >>> Do you have a system setup that can write qgis c++ application? If >>> you do, can you create a valid raster layer from that? >>> >>> >>> Nejia wrote >>>> 1- see my response here >>>> http://stackoverflow.com/questions/26920574/cannot-find-qgsapplicati >>>> o >>>> n >>>> -h-and >>>> -other-header-files/27035138#27035138 >>>> >>>> -Message d'origine- >>>> De : >>> >>>> qgis-developer-bounces@.osgeo >>> >>>> [mailto: >>> >>>> qgis-developer-bounces@.osgeo >>> >>>> ] De la part de eliu1234 >>>> Envoyé : mercredi 19 novembre 2014 17:39 À : >>> >>>> qgis-developer@.osgeo >>> >>>> Objet : Re: [Qgis-developer] Problems with developing custom c++ >>>> qgis application with QtCreator and MSVC2008 on Windows >>>> >>>> 1. So in the .proj file, what do i need to change? >>>> >>>> 2. My Python works in this case, it is the C++ part that is not >>>> working. >>>>
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
Thanks for the link. I have checked out the C++ code example on Github before. But it is just kinda frustrating to see that the examples are mostly from 5 years ago and so much have changed. Also, for the add_raster_layer example in particular, the github does not even have all the files needed for the code to run. And when I just copy the code I need from there, it does not work either. Nejia wrote > To write QGIS C++ plugin see : > http://download.osgeo.org/qgis/doc/manual/qgis-1.1.0_coding-compilation_guide_en.pdf > (2.2 Programming a QGIS C++ Plugin in four steps) > And you can find some C++ plugin examples here: > https://github.com/qgis/QGIS-Code-Examples and > https://github.com/qgis/QGIS-Code-Examples/tree/master/4_adding_rasters_to_canvas > > Regards, > Nejia > > -Message d'origine- > De : > qgis-developer-bounces@.osgeo > [mailto: > qgis-developer-bounces@.osgeo > ] De la part de eliu1234 > Envoyé : lundi 24 novembre 2014 17:52 > À : > qgis-developer@.osgeo > Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis > application with QtCreator and MSVC2008 on Windows > > QgisInterface is an abstract class. How are you initializing it? Or do > you just declare it and add a raster layer directly? Because from that > link, I see the addRasterLayer method is a pure virtual function and > QgisInterface is abstract class. I want to add this layer into a > QgsMapCanvas, how should I do that? > > Also, is it possible for you to test my code before to see if it works on > your system? > QgsRasterLayer * rlayer = new > QgsRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true","raster";); > qDebug() << rlayer->isValid(); > > > Nejia wrote >> QgisInterface *m_ptInterface; >> See >> http://qgis.org/api/2.6/classQgisInterface.html#a808a34b507a8c4204d607 >> a5857d62748 >> >> Regards, >> Nejia >> >> -Message d'origine- >> De : > >> qgis-developer-bounces@.osgeo > >> [mailto: > >> qgis-developer-bounces@.osgeo > >> ] De la part de eliu1234 >> Envoyé : vendredi 21 novembre 2014 21:36 À : > >> qgis-developer@.osgeo > >> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >> application with QtCreator and MSVC2008 on Windows >> >> What is the m_ptInterface in your code? >> >> >> Nejia wrote >>> I use the same environment of Qgis to write c++ plugins: >>> http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master >>> / >>> doc/INSTALL.html#toc14 >>> >>> to add raster layer: >>> m_ptInterface->addRasterLayer("http://server.arcgisonline.com/ArcGIS/ >>> r est/services/World_Imagery/MapServer?f=json&pretty=true","raster"); >>> >>> Regards, >>> Nejia >>> >>> -Message d'origine- >>> De : >> >>> qgis-developer-bounces@.osgeo >> >>> [mailto: >> >>> qgis-developer-bounces@.osgeo >> >>> ] De la part de eliu1234 >>> Envoyé : jeudi 20 novembre 2014 21:40 À : >> >>> qgis-developer@.osgeo >> >>> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >>> application with QtCreator and MSVC2008 on Windows >>> >>> Do you have a system setup that can write qgis c++ application? If >>> you do, can you create a valid raster layer from that? >>> >>> >>> Nejia wrote >>>> 1- see my response here >>>> http://stackoverflow.com/questions/26920574/cannot-find-qgsapplicati >>>> o >>>> n >>>> -h-and >>>> -other-header-files/27035138#27035138 >>>> >>>> -Message d'origine- >>>> De : >>> >>>> qgis-developer-bounces@.osgeo >>> >>>> [mailto: >>> >>>> qgis-developer-bounces@.osgeo >>> >>>> ] De la part de eliu1234 >>>> Envoyé : mercredi 19 novembre 2014 17:39 À : >>> >>>> qgis-developer@.osgeo >>> >>>> Objet : Re: [Qgis-developer] Problems with developing custom c++ >>>> qgis application with QtCreator and MSVC2008 on Windows >>>> >>>> 1. So in the .proj file, what do i need to change? >>>> >>>> 2. My Python works in this case, it is the C++ part that is not >>>> working. >>>> >>>> >
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
To write QGIS C++ plugin see : http://download.osgeo.org/qgis/doc/manual/qgis-1.1.0_coding-compilation_guide_en.pdf (2.2 Programming a QGIS C++ Plugin in four steps) And you can find some C++ plugin examples here: https://github.com/qgis/QGIS-Code-Examples and https://github.com/qgis/QGIS-Code-Examples/tree/master/4_adding_rasters_to_canvas Regards, Nejia -Message d'origine- De : qgis-developer-boun...@lists.osgeo.org [mailto:qgis-developer-boun...@lists.osgeo.org] De la part de eliu1234 Envoyé : lundi 24 novembre 2014 17:52 À : qgis-developer@lists.osgeo.org Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows QgisInterface is an abstract class. How are you initializing it? Or do you just declare it and add a raster layer directly? Because from that link, I see the addRasterLayer method is a pure virtual function and QgisInterface is abstract class. I want to add this layer into a QgsMapCanvas, how should I do that? Also, is it possible for you to test my code before to see if it works on your system? QgsRasterLayer * rlayer = new QgsRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true","raster";); qDebug() << rlayer->isValid(); Nejia wrote > QgisInterface *m_ptInterface; > See > http://qgis.org/api/2.6/classQgisInterface.html#a808a34b507a8c4204d607 > a5857d62748 > > Regards, > Nejia > > -Message d'origine- > De : > qgis-developer-bounces@.osgeo > [mailto: > qgis-developer-bounces@.osgeo > ] De la part de eliu1234 > Envoyé : vendredi 21 novembre 2014 21:36 À : > qgis-developer@.osgeo > Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis > application with QtCreator and MSVC2008 on Windows > > What is the m_ptInterface in your code? > > > Nejia wrote >> I use the same environment of Qgis to write c++ plugins: >> http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master >> / >> doc/INSTALL.html#toc14 >> >> to add raster layer: >> m_ptInterface->addRasterLayer("http://server.arcgisonline.com/ArcGIS/ >> r est/services/World_Imagery/MapServer?f=json&pretty=true","raster"); >> >> Regards, >> Nejia >> >> -Message d'origine----- >> De : > >> qgis-developer-bounces@.osgeo > >> [mailto: > >> qgis-developer-bounces@.osgeo > >> ] De la part de eliu1234 >> Envoyé : jeudi 20 novembre 2014 21:40 À : > >> qgis-developer@.osgeo > >> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >> application with QtCreator and MSVC2008 on Windows >> >> Do you have a system setup that can write qgis c++ application? If >> you do, can you create a valid raster layer from that? >> >> >> Nejia wrote >>> 1- see my response here >>> http://stackoverflow.com/questions/26920574/cannot-find-qgsapplicati >>> o >>> n >>> -h-and >>> -other-header-files/27035138#27035138 >>> >>> -Message d'origine- >>> De : >> >>> qgis-developer-bounces@.osgeo >> >>> [mailto: >> >>> qgis-developer-bounces@.osgeo >> >>> ] De la part de eliu1234 >>> Envoyé : mercredi 19 novembre 2014 17:39 À : >> >>> qgis-developer@.osgeo >> >>> Objet : Re: [Qgis-developer] Problems with developing custom c++ >>> qgis application with QtCreator and MSVC2008 on Windows >>> >>> 1. So in the .proj file, what do i need to change? >>> >>> 2. My Python works in this case, it is the C++ part that is not working. >>> >>> >>> Nejia wrote >>>> Hi, >>>> >>>> 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using >>>> release mode so if you want to debug your application you can use >>>> RelWithDebInfo mode. >>>> 2- see: >>>> http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-lay >>>> e >>>> r >>>> - >>>> using- >>>> pyqgis >>>> http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-im >>>> a >>>> g >>>> e >>>> ry-dat >>>> aset-to-qgis/ >>>> >>>> Cheers >>>> Nejia >>> >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-cu
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
QgisInterface is an abstract class. How are you initializing it? Or do you just declare it and add a raster layer directly? Because from that link, I see the addRasterLayer method is a pure virtual function and QgisInterface is abstract class. I want to add this layer into a QgsMapCanvas, how should I do that? Also, is it possible for you to test my code before to see if it works on your system? QgsRasterLayer * rlayer = new QgsRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true","raster";); qDebug() << rlayer->isValid(); Nejia wrote > QgisInterface *m_ptInterface; > See > http://qgis.org/api/2.6/classQgisInterface.html#a808a34b507a8c4204d607a5857d62748 > > Regards, > Nejia > > -Message d'origine- > De : > qgis-developer-bounces@.osgeo > [mailto: > qgis-developer-bounces@.osgeo > ] De la part de eliu1234 > Envoyé : vendredi 21 novembre 2014 21:36 > À : > qgis-developer@.osgeo > Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis > application with QtCreator and MSVC2008 on Windows > > What is the m_ptInterface in your code? > > > Nejia wrote >> I use the same environment of Qgis to write c++ plugins: >> http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/ >> doc/INSTALL.html#toc14 >> >> to add raster layer: >> m_ptInterface->addRasterLayer("http://server.arcgisonline.com/ArcGIS/r >> est/services/World_Imagery/MapServer?f=json&pretty=true","raster"); >> >> Regards, >> Nejia >> >> -Message d'origine- >> De : > >> qgis-developer-bounces@.osgeo > >> [mailto: > >> qgis-developer-bounces@.osgeo > >> ] De la part de eliu1234 >> Envoyé : jeudi 20 novembre 2014 21:40 >> À : > >> qgis-developer@.osgeo > >> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >> application with QtCreator and MSVC2008 on Windows >> >> Do you have a system setup that can write qgis c++ application? If you >> do, can you create a valid raster layer from that? >> >> >> Nejia wrote >>> 1- see my response here >>> http://stackoverflow.com/questions/26920574/cannot-find-qgsapplicatio >>> n >>> -h-and >>> -other-header-files/27035138#27035138 >>> >>> -Message d'origine- >>> De : >> >>> qgis-developer-bounces@.osgeo >> >>> [mailto: >> >>> qgis-developer-bounces@.osgeo >> >>> ] De la part de eliu1234 >>> Envoyé : mercredi 19 novembre 2014 17:39 À : >> >>> qgis-developer@.osgeo >> >>> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >>> application with QtCreator and MSVC2008 on Windows >>> >>> 1. So in the .proj file, what do i need to change? >>> >>> 2. My Python works in this case, it is the C++ part that is not working. >>> >>> >>> Nejia wrote >>>> Hi, >>>> >>>> 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using >>>> release mode so if you want to debug your application you can use >>>> RelWithDebInfo mode. >>>> 2- see: >>>> http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-laye >>>> r >>>> - >>>> using- >>>> pyqgis >>>> http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-ima >>>> g >>>> e >>>> ry-dat >>>> aset-to-qgis/ >>>> >>>> Cheers >>>> Nejia >>> >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c >>> - >>> qgis-a >>> pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.h >>> t ml Sent from the Quantum GIS - Developer mailing list archive at >>> Nabble.com. >>> ___ >>> Qgis-developer mailing list >> >>> Qgis-developer@.osgeo >> >>> http://lists.osgeo.org/mailman/listinfo/qgis-developer >>> >>> ___ >>> Qgis-developer mailing list >> >>> Qgis-developer@.osgeo >> >>> http://lists.osgeo.org/mailman/listinfo/qgis-developer >> >> >> >> >> >> --
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
QgisInterface is an abstract class. How are you initializing it? Or do you just declare it and add a raster layer directly? Because from that link, I see the addRasterLayer method is a pure virtual function. Nejia wrote > QgisInterface *m_ptInterface; > See > http://qgis.org/api/2.6/classQgisInterface.html#a808a34b507a8c4204d607a5857d62748 > > Regards, > Nejia > > -Message d'origine- > De : > qgis-developer-bounces@.osgeo > [mailto: > qgis-developer-bounces@.osgeo > ] De la part de eliu1234 > Envoyé : vendredi 21 novembre 2014 21:36 > À : > qgis-developer@.osgeo > Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis > application with QtCreator and MSVC2008 on Windows > > What is the m_ptInterface in your code? > > > Nejia wrote >> I use the same environment of Qgis to write c++ plugins: >> http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/ >> doc/INSTALL.html#toc14 >> >> to add raster layer: >> m_ptInterface->addRasterLayer("http://server.arcgisonline.com/ArcGIS/r >> est/services/World_Imagery/MapServer?f=json&pretty=true","raster"); >> >> Regards, >> Nejia >> >> -Message d'origine- >> De : > >> qgis-developer-bounces@.osgeo > >> [mailto: > >> qgis-developer-bounces@.osgeo > >> ] De la part de eliu1234 >> Envoyé : jeudi 20 novembre 2014 21:40 >> À : > >> qgis-developer@.osgeo > >> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >> application with QtCreator and MSVC2008 on Windows >> >> Do you have a system setup that can write qgis c++ application? If you >> do, can you create a valid raster layer from that? >> >> >> Nejia wrote >>> 1- see my response here >>> http://stackoverflow.com/questions/26920574/cannot-find-qgsapplicatio >>> n >>> -h-and >>> -other-header-files/27035138#27035138 >>> >>> -----Message d'origine- >>> De : >> >>> qgis-developer-bounces@.osgeo >> >>> [mailto: >> >>> qgis-developer-bounces@.osgeo >> >>> ] De la part de eliu1234 >>> Envoyé : mercredi 19 novembre 2014 17:39 À : >> >>> qgis-developer@.osgeo >> >>> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >>> application with QtCreator and MSVC2008 on Windows >>> >>> 1. So in the .proj file, what do i need to change? >>> >>> 2. My Python works in this case, it is the C++ part that is not working. >>> >>> >>> Nejia wrote >>>> Hi, >>>> >>>> 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using >>>> release mode so if you want to debug your application you can use >>>> RelWithDebInfo mode. >>>> 2- see: >>>> http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-laye >>>> r >>>> - >>>> using- >>>> pyqgis >>>> http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-ima >>>> g >>>> e >>>> ry-dat >>>> aset-to-qgis/ >>>> >>>> Cheers >>>> Nejia >>> >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c >>> - >>> qgis-a >>> pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.h >>> t ml Sent from the Quantum GIS - Developer mailing list archive at >>> Nabble.com. >>> ___ >>> Qgis-developer mailing list >> >>> Qgis-developer@.osgeo >> >>> http://lists.osgeo.org/mailman/listinfo/qgis-developer >>> >>> ___ >>> Qgis-developer mailing list >> >>> Qgis-developer@.osgeo >> >>> http://lists.osgeo.org/mailman/listinfo/qgis-developer >> >> >> >> >> >> -- >> View this message in context: >> http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c- >> qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5174 >> 130.html Sent from the Quantum GIS - Developer mailing list archive at >> Nabble.com. >> ___ >> Qgis-developer mailing list > >> Qgis-developer
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
QgisInterface *m_ptInterface; See http://qgis.org/api/2.6/classQgisInterface.html#a808a34b507a8c4204d607a5857d62748 Regards, Nejia -Message d'origine- De : qgis-developer-boun...@lists.osgeo.org [mailto:qgis-developer-boun...@lists.osgeo.org] De la part de eliu1234 Envoyé : vendredi 21 novembre 2014 21:36 À : qgis-developer@lists.osgeo.org Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows What is the m_ptInterface in your code? Nejia wrote > I use the same environment of Qgis to write c++ plugins: > http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/ > doc/INSTALL.html#toc14 > > to add raster layer: > m_ptInterface->addRasterLayer("http://server.arcgisonline.com/ArcGIS/r > est/services/World_Imagery/MapServer?f=json&pretty=true","raster"); > > Regards, > Nejia > > -Message d'origine- > De : > qgis-developer-bounces@.osgeo > [mailto: > qgis-developer-bounces@.osgeo > ] De la part de eliu1234 > Envoyé : jeudi 20 novembre 2014 21:40 > À : > qgis-developer@.osgeo > Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis > application with QtCreator and MSVC2008 on Windows > > Do you have a system setup that can write qgis c++ application? If you > do, can you create a valid raster layer from that? > > > Nejia wrote >> 1- see my response here >> http://stackoverflow.com/questions/26920574/cannot-find-qgsapplicatio >> n >> -h-and >> -other-header-files/27035138#27035138 >> >> -Message d'origine- >> De : > >> qgis-developer-bounces@.osgeo > >> [mailto: > >> qgis-developer-bounces@.osgeo > >> ] De la part de eliu1234 >> Envoyé : mercredi 19 novembre 2014 17:39 À : > >> qgis-developer@.osgeo > >> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >> application with QtCreator and MSVC2008 on Windows >> >> 1. So in the .proj file, what do i need to change? >> >> 2. My Python works in this case, it is the C++ part that is not working. >> >> >> Nejia wrote >>> Hi, >>> >>> 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using >>> release mode so if you want to debug your application you can use >>> RelWithDebInfo mode. >>> 2- see: >>> http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-laye >>> r >>> - >>> using- >>> pyqgis >>> http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-ima >>> g >>> e >>> ry-dat >>> aset-to-qgis/ >>> >>> Cheers >>> Nejia >> >> >> >> >> >> -- >> View this message in context: >> http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c >> - >> qgis-a >> pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.h >> t ml Sent from the Quantum GIS - Developer mailing list archive at >> Nabble.com. >> ___ >> Qgis-developer mailing list > >> Qgis-developer@.osgeo > >> http://lists.osgeo.org/mailman/listinfo/qgis-developer >> >> ___ >> Qgis-developer mailing list > >> Qgis-developer@.osgeo > >> http://lists.osgeo.org/mailman/listinfo/qgis-developer > > > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c- > qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5174 > 130.html Sent from the Quantum GIS - Developer mailing list archive at > Nabble.com. > ___ > Qgis-developer mailing list > Qgis-developer@.osgeo > http://lists.osgeo.org/mailman/listinfo/qgis-developer > > ___ > Qgis-developer mailing list > Qgis-developer@.osgeo > http://lists.osgeo.org/mailman/listinfo/qgis-developer -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c-qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5174285.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
What is the m_ptInterface in your code? Nejia wrote > I use the same environment of Qgis to write c++ plugins: > http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/doc/INSTALL.html#toc14 > > to add raster layer: > m_ptInterface->addRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true","raster";); > > Regards, > Nejia > > -Message d'origine- > De : > qgis-developer-bounces@.osgeo > [mailto: > qgis-developer-bounces@.osgeo > ] De la part de eliu1234 > Envoyé : jeudi 20 novembre 2014 21:40 > À : > qgis-developer@.osgeo > Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis > application with QtCreator and MSVC2008 on Windows > > Do you have a system setup that can write qgis c++ application? If you do, > can you create a valid raster layer from that? > > > Nejia wrote >> 1- see my response here >> http://stackoverflow.com/questions/26920574/cannot-find-qgsapplication >> -h-and >> -other-header-files/27035138#27035138 >> >> -Message d'origine- >> De : > >> qgis-developer-bounces@.osgeo > >> [mailto: > >> qgis-developer-bounces@.osgeo > >> ] De la part de eliu1234 >> Envoyé : mercredi 19 novembre 2014 17:39 À : > >> qgis-developer@.osgeo > >> Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis >> application with QtCreator and MSVC2008 on Windows >> >> 1. So in the .proj file, what do i need to change? >> >> 2. My Python works in this case, it is the C++ part that is not working. >> >> >> Nejia wrote >>> Hi, >>> >>> 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using >>> release mode so if you want to debug your application you can use >>> RelWithDebInfo mode. >>> 2- see: >>> http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-layer >>> - >>> using- >>> pyqgis >>> http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-imag >>> e >>> ry-dat >>> aset-to-qgis/ >>> >>> Cheers >>> Nejia >> >> >> >> >> >> -- >> View this message in context: >> http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c- >> qgis-a >> pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.ht >> ml Sent from the Quantum GIS - Developer mailing list archive at >> Nabble.com. >> ___ >> Qgis-developer mailing list > >> Qgis-developer@.osgeo > >> http://lists.osgeo.org/mailman/listinfo/qgis-developer >> >> ___ >> Qgis-developer mailing list > >> Qgis-developer@.osgeo > >> http://lists.osgeo.org/mailman/listinfo/qgis-developer > > > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c-qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5174130.html > Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. > ___ > Qgis-developer mailing list > Qgis-developer@.osgeo > http://lists.osgeo.org/mailman/listinfo/qgis-developer > > ___ > Qgis-developer mailing list > Qgis-developer@.osgeo > http://lists.osgeo.org/mailman/listinfo/qgis-developer -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c-qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5174285.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
I use the same environment of Qgis to write c++ plugins: http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/doc/INSTALL.html#toc14 to add raster layer: m_ptInterface->addRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true","raster";); Regards, Nejia -Message d'origine- De : qgis-developer-boun...@lists.osgeo.org [mailto:qgis-developer-boun...@lists.osgeo.org] De la part de eliu1234 Envoyé : jeudi 20 novembre 2014 21:40 À : qgis-developer@lists.osgeo.org Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows Do you have a system setup that can write qgis c++ application? If you do, can you create a valid raster layer from that? Nejia wrote > 1- see my response here > http://stackoverflow.com/questions/26920574/cannot-find-qgsapplication > -h-and > -other-header-files/27035138#27035138 > > -Message d'origine- > De : > qgis-developer-bounces@.osgeo > [mailto: > qgis-developer-bounces@.osgeo > ] De la part de eliu1234 > Envoyé : mercredi 19 novembre 2014 17:39 À : > qgis-developer@.osgeo > Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis > application with QtCreator and MSVC2008 on Windows > > 1. So in the .proj file, what do i need to change? > > 2. My Python works in this case, it is the C++ part that is not working. > > > Nejia wrote >> Hi, >> >> 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using >> release mode so if you want to debug your application you can use >> RelWithDebInfo mode. >> 2- see: >> http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-layer >> - >> using- >> pyqgis >> http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-imag >> e >> ry-dat >> aset-to-qgis/ >> >> Cheers >> Nejia > > > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c- > qgis-a > pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.ht > ml Sent from the Quantum GIS - Developer mailing list archive at > Nabble.com. > ___ > Qgis-developer mailing list > Qgis-developer@.osgeo > http://lists.osgeo.org/mailman/listinfo/qgis-developer > > ___ > Qgis-developer mailing list > Qgis-developer@.osgeo > http://lists.osgeo.org/mailman/listinfo/qgis-developer -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c-qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5174130.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
Do you have a system setup that can write qgis c++ application? If you do, can you create a valid raster layer from that? Nejia wrote > 1- see my response here > http://stackoverflow.com/questions/26920574/cannot-find-qgsapplication-h-and > -other-header-files/27035138#27035138 > > -Message d'origine- > De : > qgis-developer-bounces@.osgeo > [mailto: > qgis-developer-bounces@.osgeo > ] De la part de eliu1234 > Envoyé : mercredi 19 novembre 2014 17:39 > À : > qgis-developer@.osgeo > Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis > application with QtCreator and MSVC2008 on Windows > > 1. So in the .proj file, what do i need to change? > > 2. My Python works in this case, it is the C++ part that is not working. > > > Nejia wrote >> Hi, >> >> 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using >> release mode so if you want to debug your application you can use >> RelWithDebInfo mode. >> 2- see: >> http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-layer- >> using- >> pyqgis >> http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-image >> ry-dat >> aset-to-qgis/ >> >> Cheers >> Nejia > > > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c-qgis-a > pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.html > Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. > ___ > Qgis-developer mailing list > Qgis-developer@.osgeo > http://lists.osgeo.org/mailman/listinfo/qgis-developer > > ___ > Qgis-developer mailing list > Qgis-developer@.osgeo > http://lists.osgeo.org/mailman/listinfo/qgis-developer -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c-qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5174130.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
1- see my response here http://stackoverflow.com/questions/26920574/cannot-find-qgsapplication-h-and -other-header-files/27035138#27035138 -Message d'origine- De : qgis-developer-boun...@lists.osgeo.org [mailto:qgis-developer-boun...@lists.osgeo.org] De la part de eliu1234 Envoyé : mercredi 19 novembre 2014 17:39 À : qgis-developer@lists.osgeo.org Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows 1. So in the .proj file, what do i need to change? 2. My Python works in this case, it is the C++ part that is not working. Nejia wrote > Hi, > > 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using > release mode so if you want to debug your application you can use > RelWithDebInfo mode. > 2- see: > http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-layer- > using- > pyqgis > http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-image > ry-dat > aset-to-qgis/ > > Cheers > Nejia -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c-qgis-a pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
1. So in the .proj file, what do i need to change? 2. My Python works in this case, it is the C++ part that is not working. Nejia wrote > Hi, > > 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using release > mode so if you want to debug your application you can use RelWithDebInfo > mode. > 2- see: > http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-layer-using- > pyqgis > http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-imagery-dat > aset-to-qgis/ > > Cheers > Nejia -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c-qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows
Hi, 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using release mode so if you want to debug your application you can use RelWithDebInfo mode. 2- see: http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-layer-using- pyqgis http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-imagery-dat aset-to-qgis/ Cheers Nejia -Message d'origine- De : qgis-developer-boun...@lists.osgeo.org [mailto:qgis-developer-boun...@lists.osgeo.org] De la part de eliu1234 Envoyé : mercredi 19 novembre 2014 07:42 À : qgis-developer@lists.osgeo.org Objet : [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows I am using qtcreator and msvc2008 for developing the c++ custom application. I followed the following tutorial to setup the system: http://3nids.wordpress.com/2014/02/27/build-and-deploy-c-qgis-app-on-windows / Problem 1: under debug mode, I cannot create a QgsMapCanvas object. It always exit with code 1. Problem 2: under release mode, I tried to create a raster layer with the following command: QgsRasterLayer * layer = new QgsRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Im agery/MapServer?f=json&pretty=true","raster"); It always result in a layer which is invalid. I tried the python equivalent command: layer = QgsRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Im agery/MapServer?f=json&pretty=true","raster"); in qgis python console and it works fine. Any help is appreciated. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c-qgis-a pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer