Results 1 to 6 of 6

Thread: Using QtDesigner highlighter in my own application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    371
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    14
    Thanked 18 Times in 17 Posts

    Default Re: Using QtDesigner highlighter in my own application

    Now the code is working, and I can load simple syntax definitions. Next step is to use the language manager to nest syntax definitions, as KatePart really does. Code is available from SVN:

    Qt Code:
    1. svn co https://qtedit4.googlecode.com/svn/tools/qtsourceview
    To copy to clipboard, switch view to plain text mode 

    The code depends on the full QtCreator source. Just follow instructions to configure it (look inside the *.pro file).

    Feel free to use and abuse.

  2. #2
    Join Date
    Jan 2006
    Posts
    371
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    14
    Thanked 18 Times in 17 Posts

    Default Re: Using QtDesigner highlighter in my own application

    Good news:

    I managed to get the full syntax highlighter working, and I started testing it. I loaded the HTML syntax, and was able to see the colors for HTML/CSS/JavaScript - which means the main engine is working. I also "rebased" the code to the latest code from QtCreator (see the SVN history).

    The code should be usable for 3rd parties now.

  3. #3
    Join Date
    May 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Using QtDesigner highlighter in my own application

    Very interesting to know that there is a syntax highlighter ready for use. Will keep this in mind for future applications!

  4. #4
    Join Date
    Jan 2006
    Posts
    371
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    14
    Thanked 18 Times in 17 Posts

    Default Re: Using QtDesigner highlighter in my own application

    I finally forked the code. The google code SVN now contains a small demo that loads definitions. Tested under Win7 and Linux, using Qt4.7. This should build on Qt4.2 and above, but I did not test it fully.

    If you are on windows, the example will not load as expected. This is because QtCreator does not use the Kate highlighter for C++ files, and thus it does not contain cpp.xml. Just download the corresponding XML from the QtCreator GUI:
    Tools->Options->Text Editor->Generic Highlighter->Download definitions.

    The XML will be saved in %HOME%\AppData\Roaming\Nokia\qtcreator\generic-highlighter, the code currently does load files from that dir, so don't worry.

    Check the SVN and send patches if you like this project.
    Attached Images Attached Images

  5. #5
    Join Date
    Jan 2006
    Posts
    371
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    14
    Thanked 18 Times in 17 Posts

    Default Re: Using QtDesigner highlighter in my own application

    I just released QtSourceView 0.0.3, with qate support: http://www.qtcentre.org/threads/3105-qtsourceview.

    Home page + download links: http://code.google.com/p/qtedit4/wiki/QtSourceView

Similar Threads

  1. Replies: 7
    Last Post: 4th February 2020, 13:41
  2. Tree Model Item Highlighter
    By sajis997 in forum Qt Programming
    Replies: 9
    Last Post: 9th January 2011, 17:58
  3. Replies: 4
    Last Post: 11th May 2010, 17:33
  4. Syntax Highlighter sample is wrong
    By kib2 in forum Qt Programming
    Replies: 2
    Last Post: 8th November 2007, 21:24
  5. QTextEdit with syntax highlighter
    By sarode in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2006, 07:20

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.