[GIS] How do Qt Designer and QGIS work together

qgisqt-designerqt4

I am just trying understand how qgis and designer work together. From Nathan W's excellent posts I know how to create a user form and how to hook it to a qgis layer and also how to add validation code. My questions here are pretty naive but the stuff that everyone knows is precisely the stuff that one can't find in print:

  1. Is the copy of Qt Designer that comes with QGIS integrated wtih the QGIS GUI in anyway (like the forms designer within ms-access is the the rest of ms-access)?

  2. Can I start Qt Designer from within QGIS or do I have to have to fish around in the QGIS installation with Windows Explorer and find the Qt Designer exe to double click on?

  3. Am I better off installing a separate version of Qt Designer/Qt Creator or pyQt than using the integrated Qt Designer?
  4. Does the pre-packaged windows installer for new users come with Qt Designer configured in a way that can be used for form design?
  5. If I am looking for a way to create forms with python validation code, is PyQt a good solution?
  6. Many data collection tasks are non-spatial, for example adding in a price list for road signs. The GIS can record which signs need replacing but the price list is needed to provide a cost estimate. Is there anyway of triggering the display of forms for non-spatial data tables?

Best Answer

Is the copy of Qt Designer that comes with QGIS integrated wtih the QGIS GUI in anyway (like the forms designer within ms-access is the the rest of ms-access)?

No it's not. The Qt Designer can be embedded into other applications however I haven't looked into doing this for QGIS yet.

Can I start Qt Designer from within QGIS or do I have to have to fish around in the QGIS installation with Windows Explorer and find the Qt Designer exe to double click on?

designer.exe is installed into bin\ folder for OSGeo4w install however it doesn't seem the weekly builds include this yet. Shouldn't be too hard to add into the nightly, weekly packages. NOTE: If you want to download it yourself to install into your QGIS install. Download the following file http://download.osgeo.org/osgeo4w/release/qt/qt4-devel/qt4-devel-4.7.1-1.tar.bz2 and copy the apps, bin, include, lib folders inside into the root of your QGIS install.

Am I better off installing a separate version of Qt Designer/Qt Creator or pyQt than using the integrated Qt Designer?

EDIT: I would stick to the packages that get installed with QGIS as they are the right versions. You don't need Qt Creator unless you are building the QGIS code base.

Does the pre-packaged windows installer for new users come with Qt Designer configured in a way that can be used for form design?

It's not included at the moment. I'll look at getting it added. There is nothing to configure once it's installed.

If I am looking for a way to create forms with python validation code, is PyQt a good solution?

Yes

Many data collection tasks are non-spatial, for example adding in a price list for road signs. The GIS can record which signs need replacing but the price list is needed to provide a cost estimate. Is there anyway of triggering the display of forms for non-spatial data tables?

Yes there are ways using the PyQGIS API and also just using normal PyQt. It depends on what you need to do.

Related Question