Results 1 to 3 of 3

Thread: MacOS settings

  1. #1
    Join Date
    Mar 2006
    Location
    Irvine, CA
    Posts
    11
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default MacOS settings

    Due to my QtXml prebinding difficulties with Qt 4.3, I reinstalled Qt 4.2.3, recompiling from scratch. I regenerated a new Xcode project file using qmake -spec macx-xcode, and now QtXml links and works ok as before.

    It would be nice to know why my 4.2.3 links properly but 4.3 does not. But failing that, my question is this: for MacOS, does anybody know exactly where the Qt settings are? Is there a QTDIR environment variable somewhere? My local .profile sure ain't it.

    Even after reinstalling 4.2.3, Qt Assistant and the Qt Demo programs in the Developer/Applications folder still think I'm using 4.3. I need some clarity as to where, on MacOS, is everything supposed to go and who points to what and how.

    Can I have 4.2.3. and 4.3 [and 4.3.1 and 4.4 and as many snapshots as I want] installed, and simply change some environment variables somewhere to tell all these programs where the preferred version of Qt I want to use is located? It takes hours to recompile everything, and this surely this is overkill. I have read everything I can find on the subject over and over and this info just seems to be obfuscated.

    Steve Kaiser
    skaiser@uci.edu

  2. #2
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: MacOS settings

    I'm not sure if this answers your question, but I was able to switch from 4.2.3 to 4.3.0 on OSX by doing the following:

    * unzip / tar the 4.3.0 sources to a tmp directory

    Qt Code:
    1. ./configure
    2. make
    3. make install (copies files to /usr/local/Trolltech/4.3.0)
    To copy to clipboard, switch view to plain text mode 

    Since I compile from the bash shell, the next thing you need to do is change the PATH variable. I don't have my own .bashrc file, so I went in and changed the default one:

    Qt Code:
    1. sudo vi /etc/profile
    To copy to clipboard, switch view to plain text mode 

    Change your path to use /usr/local/Trolltech/4.3.0/bin instead of the previous version. Open a new shell to start using the new path. Be sure to run make clean and qmake again on any existing projects you have to be sure they are built with the new qmake / paths / libraries...

    Colby

  3. #3
    Join Date
    Mar 2006
    Location
    Irvine, CA
    Posts
    11
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: MacOS settings

    I think I have learned a few tidbits, so I share them:

    1. If I install the Qt libraries from binaries (.dmg), or install them from sources (.tar.gz), they wind up very different default locations:

    #----- Qt 4.2.3 installed from sources (qt-mac-opensource-src-4.2.3.tar.gz):
    /usr/local/Trolltech/Qt-4.2.3/lib/QtCore.framework
    #----- Qt 4.3.0 installed from sources (qt-mac-opensource-src-4.3.0.tar.gz):
    /usr/local/Trolltech/Qt-4.3.0/lib/QtCore.framework
    #----- Qt 4.3.0 installed from binaries (qt-mac-opensource-4.3.0.dmg):
    /Library/Frameworks/QtCore.framework

    Similarly, qmake winds up in different locations:

    #----- Qt 4.2.3 installed from sources:
    /usr/local/Trolltech/Qt-4.2.3/bin/qmake
    #----- Qt 4.3.0 installed from sources:
    /usr/local/Trolltech/Qt-4.3.0/bin/qmake
    #----- Qt 4.3.0 installed from binaries:
    /usr/bin/qmake-4.3

    The binary installer also adds some symbolic links:
    /usr/bin/qmake -> /usr/bin/qmake-4.3
    /Developer/Tools/Qt/qmake -> /usr/bin/qmake-4.3

    Assistant winds up here:

    #----- Qt 4.2.3 installed from sources:
    /usr/local/Trolltech/Qt-4.2.3/bin/assistant.app
    #----- Qt 4.3.0 installed from sources:
    /usr/local/Trolltech/Qt-4.3.0/bin/assistant.app
    #----- Qt 4.3.0 installed from binaries:
    /Developer/Applications/Qt/assistant.app
    /Developer/Tools/Qt/assistant.app ->

    Each instance of assistant seems to know where the Qt documents, for it's own particular assigned Qt version, are located. I.e. there is no global environment Qt version environment variable.

    2. You can get a full listing of what your binary installer did by using lsbom:
    $ lsbom /Library/Receipts/Qt_libraries.pkg/Contents/Archive.bom
    $ lsbom /Library/Receipts/Qt_tools.pkg/Contents/Archive.bom

    3. Each instance of qmake can be queried for info with a -query option, and each (I have 3 qmakes as described above) gives different information based on how it was built. Again, this implies there is no global enviroment variable that tells qmake what Qt version is to be used. The version seems hard coded into each qmake when it was compiled. Here are all the -query options I know about:

    $ qmake -query QT_VERSION
    4.2.3
    $ qmake -query QT_INSTALL_DATA
    /usr/local/Trolltech/Qt-4.2.3
    $ qmake -query QT_INSTALL_PREFIX
    /usr/local/Trolltech/Qt-4.2.3
    $ qmake -query QT_INSTALL_LIBS
    /usr/local/Trolltech/Qt-4.2.3/lib
    $ qmake -query QT_INSTALL_BINS
    /usr/local/Trolltech/Qt-4.2.3/bin
    $ qmake -query QT_INSTALL_HEADERS
    /usr/local/Trolltech/Qt-4.2.3/include

    I can understand QT_VERSION being hard embedded in the qmake executable, but how in heaven's name it knows QT_INSTALL_PREFIX is a mystery to me. I can move each qmake executable to wildly different places on my hard disk and whenever I run it, each query gives the correct information based on how it was built. From this I am going to conclude that the /usr/local/Trolltech/Qt-4.2.3 location is hard coded into qmake. Perhaps qmake itself is built as part of the installation process.

    I read a lot about a QTDIR environment variable, but at least on a mac, there appears to be no such thing.

    So then, I must logically conclude that the way to choose what version of Qt I use, is entirely determined by which qmake I run. Which qmake I run is dictated by which qmake the system finds first via the PATH environment variable. /usr/bin is in PATH by default, so if I do not modify PATH, the system will find the binary installation's qmake first (source code installations of qmake will be in /usr/local/Trolltech/Qt-4.x.x/bin).

    Steve

Similar Threads

  1. Problems installing on MacOS X
    By a5char in forum Installation and Deployment
    Replies: 2
    Last Post: 26th March 2007, 21:45
  2. Tab Order Settings in a QDialog widgets
    By vinnu in forum Qt Programming
    Replies: 10
    Last Post: 21st September 2006, 16:25
  3. qSplitter settings
    By ovidiu.sabou in forum Qt Tools
    Replies: 4
    Last Post: 14th March 2006, 18:24
  4. Another MacOS issue ?!
    By Nemo in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2006, 09:16
  5. Replies: 4
    Last Post: 1st February 2006, 17:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.