当前位置:网站首页>QT excellent open source project 13: qscintilla
QT excellent open source project 13: qscintilla
2022-07-27 13:20:00 【Climb on the grass】
Scintilla It's a free one 、 Cross platform 、 Edit controls that support syntax highlighting . It fully supports source code editing and debugging , Including syntax highlighting 、 Misdirection 、 Automatic completion (code completion) And function tips (call tips). For detailed introduction, please refer to :https://www.scintilla.org/
without doubt ,Notepad++ Is the most famous based on Scintilla Open source editor for , It is completely used. C++ Realization

and QScintilla yes Scintilla stay QT Transplantation on , Using this library can make development more convenient Qt Program
One . download
QScintilla Its official website :https://qscintilla.com/
Download address :Riverbank Computing | Download
Be careful : There are multiple versions , and 2.12 And later versions , No longer supported Qt4 and Qt5 了 , So there is no in the source code QT4QT5 This catalog is . What I download here is 2.11.6 This version . I used it here QT The version is Qt 5.12.2. Unzip after download , Its directory structure is as follows :
| Directory name | purpose |
|---|---|
| Qt4Qt5 | Compile folder , Generate corresponding DLL file |
| designer-Qt4Qt5 | Compilation folder of relevant designer plug-ins |
| example-Qt4Qt5 | Simple sample folder |
| doc | Use Doxygen Generated help documents |
| lexers | Implemented parsers |
| ... | ... |
This article only demonstrates how to compile and generate dll, About Qt Designer Compilation of plug-ins , See :QScintilla Installation and introduction of
Two . Compiling and testing
open Qt4Qt5 In folder qscintilla.pro The file can be compiled directly , No error reported , Here we use debug Version as an example , After compilation , Will be in debug Generate... In directory qscintilla2_qt5d.lib and qscintilla2_qt5d.dll file
Tests can be used directly example-Qt4Qt5 In folder application engineering , But you're right application.pro The document is slightly revised , The revised document is as follows :
QT += core gui widgets
CONFIG += qscintilla2
HEADERS = mainwindow.h
SOURCES = main.cpp mainwindow.cpp
RESOURCES = application.qrc
INCLUDEPATH += ../Qt4Qt5
LIBS += qscintilla2_qt5d.lib because application It's used in the project Qt4Qt5/Qsci Header file in , Therefore, it is necessary to Qt4Qt5 The directory contains to INCLUDEPATH in
Then compile the previously compiled qscintilla2_qt5d.lib copy to example-Qt4Qt5 in
In this way, you can compile normally application Engineering. , To run , You have to qscintilla2_qt5d.dll copy to application.exe In the directory
Runtime , As shown below :

3、 ... and . Class hierarchy

The picture is from :https://qscintilla.com/#editor
1. The most basic class is QSciScintillaBase, It is ⽂ The base class of this editor , This kind of bottom layer , Usually not used directly .QScintilla The library provides ⼀ Upper layer ⼦ class QSciScintlla , It is ⽂ This editor class , There are many similar to Qt Of API . If the class is missing some of the required ⾮ Often specific functions , At this time, you can inherit its ⽗ class QSciScintillaBase.
2. Syntax highlighted objects are called lexical analyzers . After creating and configuring such a lexical analyzer object , Just apply it to ⽂ This editor (QSciScintilla object ) Then you can . About the implementation of lexical analyzer ,QScintilla Provides QSciLexer class , This category is ⼀ An abstract class , So before you create an object , It needs to be subclassed .
3.⼀ A good one ⽂ This editor provides more than just syntax highlighting , It also needs functions such as function parameter prompt and automatic completion . These functions exist in QSciAPI Class . Just create from this class ⼀ An example , And apply it to QSciLexer In the object . Its parent class is an abstract class , Class called QSciAbstractAPIs.
For more information, please refer to the official documents
Link to the original text :https://blog.csdn.net/caoshangpa/article/details/125974273
边栏推荐
- AMD Adrenalin 22.7.1 驱动更新:OpenGL 性能翻倍,支持微软 Win11 22H2 系统
- JS single thread understanding notes - Original
- Feign's dynamic proxy
- Distributed system architecture theory and components
- A survey of video game addictive behavior research
- 完美指南|如何使用 ODBC 进行无代理 Oracle 数据库监控?
- SQL statement problem, calculate the data with a difference of less than 10 minutes to be displayed as the same batch of data
- 面试考点:三种图的问题
- JNI程序如何进行参数传递
- Zhongke Lanxun fell 30% on the first day of listing: Huang Zhiqiang, 60, started a company with a market value of 7.7 billion
猜你喜欢

Baoli food listed on Shanghai Stock Exchange: annual revenue of 1.578 billion, market value of 5.8 billion

Qt优秀开源项目之十三:QScintilla

MySQL扩展

开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能

赋能金融风控加分项的这30个问题,您都搞懂了吗

500强企业如何提升研发效能?来看看行业专家怎么说!

Open source project - taier1.2 release, new workflow, tenant binding simplification and other functions

Getting started for beginners: build your own blog with WordPress

Jesd204b debugging notes (practical version)

AMD Adrenalin 22.7.1 驱动更新:OpenGL 性能翻倍,支持微软 Win11 22H2 系统
随机推荐
POJ1548 Robots【二分图最小路径覆盖】
Eccv2022 | Ru & Google proposed to use clip for zero shot target detection!
Poj2594 treasure exploration [bipartite graph minimum path coverage] [Floyd]
Seata 在蚂蚁国际银行业务的落地实践
轮播图
JS true / false array conversion
完美指南|如何使用 ODBC 进行无代理 Oracle 数据库监控?
Amd adrenalin 22.7.1 driver update: double the performance of OpenGL and support Microsoft win11 22h2 system
[node+ts] build node+typescript project
字节跳动的 Flink OLAP 作业调度和查询执行优化实践
JS single thread understanding notes - Original
SQL statement problem, calculate the data with a difference of less than 10 minutes to be displayed as the same batch of data
Antd's tool function getprefixcls gets the public prefix
PAT乙级 1109 擅长C(详解)
Xshell7 can log in to MySQL virtual machine, but not mysql
POJ2446 Chessboard【二分图最大匹配】
固定定位
Plus SBOM: assembly line BOM pbom
Feign's dynamic proxy
v-on基础指令