Pyqt正则表达式编辑器
QRegexEditor的Python项目详细描述
关于
qregexeditor是用python和 皮奎特。
您可以将qregexeditor用作独立应用程序,也可以用作小部件 在您自己的PyQt/PySide应用程序中
该工具的灵感来自:
安装
首先从pypi安装包:
pip install qregexeditor --upgrade
然后您可以运行应用程序:
QRegexEditor
依赖关系
- Python(2.7或>;=3.2)
- PyQt5或PySide或PyQt4
在自定义PyQt应用程序中使用小部件
将该小部件用作任何其他qt小部件
可以通过编程方式指定正则表达式和字符串模式。 您可能还想连接到quick_ref_requested信号,以便 应用程序可以在最合适的位置显示/隐藏快速引用小部件。
""" This example show you how to use the widget in a custom application. """importsysfromPyQt5.QtWidgetsimportQApplication,QMainWindow# if you use PyQt4 or PySide, you must set the QT_API environment variable# to select the proper bindings, see# https://github.com/pyQode/pyQode/wiki/Getting-started#qt-bindings-selectionfromqregexeditor.apiimportRegexEditorWidget,QuickRefWidgetapp=QApplication(sys.argv)window=QMainWindow()editor=RegexEditorWidget()quick_ref=QuickRefWidget()quick_ref.hide()window.setCentralWidget(editor)# show/hide quick reference widgeteditor.quick_ref_requested.connect(quick_ref.setVisible)window.show()app.exec_()