Python editor in a PyQt4 application - qt

I need to integrate an editor into a window/dialog in my PyQt4 application.
It needs to support syntax highlighting for Python, Java and C++. It should run under Linux and ideally windows.
What would you suggest and where can I find the API and instructions?
I was thinking about Katepart, but I can't find instructions for it.

http://www.riverbankcomputing.co.uk/software/qscintilla/intro
http://www.riverbankcomputing.co.uk/static/Docs/QScintilla2/index.html
http://eli.thegreenplace.net/2011/04/01/sample-using-qscintilla-with-pyqt/

Related

How to use OpenCL 2.0 kernel language in Qt Creator?

Several days ago, when I started to learn OpenCL, I needed a good IDE to write OpenCL C kernel language, which provides some basic functions like syntax highlighting and static analysis. I was surprised to find out that Qt Creator is able to do the job.
Everything was fine until today I started to use some feature in OpenCL 2.0:
It looks like Qt Creator use libclang to do the parsing and libclang treats my source files as OpenCL 1.0. But My machine supports OpenCL 3.0 and the code was ok to compile and run. So I doubt it only supports OpenCL 1.0.
My questions are:
How to make Qt Creator (or the libclang plugin in it) support OpenCL 2.0?
How do you guys write OpenCL 2.0? Is there any better IDEs or editors?
Thank you guys, I am really a newbie here.
I tried to rename the file's postfix to ".cl2", but it doesn't work.
I read the OpenCL support documentation of LLVM, but failed to find out the solution.
QtCreator uses KDE syntax highlighting engine. The definitions are simple XML files. You can find them here, but opencl.xml doesn't look updated for 2.0/3.0 language. You can try to change it, and then put it into $HOME/.config/QtProject/qtcreator/generic-highlighter/syntax and it should pick it up.
In QtCreator, you can download newer definitions by going to Tools -> Options, select "Text editor" in left, then "Generic highlighter" tab. This will put the updated files in $HOME.local/share/org.kde.syntax-highlighting/

QT application on BeagleboneBlack

Hi I have a debian image on BBB I have already installed QT creator on B^3 but the problem is whenever I try to start a new project in qt creator, couldn't see any option of kit. Infact when i add qmake and compiler path the application throws error.
What can I do to solve the problem. Can i directly get the full pack of SDK from qt.io/download ?
You must compile Qt libraries for your device (BBB) on your own, using specified compiler. You can find more information on this topic, here:
Qt Cross-Compilation Options
As soon as you compile Qt libraries for your device, you must move them to appropriate directories (on your BBB).
First, I would suggest learning to cross-compile, it's much faster & more easily maintained when you want to move to new versions. There's a ton of documentation and community around doing this. Windows & Linux both of which are probably dated, but info is still relavent. I've heard it's much easier from a linux host, but that could be biased.
That being said, if you don't want to cross-compile I believe you can simply install the qt embedded libraries. This question may offer some good advice. Once you have the libraries installed, you should be able to use qmake directly to create the Makefile for your project, then you can use cmake, or g++, etc.. to do the actual compiling.
You're likely going to work in command line though, I'm not sure you can run QT Creator on the BBB directly. I could be wrong.

Embed QtDesigner

Is it possible to embed QtDesigner into a PyQt application. I did some searching but can't really find any examples. Found lots about using the interface API but not really how to get the interface in the first place.
You will need to make 3 steps:
Get QtDesigner & QtCreator source
Create bindings from QtDesigner C++ code to python using SIP or Shiboken
Look at QtCreator source of how to embed QtDesigner into your application
I don't think its possible to do it without the source code. I doubt Qt will hand it out either. https://github.com/qt-creator/qt-creator is the source for QtCreator, but I could not find anything similar for QtDesigner.

QT multilanguage app

I am new in Qt framework and now, I want to create an app which supports multi-language display. I known there is a way to do: Qt Linguist. I searched, and archieved some information about lupdate, lrelease ... But I just have Qt Creator IDE, how can I run or compile lupdate, lrelease ???
How can I create *.ts file ?
Please give me some code example or guide to do. (I often use Qt Designer to create GUI)
As far as i know, there is no option in QtCreator to use QtLinguist - you have to do it manually. Here you have an excellent documentation about how to do it. I have learned from there also.

Are there any PyQt sqlite browser/manager?

I'm developing a program using PyQt4 and sqlite,
I want to include a small sqlite browser/editor/manager, just like sqliteman or sqlitebrowser,
are there any one written by pyqt?
You might want to take a look at the C++ SQL Browser demo shipped with Qt, and perhaps port it to Python.
The Eric Python IDE has a sql browser. It is open source and it's been written by pyqt.

Resources