Инфраструктура Python. GUI

Qt

Самой серьезной существующей библиотекой для десктопного графического интерфейса является Qt. Она кроссплатформенная, содержит богатый набор элементов интерфейса и их настроек. В настоящее время активнее всего используются версии Qt4 и Qt5 с заметно отличающимися API. Для Python существует набор биндингов и врапперов над ними, призванных скрыть эти несовместимости и сделать их API, заточенный под C++ и свои Q*-классы, более pythonic. Здесь будет описана библиотека PyQt5, включенная в Anaconda.

Qt-приложение обрабатывает события в главном цикле — методе QApplication.exec_. События присылаются системой и транслируются внутри Qt в сигналы (signal), которые соединяются (connect) со слотами (slot), функциями-обработчиками. События крутятся вокруг набора созданных виджетов, организованных в дерево. Корневой виджет является главным окном, при завершении которого происходит выход из exec_.

В отдельном скрипте для запуска достаточно использовать

app = QApplication([])
window = MainWindowClass()
window.show()
app.exec_()

Здесь же для удобства повествования будет использоваться специальная функция run_qt_and_screenshot, которая принимает класс-наследник QWidget, создает его в качестве главного окна, запускает главный цикл, а непосредственно перед закрытием главного окна и выходом делает скриншот и выводит как результат. Сюда же включено немного своей особой магии, которую IPython требует, чтобы не создавать QApplication несколько раз при переисполнении ячеек.

In [1]:
%pylab inline
Populating the interactive namespace from numpy and matplotlib
In [14]:
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebKit import *
from PyQt5.QtWebKitWidgets import *
In [3]:
import PIL.Image
from io import BytesIO

pixmap = None
def run_qt_and_screenshot(WindowClass, method='pyqt5'):
    app = QCoreApplication.instance()
    if app is None:
        app = QApplication([])

    def closeEvent(self, event):
        global pixmap
        rect = self.frameGeometry()
        dw = QDesktopWidget()
        desktop_id = dw.screen(dw.screenNumber(self)).winId()
        if method == 'pyside':
            pixmap = QPixmap.grabWindow(desktop_id, rect.x(), rect.y(), rect.width(), rect.height())
        elif method == 'pyqt5':
            pixmap = QApplication.primaryScreen().grabWindow(desktop_id, rect.x(), rect.y(), rect.width(), rect.height())
        event.accept()
        
    WindowClass.closeEvent = closeEvent
    window = WindowClass()
    window.show()

    if method == 'pyside':
        try:
            from IPython.lib.guisupport import start_event_loop_qt4
            start_event_loop_qt4(app)
        except ImportError:
            app.exec_()
    elif method == 'pyqt5':
        app.exec_()

    io = QBuffer()
    pixmap.save(io, 'PNG')
    return PIL.Image.open(BytesIO(io.data().data()))

Полезная нагрузка:

In [4]:
class MainWindow(QWidget):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setWindowTitle('Hello, world')
        self.resize(320, 240)
        btn = QPushButton('Click me!', self)
        btn.clicked.connect(self.on_btn)
    def on_btn(self):
        QMessageBox.information(self, 'I\'m making a note here', 'Huge success!')
In [5]:
run_qt_and_screenshot(MainWindow)
Out[5]:

Положение виджетов друг на друге можно настраивать вызовами resize или setGeometry, но предпочтительнее использовать лаяуты. Это контейнеры, описывающие как надо располагать виджеты внутри них, что позволяет, например, осмысленно обрабатывать изменение размера главного окна.

In [6]:
class MainWindow(QWidget):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setWindowTitle('Hello, graphics')

        ilayout = QHBoxLayout()
        self.edit = QLineEdit('sin(x)')
        btn = QPushButton('Draw')
        ilayout.addWidget(self.edit)
        ilayout.addWidget(btn)

        olayout = QVBoxLayout()
        self.area = QLabel()
        olayout.addLayout(ilayout)
        olayout.addWidget(self.area)
        self.setLayout(olayout)

        btn.clicked.connect(self.redraw)
        self.redraw()

    def redraw(self):
        expr = self.edit.text()
        dpi = 96
        ioff()
        figure(figsize=(400./dpi, 300./dpi), dpi=dpi)
        x = linspace(-5, 5)
        y = eval(expr, dict([('x', x)] + numpy.__dict__.items()))
        plot(x, y)
        io = BytesIO()
        savefig(io, format='png', dpi=dpi)
        close()
        ion()
        pix = QPixmap()
        pix.loadFromData(io.getvalue())
        self.area.setPixmap(pix)
In [7]:
run_qt_and_screenshot(MainWindow)
Out[7]:

Когда-то программа, делающая то же самое, была достойна областного конкурса исследовательских работ школьников в МАН :-) Как вариант, matplotlib можно встроить в Qt-приложение встроенным способом https://matplotlib.org/gallery/user_interfaces/embedding_in_qt_sgskip.html

Иконографика

