# QScintilla - a Port to Qt v4 of Scintilla

### 2.4.5

## Introduction

QScintilla is a port to Qt of the Scintilla editing component.

As well as features found in standard text editing components, Scintilla includes features especially useful when editing and debugging source code:

- syntax styling with support for over 70 languages
- error indicators
- code completion
- call tips
- code folding
- margins can contain markers like those used in debuggers to indicate breakpoints and the current line.
- recordable macros
- multiple views
- printing.

QScintilla is a port or Scintilla to the Qt GUI toolkit from Nokia and runs on any operating system supported by Qt (eg. Windows, UNIX/Linux, MacOS/X). QScintilla works with both Qt v3 and v4.

This documentation describes QScintilla for Qt v4. The QScintilla APIs for Qt v3 and Qt v4 are almost identical. The main difference is that the QsciScintillaBase class is derived from a different Qt class.

QScintilla also includes language bindings for Python. These require that PyQt v3 or v4 is also installed.

This version of QScintilla is based on Scintilla v1.78.

## Licensing

QScintilla uses a similar license model as Qt and is available under the GNU General Public License v2 and a commercial license.

The commercial license allows closed source applications using QScintilla to be developed and distributed. At the moment the commercial version of QScintilla is bundled with the commercial version of PyQt.

See the file "LICENSE" to see what license this copy of QScintilla is released under.

The Scintilla code within QScintilla is released under the following license:

     License for Scintilla and SciTE

     Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>

     All Rights Reserved

     Permission to use, copy, modify, and distribute this software and its
     documentation for any purpose and without fee is hereby granted,
     provided that the above copyright notice appear in all copies and that
     both that copyright notice and this permission notice appear in
     supporting documentation.

     NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
     SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
     AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY
     SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
     WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
     TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
     OR PERFORMANCE OF THIS SOFTWARE.

## Installation

As supplied QScintilla will be built as a shared library/DLL and installed in the same directories as the Qt libraries and include files.

If you want to change the configuration then edit the file `qscintilla.pro` in the `Qt4` directory. For example, if you want to build a static library, edit the value of `CONFIG` and replace `dll` with `staticlib`, and edit the value of `DEFINES` and remove `QSCINTILLA_MAKE_DLL`.

See your `qmake` documentation for more details.

To build and install QScintilla, run:

        cd Qt4
        qmake qscintilla.pro
        make
        make install

If you have both Qt v3 and v4 installed then make sure you use the correct version of `qmake`.

### Installation on Windows

Before compiling QScintilla on Windows you should remove the `Qsci` directory containing the QScintilla header files from any previous installation. This is because the `Makefile` generated by `qmake` will find these older header files instead of the new ones.

Depending on the compiler you are using you may need to run `nmake` rather than `make`.

If you have built a Windows DLL then you probably also want to run:

        copy %QTDIR%\lib\qscintilla2.dll %QTDIR%\bin

### Installation on MacOS/X

On MacOS/X you may need to pass `-spec macx-g++` in order to generate a Makefile, otherwise an XCode project file may be created.

You will probably also have to set your `DYLD_LIBRARY_PATH` environment variable to the directory in which the QScintilla library has been installed. (However, if you are only using QScintilla thought the Python bindings then you don't need to do this.)

## Example Application

The example application provided is a port of the standard Qt `application` example with the QsciScintilla class being used instead of Qt's QTextEdit class.

The example does not demonstrate all of the extra features of QScintilla.

To build the example, run:

        cd example-Qt4
        qmake application.pro
        make

On Windows (and depending on the compiler you are using) you may need to run `nmake` rather than `make`.

## Python Bindings

The Python bindings are in the `Python` directory. You must have either PyQt v3 or v4 already installed. QScintilla must also already be built and installed.

The configure, build and install the bindings, run:

        python configure.py
        make
        make install

On Windows (and depending on the compiler you are using) you may need to run `nmake` rather than `make`.

By default the bindings will be built for PyQt v4 if it is installed. If not, they will be built against PyQt v3. If you have both installed and want to build against PyQt v3 then pass `-p 3` as an argument to `configure.py`.

`configure.py` supports a number of other arguments. Pass `-h` to display a list of the supported arguments.

## Qt Designer Plugin

QScintilla includes an optional plugin for Qt Designer that allows QScintilla instances to be included in GUI designs just like any other Qt widget.

To build the plugin on all platforms, make sure QScintilla is installed and then run (as root or administrator):

        cd designer-Qt4
        qmake designer.pro
        make
        make install

On Windows (and depending on the compiler you are using) you may need to run `nmake` rather than `make`.