Re: [QGIS-Developer] How to get the name for a QgsLayoutDesignerInterface object?
Hi Raymond, For the window title, you can try designer.window().windowTitle(). To get the QgsPrintLayout object, you can try designer.masterLayout() which has the .name() method. Cheers, John On Fri, 29 Jul 2022 at 12:04, Raymond Nijssen via QGIS-Developer < qgis-developer@lists.osgeo.org> wrote: > Hi developers, > > I'm trying to get the name for a layout designer window, which is in a > python variable (designer) of type QgsLayoutDesignerInterface. > > designer.layout() returns a QgsLayout object but that class does not > have a .name() function. > > The QgsPrintLayout class does have a .name() function but I don't know > how to get a QgsPrintLayout object from my designer. > > Anyone? > > Kind regards, > Raymond > > > > ___ > QGIS-Developer mailing list > QGIS-Developer@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer > -- John Gitau ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [QGIS-Developer] Question on QGIS Authentication API
Hi Calvin, You can retrieve the name from the base config object as follows: auth_mgr = QgsApplication.authManager() conf_map = auth_mgr.availableAuthMethodConfigs() for id, conf in conf_map.iteritems(): conf_name = conf.name() print conf_name I hope this helps. Cheers, John On Fri, Jan 31, 2020 at 11:11 PM C Hamilton wrote: > I can get a list of all of the authentication IDs in QGIS by these two > lines of code. > > authMgr = QgsApplication.authManager() > authIdList = authMgr.configIds() > > Starting from one of the authentication ids in the list I cannot seem to > find out how to retrieve its associated name. It is probably simple, but I > cannot find the right method to call. Does anyone know how to do it? > > Thanks, > > Calvin > ___ > QGIS-Developer mailing list > QGIS-Developer@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] itemChanged signal use on a QgsComposerItem
Hi, Have you tried the 'sizeChanged' signal? Also, have a look at the QgsComposerItemWidget class, specifically this function: https://github.com/qgis/QGIS/blob/master/src/app/composer/qgscomposeritemwidget.cpp#L378. It might contain some pointers for your use case. All the best. Regards, John On Wed, Jan 13, 2016 at 4:26 AM, a arias wrote: > > > Hi. I'm working on a plugin for the Composer, but it seems that few people > are interested in this aspect of QGIS, so I rarely get answers to my > difficulties on stackexchange ( > http://gis.stackexchange.com/questions/174648/how-to-use-itemchanged-signal-to-update-data > ). > > I need to to call a function when I move one of the QgsComposerItems on > the composer. For example a QgsComposerLabel that is already placed on the > composer and whose variable name is *label1*, this code > > def setCoordText(): > > label1.setText(str(label1.x()) + "," + str(label1.y())) > > label1.itemChanged.connect(setCoordText) > > > should show the x and y numbers of the label's new location. However this > only works if the label is moved AND then is put back with an UNDO command. > It is as if the signal is triggered by the Undo command, but not the move > itself. Can anybody help me with this? Thank you > > ___ > Qgis-developer mailing list > Qgis-developer@lists.osgeo.org > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer > ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Building plugin for Print Composer
Hi Jakob, A workaround would be to have a plugin that creates a new composer view object: *custom_composer = self.iface.createNewComposer("My Composer")* Then get a reference to the main window in the composer view: *main_window = custom_composer.composerWindow()* Then you can either add a new toolbar (and required actions) or append an action to the main toolbar. Have a look at the ComposerWrapper class for something similar we implemented for designing charts in the composer: https://gist.github.com/gkahiu/06a43a589f9441736397 Hope this is helpful. Cheers, John On Mon, Jun 22, 2015 at 2:07 PM, G. Allegri wrote: > You can act on it but you can't custom gui widgets to the Composer > interface. > I cannot check the code right know. I listen to a specific (existing) > composition opening but if I remember correctly you can watch the Composer > opening too. > Il 22/giu/2015 17:19, "Jakob Lanstorp" ha scritto: > >> Hi Giovanni, thanks for the update. Another solution would be to catch the >> event when a user starts an existing print composer. Cannot in doc for the >> pyqgis API find anything for this. Anyone who know is one can listens for >> a >> print composer to startup by the user and act on it. >> >> >> >> - >> Jakob Lanstorp >> -- >> View this message in context: >> http://osgeo-org.1560.x6.nabble.com/Building-plugin-for-Print-Composer-tp5212187p5212221.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 > ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Building QGIS with VS/Win7 PATH to Bison
Hi, A workaround can be to explicitly set the path for Bison in Visual Studio 2008 under *Tools > Options > Projects and Solutions > VC++ Directories >* *Executable files*. See this link for more info: http://msdn.microsoft.com/en-us/library/t9az1d21(v=vs.90).aspx Regards, John On Thu, Jul 17, 2014 at 11:54 AM, wrote: > > Hello, > > Sorry for boring you, > but my problem still isn't solved. > > I have a batch-script like in the INSTALL-Guide named setupvcproject. > Before calling it the path is knowing my bison-directory (C:\GnuWin32\bin), > afterwards it is gone away and i get the following compiling error > > Generating qgsexpressionparser.cpp > > C:\GnuWin32\bin\bison.exe: m4: No such file or directory > > Here is the output of my dosbox: > > > C:\Temp>echo %PATH% > C:\Program Files (x86)\NVIDIA > Corporation\PhysX\Common;C:\Windows\system32;C:\Wi > > ndows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Pr > ogram Files\Intel\DMIX;C:\Program Files (x86)\Microsoft SQL > Server\90\Tools\binn > \;C:\Program Files\Microsoft Platform SDK\Bin\.;C:\Program Files\Microsoft > Platf > orm SDK\Bin\WinNT\.;c:\Qt\4.8.2;%PROGRAMFILES%\Internet > Explorer;C:\Oracle\insta > ntclient_12_1;C:\PROGRA~2\CMAKE2~1.8\bin;C:\GnuWin32\bin;C:\Program Files > (x86)\ > NVIDIA > Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System > 32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program > Files\Intel\DMIX; > C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program > Files\Micr > osoft Platform SDK\Bin\.;C:\Program Files\Microsoft Platform > SDK\Bin\WinNT\.;c:\ > Qt\4.8.2;C:\Program Files\Internet > Explorer;C:\Oracle\instantclient_12_1;C:\PROG > RA~2\CMAKE2~1.8\bin;C:\GnuWin32\bin; > > C:\Temp>setupvcproject > > C:\Temp>Path > C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\PROGRA~2 > \CMAKE2~1.8\bin;C:\GnuWin32\bin;" > > C:\Temp>set PYTHONPATH= > > C:\Temp>set VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio > 9.0\Common7\T > ools\ > > C:\Temp>call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ > vcvarsall.ba > t" x86 > Setting environment for using Microsoft Visual Studio 2008 x86 tools. > Microsoft Windows [Version 6.1.7601] > Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten. > > C:\Temp>echo %PATH% > > C:\OSGeo4W\apps\Python27\Scripts;C:\OSGeo4W\bin;C:\Windows\system32;C:\Windows;C > :\Windows\WBem;C:\OSGeo4W\apps\msys\bin > > > and here is my setupvcproject.bat: > > Path > %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\System32\Wbem;C:\PROGRA~2\CMAKE2~1.8\bin;C:\GnuWin32\bin;" > set PYTHONPATH= > > set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio > 9.0\Common7\Tools\ > call "C:\Program Files (x86)\Microsoft Visual Studio > 9.0\VC\vcvarsall.bat" x86 > > set INCLUDE=%INCLUDE%;%PROGRAMFILES%\Microsoft Platform SDK\include > set LIB=%LIB%;%PROGRAMFILES%\Microsoft Platform SDK\lib > > set OSGEO4W_ROOT=C:\OSGeo4W > call "%OSGEO4W_ROOT%\bin\o4w_env.bat" > > @set GRASS_PREFIX=c:/OSGeo4W/apps/grass/grass-6.4.0 > @set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include > @set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib > > call "C:\Program Files (x86)\Microsoft Visual Studio > 9.0\Common7\IDE\devenv.exe" > > @cmd > > ___ > 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