Программы и сайты часто оформляются иконками, упрощающими навигацию за счет понимания семантики некоторого пункта UI не только чтением текста, но и опознаванием стоящей рядом иконки. В настоящее время более-менее сформировался иконографический язык и его "слова" доступны в свободно распространяемых шрифтах FontAwesome (https://fontawesome.com/cheatsheet) и ElusiveIcons (http://elusiveicons.com/icons/). Их можно использовать в Qt, используя библиотеку qtawesome. В момент ее импорта должен быть рабочий QApplication.

pip install qtawesome
In [4]:
app = QCoreApplication.instance()
if app is None:
    app = QApplication([])
import qtawesome
In [13]:
def qpixmap_to_png(pixmap):
    io = QBuffer()
    pixmap.save(io, 'PNG')
    return io.data().data()

def qicon_to_png(icon):
    return qpixmap_to_png(icon.pixmap(32, 32))

get_ipython().display_formatter.formatters['image/png'].for_type(QIcon, qicon_to_png);
In [15]:
qtawesome.icon('fa.question-circle', color='blue', color_active='orange')
Out[15]:
In [16]:
qtawesome.icon('fa.venus-mars')
Out[16]:
In [17]:
qtawesome.icon('fa.camera', 'fa.ban', options=[{'scale_factor': 0.5}, {'color': 'red', 'opacity': 0.7}])
Out[17]:
In [18]:
from ultra import json_file_get
In [19]:
fn_ei = "C:\\Users\\User\\Anaconda2\\Lib\\site-packages\\qtawesome\\fonts\\elusiveicons-webfont-charmap.json"
fn_fa = "C:\\Users\\User\\Anaconda2\\Lib\\site-packages\\qtawesome\\fonts\\fontawesome-webfont-charmap.json"
names = ['ei.' + name for name in json_file_get(fn_ei).keys()] + ['fa.' + name for name in json_file_get(fn_fa).keys()]
print len(names)
print
for name in names:
    #IPython.display.display(qtawesome.icon(name))
    print name,
998

ei.comment ei.universal-access ei.photo ei.laptop ei.move ei.eye-close ei.hand-left ei.align-left ei.tasks ei.redux ei.quote-right-alt ei.caret-left ei.paper-clip-alt ei.laptop-alt ei.spotify ei.graph-alt ei.group ei.twitter ei.paper-clip ei.error-alt ei.broom ei.search-alt ei.vimeo ei.wrench-alt ei.foursquare ei.resize-vertical ei.opensource ei.th ei.folder-sign ei.th-list ei.speaker ei.deviantart ei.trash-alt ei.eur ei.random ei.flag-alt ei.video-chat ei.info-circle ei.circle-arrow-left ei.stop ei.smiley-alt ei.remove-circle ei.volume-up ei.reddit ei.idea-alt ei.facebook ei.w3c ei.compass ei.facetime-video ei.address-book ei.indent-left ei.friendfeed-rect ei.caret-up ei.trash ei.magic ei.gift ei.quotes ei.cogs ei.signal ei.list ei.upload ei.refresh ei.picasa ei.magnet ei.edit ei.viadeo ei.adjust ei.gbp ei.file-new ei.chevron-down ei.quote-alt ei.time-alt ei.glasses ei.resize-horizontal ei.arrow-down ei.heart-alt ei.delicious ei.picture ei.livejournal ei.globe ei.heart-empty ei.idea ei.align-center ei.tumblr ei.unlock ei.video ei.arrow-left ei.download ei.home ei.comment-alt ei.pencil-alt ei.retweet ei.hourglass ei.caret-down ei.chevron-left ei.font ei.leaf ei.file-new-alt ei.pinterest ei.screenshot ei.user ei.tags ei.print ei.flickr ei.zoom-in ei.plus-sign ei.bookmark-empty ei.map-marker ei.bold ei.question-sign ei.file-alt ei.hand-down ei.screen ei.barcode ei.thumbs-up ei.guidedog ei.pause ei.key ei.eye-open ei.path ei.smiley ei.list-alt ei.asl ei.resize-full ei.search ei.male ei.ok ei.adjust-alt ei.braille ei.credit-card ei.headphones ei.file-edit-alt ei.website ei.minus ei.filter ei.share-alt ei.inbox ei.fast-backward ei.cog ei.graph ei.circle-arrow-up ei.link ei.file-edit ei.home-alt ei.blind ei.ban-circle ei.pause-alt ei.volume-down ei.bell ei.cc ei.blogger ei.puzzle ei.inbox-alt ei.text-height ei.plurk-alt ei.phone-alt ei.ok-sign ei.brush ei.female ei.qrcode ei.scissors ei.dribbble ei.cloud ei.instagram ei.inbox-box ei.return-key ei.tint ei.text-width ei.certificate ei.bookmark ei.video-alt ei.myspace ei.question ei.align-right ei.quote-right ei.behance ei.music ei.soundcloud ei.italic ei.time ei.forward ei.wordpress ei.photo-alt ei.calendar-sign ei.stop-alt ei.fork ei.pencil ei.shopping-cart ei.exclamation-sign ei.cloud-alt ei.chevron-right ei.plurk ei.fire ei.wrench ei.envelope ei.fast-forward ei.glass ei.download-alt ei.github ei.bullhorn ei.adult ei.child ei.bulb ei.website-alt ei.digg ei.address-book-alt ei.folder ei.podcast ei.rss ei.hearing-impaired ei.stumbleupon ei.star-alt ei.star-empty ei.cog-alt ei.car ei.googleplus ei.youtube ei.record ei.hdd ei.dashboard ei.friendfeed ei.error ei.screen-alt ei.indent-right ei.torso ei.map-marker-alt ei.align-justify ei.heart ei.arrow-up ei.vkontakte ei.thumbs-down ei.lock ei.skype ei.share ei.remove ei.linkedin ei.lock-alt ei.th-large ei.tag ei.play-alt ei.compass-alt ei.file ei.shopping-cart-sign ei.hand-up ei.usd ei.resize-small ei.github-text ei.calendar ei.film ei.check-empty ei.unlock-alt ei.slideshare ei.remove-sign ei.person ei.mic ei.view-mode ei.check ei.play-circle ei.iphone-home ei.book ei.minus-sign ei.warning-sign ei.lastfm ei.reverse-alt ei.css ei.caret-right ei.circle-arrow-down ei.play ei.repeat ei.star ei.briefcase ei.envelope-alt ei.fullscreen ei.camera ei.volume-off ei.folder-close ei.asterisk ei.globe-alt ei.ok-circle ei.plane ei.repeat-alt ei.plus ei.arrow-right ei.group-alt ei.step-forward ei.network ei.forward-alt ei.circle-arrow-right ei.off ei.eject ei.phone ei.step-backward ei.wheelchair ei.lines ei.flag ei.hand-right ei.folder-open ei.road ei.chevron-up ei.fontsize ei.stackoverflow ei.backward ei.mic-alt ei.zoom-out fa.code fa.chain fa.chevron-circle-right fa.dollar fa.crosshairs fa.gg fa.ge fa.legal fa.angle-double-left fa.flash fa.send fa.foursquare fa.hourglass-2 fa.hourglass-3 fa.th fa.angle-left fa.recycle fa.file-code-o fa.thumb-tack fa.fax fa.xing-square fa.hospital-o fa.volume-up fa.spoon fa.facebook fa.cloud-download fa.trophy fa.caret-up fa.magic fa.hourglass-o fa.balance-scale fa.upload fa.magnet fa.adjust fa.subway fa.codiepie fa.location-arrow fa.check-circle fa.arrow-down fa.bicycle fa.instagram fa.caret-square-o-up fa.facebook-f fa.crop fa.external-link fa.arrow-circle-down fa.paper-plane fa.meanpath fa.long-arrow-left fa.download fa.bold fa.caret-down fa.chevron-left fa.venus fa.font fa.pinterest fa.cart-plus fa.folder-open-o fa.tachometer fa.creative-commons fa.clipboard fa.bar-chart fa.reply fa.hourglass-half fa.graduation-cap fa.info-circle fa.exchange fa.hand-o-up fa.pause fa.paypal fa.tv fa.github-square fa.search fa.mixcloud fa.venus-mars fa.flask fa.pinterest-square fa.fast-backward fa.code-fork fa.tasks fa.firefox fa.apple fa.gamepad fa.cc-stripe fa.quote-left fa.user-times fa.plus-square-o fa.eye-slash fa.trello fa.dribbble fa.user-secret fa.cloud fa.usd fa.eye fa.usb fa.certificate fa.500px fa.camera fa.music fa.gg-circle fa.sort fa.pencil fa.bookmark-o fa.diamond fa.share fa.hourglass-1 fa.envelope fa.yahoo fa.glass fa.flag fa.train fa.bullhorn fa.pause-circle-o fa.folder fa.outdent fa.stumbleupon fa.i-cursor fa.car fa.file-excel-o fa.arrow-circle-o-left fa.paragraph fa.file-photo-o fa.y-combinator fa.cab fa.male fa.history fa.h-square fa.heart fa.sort-amount-desc fa.search-plus fa.life-ring fa.lock fa.git-square fa.mouse-pointer fa.mail-forward fa.sign-in fa.odnoklassniki-square fa.tag fa.align-justify fa.level-up fa.chevron-circle-down fa.filter fa.sticky-note-o fa.moon-o fa.comments-o fa.lastfm fa.pagelines fa.credit-card-alt fa.file-word-o fa.map fa.object-ungroup fa.briefcase fa.stop fa.clone fa.plane fa.check-square fa.toggle-left fa.unlink fa.github fa.step-backward fa.wheelchair fa.cutlery fa.microphone-slash fa.user-plus fa.truck fa.toggle-down fa.ambulance fa.cc-visa fa.superscript fa.tty fa.shield fa.user-md fa.hand-stop-o fa.pie-chart fa.align-left fa.motorcycle fa.ticket fa.battery-half fa.spotify fa.dot-circle-o fa.facebook-square fa.group fa.angle-up fa.shopping-basket fa.paperclip fa.deviantart fa.file-audio-o fa.eur fa.coffee fa.times-circle-o fa.weixin fa.yc fa.y-combinator-square fa.internet-explorer fa.file-video-o fa.angle-double-up fa.safari fa.mail-reply-all fa.bank fa.commenting-o fa.black-tie fa.youtube-play fa.edit fa.caret-square-o-right fa.arrows fa.refresh fa.list-ul fa.file-o fa.battery-0 fa.battery-3 fa.battery-2 fa.battery-4 fa.battery-three-quarters fa.reddit-alien fa.square fa.ellipsis-v fa.list fa.globe fa.strikethrough fa.comment-o fa.bluetooth fa.hand-pointer-o fa.unlock fa.arrow-left fa.scissors fa.ellipsis-h fa.scribd fa.exclamation fa.try fa.flag-o fa.star-half-full fa.battery-quarter fa.ra fa.print fa.check-circle-o fa.houzz fa.lemon-o fa.umbrella fa.bell-o fa.intersex fa.cc-diners-club fa.undo fa.shekel fa.rebel fa.chevron-down fa.soundcloud fa.thumbs-o-down fa.bar-chart-o fa.indent fa.language fa.circle-thin fa.drupal fa.headphones fa.cc-mastercard fa.times fa.buysellads fa.fonticons fa.sort-asc fa.folder-open fa.heartbeat fa.feed fa.arrows-v fa.phone-square fa.text-height fa.linkedin-square fa.delicious fa.qrcode fa.arrows-h fa.mercury fa.text-width fa.envelope-o fa.rss-square fa.bookmark fa.automobile fa.sort-down fa.bitcoin fa.behance fa.sort-up fa.toggle-right fa.star-half-o fa.keyboard-o fa.gear fa.minus-circle fa.hotel fa.sort-numeric-asc fa.share-alt fa.shirtsinbulk fa.viacoin fa.copy fa.institution fa.rss fa.television fa.slack fa.folder-o fa.bed fa.caret-square-o-down fa.paper-plane-o fa.circle-o-notch fa.medkit fa.file-zip-o fa.calendar-minus-o fa.tencent-weibo fa.navicon fa.file-archive-o fa.share-alt-square fa.file-movie-o fa.building-o fa.sort-alpha-desc fa.map-signs fa.long-arrow-right fa.microphone fa.calendar-check-o fa.play-circle fa.github-alt fa.file-sound-o fa.wrench fa.play fa.hand-o-down fa.hand-rock-o fa.cc-jcb fa.compress fa.pencil-square-o fa.google-plus-square fa.angle-right fa.rotate-left fa.forumbee fa.eject fa.mobile fa.hourglass-end fa.trash-o fa.star-o fa.floppy-o fa.hand-grab-o fa.cc-discover fa.bomb fa.star-half-empty fa.random fa.fire-extinguisher fa.pencil-square fa.reddit-square fa.arrow-circle-o-down fa.caret-left fa.camera-retro fa.thumbs-o-up fa.product-hunt fa.digg fa.copyright fa.terminal fa.twitter-square fa.shopping-bag fa.stop-circle fa.photo fa.circle fa.columns fa.sign-out fa.cube fa.gittip fa.mars-stroke-v fa.file-text fa.amazon fa.smile-o fa.compass fa.list-ol fa.stumbleupon-circle fa.qq fa.yc-square fa.child fa.stop-circle-o fa.remove fa.pied-piper fa.gears fa.gbp fa.ban fa.fighter-jet fa.space-shuttle fa.steam fa.bars fa.lightbulb-o fa.map-pin fa.circle-o fa.contao fa.vine fa.align-center fa.rmb fa.bullseye fa.btc fa.close fa.calendar fa.retweet fa.hourglass fa.weibo fa.tags fa.minus-square-o fa.rouble fa.won fa.subscript fa.flickr fa.cc-amex fa.reddit fa.times-circle fa.tripadvisor fa.sort-amount-asc fa.renren fa.arrow-circle-o-right fa.pinterest-p fa.html5 fa.key fa.picture-o fa.toggle-off fa.list-alt fa.fort-awesome fa.cubes fa.tablet fa.credit-card fa.toggle-up fa.minus fa.unlock-alt fa.ils fa.cog fa.arrow-right fa.cc-paypal fa.birthday-cake fa.comment fa.bell fa.cc fa.get-pocket fa.bell-slash-o fa.header fa.bluetooth-b fa.linux fa.table fa.caret-square-o-left fa.spinner fa.thumbs-up fa.tint fa.soccer-ball-o fa.connectdevelop fa.chrome fa.trademark fa.align-right fa.quote-right fa.long-arrow-down fa.beer fa.th-list fa.eraser fa.codepen fa.square-o fa.hourglass-start fa.ruble fa.fire fa.sellsy fa.fast-forward fa.bell-slash fa.commenting fa.inr fa.hashtag fa.file-text-o fa.mortar-board fa.vimeo fa.dashboard fa.hand-o-right fa.object-group fa.rotate-right fa.anchor fa.meh-o fa.file-image-o fa.mars-stroke-h fa.calculator fa.vk fa.odnoklassniki fa.linkedin fa.jpy fa.unsorted fa.turkish-lira fa.skype fa.envelope-square fa.ship fa.dashcube fa.optin-monster fa.paw fa.venus-double fa.calendar-times-o fa.check fa.sliders fa.stack-overflow fa.file-pdf-o fa.android fa.stack-exchange fa.twitch fa.caret-right fa.dedent fa.tree fa.gratipay fa.map-marker fa.slideshare fa.binoculars fa.sticky-note fa.sheqel fa.user fa.ioxhost fa.expand fa.euro fa.bitbucket-square fa.hand-paper-o fa.database fa.rupee fa.hacker-news fa.edge fa.calendar-plus-o fa.hand-lizard-o fa.xing fa.youtube-square fa.taxi fa.sort-desc fa.rocket fa.yen fa.money fa.laptop fa.arrows-alt fa.underline fa.google-plus fa.cut fa.share-square-o fa.street-view fa.arrow-circle-up fa.plus-square fa.desktop fa.expeditedssl fa.toggle-on fa.minus-square fa.adn fa.whatsapp fa.save fa.puzzle-piece fa.css3 fa.skyatlas fa.level-down fa.mobile-phone fa.check-square-o fa.hand-spock-o fa.leanpub fa.arrow-circle-left fa.exclamation-triangle fa.gift fa.cogs fa.signal fa.frown-o fa.modx fa.battery-empty fa.chevron-circle-left fa.university fa.sitemap fa.external-link-square fa.google fa.volume-off fa.twitter fa.battery-full fa.hand-o-left fa.phone fa.mars-double fa.maxcdn fa.hand-peace-o fa.pause-circle fa.lastfm-square fa.home fa.empire fa.server fa.search-minus fa.pied-piper-alt fa.leaf fa.exclamation-circle fa.comments fa.cny fa.facebook-official fa.clock-o fa.hand-scissors-o fa.tumblr-square fa.rub fa.chevron-circle-up fa.opencart fa.barcode fa.vimeo-square fa.battery-1 fa.arrow-circle-right fa.bolt fa.paste fa.hdd-o fa.plug fa.industry fa.map-o fa.krw fa.joomla fa.sun-o fa.plus fa.life-buoy fa.play-circle-o fa.mars-stroke fa.road fa.volume-down fa.question-circle fa.image fa.angle-double-right fa.reply-all fa.inbox fa.female fa.gavel fa.life-bouy fa.jsfiddle fa.git fa.share-square fa.support fa.question fa.wordpress fa.italic fa.forward fa.steam-square fa.sort-numeric-desc fa.video-camera fa.thumbs-down fa.medium fa.chevron-right fa.bus fa.registered fa.mars fa.angle-down fa.send-o fa.link fa.eyedropper fa.mail-reply fa.bug fa.angellist fa.chain-broken fa.info fa.tumblr fa.line-chart fa.long-arrow-up fa.simplybuilt fa.trash fa.paint-brush fa.windows fa.calendar-o fa.reorder fa.suitcase fa.file-picture-o fa.arrow-circle-o-up fa.arrow-up fa.opera fa.shopping-cart fa.files-o fa.th-large fa.warning fa.at fa.file fa.star-half fa.futbol-o fa.flag-checkered fa.genderless fa.archive fa.film fa.power-off fa.heart-o fa.percent fa.google-wallet fa.book fa.transgender fa.cloud-upload fa.file-powerpoint-o fa.openid fa.repeat fa.star fa.users fa.transgender-alt fa.asterisk fa.plus-circle fa.cart-arrow-down fa.wechat fa.life-saver fa.dropbox fa.wikipedia-w fa.newspaper-o fa.building fa.bitbucket fa.yelp fa.neuter fa.behance-square fa.wifi fa.youtube fa.angle-double-down fa.sort-alpha-asc fa.area-chart fa.chevron-up fa.stethoscope fa.step-forward fa.backward

Стили, меню, тулбар, статусбар

todo темы: есть ли симпатичные в опенсорсе? Как ставить?

есть https://github.com/ColinDuquesnoy/QDarkStyleSheet

https://wiki.qt.io/Gallery_of_Qt_CSS_Based_Styles

был когда-то qtdotnetstyle, еще до qss

Разделитель в меню, тулбар, статусбар

In [22]:
class MyWindow(QMainWindow):
    def __init__(self, parent=None):
        super(MyWindow, self).__init__(parent)
        exitAction = QAction(qtawesome.icon('fa.question-circle', color='blue', color_active='orange'), '&Exit', self)
        exitAction.setShortcut('Ctrl+Q')
        exitAction.setStatusTip('Exit application')
        exitAction.triggered.connect(self.close)

        self.toolbar = self.addToolBar('Exit')
        self.toolbar.addAction(exitAction)
        
        self.combo = QComboBox()
        for k in QStyleFactory.keys():
            self.combo.addItem(k)
        self.combo.currentIndexChanged.connect(self.combo_changed)
        self.toolbar.addWidget(self.combo)

        self.statusBar()

        menubar = self.menuBar()
        fileMenu = menubar.addMenu('&File')
        fileMenu.addAction(exitAction)
        
    def combo_changed(self, arg):
        app = QCoreApplication.instance()
        style = self.combo.currentText()
        app.setStyle(QStyleFactory.create(style))

run_qt_and_screenshot(MyWindow)
Out[22]:
In [23]:
QStyleFactory.keys()
Out[23]:
[u'Windows', u'WindowsXP', u'WindowsVista', u'Fusion']

Грид

todo

  • Как установить режим выделения, получать выделение, событие изменения выделения
  • Как добавить чекбоксы в грид
  • Ресайз окна очень тормозит, возможно потому что грид спрашивает data на каждый пиксель, как этого избежать?
  • Длины скроллбаров на гриде неправильные
In [5]:
import sys
import operator
In [6]:
data = c_[arange(0, 1000, dtype='int').astype('object'), random.rand(1000), random.randn(1000)]
In [20]:
class NumpyArrayModel(QAbstractTableModel):
    data_calls_changed = pyqtSignal(int)
    def __init__(self, header, arr, parent=None):
        self.data_calls = 0
        assert len(arr.shape) == 2
        self.arr = arr
        self.header = header
        self.parent = parent
        super(NumpyArrayModel, self).__init__(parent)
    def headerData(self, section, orientation, role=Qt.DisplayRole):
        if orientation == Qt.Horizontal:
            if role == Qt.DisplayRole:
                return self.header[section]
        return QAbstractTableModel.headerData(self, section, orientation, role)
    def rowCount(self, parent):
        return self.arr.shape[0]
    def columnCount(self, parent):
        return self.arr.shape[1]
    def data(self, index, role):
        if role == Qt.DisplayRole:
            self.data_calls += 1
            self.data_calls_changed.emit(self.data_calls)
            return str(self.arr[index.row(), index.column()])
        if role == Qt.ForegroundRole and index.column() == 2:
            return QBrush(Qt.darkRed if self.arr[index.row(), index.column()] < 0 else Qt.darkGreen)
        return None
    def sort(self, Ncol, order):
        self.layoutAboutToBeChanged.emit()
        if Ncol == 2:
            self.arr = array(sorted(self.arr, key=lambda x:abs(x[2])))
        else:
            self.arr = array(sorted(self.arr, key=operator.itemgetter(Ncol)))
        if order == Qt.DescendingOrder:
            self.arr = self.arr[::-1]
        self.layoutChanged.emit()
In [21]:
class MainWindow(QWidget):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setWindowTitle('Hello, widgets')
        self.resize(640, 400)
        
        hbox = QHBoxLayout(self)

        vbox = QVBoxLayout()
        self.lbl = QLabel("foo")
        vbox.addWidget(self.lbl)
        vbox.addSpacerItem(QSpacerItem(1, 2))
        cmd = QPushButton("Click me")
        vbox.addWidget(cmd)
        import qtawesome
        
        cmd2 = QPushButton(qtawesome.icon('fa.question-circle', color='blue', color_active='orange'), "Help")
        vbox.addWidget(cmd2)
        #cmd.clicked.connect(someFunc)
        hbox.addLayout(vbox)

        txt = QTextEdit()
        hbox.addWidget(txt)
        txt.setText("Input there")

        self.model = NumpyArrayModel(['Index', 'Uniform', 'Normal'], data)
        self.model.data_calls_changed.connect(self.data_calls)
        
        self.tbl = QTableView()
        self.tbl.setMinimumWidth(300)
        self.tbl.setModel(self.model)
        self.tbl.verticalHeader().hide()
        self.tbl.verticalHeader().setSectionResizeMode(QHeaderView.Fixed)
        self.tbl.verticalHeader().setDefaultSectionSize(16)
        self.tbl.horizontalHeader().setAlternatingRowColors(True)
        self.tbl.resizeColumnsToContents()
        self.tbl.setSortingEnabled(True)
        self.tbl.setAlternatingRowColors(True)

        self.tbl.setSelectionBehavior(QTableView.SelectRows)
        self.tbl.setSelectionMode(QTableView.SingleSelection)

        selectionModel = self.tbl.selectionModel()
        selectionModel.selectionChanged.connect(lambda: self.selection_changed(selectionModel.selectedRows()))

        hbox.addWidget(self.tbl)

        self.wv = QWebView()
        #self.wv.load(QUrl("http://yandex.ru"))
        self.wv.setHtml('<b>Hello, <a href="http://google.com">world</a>!</b>')
        hbox.addWidget(self.wv)

    def data_calls(self, num):
        self.lbl.setText(str(num))
    def selection_changed(self, selected):
        html = 'Row: <b>%d</b>, column: <b>%d</b>' % (selected[0].row(), selected[0].column())
        self.wv.setHtml(html)
In [22]:
run_qt_and_screenshot(MainWindow)
Out[22]:

Дерево

todo дерево:драгндроп, обработка смены выделения, показывать развернутым

In [24]:
class TreeItem(object):
    def __init__(self, data, parent=None):
        self.parentItem = parent
        self.itemData = data
        self.childItems = []

    def appendChild(self, item):
        self.childItems.append(item)

    def child(self, row):
        return self.childItems[row]

    def childCount(self):
        return len(self.childItems)

    def columnCount(self):
        return len(self.itemData)

    def data(self, column):
        try:
            return self.itemData[column]
        except IndexError:
            return None

    def parent(self):
        return self.parentItem

    def row(self):
        if self.parentItem:
            return self.parentItem.childItems.index(self)
        return 0


class TreeModel(QAbstractItemModel):
    def __init__(self, data, parent=None):
        super(TreeModel, self).__init__(parent)
        self.rootItem = TreeItem(("Title", "Summary"))
        import re
        parents = [self.rootItem]
        indentations = [0]
        for line in data.splitlines():
            position = len(re.match('\s*', line).group())
            lineData = line[position:].strip()
            columnData = lineData.split('\t')
            if position > indentations[-1]:
                # The last child of the current parent is now the new
                # parent unless the current parent has no children.
                if parents[-1].childCount() > 0:
                    parents.append(parents[-1].child(parents[-1].childCount() - 1))
                    indentations.append(position)
            else:
                while position < indentations[-1] and len(parents) > 0:
                    parents.pop()
                    indentations.pop()
            parents[-1].appendChild(TreeItem(columnData, parents[-1]))

    def columnCount(self, parent):
        parentItem = parent.internalPointer() if parent.isValid() else self.rootItem
        return parentItem.columnCount()
    def rowCount(self, parent):
        if parent.column() > 0: return 0
        parentItem = parent.internalPointer() if parent.isValid() else self.rootItem
        return parentItem.childCount()

    def headerData(self, section, orientation, role):
        if orientation == Qt.Horizontal and role == Qt.DisplayRole:
            return self.rootItem.data(section)
        return None
    def data(self, index, role):
        if not index.isValid(): return None
        if role != Qt.DisplayRole: return None
        item = index.internalPointer()
        return item.data(index.column())

    def flags(self, index):
        if not index.isValid(): return Qt.NoItemFlags
        return Qt.ItemIsEnabled | Qt.ItemIsSelectable

    def index(self, row, column, parent):
        if not self.hasIndex(row, column, parent): return QModelIndex()
        parentItem = parent.internalPointer() if parent.isValid() else self.rootItem
        childItem = parentItem.child(row)
        if not childItem: return QModelIndex()
        return self.createIndex(row, column, childItem)

    def parent(self, index):
        if not index.isValid(): return QModelIndex()
        childItem = index.internalPointer()
        parentItem = childItem.parent()
        if parentItem == self.rootItem: return QModelIndex()
        return self.createIndex(parentItem.row(), 0, parentItem)


model = TreeModel('''data\t1
 data2\t2
  data3\t3
  data4\t4
data5\t5
 data6\tSIX''')

class MyTreeView(QTreeView):
    def __init__(self, parent=None):
        super(MyTreeView, self).__init__(parent)
        self.setModel(model)
        self.setWindowTitle("Simple Tree Model")
        self.expandAll()

run_qt_and_screenshot(MyTreeView)
Out[24]:
In [25]:
print ' '.join(dir(QTreeView))
AboveItem AdjustIgnored AdjustToContents AdjustToContentsOnFirstShow AllEditTriggers AnimatingState AnyKeyPressed BelowItem Box CollapsingState ContiguousSelection CurrentChanged CursorAction DoubleClicked DragDrop DragDropMode DragOnly DragSelectingState DraggingState DrawChildren DrawWindowBackground DropIndicatorPosition DropOnly EditKeyPressed EditTrigger EditTriggers EditingState EnsureVisible ExpandingState ExtendedSelection HLine IgnoreMask InternalMove MoveDown MoveEnd MoveHome MoveLeft MoveNext MovePageDown MovePageUp MovePrevious MoveRight MoveUp MultiSelection NoDragDrop NoEditTriggers NoFrame NoSelection NoState OnItem OnViewport PaintDeviceMetric Panel PdmDepth PdmDevicePixelRatio PdmDevicePixelRatioScaled PdmDpiX PdmDpiY PdmHeight PdmHeightMM PdmNumColors PdmPhysicalDpiX PdmPhysicalDpiY PdmWidth PdmWidthMM Plain PositionAtBottom PositionAtCenter PositionAtTop Raised RenderFlag RenderFlags ScrollHint ScrollMode ScrollPerItem ScrollPerPixel SelectColumns SelectItems SelectRows SelectedClicked SelectionBehavior SelectionMode Shadow Shadow_Mask Shape Shape_Mask SingleSelection SizeAdjustPolicy State StyleMask StyledPanel Sunken VLine WinPanel __class__ __delattr__ __dict__ __doc__ __format__ __getattr__ __getattribute__ __hash__ __init__ __module__ __new__ __reduce__ __reduce_ex__ __repr__ __setattr__ __sizeof__ __str__ __subclasshook__ __weakref__ acceptDrops accessibleDescription accessibleName actionEvent actions activateWindow activated addAction addActions addScrollBarWidget adjustSize allColumnsShowFocus alternatingRowColors autoExpandDelay autoFillBackground autoScrollMargin backgroundRole baseSize blockSignals changeEvent childAt childEvent children childrenRect childrenRegion clearFocus clearMask clearSelection clicked close closeEditor closeEvent closePersistentEditor collapse collapseAll collapsed colorCount columnAt columnCountChanged columnMoved columnResized columnViewportPosition columnWidth commitData connectNotify contentsMargins contentsRect contextMenuEvent contextMenuPolicy cornerWidget create createWindowContainer currentChanged currentIndex cursor customContextMenuRequested customEvent dataChanged defaultDropAction deleteLater depth destroy destroyed devType devicePixelRatio devicePixelRatioF devicePixelRatioFScale dirtyRegionOffset disconnect disconnectNotify doubleClicked dragDropMode dragDropOverwriteMode dragEnabled dragEnterEvent dragLeaveEvent dragMoveEvent drawBranches drawFrame drawRow drawTree dropEvent dropIndicatorPosition dumpObjectInfo dumpObjectTree dynamicPropertyNames edit editTriggers editorDestroyed effectiveWinId ensurePolished enterEvent entered event eventFilter executeDelayedItemsLayout expand expandAll expandToDepth expanded expandsOnDoubleClick find findChild findChildren focusInEvent focusNextChild focusNextPrevChild focusOutEvent focusPolicy focusPreviousChild focusProxy focusWidget font fontInfo fontMetrics foregroundRole frameGeometry frameRect frameShadow frameShape frameSize frameStyle frameWidth geometry getContentsMargins grab grabGesture grabKeyboard grabMouse grabShortcut graphicsEffect graphicsProxyWidget hasAutoScroll hasFocus hasHeightForWidth hasMouseTracking header height heightForWidth heightMM hide hideColumn hideEvent horizontalOffset horizontalScrollBar horizontalScrollBarPolicy horizontalScrollMode horizontalScrollbarAction horizontalScrollbarValueChanged iconSize iconSizeChanged indentation indexAbove indexAt indexBelow indexRowSizeHint indexWidget inherits initPainter initStyleOption inputMethodEvent inputMethodHints inputMethodQuery insertAction insertActions installEventFilter isActiveWindow isAncestorOf isAnimated isColumnHidden isEnabled isEnabledTo isExpanded isFirstColumnSpanned isFullScreen isHeaderHidden isHidden isIndexHidden isLeftToRight isMaximized isMinimized isModal isRightToLeft isRowHidden isSignalConnected isSortingEnabled isVisible isVisibleTo isWidgetType isWindow isWindowModified isWindowType itemDelegate itemDelegateForColumn itemDelegateForRow itemsExpandable keyPressEvent keyReleaseEvent keyboardGrabber keyboardSearch killTimer layout layoutDirection leaveEvent lineWidth locale logicalDpiX logicalDpiY lower mapFrom mapFromGlobal mapFromParent mapTo mapToGlobal mapToParent mask maximumHeight maximumSize maximumViewportSize maximumWidth metaObject metric midLineWidth minimumHeight minimumSize minimumSizeHint minimumWidth model mouseDoubleClickEvent mouseGrabber mouseMoveEvent mousePressEvent mouseReleaseEvent move moveCursor moveEvent moveToThread nativeEvent nativeParentWidget nextInFocusChain normalGeometry objectName objectNameChanged openPersistentEditor overrideWindowFlags overrideWindowState paintEngine paintEvent paintingActive palette parent parentWidget physicalDpiX physicalDpiY pos pressed previousInFocusChain property pyqtConfigure raise_ receivers rect reexpand releaseKeyboard releaseMouse releaseShortcut removeAction removeEventFilter render repaint reset resetIndentation resize resizeColumnToContents resizeEvent restoreGeometry rootIndex rootIsDecorated rowHeight rowsAboutToBeRemoved rowsInserted rowsRemoved saveGeometry scheduleDelayedItemsLayout scroll scrollBarWidgets scrollContentsBy scrollDirtyRegion scrollTo scrollToBottom scrollToTop selectAll selectedIndexes selectionBehavior selectionChanged selectionCommand selectionMode selectionModel sender senderSignalIndex setAcceptDrops setAccessibleDescription setAccessibleName setAllColumnsShowFocus setAlternatingRowColors setAnimated setAttribute setAutoExpandDelay setAutoFillBackground setAutoScroll setAutoScrollMargin setBackgroundRole setBaseSize setColumnHidden setColumnWidth setContentsMargins setContextMenuPolicy setCornerWidget setCurrentIndex setCursor setDefaultDropAction setDirtyRegion setDisabled setDragDropMode setDragDropOverwriteMode setDragEnabled setDropIndicatorShown setEditTriggers setEnabled setExpanded setExpandsOnDoubleClick setFirstColumnSpanned setFixedHeight setFixedSize setFixedWidth setFocus setFocusPolicy setFocusProxy setFont setForegroundRole setFrameRect setFrameShadow setFrameShape setFrameStyle setGeometry setGraphicsEffect setHeader setHeaderHidden setHidden setHorizontalScrollBar setHorizontalScrollBarPolicy setHorizontalScrollMode setIconSize setIndentation setIndexWidget setInputMethodHints setItemDelegate setItemDelegateForColumn setItemDelegateForRow setItemsExpandable setLayout setLayoutDirection setLineWidth setLocale setMask setMaximumHeight setMaximumSize setMaximumWidth setMidLineWidth setMinimumHeight setMinimumSize setMinimumWidth setModel setMouseTracking setObjectName setPalette setParent setProperty setRootIndex setRootIsDecorated setRowHidden setSelection setSelectionBehavior setSelectionMode setSelectionModel setShortcutAutoRepeat setShortcutEnabled setSizeAdjustPolicy setSizeIncrement setSizePolicy setSortingEnabled setState setStatusTip setStyle setStyleSheet setTabKeyNavigation setTabOrder setTextElideMode setToolTip setToolTipDuration setTreePosition setUniformRowHeights setUpdatesEnabled setVerticalScrollBar setVerticalScrollBarPolicy setVerticalScrollMode setViewport setViewportMargins setVisible setWhatsThis setWindowFilePath setWindowFlags setWindowIcon setWindowIconText setWindowModality setWindowModified setWindowOpacity setWindowRole setWindowState setWindowTitle setWordWrap setupViewport sharedPainter show showColumn showDropIndicator showEvent showFullScreen showMaximized showMinimized showNormal signalsBlocked size sizeAdjustPolicy sizeHint sizeHintForColumn sizeHintForIndex sizeHintForRow sizeIncrement sizePolicy sortByColumn stackUnder startDrag startTimer state staticMetaObject statusTip style styleSheet tabKeyNavigation tabletEvent testAttribute textElideMode thread timerEvent toolTip toolTipDuration tr treePosition underMouse ungrabGesture uniformRowHeights unsetCursor unsetLayoutDirection unsetLocale update updateEditorData updateEditorGeometries updateGeometries updateGeometry updateMicroFocus updatesEnabled verticalOffset verticalScrollBar verticalScrollBarPolicy verticalScrollMode verticalScrollbarAction verticalScrollbarValueChanged viewOptions viewport viewportEntered viewportEvent viewportMargins viewportSizeHint visibleRegion visualRect visualRegionForSelection whatsThis wheelEvent width widthMM winId window windowFilePath windowFlags windowHandle windowIcon windowIconChanged windowIconText windowIconTextChanged windowModality windowOpacity windowRole windowState windowTitle windowTitleChanged windowType wordWrap x y

Scintilla

Самым популярным компонентом для подсвеченного текста является Scintilla, которую использует, например, Notepad++. Для Qt существует враппер с Python-оберткой в свою очередь для него. Хороший обзор QScintilla можно найти здесь https://qscintilla.com/

http://pyqt.sourceforge.net/Docs/QScintilla2/classQsciLexer.html

https://qscintilla.com/downloads/qscintilla_docs.pdf

https://scintilla.org/ScintillaDoc.html

conda install -c cogsci qscintilla2

todo

SCI_STYLESETFONT(int style, const char *fontName)
SCI_STYLESETSIZE(int style, int sizePoints)
SCI_STYLESETBOLD(int style, bool bold)
SCI_STYLESETITALIC(int style, bool italic)
SCI_STYLESETUNDERLINE(int style, bool underline)
SCI_STYLESETFORE(int style, colour fore)
SCI_STYLESETBACK(int style, colour back)
SCI_STYLESETCHANGEABLE(int style, bool changeable)
SCI_STYLESETHOTSPOT(int style, bool hotspot)
In [34]:
print QsciLexerPython().lexer(), QsciLexerPython().language(), QsciLexerPython().description(4)
python Python Single-quoted string
In [35]:
print QsciLexerPython.Comment, QsciLexerPython.Number
1 2
In [31]:
from PyQt5.Qsci import QsciScintilla, QsciLexerPython
In [27]:
import xmltodict
from ultra import file_get

theme = xmltodict.parse(file_get("C:\\Program Files (x86)\\Notepad++\\themes\\Solarized-light.xml"))

style = [
    lexer_record['WordsStyle']
    for lexer_record in theme['NotepadPlus']['LexerStyles']['LexerType']
    if lexer_record['@name'] == 'python'
][0]

global_style = theme['NotepadPlus']['GlobalStyles']['WidgetStyle']

todo

  • менять стрелку влево на стрелку вправо на Margin?
  • collapsed-expanded
  • ссылки, обработка кликов на них
  • интеллисенс?
  • получение выделения
  • установление курсора/скролла, выделения
  • подсветка таких же выделенных слов
  • выделенный в Notepad++ текст имеет цвета, а у меня всегда белый
  • Настройки Scintilla из Notepad++?
  • Как прикрутить лексеры из Notepad++? pygments? Как подсвечивать синтаксис вставленных в текст блоков кода на разных языках?
In [12]:
for item in dir(QsciScintilla):
    print item,
ANNOTATION_BOXED ANNOTATION_HIDDEN ANNOTATION_INDENTED ANNOTATION_STANDARD AcsAPIs AcsAll AcsDocument AcsNone AcusAlways AcusExplicit AcusNever AdjustIgnored AdjustToContents AdjustToContentsOnFirstShow AiClosing AiMaintain AiOpening AnnotationBoxed AnnotationDisplay AnnotationHidden AnnotationIndented AnnotationStandard AutoCompletionSource AutoCompletionUseSingle Background Bookmark BottomLeftCorner Box BoxIndicator BoxedFoldStyle BoxedMinus BoxedMinusConnected BoxedPlus BoxedPlusConnected BoxedTreeFoldStyle BraceMatch CARETSTYLE_BLOCK CARETSTYLE_INVISIBLE CARETSTYLE_LINE CARET_EVEN CARET_JUMPS CARET_SLOP CARET_STRICT CallTipsAboveText CallTipsBelowText CallTipsContext CallTipsNoAutoCompletionContext CallTipsNoContext CallTipsNone CallTipsPosition CallTipsStyle Circle CircledFoldStyle CircledMinus CircledMinusConnected CircledPlus CircledPlusConnected CircledTreeFoldStyle DashesIndicator DiagonalIndicator DotBoxIndicator DotsIndicator DownTriangle DrawChildren DrawWindowBackground EDGE_BACKGROUND EDGE_LINE EDGE_NONE EdgeBackground EdgeLine EdgeMode EdgeNone EolMac EolMode EolUnix EolWindows FoldStyle FullBoxIndicator FullRectangle HLine HiddenIndicator INDIC0_MASK INDIC1_MASK INDIC2_MASK INDICS_MASK INDIC_BOX INDIC_COMPOSITIONTHICK INDIC_COMPOSITIONTHIN INDIC_CONTAINER INDIC_DASH INDIC_DIAGONAL INDIC_DOTBOX INDIC_DOTS INDIC_FULLBOX INDIC_HIDDEN INDIC_IME INDIC_IME_MAX INDIC_MAX INDIC_PLAIN INDIC_ROUNDBOX INDIC_SQUIGGLE INDIC_SQUIGGLELOW INDIC_SQUIGGLEPIXMAP INDIC_STRAIGHTBOX INDIC_STRIKE INDIC_TEXTFORE INDIC_TT IgnoreMask IndicatorStyle Invisible LeftRectangle LeftSideRoundedSplitter LeftSideSplitter MarginType MarkerSymbol Minus MoNone MoSublineSelect NoBraceMatch NoFoldStyle NoFrame NumberMargin PaintDeviceMetric Panel PdmDepth PdmDevicePixelRatio PdmDevicePixelRatioScaled PdmDpiX PdmDpiY PdmHeight PdmHeightMM PdmNumColors PdmPhysicalDpiX PdmPhysicalDpiY PdmWidth PdmWidthMM Plain PlainFoldStyle PlainIndicator Plus QSCN_SELCHANGED Raised Rectangle RenderFlag RenderFlags RightArrow RightTriangle RoundBoxIndicator RoundedBottomLeftCorner SCEN_CHANGE SCFIND_CXX11REGEX SCFIND_MATCHCASE SCFIND_POSIX SCFIND_REGEXP SCFIND_WHOLEWORD SCFIND_WORDSTART SCI_ADDREFDOCUMENT SCI_ADDSELECTION SCI_ADDSTYLEDTEXT SCI_ADDTABSTOP SCI_ADDTEXT SCI_ADDUNDOACTION SCI_ALLOCATE SCI_ALLOCATEEXTENDEDSTYLES SCI_ALLOCATESUBSTYLES SCI_ANNOTATIONCLEARALL SCI_ANNOTATIONGETLINES SCI_ANNOTATIONGETSTYLE SCI_ANNOTATIONGETSTYLEOFFSET SCI_ANNOTATIONGETSTYLES SCI_ANNOTATIONGETTEXT SCI_ANNOTATIONGETVISIBLE SCI_ANNOTATIONSETSTYLE SCI_ANNOTATIONSETSTYLEOFFSET SCI_ANNOTATIONSETSTYLES SCI_ANNOTATIONSETTEXT SCI_ANNOTATIONSETVISIBLE SCI_APPENDTEXT SCI_ASSIGNCMDKEY SCI_AUTOCACTIVE SCI_AUTOCCANCEL SCI_AUTOCCOMPLETE SCI_AUTOCGETAUTOHIDE SCI_AUTOCGETCANCELATSTART SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR SCI_AUTOCGETCHOOSESINGLE SCI_AUTOCGETCURRENT SCI_AUTOCGETCURRENTTEXT SCI_AUTOCGETDROPRESTOFWORD SCI_AUTOCGETIGNORECASE SCI_AUTOCGETMAXHEIGHT SCI_AUTOCGETMAXWIDTH SCI_AUTOCGETMULTI SCI_AUTOCGETORDER SCI_AUTOCGETSEPARATOR SCI_AUTOCGETTYPESEPARATOR SCI_AUTOCPOSSTART SCI_AUTOCSELECT SCI_AUTOCSETAUTOHIDE SCI_AUTOCSETCANCELATSTART SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR SCI_AUTOCSETCHOOSESINGLE SCI_AUTOCSETDROPRESTOFWORD SCI_AUTOCSETFILLUPS SCI_AUTOCSETIGNORECASE SCI_AUTOCSETMAXHEIGHT SCI_AUTOCSETMAXWIDTH SCI_AUTOCSETMULTI SCI_AUTOCSETORDER SCI_AUTOCSETSEPARATOR SCI_AUTOCSETTYPESEPARATOR SCI_AUTOCSHOW SCI_AUTOCSTOPS SCI_BACKTAB SCI_BEGINUNDOACTION SCI_BRACEBADLIGHT SCI_BRACEBADLIGHTINDICATOR SCI_BRACEHIGHLIGHT SCI_BRACEHIGHLIGHTINDICATOR SCI_BRACEMATCH SCI_CALLTIPACTIVE SCI_CALLTIPCANCEL SCI_CALLTIPPOSSTART SCI_CALLTIPSETBACK SCI_CALLTIPSETFORE SCI_CALLTIPSETFOREHLT SCI_CALLTIPSETHLT SCI_CALLTIPSETPOSITION SCI_CALLTIPSETPOSSTART SCI_CALLTIPSHOW SCI_CALLTIPUSESTYLE SCI_CANCEL SCI_CANPASTE SCI_CANREDO SCI_CANUNDO SCI_CHANGEINSERTION SCI_CHANGELEXERSTATE SCI_CHARLEFT SCI_CHARLEFTEXTEND SCI_CHARLEFTRECTEXTEND SCI_CHARPOSITIONFROMPOINT SCI_CHARPOSITIONFROMPOINTCLOSE SCI_CHARRIGHT SCI_CHARRIGHTEXTEND SCI_CHARRIGHTRECTEXTEND SCI_CHOOSECARETX SCI_CLEAR SCI_CLEARALL SCI_CLEARALLCMDKEYS SCI_CLEARCMDKEY SCI_CLEARDOCUMENTSTYLE SCI_CLEARREGISTEREDIMAGES SCI_CLEARREPRESENTATION SCI_CLEARSELECTIONS SCI_CLEARTABSTOPS SCI_COLOURISE SCI_CONTRACTEDFOLDNEXT SCI_CONVERTEOLS SCI_COPY SCI_COPYALLOWLINE SCI_COPYRANGE SCI_COPYTEXT SCI_COUNTCHARACTERS SCI_CREATEDOCUMENT SCI_CREATELOADER SCI_CUT SCI_DELETEBACK SCI_DELETEBACKNOTLINE SCI_DELETERANGE SCI_DELLINELEFT SCI_DELLINERIGHT SCI_DELWORDLEFT SCI_DELWORDRIGHT SCI_DELWORDRIGHTEND SCI_DESCRIBEKEYWORDSETS SCI_DESCRIBEPROPERTY SCI_DISTANCETOSECONDARYSTYLES SCI_DOCLINEFROMVISIBLE SCI_DOCUMENTEND SCI_DOCUMENTENDEXTEND SCI_DOCUMENTSTART SCI_DOCUMENTSTARTEXTEND SCI_DROPSELECTIONN SCI_EDITTOGGLEOVERTYPE SCI_EMPTYUNDOBUFFER SCI_ENDUNDOACTION SCI_ENSUREVISIBLE SCI_ENSUREVISIBLEENFORCEPOLICY SCI_EXPANDCHILDREN SCI_FINDCOLUMN SCI_FINDINDICATORFLASH SCI_FINDINDICATORHIDE SCI_FINDINDICATORSHOW SCI_FINDTEXT SCI_FOLDALL SCI_FOLDCHILDREN SCI_FOLDLINE SCI_FORMATRANGE SCI_FORMFEED SCI_FREESUBSTYLES SCI_GETADDITIONALCARETFORE SCI_GETADDITIONALCARETSBLINK SCI_GETADDITIONALCARETSVISIBLE SCI_GETADDITIONALSELALPHA SCI_GETADDITIONALSELECTIONTYPING SCI_GETALLLINESVISIBLE SCI_GETANCHOR SCI_GETAUTOMATICFOLD SCI_GETBACKSPACEUNINDENTS SCI_GETBUFFEREDDRAW SCI_GETCARETFORE SCI_GETCARETLINEBACK SCI_GETCARETLINEBACKALPHA SCI_GETCARETLINEVISIBLE SCI_GETCARETLINEVISIBLEALWAYS SCI_GETCARETPERIOD SCI_GETCARETSTICKY SCI_GETCARETSTYLE SCI_GETCARETWIDTH SCI_GETCHARACTERPOINTER SCI_GETCHARAT SCI_GETCODEPAGE SCI_GETCOLUMN SCI_GETCONTROLCHARSYMBOL SCI_GETCURLINE SCI_GETCURRENTPOS SCI_GETCURSOR SCI_GETDIRECTFUNCTION SCI_GETDIRECTPOINTER SCI_GETDOCPOINTER SCI_GETEDGECOLOUR SCI_GETEDGECOLUMN SCI_GETEDGEMODE SCI_GETENDATLASTLINE SCI_GETENDSTYLED SCI_GETEOLMODE SCI_GETEXTRAASCENT SCI_GETEXTRADESCENT SCI_GETFIRSTVISIBLELINE SCI_GETFOCUS SCI_GETFOLDEXPANDED SCI_GETFOLDLEVEL SCI_GETFOLDPARENT SCI_GETFONTQUALITY SCI_GETGAPPOSITION SCI_GETHIGHLIGHTGUIDE SCI_GETHOTSPOTACTIVEBACK SCI_GETHOTSPOTACTIVEFORE SCI_GETHOTSPOTACTIVEUNDERLINE SCI_GETHOTSPOTSINGLELINE SCI_GETHSCROLLBAR SCI_GETIDENTIFIER SCI_GETIMEINTERACTION SCI_GETINDENT SCI_GETINDENTATIONGUIDES SCI_GETINDICATORCURRENT SCI_GETINDICATORVALUE SCI_GETKEYSUNICODE SCI_GETLASTCHILD SCI_GETLAYOUTCACHE SCI_GETLENGTH SCI_GETLEXER SCI_GETLEXERLANGUAGE SCI_GETLINE SCI_GETLINECOUNT SCI_GETLINEENDPOSITION SCI_GETLINEENDTYPESACTIVE SCI_GETLINEENDTYPESALLOWED SCI_GETLINEENDTYPESSUPPORTED SCI_GETLINEINDENTATION SCI_GETLINEINDENTPOSITION SCI_GETLINESELENDPOSITION SCI_GETLINESELSTARTPOSITION SCI_GETLINESTATE SCI_GETLINEVISIBLE SCI_GETMAINSELECTION SCI_GETMARGINCURSORN SCI_GETMARGINLEFT SCI_GETMARGINMASKN SCI_GETMARGINOPTIONS SCI_GETMARGINRIGHT SCI_GETMARGINSENSITIVEN SCI_GETMARGINTYPEN SCI_GETMARGINWIDTHN SCI_GETMAXLINESTATE SCI_GETMODEVENTMASK SCI_GETMODIFY SCI_GETMOUSEDOWNCAPTURES SCI_GETMOUSEDWELLTIME SCI_GETMOUSESELECTIONRECTANGULARSWITCH SCI_GETMULTIPASTE SCI_GETMULTIPLESELECTION SCI_GETNEXTTABSTOP SCI_GETOVERTYPE SCI_GETPASTECONVERTENDINGS SCI_GETPHASESDRAW SCI_GETPOSITIONCACHE SCI_GETPRIMARYSTYLEFROMSTYLE SCI_GETPRINTCOLOURMODE SCI_GETPRINTMAGNIFICATION SCI_GETPRINTWRAPMODE SCI_GETPROPERTY SCI_GETPROPERTYEXPANDED SCI_GETPROPERTYINT SCI_GETPUNCTUATIONCHARS SCI_GETRANGEPOINTER SCI_GETREADONLY SCI_GETRECTANGULARSELECTIONANCHOR SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE SCI_GETRECTANGULARSELECTIONCARET SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE SCI_GETRECTANGULARSELECTIONMODIFIER SCI_GETREPRESENTATION SCI_GETSCROLLWIDTH SCI_GETSCROLLWIDTHTRACKING SCI_GETSEARCHFLAGS SCI_GETSELALPHA SCI_GETSELECTIONEMPTY SCI_GETSELECTIONEND SCI_GETSELECTIONMODE SCI_GETSELECTIONNANCHOR SCI_GETSELECTIONNANCHORVIRTUALSPACE SCI_GETSELECTIONNCARET SCI_GETSELECTIONNCARETVIRTUALSPACE SCI_GETSELECTIONNEND SCI_GETSELECTIONNSTART SCI_GETSELECTIONS SCI_GETSELECTIONSTART SCI_GETSELEOLFILLED SCI_GETSELTEXT SCI_GETSTATUS SCI_GETSTYLEAT SCI_GETSTYLEBITS SCI_GETSTYLEBITSNEEDED SCI_GETSTYLEDTEXT SCI_GETSTYLEFROMSUBSTYLE SCI_GETSUBSTYLEBASES SCI_GETSUBSTYLESLENGTH SCI_GETSUBSTYLESSTART SCI_GETTABINDENTS SCI_GETTABWIDTH SCI_GETTAG SCI_GETTARGETEND SCI_GETTARGETRANGE SCI_GETTARGETSTART SCI_GETTECHNOLOGY SCI_GETTEXT SCI_GETTEXTLENGTH SCI_GETTEXTRANGE SCI_GETTWOPHASEDRAW SCI_GETUNDOCOLLECTION SCI_GETUSETABS SCI_GETVIEWEOL SCI_GETVIEWWS SCI_GETVIRTUALSPACEOPTIONS SCI_GETVSCROLLBAR SCI_GETWHITESPACECHARS SCI_GETWHITESPACESIZE SCI_GETWORDCHARS SCI_GETWRAPINDENTMODE SCI_GETWRAPMODE SCI_GETWRAPSTARTINDENT SCI_GETWRAPVISUALFLAGS SCI_GETWRAPVISUALFLAGSLOCATION SCI_GETXOFFSET SCI_GETZOOM SCI_GOTOLINE SCI_GOTOPOS SCI_GRABFOCUS SCI_HIDELINES SCI_HIDESELECTION SCI_HOME SCI_HOMEDISPLAY SCI_HOMEDISPLAYEXTEND SCI_HOMEEXTEND SCI_HOMERECTEXTEND SCI_HOMEWRAP SCI_HOMEWRAPEXTEND SCI_INDICATORALLONFOR SCI_INDICATORCLEARRANGE SCI_INDICATOREND SCI_INDICATORFILLRANGE SCI_INDICATORSTART SCI_INDICATORVALUEAT SCI_INDICGETALPHA SCI_INDICGETFLAGS SCI_INDICGETFORE SCI_INDICGETHOVERFORE SCI_INDICGETHOVERSTYLE SCI_INDICGETOUTLINEALPHA SCI_INDICGETSTYLE SCI_INDICGETUNDER SCI_INDICSETALPHA SCI_INDICSETFLAGS SCI_INDICSETFORE SCI_INDICSETHOVERFORE SCI_INDICSETHOVERSTYLE SCI_INDICSETOUTLINEALPHA SCI_INDICSETSTYLE SCI_INDICSETUNDER SCI_INSERTTEXT SCI_LEXER_START SCI_LINECOPY SCI_LINECUT SCI_LINEDELETE SCI_LINEDOWN SCI_LINEDOWNEXTEND SCI_LINEDOWNRECTEXTEND SCI_LINEDUPLICATE SCI_LINEEND SCI_LINEENDDISPLAY SCI_LINEENDDISPLAYEXTEND SCI_LINEENDEXTEND SCI_LINEENDRECTEXTEND SCI_LINEENDWRAP SCI_LINEENDWRAPEXTEND SCI_LINEFROMPOSITION SCI_LINELENGTH SCI_LINESCROLL SCI_LINESCROLLDOWN SCI_LINESCROLLUP SCI_LINESJOIN SCI_LINESONSCREEN SCI_LINESSPLIT SCI_LINETRANSPOSE SCI_LINEUP SCI_LINEUPEXTEND SCI_LINEUPRECTEXTEND SCI_LOADLEXERLIBRARY SCI_LOWERCASE SCI_MARGINGETSTYLE SCI_MARGINGETSTYLEOFFSET SCI_MARGINGETSTYLES SCI_MARGINGETTEXT SCI_MARGINSETSTYLE SCI_MARGINSETSTYLEOFFSET SCI_MARGINSETSTYLES SCI_MARGINSETTEXT SCI_MARGINTEXTCLEARALL SCI_MARKERADD SCI_MARKERADDSET SCI_MARKERDEFINE SCI_MARKERDEFINEPIXMAP SCI_MARKERDEFINERGBAIMAGE SCI_MARKERDELETE SCI_MARKERDELETEALL SCI_MARKERDELETEHANDLE SCI_MARKERENABLEHIGHLIGHT SCI_MARKERGET SCI_MARKERLINEFROMHANDLE SCI_MARKERNEXT SCI_MARKERPREVIOUS SCI_MARKERSETALPHA SCI_MARKERSETBACK SCI_MARKERSETBACKSELECTED SCI_MARKERSETFORE SCI_MARKERSYMBOLDEFINED SCI_MOVECARETINSIDEVIEW SCI_MOVESELECTEDLINESDOWN SCI_MOVESELECTEDLINESUP SCI_NEWLINE SCI_NULL SCI_OPTIONAL_START SCI_PAGEDOWN SCI_PAGEDOWNEXTEND SCI_PAGEDOWNRECTEXTEND SCI_PAGEUP SCI_PAGEUPEXTEND SCI_PAGEUPRECTEXTEND SCI_PARADOWN SCI_PARADOWNEXTEND SCI_PARAUP SCI_PARAUPEXTEND SCI_PASTE SCI_POINTXFROMPOSITION SCI_POINTYFROMPOSITION SCI_POSITIONAFTER SCI_POSITIONBEFORE SCI_POSITIONFROMLINE SCI_POSITIONFROMPOINT SCI_POSITIONFROMPOINTCLOSE SCI_POSITIONRELATIVE SCI_PRIVATELEXERCALL SCI_PROPERTYNAMES SCI_PROPERTYTYPE SCI_REDO SCI_REGISTERIMAGE SCI_REGISTERRGBAIMAGE SCI_RELEASEALLEXTENDEDSTYLES SCI_RELEASEDOCUMENT SCI_REPLACESEL SCI_REPLACETARGET SCI_REPLACETARGETRE SCI_RGBAIMAGESETHEIGHT SCI_RGBAIMAGESETSCALE SCI_RGBAIMAGESETWIDTH SCI_ROTATESELECTION SCI_SCROLLCARET SCI_SCROLLRANGE SCI_SCROLLTOEND SCI_SCROLLTOSTART SCI_SEARCHANCHOR SCI_SEARCHINTARGET SCI_SEARCHNEXT SCI_SEARCHPREV SCI_SELECTALL SCI_SELECTIONDUPLICATE SCI_SELECTIONISRECTANGLE SCI_SETADDITIONALCARETFORE SCI_SETADDITIONALCARETSBLINK SCI_SETADDITIONALCARETSVISIBLE SCI_SETADDITIONALSELALPHA SCI_SETADDITIONALSELBACK SCI_SETADDITIONALSELECTIONTYPING SCI_SETADDITIONALSELFORE SCI_SETANCHOR SCI_SETAUTOMATICFOLD SCI_SETBACKSPACEUNINDENTS SCI_SETBUFFEREDDRAW SCI_SETCARETFORE SCI_SETCARETLINEBACK SCI_SETCARETLINEBACKALPHA SCI_SETCARETLINEVISIBLE SCI_SETCARETLINEVISIBLEALWAYS SCI_SETCARETPERIOD SCI_SETCARETSTICKY SCI_SETCARETSTYLE SCI_SETCARETWIDTH SCI_SETCHARSDEFAULT SCI_SETCODEPAGE SCI_SETCONTROLCHARSYMBOL SCI_SETCURRENTPOS SCI_SETCURSOR SCI_SETDOCPOINTER SCI_SETEDGECOLOUR SCI_SETEDGECOLUMN SCI_SETEDGEMODE SCI_SETEMPTYSELECTION SCI_SETENDATLASTLINE SCI_SETEOLMODE SCI_SETEXTRAASCENT SCI_SETEXTRADESCENT SCI_SETFIRSTVISIBLELINE SCI_SETFOCUS SCI_SETFOLDEXPANDED SCI_SETFOLDFLAGS SCI_SETFOLDLEVEL SCI_SETFOLDMARGINCOLOUR SCI_SETFOLDMARGINHICOLOUR SCI_SETFONTQUALITY SCI_SETHIGHLIGHTGUIDE SCI_SETHOTSPOTACTIVEBACK SCI_SETHOTSPOTACTIVEFORE SCI_SETHOTSPOTACTIVEUNDERLINE SCI_SETHOTSPOTSINGLELINE SCI_SETHSCROLLBAR SCI_SETIDENTIFIER SCI_SETIDENTIFIERS SCI_SETIMEINTERACTION SCI_SETINDENT SCI_SETINDENTATIONGUIDES SCI_SETINDICATORCURRENT SCI_SETINDICATORVALUE SCI_SETKEYSUNICODE SCI_SETKEYWORDS SCI_SETLAYOUTCACHE SCI_SETLEXER SCI_SETLEXERLANGUAGE SCI_SETLINEENDTYPESALLOWED SCI_SETLINEINDENTATION SCI_SETLINESTATE SCI_SETMAINSELECTION SCI_SETMARGINCURSORN SCI_SETMARGINLEFT SCI_SETMARGINMASKN SCI_SETMARGINOPTIONS SCI_SETMARGINRIGHT SCI_SETMARGINSENSITIVEN SCI_SETMARGINTYPEN SCI_SETMARGINWIDTHN SCI_SETMODEVENTMASK SCI_SETMOUSEDOWNCAPTURES SCI_SETMOUSEDWELLTIME SCI_SETMOUSESELECTIONRECTANGULARSWITCH SCI_SETMULTIPASTE SCI_SETMULTIPLESELECTION SCI_SETOVERTYPE SCI_SETPASTECONVERTENDINGS SCI_SETPHASESDRAW SCI_SETPOSITIONCACHE SCI_SETPRINTCOLOURMODE SCI_SETPRINTMAGNIFICATION SCI_SETPRINTWRAPMODE SCI_SETPROPERTY SCI_SETPUNCTUATIONCHARS SCI_SETREADONLY SCI_SETRECTANGULARSELECTIONANCHOR SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE SCI_SETRECTANGULARSELECTIONCARET SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE SCI_SETRECTANGULARSELECTIONMODIFIER SCI_SETREPRESENTATION SCI_SETSAVEPOINT SCI_SETSCROLLWIDTH SCI_SETSCROLLWIDTHTRACKING SCI_SETSEARCHFLAGS SCI_SETSEL SCI_SETSELALPHA SCI_SETSELBACK SCI_SETSELECTION SCI_SETSELECTIONEND SCI_SETSELECTIONMODE SCI_SETSELECTIONNANCHOR SCI_SETSELECTIONNANCHORVIRTUALSPACE SCI_SETSELECTIONNCARET SCI_SETSELECTIONNCARETVIRTUALSPACE SCI_SETSELECTIONNEND SCI_SETSELECTIONNSTART SCI_SETSELECTIONSTART SCI_SETSELEOLFILLED SCI_SETSELFORE SCI_SETSTATUS SCI_SETSTYLEBITS SCI_SETSTYLING SCI_SETSTYLINGEX SCI_SETTABINDENTS SCI_SETTABWIDTH SCI_SETTARGETEND SCI_SETTARGETRANGE SCI_SETTARGETSTART SCI_SETTECHNOLOGY SCI_SETTEXT SCI_SETTWOPHASEDRAW SCI_SETUNDOCOLLECTION SCI_SETUSETABS SCI_SETVIEWEOL SCI_SETVIEWWS SCI_SETVIRTUALSPACEOPTIONS SCI_SETVISIBLEPOLICY SCI_SETVSCROLLBAR SCI_SETWHITESPACEBACK SCI_SETWHITESPACECHARS SCI_SETWHITESPACEFORE SCI_SETWHITESPACESIZE SCI_SETWORDCHARS SCI_SETWRAPINDENTMODE SCI_SETWRAPMODE SCI_SETWRAPSTARTINDENT SCI_SETWRAPVISUALFLAGS SCI_SETWRAPVISUALFLAGSLOCATION SCI_SETXCARETPOLICY SCI_SETXOFFSET SCI_SETYCARETPOLICY SCI_SETZOOM SCI_SHOWLINES SCI_START SCI_STARTRECORD SCI_STARTSTYLING SCI_STOPRECORD SCI_STUTTEREDPAGEDOWN SCI_STUTTEREDPAGEDOWNEXTEND SCI_STUTTEREDPAGEUP SCI_STUTTEREDPAGEUPEXTEND SCI_STYLECLEARALL SCI_STYLEGETBACK SCI_STYLEGETBOLD SCI_STYLEGETCASE SCI_STYLEGETCHANGEABLE SCI_STYLEGETCHARACTERSET SCI_STYLEGETEOLFILLED SCI_STYLEGETFONT SCI_STYLEGETFORE SCI_STYLEGETHOTSPOT SCI_STYLEGETITALIC SCI_STYLEGETSIZE SCI_STYLEGETSIZEFRACTIONAL SCI_STYLEGETUNDERLINE SCI_STYLEGETVISIBLE SCI_STYLEGETWEIGHT SCI_STYLERESETDEFAULT SCI_STYLESETBACK SCI_STYLESETBOLD SCI_STYLESETCASE SCI_STYLESETCHANGEABLE SCI_STYLESETCHARACTERSET SCI_STYLESETEOLFILLED SCI_STYLESETFONT SCI_STYLESETFORE SCI_STYLESETHOTSPOT SCI_STYLESETITALIC SCI_STYLESETSIZE SCI_STYLESETSIZEFRACTIONAL SCI_STYLESETUNDERLINE SCI_STYLESETVISIBLE SCI_STYLESETWEIGHT SCI_SWAPMAINANCHORCARET SCI_TAB SCI_TARGETFROMSELECTION SCI_TEXTHEIGHT SCI_TEXTWIDTH SCI_TOGGLECARETSTICKY SCI_TOGGLEFOLD SCI_UNDO SCI_UPPERCASE SCI_USEPOPUP SCI_USERLISTSHOW SCI_VCHOME SCI_VCHOMEEXTEND SCI_VCHOMERECTEXTEND SCI_VCHOMEWRAP SCI_VCHOMEWRAPEXTEND SCI_VERTICALCENTRECARET SCI_VISIBLEFROMDOCLINE SCI_WORDENDPOSITION SCI_WORDLEFT SCI_WORDLEFTEND SCI_WORDLEFTENDEXTEND SCI_WORDLEFTEXTEND SCI_WORDPARTLEFT SCI_WORDPARTLEFTEXTEND SCI_WORDPARTRIGHT SCI_WORDPARTRIGHTEXTEND SCI_WORDRIGHT SCI_WORDRIGHTEND SCI_WORDRIGHTENDEXTEND SCI_WORDRIGHTEXTEND SCI_WORDSTARTPOSITION SCI_WRAPCOUNT SCI_ZOOMIN SCI_ZOOMOUT SCK_ADD SCK_BACK SCK_DELETE SCK_DIVIDE SCK_DOWN SCK_END SCK_ESCAPE SCK_HOME SCK_INSERT SCK_LEFT SCK_MENU SCK_NEXT SCK_PRIOR SCK_RETURN SCK_RIGHT SCK_RWIN SCK_SUBTRACT SCK_TAB SCK_UP SCK_WIN SCLEX_A68K SCLEX_ABAQUS SCLEX_ADA SCLEX_APDL SCLEX_AS SCLEX_ASM SCLEX_ASN1 SCLEX_ASP SCLEX_ASYMPTOTE SCLEX_AU3 SCLEX_AVE SCLEX_AVS SCLEX_BAAN SCLEX_BASH SCLEX_BATCH SCLEX_BIBTEX SCLEX_BLITZBASIC SCLEX_BULLANT SCLEX_CAML SCLEX_CLW SCLEX_CLWNOCASE SCLEX_CMAKE SCLEX_COBOL SCLEX_COFFEESCRIPT SCLEX_CONF SCLEX_CONTAINER SCLEX_CPP SCLEX_CPPNOCASE SCLEX_CSOUND SCLEX_CSS SCLEX_D SCLEX_DIFF SCLEX_DMAP SCLEX_DMIS SCLEX_ECL SCLEX_EIFFEL SCLEX_EIFFELKW SCLEX_ERLANG SCLEX_ERRORLIST SCLEX_ESCRIPT SCLEX_F77 SCLEX_FLAGSHIP SCLEX_FORTH SCLEX_FORTRAN SCLEX_FREEBASIC SCLEX_GAP SCLEX_GUI4CLI SCLEX_HASKELL SCLEX_HTML SCLEX_IHEX SCLEX_INNOSETUP SCLEX_KIX SCLEX_KVIRC SCLEX_LATEX SCLEX_LISP SCLEX_LITERATEHASKELL SCLEX_LOT SCLEX_LOUT SCLEX_LUA SCLEX_MAGIK SCLEX_MAKEFILE SCLEX_MARKDOWN SCLEX_MATLAB SCLEX_METAPOST SCLEX_MMIXAL SCLEX_MODULA SCLEX_MSSQL SCLEX_MYSQL SCLEX_NIMROD SCLEX_NNCRONTAB SCLEX_NSIS SCLEX_NULL SCLEX_OCTAVE SCLEX_OPAL SCLEX_OSCRIPT SCLEX_PASCAL SCLEX_PERL SCLEX_PHP SCLEX_PHPSCRIPT SCLEX_PLM SCLEX_PO SCLEX_POV SCLEX_POWERBASIC SCLEX_POWERPRO SCLEX_POWERSHELL SCLEX_PROGRESS SCLEX_PROPERTIES SCLEX_PS SCLEX_PUREBASIC SCLEX_PYTHON SCLEX_R SCLEX_REBOL SCLEX_REGISTRY SCLEX_RUBY SCLEX_RUST SCLEX_SCRIPTOL SCLEX_SMALLTALK SCLEX_SML SCLEX_SORCUS SCLEX_SPECMAN SCLEX_SPICE SCLEX_SQL SCLEX_SREC SCLEX_STTXT SCLEX_TACL SCLEX_TADS3 SCLEX_TAL SCLEX_TCL SCLEX_TCMD SCLEX_TEHEX SCLEX_TEX SCLEX_TXT2TAGS SCLEX_VB SCLEX_VBSCRIPT SCLEX_VERILOG SCLEX_VHDL SCLEX_VISUALPROLOG SCLEX_XML SCLEX_YAML SCMOD_ALT SCMOD_CTRL SCMOD_META SCMOD_NORM SCMOD_SHIFT SCMOD_SUPER SCN_AUTOCCANCELLED SCN_AUTOCCHARDELETED SCN_AUTOCSELECTION SCN_CALLTIPCLICK SCN_CHARADDED SCN_DOUBLECLICK SCN_DWELLEND SCN_DWELLSTART SCN_FOCUSIN SCN_FOCUSOUT SCN_HOTSPOTCLICK SCN_HOTSPOTDOUBLECLICK SCN_HOTSPOTRELEASECLICK SCN_INDICATORCLICK SCN_INDICATORRELEASE SCN_MACRORECORD SCN_MARGINCLICK SCN_MODIFIED SCN_MODIFYATTEMPTRO SCN_NEEDSHOWN SCN_PAINTED SCN_SAVEPOINTLEFT SCN_SAVEPOINTREACHED SCN_STYLENEEDED SCN_UPDATEUI SCN_USERLISTSELECTION SCN_ZOOM SCVS_NONE SCVS_RECTANGULARSELECTION SCVS_USERACCESSIBLE SCWS_INVISIBLE SCWS_VISIBLEAFTERINDENT SCWS_VISIBLEALWAYS SC_ALPHA_NOALPHA SC_ALPHA_OPAQUE SC_ALPHA_TRANSPARENT SC_AUTOMATICFOLD_CHANGE SC_AUTOMATICFOLD_CLICK SC_AUTOMATICFOLD_SHOW SC_CACHE_CARET SC_CACHE_DOCUMENT SC_CACHE_NONE SC_CACHE_PAGE SC_CARETSTICKY_OFF SC_CARETSTICKY_ON SC_CARETSTICKY_WHITESPACE SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE SC_CASE_LOWER SC_CASE_MIXED SC_CASE_UPPER SC_CHARSET_8859_15 SC_CHARSET_ANSI SC_CHARSET_ARABIC SC_CHARSET_BALTIC SC_CHARSET_CHINESEBIG5 SC_CHARSET_DEFAULT SC_CHARSET_EASTEUROPE SC_CHARSET_GB2312 SC_CHARSET_GREEK SC_CHARSET_HANGUL SC_CHARSET_HEBREW SC_CHARSET_JOHAB SC_CHARSET_MAC SC_CHARSET_OEM SC_CHARSET_RUSSIAN SC_CHARSET_SHIFTJIS SC_CHARSET_SYMBOL SC_CHARSET_THAI SC_CHARSET_TURKISH SC_CHARSET_VIETNAMESE SC_CP_DBCS SC_CP_UTF8 SC_CURSORARROW SC_CURSORNORMAL SC_CURSORREVERSEARROW SC_CURSORWAIT SC_EFF_QUALITY_ANTIALIASED SC_EFF_QUALITY_DEFAULT SC_EFF_QUALITY_LCD_OPTIMIZED SC_EFF_QUALITY_MASK SC_EFF_QUALITY_NON_ANTIALIASED SC_EOL_CR SC_EOL_CRLF SC_EOL_LF SC_FOLDACTION_CONTRACT SC_FOLDACTION_EXPAND SC_FOLDACTION_TOGGLE SC_FOLDFLAG_LEVELNUMBERS SC_FOLDFLAG_LINEAFTER_CONTRACTED SC_FOLDFLAG_LINEAFTER_EXPANDED SC_FOLDFLAG_LINEBEFORE_CONTRACTED SC_FOLDFLAG_LINEBEFORE_EXPANDED SC_FOLDFLAG_LINESTATE SC_FOLDLEVELBASE SC_FOLDLEVELHEADERFLAG SC_FOLDLEVELNUMBERMASK SC_FOLDLEVELWHITEFLAG SC_FONT_SIZE_MULTIPLIER SC_IME_INLINE SC_IME_WINDOWED SC_INDICFLAG_VALUEBEFORE SC_INDICVALUEBIT SC_INDICVALUEMASK SC_IV_LOOKBOTH SC_IV_LOOKFORWARD SC_IV_NONE SC_IV_REAL SC_LASTSTEPINUNDOREDO SC_LINE_END_TYPE_DEFAULT SC_LINE_END_TYPE_UNICODE SC_MARGINOPTION_NONE SC_MARGINOPTION_SUBLINESELECT SC_MARGIN_BACK SC_MARGIN_FORE SC_MARGIN_NUMBER SC_MARGIN_RTEXT SC_MARGIN_SYMBOL SC_MARGIN_TEXT SC_MARKNUM_FOLDER SC_MARKNUM_FOLDEREND SC_MARKNUM_FOLDERMIDTAIL SC_MARKNUM_FOLDEROPEN SC_MARKNUM_FOLDEROPENMID SC_MARKNUM_FOLDERSUB SC_MARKNUM_FOLDERTAIL SC_MARK_ARROW SC_MARK_ARROWDOWN SC_MARK_ARROWS SC_MARK_AVAILABLE SC_MARK_BACKGROUND SC_MARK_BOOKMARK SC_MARK_BOXMINUS SC_MARK_BOXMINUSCONNECTED SC_MARK_BOXPLUS SC_MARK_BOXPLUSCONNECTED SC_MARK_CHARACTER SC_MARK_CIRCLE SC_MARK_CIRCLEMINUS SC_MARK_CIRCLEMINUSCONNECTED SC_MARK_CIRCLEPLUS SC_MARK_CIRCLEPLUSCONNECTED SC_MARK_DOTDOTDOT SC_MARK_EMPTY SC_MARK_FULLRECT SC_MARK_LCORNER SC_MARK_LCORNERCURVE SC_MARK_LEFTRECT SC_MARK_MINUS SC_MARK_PIXMAP SC_MARK_PLUS SC_MARK_RGBAIMAGE SC_MARK_ROUNDRECT SC_MARK_SHORTARROW SC_MARK_SMALLRECT SC_MARK_TCORNER SC_MARK_TCORNERCURVE SC_MARK_UNDERLINE SC_MARK_VLINE SC_MASK_FOLDERS SC_MODEVENTMASKALL SC_MOD_BEFOREDELETE SC_MOD_BEFOREINSERT SC_MOD_CHANGEANNOTATION SC_MOD_CHANGEFOLD SC_MOD_CHANGEINDICATOR SC_MOD_CHANGELINESTATE SC_MOD_CHANGEMARGIN SC_MOD_CHANGEMARKER SC_MOD_CHANGESTYLE SC_MOD_CHANGETABSTOPS SC_MOD_CONTAINER SC_MOD_DELETETEXT SC_MOD_INSERTCHECK SC_MOD_INSERTTEXT SC_MOD_LEXERSTATE SC_MULTIAUTOC_EACH SC_MULTIAUTOC_ONCE SC_MULTILINEUNDOREDO SC_MULTIPASTE_EACH SC_MULTIPASTE_ONCE SC_MULTISTEPUNDOREDO SC_ORDER_CUSTOM SC_ORDER_PERFORMSORT SC_ORDER_PRESORTED SC_PERFORMED_REDO SC_PERFORMED_UNDO SC_PERFORMED_USER SC_PHASES_MULTIPLE SC_PHASES_ONE SC_PHASES_TWO SC_PRINT_BLACKONWHITE SC_PRINT_COLOURONWHITE SC_PRINT_COLOURONWHITEDEFAULTBG SC_PRINT_INVERTLIGHT SC_PRINT_NORMAL SC_SEL_LINES SC_SEL_RECTANGLE SC_SEL_STREAM SC_SEL_THIN SC_STARTACTION SC_STATUS_BADALLOC SC_STATUS_FAILURE SC_STATUS_OK SC_STATUS_WARNREGEX SC_STATUS_WARN_START SC_TECHNOLOGY_DEFAULT SC_TECHNOLOGY_DIRECTWRITE SC_TECHNOLOGY_DIRECTWRITEDC SC_TECHNOLOGY_DIRECTWRITERETAIN SC_TIME_FOREVER SC_TYPE_BOOLEAN SC_TYPE_INTEGER SC_TYPE_STRING SC_UPDATE_CONTENT SC_UPDATE_H_SCROLL SC_UPDATE_SELECTION SC_UPDATE_V_SCROLL SC_WEIGHT_BOLD SC_WEIGHT_NORMAL SC_WEIGHT_SEMIBOLD SC_WRAPINDENT_FIXED SC_WRAPINDENT_INDENT SC_WRAPINDENT_SAME SC_WRAPVISUALFLAGLOC_DEFAULT SC_WRAPVISUALFLAGLOC_END_BY_TEXT SC_WRAPVISUALFLAGLOC_START_BY_TEXT SC_WRAPVISUALFLAG_END SC_WRAPVISUALFLAG_MARGIN SC_WRAPVISUALFLAG_NONE SC_WRAPVISUALFLAG_START SC_WRAP_CHAR SC_WRAP_NONE SC_WRAP_WHITESPACE SC_WRAP_WORD STYLE_BRACEBAD STYLE_BRACELIGHT STYLE_CALLTIP STYLE_CONTROLCHAR STYLE_DEFAULT STYLE_INDENTGUIDE STYLE_LASTPREDEFINED STYLE_LINENUMBER STYLE_MAX SendScintilla SendScintillaPtrResult Shadow Shadow_Mask Shape Shape_Mask SizeAdjustPolicy SloppyBraceMatch SmallRectangle SquiggleIndicator SquiggleLowIndicator SquigglePixmapIndicator StraightBoxIndicator StrictBraceMatch StrikeIndicator StyleMask StyledPanel Sunken SymbolMargin SymbolMarginDefaultBackgroundColor SymbolMarginDefaultForegroundColor TTIndicator TextColorIndicator TextMargin TextMarginRightJustified ThickCompositionIndicator ThinCompositionIndicator ThreeDots ThreeRightArrows UNDO_MAY_COALESCE Underline VISIBLE_SLOP VISIBLE_STRICT VLine VerticalLine WhitespaceVisibility WinPanel WrapCharacter WrapFlagByBorder WrapFlagByText WrapFlagInMargin WrapFlagNone WrapIndentFixed WrapIndentIndented WrapIndentMode WrapIndentSame WrapMode WrapNone WrapVisualFlag WrapWhitespace WrapWord WsInvisible WsVisible WsVisibleAfterIndent __class__ __delattr__ __dict__ __doc__ __format__ __getattr__ __getattribute__ __hash__ __init__ __module__ __new__ __reduce__ __reduce_ex__ __repr__ __setattr__ __sizeof__ __str__ __subclasshook__ __weakref__ acceptDrops accessibleDescription accessibleName actionEvent actions activateWindow addAction addActions addScrollBarWidget adjustSize annotate annotation annotationDisplay apiContext append autoCompleteFromAPIs autoCompleteFromAll autoCompleteFromDocument autoCompletionCaseSensitivity autoCompletionFillupsEnabled autoCompletionReplaceWord autoCompletionShowSingle autoCompletionSource autoCompletionThreshold autoCompletionUseSingle autoFillBackground autoIndent backgroundRole backspaceUnindents baseSize beginUndoAction blockSignals braceMatching callTip callTipsPosition callTipsStyle callTipsVisible canInsertFromMimeData cancelList caseSensitive changeEvent childAt childEvent children childrenRect childrenRegion clear clearAnnotations clearFocus clearFolds clearIndicatorRange clearMarginText clearMask clearRegisteredImages close closeEvent color colorCount connectNotify contentsMargins contentsRect contextMenuEvent contextMenuPolicy contractedFolds convertEols copy copyAvailable cornerWidget create createStandardContextMenu createWindowContainer cursor cursorPositionChanged customContextMenuRequested customEvent cut deleteLater depth destroy destroyed devType devicePixelRatio devicePixelRatioF devicePixelRatioFScale disconnect disconnectNotify document dragEnterEvent dragLeaveEvent dragMoveEvent drawFrame dropEvent dumpObjectInfo dumpObjectTree dynamicPropertyNames edgeColor edgeColumn edgeMode effectiveWinId endUndoAction ensureCursorVisible ensureLineVisible ensurePolished enterEvent eolMode eolVisibility event eventFilter extraAscent extraDescent fillIndicatorRange find findChild findChildren findFirst findFirstInSelection findNext firstVisibleLine focusInEvent focusNextChild focusNextPrevChild focusOutEvent focusPolicy focusPreviousChild focusProxy focusWidget foldAll foldLine folding font fontInfo fontMetrics foregroundRole frameGeometry frameRect frameShadow frameShape frameSize frameStyle frameWidth fromMimeData geometry getContentsMargins getCursorPosition getSelection grab grabGesture grabKeyboard grabMouse grabShortcut graphicsEffect graphicsProxyWidget hasFocus hasHeightForWidth hasMouseTracking hasSelectedText height heightForWidth heightMM hide hideEvent horizontalScrollBar horizontalScrollBarPolicy indent indentation indentationGuides indentationWidth indentationsUseTabs indicatorClicked indicatorDefine indicatorDrawUnder indicatorReleased inherits initPainter initStyleOption inputMethodEvent inputMethodHints inputMethodQuery insert insertAction insertActions insertAt installEventFilter isActiveWindow isAncestorOf isCallTipActive isEnabled isEnabledTo isFullScreen isHidden isLeftToRight isListActive isMaximized isMinimized isModal isModified isReadOnly isRedoAvailable isRightToLeft isSignalConnected isUndoAvailable isUtf8 isVisible isVisibleTo isWidgetType isWindow isWindowModified isWindowType isWordCharacter keyPressEvent keyReleaseEvent keyboardGrabber killTimer layout layoutDirection leaveEvent length lexer lineAt lineIndexFromPosition lineLength lineWidth lines linesChanged locale logicalDpiX logicalDpiY lower mapFrom mapFromGlobal mapFromParent mapTo mapToGlobal mapToParent marginClicked marginLineNumbers marginMarkerMask marginOptions marginSensitivity marginType marginWidth markerAdd markerDefine markerDelete markerDeleteAll markerDeleteHandle markerFindNext markerFindPrevious markerLine markersAtLine mask maximumHeight maximumSize maximumViewportSize maximumWidth metaObject metric midLineWidth minimumHeight minimumSize minimumSizeHint minimumWidth modificationAttempted modificationChanged mouseDoubleClickEvent mouseGrabber mouseMoveEvent mousePressEvent mouseReleaseEvent move moveEvent moveToMatchingBrace moveToThread nativeEvent nativeParentWidget nextInFocusChain normalGeometry objectName objectNameChanged overrideWindowFlags overrideWindowState overwriteMode paintEngine paintEvent paintingActive palette paper parent parentWidget paste physicalDpiX physicalDpiY pool pos positionFromLineIndex previousInFocusChain property pyqtConfigure raise_ read receivers recolor rect redo registerImage releaseKeyboard releaseMouse releaseShortcut removeAction removeEventFilter removeSelectedText render repaint replace replaceSelectedText resetFoldMarginColors resetHotspotBackgroundColor resetHotspotForegroundColor resetMatchedBraceIndicator resetSelectionBackgroundColor resetSelectionForegroundColor resetUnmatchedBraceIndicator resize resizeEvent restoreGeometry saveGeometry scroll scrollBarWidgets scrollContentsBy selectAll selectToMatchingBrace selectedText selectionChanged selectionToEol sender senderSignalIndex setAcceptDrops setAccessibleDescription setAccessibleName setAnnotationDisplay setAttribute setAutoCompletionCaseSensitivity setAutoCompletionFillups setAutoCompletionFillupsEnabled setAutoCompletionReplaceWord setAutoCompletionShowSingle setAutoCompletionSource setAutoCompletionThreshold setAutoCompletionUseSingle setAutoCompletionWordSeparators setAutoFillBackground setAutoIndent setBackgroundRole setBackspaceUnindents setBaseSize setBraceMatching setCallTipsBackgroundColor setCallTipsForegroundColor setCallTipsHighlightColor setCallTipsPosition setCallTipsStyle setCallTipsVisible setCaretForegroundColor setCaretLineBackgroundColor setCaretLineVisible setCaretWidth setColor setContentsMargins setContextMenuPolicy setContractedFolds setCornerWidget setCursor setCursorPosition setDisabled setDocument setEdgeColor setEdgeColumn setEdgeMode setEnabled setEolMode setEolVisibility setExtraAscent setExtraDescent setFirstVisibleLine setFixedHeight setFixedSize setFixedWidth setFocus setFocusPolicy setFocusProxy setFoldMarginColors setFolding setFont setForegroundRole setFrameRect setFrameShadow setFrameShape setFrameStyle setGeometry setGraphicsEffect setHidden setHorizontalScrollBar setHorizontalScrollBarPolicy setHotspotBackgroundColor setHotspotForegroundColor setHotspotUnderline setHotspotWrap setIndentation setIndentationGuides setIndentationGuidesBackgroundColor setIndentationGuidesForegroundColor setIndentationWidth setIndentationsUseTabs setIndicatorDrawUnder setIndicatorForegroundColor setIndicatorHoverForegroundColor setIndicatorHoverStyle setIndicatorOutlineColor setInputMethodHints setLayout setLayoutDirection setLexer setLineWidth setLocale setMarginLineNumbers setMarginMarkerMask setMarginOptions setMarginSensitivity setMarginText setMarginType setMarginWidth setMarginsBackgroundColor setMarginsFont setMarginsForegroundColor setMarkerBackgroundColor setMarkerForegroundColor setMask setMatchedBraceBackgroundColor setMatchedBraceForegroundColor setMatchedBraceIndicator setMaximumHeight setMaximumSize setMaximumWidth setMidLineWidth setMinimumHeight setMinimumSize setMinimumWidth setModified setMouseTracking setObjectName setOverwriteMode setPalette setPaper setParent setProperty setReadOnly setSelection setSelectionBackgroundColor setSelectionForegroundColor setSelectionToEol setShortcutAutoRepeat setShortcutEnabled setSizeAdjustPolicy setSizeIncrement setSizePolicy setStatusTip setStyle setStyleSheet setTabIndents setTabOrder setTabWidth setText setToolTip setToolTipDuration setUnmatchedBraceBackgroundColor setUnmatchedBraceForegroundColor setUnmatchedBraceIndicator setUpdatesEnabled setUtf8 setVerticalScrollBar setVerticalScrollBarPolicy setViewport setViewportMargins setVisible setWhatsThis setWhitespaceBackgroundColor setWhitespaceForegroundColor setWhitespaceSize setWhitespaceVisibility setWindowFilePath setWindowFlags setWindowIcon setWindowIconText setWindowModality setWindowModified setWindowOpacity setWindowRole setWindowState setWindowTitle setWrapIndentMode setWrapMode setWrapVisualFlags setupViewport sharedPainter show showEvent showFullScreen showMaximized showMinimized showNormal showUserList signalsBlocked size sizeAdjustPolicy sizeHint sizeIncrement sizePolicy stackUnder standardCommands startTimer staticMetaObject statusTip style styleSheet tabIndents tabWidth tabletEvent testAttribute text textChanged textHeight thread timerEvent toMimeData toolTip toolTipDuration tr underMouse undo ungrabGesture unindent unsetCursor unsetLayoutDirection unsetLocale update updateGeometry updateMicroFocus updatesEnabled userListActivated verticalScrollBar verticalScrollBarPolicy viewport viewportEvent viewportMargins viewportSizeHint visibleRegion whatsThis wheelEvent whitespaceSize whitespaceVisibility width widthMM winId window windowFilePath windowFlags windowHandle windowIcon windowIconChanged windowIconText windowIconTextChanged windowModality windowOpacity windowRole windowState windowTitle windowTitleChanged windowType wordAtLineIndex wordAtPoint wordCharacters wrapIndentMode wrapMode write x y zoomIn zoomOut zoomTo
In [33]:
class SimplePythonEditor(QsciScintilla):
    ARROW_MARKER_NUM = 8

    def __init__(self, parent=None):
        super(SimplePythonEditor, self).__init__(parent)

        self.setUtf8(True)
        self.setWrapMode(QsciScintilla.WrapWord)
        self.setIndentationsUseTabs(False)
        #self.setIndentationGuides(True) # вертикальные полоски на каждом табе
        self.setTabWidth(4)
        self.setAutoIndent(True)
        
        # Set the default font
        font = QFont()
        font.setFamily('Vollkorn')
        font.setFixedPitch(True)
        font.setPointSize(24)
        self.setFont(font)

        # Margin 0 is used for line numbers
        fontmetrics = QFontMetrics(font)
        self.setMarginsFont(font)
        self.setMarginWidth(0, fontmetrics.width("00000") + 6)
        self.setMarginLineNumbers(0, True)

        # Clickable margin 1 for showing markers
        self.setMarginWidth(1, fontmetrics.width("0"))
        self.setMarginSensitivity(1, True)
        self.marginClicked.connect(self.on_margin_clicked)
        self.markerDefine(QsciScintilla.RightArrow, self.ARROW_MARKER_NUM)
        self.setMarkerBackgroundColor(QColor("#ee1111"), self.ARROW_MARKER_NUM)

        # Brace matching: enable for a brace immediately before or after the current position
        self.setBraceMatching(QsciScintilla.SloppyBraceMatch)
        self.setMatchedBraceBackgroundColor(Qt.yellow);

        self.setCaretLineVisible(True)
        for item in global_style:
            fg = QColor('#' + item['@fgColor']) if '@fgColor' in item else None
            bg = QColor('#' + item['@bgColor']) if '@bgColor' in item else None
            if item['@name'] == 'Current line background colour':
                self.setCaretLineBackgroundColor(bg)
            elif item['@name'] == 'Selected text colour':
                self.setSelectionBackgroundColor(bg)
            elif item['@name'] == 'Line number margin':
                self.setMarginsBackgroundColor(bg)
                self.setMarginsForegroundColor(fg)
            elif item['@name'] == 'Caret colour':
                self.setCaretForegroundColor(fg)
            elif item['@name'] == 'Brace highlight style':
                self.setMatchedBraceBackgroundColor(bg)
                self.setMatchedBraceForegroundColor(fg)
            elif item['@name'] == 'Bad brace colour':
                self.setUnmatchedBraceBackgroundColor(bg)
                self.setUnmatchedBraceForegroundColor(fg)
        
        lexer = QsciLexerPython()
        lexer.setDefaultFont(font)
        self.setLexer(lexer)
        for item in style:
            if int(item['@styleID']) == 0:
                lexer.setPaper(QColor('#' + item['@bgColor']))
            lexer.setFont(font, int(item['@styleID']))
            self.SendScintilla(QsciScintilla.SCI_STYLESETBACK, int(item['@styleID']), QColor('#' + item['@bgColor']))
            self.SendScintilla(QsciScintilla.SCI_STYLESETFORE, int(item['@styleID']), QColor('#' + item['@fgColor']))

        # Hide horizontal scrollbar by raw message to Scintilla
        self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)

        self.setMinimumSize(480, 320)
        
        self.setText('def hello():\n\t# Comment\n\tpass\n\tself.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)\n\tpass')

    def on_margin_clicked(self, nmargin, nline, modifiers):
        # Toggle marker for the line the margin was clicked on
        if self.markersAtLine(nline) != 0:
            self.markerDelete(nline, self.ARROW_MARKER_NUM)
        else:
            self.markerAdd(nline, self.ARROW_MARKER_NUM)
            
    def wheelEvent(self, event):
        if QApplication.keyboardModifiers() & Qt.ControlModifier:
            if event.angleDelta().y() > 0:
                self.zoomIn()
            else:
                self.zoomOut()
        else:
            super(SimplePythonEditor, self).wheelEvent(event)
        
