C++ Qt "hello-scintilla" example?

83 views
Skip to the first unread message

kukove...@hotmail.com

unread,
18 Jul 2022, 13:12:3818/07/2022
to scintilla-interest
Hi,

Can anyone point me to a step-by-step tutorial of creating a simple C++ Qt5/6 hello-scintilla tutorial?
If there isn't one, could someone please help guide me past the point of compiling the ScintillaEdit and ScintillaEditBase shared libraries?

Thanks,
Matic

Michael Neuroth

unread,
18 Jul 2022, 18:30:0818/07/2022
to scintilla-interest
Hi,

on the SciTEQt GitHub Project you can not find a step-by-step tutorial, but a port of SiTE to Qt 5. On the QuickScintilla GitHub Project you can find a simple example to create a Qt application using the Scintilla control: QuickScintillaDemo.
Maybe this links help you to solve you problem.

Michael

kukove...@hotmail.com

unread,
19 Jul 2022, 02:27:4319/07/2022
to scintilla-interest
Hi Michael,

Thank you very much for the information.
Is it a hard task to move the QuickScintilla example from QtQuick to straight C++ Qt? (I apologize if this is a simple problem, but the only experience with Qt I have is compiling a helloworld example with a window and a button)

Regards,
Matic

seasoned_geek

unread,
6 Aug 2022, 15:42:1506/08/2022
to scintilla-interest
Hello Matic,

Not a direct answer to your question, but probably as good as you will get. The problem with most every (possibly all) of the platform/toolset "example" programs is they started out as "just the bare minimum" then exploded. At one point Scite was the base demo but now it is a very robust text editor. Useful for programmers working on their own stuff, but not useful for someone coming to this cold.

I have a port of Scintilla called CsScintilla


Feature wise it is a few changes behind, but good enough for what you want.

It uses CopperSpice which is a fork of Qt 4.8 that dumped QML and changed a lot of things under the hood. Many of the header file names and classes (at the high level anyway) remain the same.

The Wiki covers all of the instructions/steps needed to build the requirements, assuming you don't just install the .DEB or .RPM. (No, I don't have Windows up and running. No time and very little interest in Windows right now.)


Once you have followed the instructions for building you want to poke around in this directory.


There is a shell script to build all of the examples.

CopperSpice world uses CMake, not QMake but you should be able to re-use the code.

Example1 is the CopperSpice version of what you are asking for Qt.


It also has comments about what you can leave out, like the menu and toolbar. The MainWindow source file is deliberately splitting that code out so one doesn't get lots in "code fog."

Once you understand the minimum needed for the CopperSpice version you should be able to create your own Qt based minimal project by stealing those .cpp and .h files. I believe you should be able to mass substitute to replace CsScintilla with Scintilla but have not tired.

Given you said your only Qt experience is building the HelloWorld example, I would not jump straight in to stealing those source files and trying to create project.

Each of the examples in that directory work toward a progressively more capable editor.

Hope this helps
Reply all
Reply to author
Forward
0 new messages