[Qgis-developer] OSGEO4W vs. Mac OS X Qt version (or ~34 plugins
slightly broken)
Larry Shaffer
larrys at dakotacarto.com
Thu May 10 16:40:31 PDT 2012
Hi William,
On Thu, May 10, 2012 at 11:28 AM, William Kyngesburye <woklist at kyngchaos.com
> wrote:
> On May 10, 2012, at 11:43 AM, Larry Shaffer wrote:
>
> > Hi William,
> >
> > On Thu, May 10, 2012 at 8:26 AM, William Kyngesburye <
> woklist at kyngchaos.com> wrote:
> > On May 9, 2012, at 12:08 PM, Larry Shaffer wrote:
> >
> > > During a recent audit of almost every PyQGIS plugin (casually studying
> repetitive design patterns) and helping some users on gis.stackexhange.com[0] I have come across an issue that may affect over 30 plugins (for now,
> only on Mac).
> > >
> > > From what I can gather, William Kyngesburye's Mac builds (and
> Unix/Linux, too?) consistently use a current, stable version of Qt, now at
> 4.8, while the OSGEO4W package is at 4.4 [1]. This hasn't been an issue
> since, I believe (and assume), the bundled Qt in Mac builds included Qt3
> support. The most recent 1.7.4 Mac version appears to have a bundled Qt
> with no Qt3 support (is this correct?).
> > >
> > I haven't included Qt3Support since QGIS 1.2, when the last of the Qt3
> usage was removed (I think GRASS plugin was the last holdout).
> >
> > I'm referring to Qt4 being compiled with the legacy '-qt3support' option
> (supposedly on by default [0]), not direct Qt3 support (frameworks, etc).
> Recently, when there was an issue with QWebKit on 10.6, you posted a
> configure line for compiling Qt4 to fix the problem [1]. I noted that you
> chose the '-no-qt3support' option. Is that the same Qt you used for
> bundling the recent QGIS 1.7.4-x? Had you nixed -qt3support in past builds,
> or used Nokia's pre-compiled Qt4 builds with '-qt3support'?
> >
> > [0] http://qt-project.org/doc/qt-4.8/configure-options.html
> > [1]
> http://osgeo-org.1560.n6.nabble.com/OS-X-QtWebKit-problem-fixed-PyQwt-still-broken-td4513113.html#a4519323
> >
> "Qt3Support" is the library/framework you get with the qt3support compile
> option. I don't think there is anything extra in the other
> frameworks/libraries when you compile with this option.
>
Thank you for the clarification on the Qt3Support framework.
OK, I think I've figured it out. When compiling Qt, and setting the
-qt3support option, the variable QT3_SUPPORT is set [0]. While this is
expected to produce the Qt3Support framework, it also affects the build of
Qt4 frameworks in ~580 places (results of search for '#ifdef QT3_SUPPORT'
in src directory [1]). This includes QAction, which is reverted to emitting
the activated() signal again [2][3].
The upshot of this is PyQt4, when compiled against a Qt4 build with the
-qt3support option, will have that support, regardless (I think) of whether
the Qt3Support framework is included in the Mac app bundle or not.
So, I'm guessing that when you compiled Qt to fix the QWebKit issue (with
no -qt3support option) you truly nixed the Qt3 support, as expected. BTW, I
think this is good: it will ferret-out the current plugins still relying
upon legacy Qt3 code (unfortunately only on Mac, causing some confusion for
users).
[0] http://qt.gitorious.org/qt/qt/blobs/4.8/src/qbase.pri#line163
[1] http://dl.dropbox.com/u/4058089/qgis/ifdef_QT3_SUPPORT.txt
[2] http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/kernel/qaction.h#line232
[3]
http://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/kernel/qaction.cpp#line1260
> > This has caused many PyQGIS plugins to fail to launch on Mac, due to
> their use of a Qt3-only QAction signal of activated() in a plugin's
> initGui() method. Basically, the plugin does not launch (i.e. does
> nothing), with no error. However, for Windows users, the plugin launches
> fine, causing problems when trying to offer cross-platform support for
> plugin issues.
> > >
> > > Can someone else verify these findings?
> > >
> > > I am slightly surprised Qt3 is still supported, and think dropping its
> support sounds like a good idea, especially for QGIS version 1.8 or >, but
> certainly don't know all the details on versioning for QGIS distributions.
> I understand this may cause problems with the OSGEO4W package. (btw: Why is
> it still on Qt 4.4?)
> > >
> > I would assume that Qt3 usage in external plugins would require support
> in PyQt, but PyQt has never compiled a PyQt3 module for me, and I'm not
> sure if it can, or how.
> >
> > Can you think of anything else that might have caused this issue, via
> differences between your 1.7.3 and 1.7.4 builds? It may be even between the
> latest 1.7.4-x builds. I can try to re-install each of the versions to find
> when the issue occurs.
> >
> There is something going on with the Qt 4.8.1 that I upgraded to in QGIS
> 1.7.4 (1.7.3 used Qt 4.8.0, which had the QtWebKit problem) - there are
> mysterious crashes is various places. There may be other problems in the
> latest Qt that don't cause a crash, but break plugins.
>
> >
> > > Here are the plugins I have found that use the deprecated activated()
> signal, including two core C++ [2]
> >
> > This is odd because those plugins then should not even compile if Qt3 is
> missing. And spatialquery works for me without Qt3Support. (GRASS works,
> but has its own problems)
> >
> > The 'Hello World' plugin is the simplest for testing/exhibiting the
> issue [2]. Odd that I get no launch of Spatial Query plugin, on all my
> 1.7.4-4 installs, but you're having success with it.
> >
> > [2] http://plugins.qgis.org/plugins/HelloWorld/
> >
> I tried on OSX 10.7, I'll try it this evening on OSX 10.6 when I get home.
>
I tried with 1.7.4-4 on 10.7 and 10.6.8 with same results: no launching of
plugins. It works with my nightly builds of QGIS (1.8 RC1), which are
bundled with '-D QGIS_MACAPP_BUNDLE=2', i.e. app does not contain the
Qt3Support framework, but PyQt4 still supports the Qt3 deprecated features
(as noted above), allowing all of the affected plugins to launch [4].
[4] http://dl.dropbox.com/u/4058089/qgis/qt3support_with-no-framework.png
>
> > > and a ZIP archive of the particular files that I found to contain that
> signal [3]. Without a complete examination of each plugin, I am not
> entirely certain all of the signals are of QAction. I tried to include only
> those that appear to be. (Note: there may be more uses of Qt3 deprecated
> methods, etc.)
> > >
> > > Please correct me if I am off on my assessment of this situation, or
> if I am late to the discussion.
> > >
> > > [0] http://gis.stackexchange.com/a/22953/6725 ,
> http://gis.stackexchange.com/a/24860/6725
> > > [1] http://trac.osgeo.org/osgeo4w/wiki/pkg-qt4-libs
> > > [2]
> http://dl.dropbox.com/u/4058089/qgis/plugins_contain-qt3activated.txt
> > > [3]
> http://dl.dropbox.com/u/4058089/qgis/plugins_contain-qt3activated.zip
> > >
> > > Regards,
> > >
> > > Larry Shaffer
> > > Dakota Cartography
> > > Black Hills, South Dakota
> > > _______________________________________________
> > > Qgis-developer mailing list
> > > Qgis-developer at lists.osgeo.org
> > > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
> > -----
> > William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> > http://www.kyngchaos.com/
> >
> > "History is an illusion caused by the passage of time, and time is an
> illusion caused by the passage of history."
> >
> > - Hitchhiker's Guide to the Galaxy
> >
> >
> >
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
>
> Theory of the Universe
>
> There is a theory which states that if ever anyone discovers exactly what
> the universe is for and why it is here, it will instantly disappear and be
> replaced by something even more bizarrely inexplicable. There is another
> theory which states that this has already happened.
>
> -Hitchhiker's Guide to the Galaxy 2nd season intro
>
>
>
Regards,
Larry Shaffer
Dakota Cartography
Black Hills, South Dakota
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120510/fe6a2255/attachment-0001.html
More information about the Qgis-developer
mailing list