run_qt_and_screenshot(SimplePythonEditor)
Out[33]:

todo uic

from PyQt4 import uic
uic.loadUi("main.ui", self) и все

pyuic5 main.ui -o main.py

todo Как что-нибудь рисовать?

todo как проигрывать видео? нужен видеоплеер -- QtAV? https://github.com/wang-bin/QtAV -- Qt+ffmpeg, не нашел питон-биндингов, ждем https://github.com/wang-bin/QtAV/pull/1082/commits -- смерджили!

стриминг stream.send_to_rtmp_server(original_video) - что это?

todo pyqtgraph? http://www.pyqtgraph.org/ PyQtGraph is a pure-python graphics and GUI library built on PyQt4 / PySide and numpy.

todo pyglet?

todo Нужны сплиттер, иконка окна, Докающиеся субокна?

todo RichEdit?

todo VB6: Label, QLineEdit, QTextEdit, Frame, Combo (как устанавливать значение?), OptionButton, Checkbox QTextEdit() .setText(text)

checkBox = QtGui.QCheckBox('Enlarge Window', self)
checkBox.toggle()
checkBox.stateChanged.connect(self.enlarge_window)
def enlarge_window(self, state):
    if state == QtCore.Qt.Checked:



todo OpenFile, OpenFolder dialogs QFontDialog.getFont() QColorDialog.getColor() QFileDialog.getOpenFileName(self, 'Open File') QFileDialog.getSaveFileName(self, 'Save File')

