Qt UI does not work in Ubuntu Hardy.

Asked by wgw

I was trying to use 4.6 without installing it, as per the instructions for Linux. (I want to keep my 4.4 installed for the moment.) I got this error:

======================
  File "/home/bill/Soft/Leo-4-6-b2/leo/plugins/qtGui.py", line 2062, in createTreeWidget
    w.setHeaderHidden(False)
AttributeError: setHeaderHidden
=====================

I added the path to the unzipped files and ran launchLeo.py. These are the instructions I followed:

==========================
You now have two choices:

1. You can run Leo from your home directory.
   Just add ~/leo-4-5 to your path.

....

Another way to run Leo is as follows::

    cd <path-to-launchLeo.py>
    python launchLeo.py %1

=========================

I'm under Ubuntu (8.04), python 2.5, qt 4. Here is the full error message.

bill@bill-laptop:~/Soft/Leo-4-6-b2$ PATH=/home/bill/Soft/Leo-4-6-b2:$PATH
bill@bill-laptop:~/Soft/Leo-4-6-b2$ python launchLeo.py
reading settings in /home/bill/Soft/Leo-4-6-b2/leo/config/leoSettings.leo
Using menus from leoSettings.leo
reading /home/bill/.leo/.leoRecentFiles.txt
loaded plugin: qtGui doPlugins,loadHandlers,loadOnePlugin,init,createDefaultGui,createQtGui
Traceback (most recent call last):
  File "launchLeo.py", line 8, in <module>
    leo.core.runLeo.run()
  File "/home/bill/Soft/Leo-4-6-b2/leo/core/runLeo.py", line 95, in run
    ok = doPostPluginsInit(args,fn,relFn,script)
  File "/home/bill/Soft/Leo-4-6-b2/leo/core/runLeo.py", line 326, in doPostPluginsInit
    c,frame = createFrame(fileName,relativeFileName,script)
  File "/home/bill/Soft/Leo-4-6-b2/leo/core/runLeo.py", line 363, in createFrame
    initEditCommanders=True)
  File "/home/bill/Soft/Leo-4-6-b2/leo/core/leoApp.py", line 507, in newLeoCommanderAndFrame
    frame.finishCreate(c)
  File "/home/bill/Soft/Leo-4-6-b2/leo/plugins/qtGui.py", line 3472, in finishCreate
    f.top = DynamicWindow(c)
  File "/home/bill/Soft/Leo-4-6-b2/leo/plugins/qtGui.py", line 1679, in __init__
    self.createMainWindow()
  File "/home/bill/Soft/Leo-4-6-b2/leo/plugins/qtGui.py", line 1722, in createMainWindow
    self.createOutlinePane(self.splitter)
  File "/home/bill/Soft/Leo-4-6-b2/leo/plugins/qtGui.py", line 1883, in createOutlinePane
    treeWidget = self.createTreeWidget(innerFrame,'treeWidget')
  File "/home/bill/Soft/Leo-4-6-b2/leo/plugins/qtGui.py", line 2062, in createTreeWidget
    w.setHeaderHidden(False)
AttributeError: setHeaderHidden
bill@bill-laptop:~/Soft/Leo-4-6-b2$

Question information

Language:
English Edit question
Status:
Expired
For:
leo-editor Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
wgw (wgwinder) said :
#1

I just discovered this discussion at http://groups.google.com/group/leo-editor/browse_thread/thread/707cc66feee35705
============
I'm also using 8.04 at work and got thes same problem.

I have now pushed alternative qt_main_hardyheron.ui to trunk. Copy it over qt_main.ui if you get this error.

==================

will see if I can resolve this through the source file.

Revision history for this message
wgw (wgwinder) said :
#2

oops! I see this is an old bug under Hardy. I thought I had QT 4.4; I don't it is 4.3.

Will see if I can get the backport....

Revision history for this message
Ville M. Vainio (villemvainio) said :
#3

Converting this to "question".

Revision history for this message
Ville M. Vainio (villemvainio) said :
#4

We indeed require at least Qt 4.4 these days. If you are able to get it working with Qt 4.4 from backports (and possibly self-compiled PyQt & sip), let us know.

Revision history for this message
wgw (wgwinder) said :
#5

Yes, I will see what I can do. Not sure what the sip is, but will give it a try. Thanks!

Ps: is it possible to launch Leo 4.6 under tcl? That way I can use it until I have worked out the QT problem. (I did not see any command line startup options for plugins -- may have missed that though...).

Revision history for this message
wgw (wgwinder) said :
#6
Revision history for this message
Launchpad Janitor (janitor) said :
#7

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Ville M. Vainio (villemvainio) said :
#8

Ville M. Vainio suggests this article as an answer to your question:

Here's a guide on how to use Leo Qt ui with Ubuntu 8.04 "Hardy". It involves downloading and
installing the latest version of Qt and PyQt.

Download and install Qt 4.5 sdk from http://www.qtsoftware.com/downloads.

In this example, I installed it to /home/vivainio2/qtsdk-2009.03, as suggested by the installer
(yes, in that's in my home directory).

Ensure that the qt sdk bin directory is on your path BEFORE any other bin directory. You can do this
by putting this to the end of your ~/.bashrc (adjust path accordingly)::

    export PATH=/home/vivainio2/qtsdk-2009.03/qt/bin:$PATH

Important: note that it's qtsdk-2009.03/qt/bin, not qtsdk-2009.03/bin.

After that, launch a new terminal or do "source ~/.bashrc"

Download sip from::

    http://www.riverbankcomputing.co.uk/software/sip/download

(I downloaded sip-4.8.2.tar.gz)

tar xzf sip-4.8.2.tar.gz
cd sip-4.8.2
python configure.py
make
sudo make install

Download PyQt from::

    http://www.riverbankcomputing.co.uk/software/pyqt/download

( I downloaded PyQt-x11-gpl-4.5.4.tar.gz)

tar xzf PyQt-x11-gpl-4.5.4.tar.gz
cd PyQt-x11-gpl-4.5.4
python configure.py

Ensure that it's using the right Qt and sip versions by checking the output::

    Qt v4.5.2 free edition is being used.
    SIP 4.8.2 is being used.

make
sudo make install

Now, you should be able to launch Leo using Qt ui with no problems.

FAQ #632: “Qt UI does not work in Ubuntu Hardy.”.