aaronr's blog

RefMap: WebKit in PyQt


So I have been playing with the new WebKit support in QT 4.4+ via the python bindings in PyQt. Pretty cool stuff and I think it will have quite a bit of potential within QGIS in the future.

Capturing map coordinates in a stand alone app...


For those of you striving to build some stand alone Python apps based on the QGIS Python bindings here is a quick snip for ya:

class MapCoords(object):
  def __init__(self, mainwindow):
    self.mainwindow = mainwindow
    # This one is to capture the mouse move for coordinate display
    QObject.connect(mainwindow.canvas, SIGNAL("xyCoordinates(QgsPoint&)"),
                    self.updateCoordsDisplay)
    self.latlon = QLabel("0.0 , 0.0")
    self.latlon.setFixedWidth(200)

Python plugin example... Raster file info...

So there was a question on the mailing list about the existence of a plugin to capture information about the file path for a bunch of loaded rasters... similar to the info contained in a tileindex with GDAL but interactive from within QGIS.

Accessing QT constants in PyQt...


So you get an event and you want to be able to check something like whether a button press was done with the right mouse... fear not, you can access all the same constants that you are accustom to in C++ QT:

void MyClass::mousePressEvent(QMouseEvent * e)
{
  if (e->button() == Qt::RightButton)
  {
    printf("Something...")
  }
}

In Python you can do the same:

def mousePressEvent(self, event):
  if event.button() == Qt.RightButton:
    print "Something..."

Passing python vars in PyQt using SIGNAL/SLOT...


So in QT programming signals and slots are at the heart of a well formed application. In Python (using PyQt) it is not exactly obvious how to start developing your own signals and slots. Hopefully this will help...

First, when signals have no arguments things are pretty simple. Take this example:

QObject.connect(self.timer, SIGNAL("timeout()"), self.processStatus)

QGIS svn head running on an EeePc


Well, I finally got around to getting a Ubuntu 7.10 install going on my new EeePc (http://eeepc.asus.com/). 7 inches of GIS goodness after installing some base GIS software and then building the svn head of QGIS. I have a quick post on my blog:

Blog Post Link

As well as a quick video screen cast of using it. Lots of opportunity for a very small, very portable, very inexpensive field data collection tool, or ultra mobile GIS workstation.

QGIS at FOSS4G


I have a quick recap with links to some pictures, presentations, and audio files from a great week at FOSS4G. QGIS had a great showing there with lots of buzz about the new 0.9 release and the Python bindings in particular. Check it out at:

Link to reprojected.com post

Aaron

Video tutorials

I have posted some video tutorials that QGIS users might find interesting. Basically I have started documenting building a new server from scratch installing everything needed to get 0.9 QGIS up and running with the Python bindings as well as running the Martin/Tim tutorials. You can check them out at:

http://www.reprojected.com/geoblog/how-tos/video/

Syndicate content