qscintilla

Python中GUI库PyQt5的安装和配置

让人想犯罪 __ 提交于 2020-05-02 07:24:12
在使用Tkinter开发GUI程序时,发现相关文档比较少,开发起来太累。经过综合比较,决定使用PyQt这个库。下面是简单的安装步骤。 1.安装 PyQt5 : pip install PyQt5 -i https://pypi.douban.com/simple 2.安装常用的Qt工具: pip install PyQt5- tools -i https://pypi.douban.com/simple 3.设置环境变量 右键我的电脑-环境变量,在path下面添加pyqt5_tools的安装目录:C:\Users\admin\AppData\Local\Programs\Python\Python37\Lib\site-packages\pyqt5_tools 4.安装QSci模块,QScintilla是Scintilla在QT上的移植。如果想在Qt上面使用强大的Scintilla控件,就安装QScintilla吧,使用命令 pip install QScintilla -i https://pypi.douban.com/simple 另有下载地址以作备用,此处安装不需要: https://riverbankcomputing.com/software/qscintilla/download 5.下载Eric6,下载后,将eric6-19.11.zip解压后的文件夹

Executing “SCI_GOTOLINE” API of Qscintilla inside indicatorReleased() event handler is not functioning properly

与世无争的帅哥 提交于 2020-01-05 04:22:13
问题 I am developing a desktop application using "PyQt4". The application contains an XML editor implemented on top of Qscintilla. However I have an issue whenever I click a hyperlink-alike text defined via indicators. The "indicatorClicked" event is invoked, but when I execute "SCI_GOTOLINE" API inside it, it goes to the desirable line properly but unluckily, for some reason, it selects the text from the clicked text position till the destination line. For me, it seems as if mouse does not get

KeyPressEvent doesn't work with Qscintilla Library (Qt)

泪湿孤枕 提交于 2019-12-25 09:19:44
问题 EDIT : THE CODE IS THE RIGHT CODE, FOR MORE EXPLANATION LOOK IN COMMENTS ;) I'm trying to do an auto completer for parenthesis with Qt and Qscintilla library but i don't know why, my program wont goes into keyPressEvent function. #include "mainwindow.h" #include <QMenuBar> #include <QFileDialog> #include <Qsci/qscilexerhtml.h> #include <QKeyEvent> #include <QTextEdit> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { initializeUI(); initializeEditor(); editor->installEventFilter

Preventing keyboard shortcuts being triggered in QScintilla (example code)

江枫思渺然 提交于 2019-12-20 02:54:38
问题 I would like to prevent application keyboard shortcuts from being triggered when editing code in my QScintilla widget, just like a normal QLineEdit field doesn't. In the executable example code below it is not possible to type whitespaces in the QScintilla widget because the spacebar has been set as a shortcut, but in the QLineEdit it works properly. I wonder if it could be something to do with the QScintilla not grabbing keyboard input properly (though it obviously does, since it is possible

Removing a line from text

此生再无相见时 提交于 2019-12-13 19:38:41
问题 Say I have a text document. I have a line.I want to delete the text on that line and replace it with another text. How do I do this? There is nothing for this on the docs, thanks in advance! 回答1: Untested: reads the lines of the file using .readlines() and then replaces the line number index in that list. Finally, it joins the lines and writes it to the file. with open("file", "rw") as fp: lines = fp.readlines() lines[line_number] = "replacement line" fp.seek(0) fp.write("\n".join(lines)) 回答2

PyQt5-5.8.2 doesn't function on Windows 10

早过忘川 提交于 2019-12-12 04:58:16
问题 I need to install qscintilla . I use pip for that: > pip install qscintilla PyQt5 automatically upgrades to the latest version '5.8.2', and sip upgrades to '4.19.2'. I suppose this has to do with the needs of qscintilla. Perhaps the latest version of qscintilla needs the latest PyQt version to operate properly. Unfortunately, PyQt5-5.8.2 combined with sip-4.19.2 don't work on Windows 10. I get the following error: > python >>> import PyQt5.QtWidgets ImportError: DLL load failed: The specified

Creating and colorizing new constructs on a existing Scintilla lexer

对着背影说爱祢 提交于 2019-12-10 21:51:33
问题 All, I'm using QScintilla to syntax-highlight my domain specific language (DSL). Since my DSL is based on python, I use the existing Python Lexer for QScintilla. I manage to create new keywords as following: self.text = Qscintilla(self) pythonLexer = QsciLexerPython(self.text) self.text.setLexer(pythonLexer) self.text.SendScintilla(QsciScintilla.SCI_SETKEYWORDS,1,bytes('WARNING', 'utf-8')) Now, how do I choose a color to highlight my newly created keywords? Thanks a lot! 回答1: The

PyQt5-5.8.2 doesn't function on Windows 10

旧巷老猫 提交于 2019-12-02 10:02:51
I need to install qscintilla . I use pip for that: > pip install qscintilla PyQt5 automatically upgrades to the latest version '5.8.2', and sip upgrades to '4.19.2'. I suppose this has to do with the needs of qscintilla. Perhaps the latest version of qscintilla needs the latest PyQt version to operate properly. Unfortunately, PyQt5-5.8.2 combined with sip-4.19.2 don't work on Windows 10. I get the following error: > python >>> import PyQt5.QtWidgets ImportError: DLL load failed: The specified module could not be found. I have checked my PATH variable in Windows 10, and I found the following

Preventing keyboard shortcuts being triggered in QScintilla (example code)

不羁岁月 提交于 2019-12-01 23:56:27
I would like to prevent application keyboard shortcuts from being triggered when editing code in my QScintilla widget, just like a normal QLineEdit field doesn't. In the executable example code below it is not possible to type whitespaces in the QScintilla widget because the spacebar has been set as a shortcut, but in the QLineEdit it works properly. I wonder if it could be something to do with the QScintilla not grabbing keyboard input properly (though it obviously does, since it is possible to input characters in it). import sys,os from PyQt4.QtGui import * from PyQt4.QtCore import * from