<<

COMPT2-TUTORIAL 6: INSTRUCTIONS FOR INSTALLATIONS OF & PYSIDE

QT INSTALLATION

In this section, you will install Qt on your machine. As part of this installation, you will have installed the Qt Designer, a Qt tool which we will use in this tutorial to create intuitive graphical user interfaces (GUIs).

First, based on your , click on the appropriate link below to download the Qt installation file.

NOTE: Please DO NOT remove the drop-off files after your download.

Qt for Windows: https://icseclzt.cc.ic.ac.uk/pickup.php?claimID=D9bnRYvkKqqacoKx&claimPasscode=ErvYQsQ3iBErdyrw& emailAddr=a.tavakoli16%40imperial.ac.uk

For Windows users, if you do not already have MinGW installed on your PC (check by running a search in your directories for “”), you would need to install it before you can start installing Qt. To install MinGW with GCC 4.8.2, please download the compressed folder from the link below, and then extract it into your “” directory (i.e., C:/mingw32). To extract the folder, you may use 7-zip (can be downloaded from: http://www.7-zip.org/). Link to download MinGW (for Windows users only): https://icseclzt.cc.ic.ac.uk/pickup.php?claimID=to6YK2nw9aEsVDv6&claimPasscode=dYxKtSX5RHdni Zw5&emailAddr=a.tavakoli16%40imperial.ac.uk

Qt for Mac: https://icseclzt.cc.ic.ac.uk/pickup.php?claimID=TwgAwaeccfumDxrY&claimPasscode=AmJ9vC2F3wn7 n69t&emailAddr=a.tavakoli16%40imperial.ac.uk

Qt for 64-bit: https://icseclzt.cc.ic.ac.uk/pickup.php?claimID=PjAohu43frGEjwf7&claimPasscode=z9vHXEDMSNQHd f6w&emailAddr=a.tavakoli16%40imperial.ac.uk

Qt for Linux 32-bit: https://icseclzt.cc.ic.ac.uk/pickup.php?claimID=5PZScPT5DAYBXHqo&claimPasscode=VokvYUN837Vb NeeN&emailAddr=a.tavakoli16%40imperial.ac.uk

NOTE: Alternatively, if the links above do not work for you for any reason, you can download the appropriate installation files from the webpage below: http://download.qt.io/official_releases/qt/4.8/4.8.7/

After your Download: After you have downloaded the appropriate Qt installation file for your machine, you may start the Qt Installation Wizard by double-clicking the downloaded file, and then follow the installation steps as follows.

NOTE: For Windows users, as mentioned earlier, you need to ensure that you have MinGW installed on your machine and give the appropriate installation path for MinGW once the wizard asks for it (shown below):

PYSIDE INSTALLATION

To install PySide (a Python binding for Qt) on your machine, please do as follows:

1. Start Anaconda Prompt as Administrator: On Windows, right-click on your Anaconda Prompt’s app, and select “Run as administrator”. 2. Run the command-line below on your Anaconda terminal: $ pip install -U PySide

NOTE: If you do not have pip installed, you need to install it in the following steps: I. Download get-pip.py from the following link: https://icseclzt.cc.ic.ac.uk/pickup.php?claimID=QpKEfEPoiVEkNQuX&claimPasscode=nkkgR8FNQicET x7N&emailAddr=a.tavakoli16%40imperial.ac.uk

2 II. Change directory to where you have downloaded the file (using the command-line tool cd) on your Anaconda Prompt and run the following command: $ python get-pip.py

If your PySide installation was successful (did not have any errors), you may now go ahead and verify that everything has been installed properly, by running the following command lines on your Anaconda Prompt:

$ python >> import PySide >> (PySide.__version__) >> import PySide.QtCore >> print(PySide.QtCore.__version__) >> quit()

If you do not have any import errors, then you have installed Qt and PySide properly and you may go ahead and open your Qt designer which should reside in the following path:

[Path_to_Anaconda_2_directory]\Lib\site-packages\PySide

For instance: C:\Program Files\Anaconda2\Lib\site-packages\PySide

Once in the aforementioned directory, find designer.exe and run it.

Now you can follow the tutorial and try out the examples provided.

3