todo Календарь QCalendarWidget

todo Табы, прогрессбар, слайдер QProgressBar self.progress.setValue(self.completed)

todo отдельно QWebView, перехватывать переходы по ссылкам

void MainWindow::downloadRequested(
     const QNetworkRequest &request)
{
// First prompted with a file dialog to make sure
// they want the file and to select a download
// location and name.
QString defaultFileName =
 QFileInfo(request.url().toString()).fileName();
QString fileName =
 QFileDialog::getSaveFileName(this,
                              tr("Save File"),
                              defaultFileName);
if (fileName.isEmpty())
 return;

// Construct a new request that stores the
// file name that should be used when the
// download is complete
QNetworkRequest newRequest = request;
newRequest.setAttribute(QNetworkRequest::User,
                       fileName);

// Ask the network manager to download
// the file and connect to the progress
// and finished signals.
QNetworkAccessManager *networkManager =
 webView->page()->networkAccessManager();
QNetworkReply *reply =
 networkManager->get(newRequest);
connect(
 reply, SIGNAL(downloadProgress(qint64, qint64)),
 this, SLOT(downloadProgress(qint64, qint64)));
connect(reply, SIGNAL(finished()),
       this, SLOT(downloadIssueFinished()));
}


todo Обработка драгндропа

todo self.setWindowIcon(QtGui.QIcon('pythonlogo.png'))