mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-22 21:53:03 +03:00
Global functions for Qt5 docset, PgUp and PgDown for ZealSearchEdit
This commit is contained in:
parent
b8f5cbedcb
commit
f817f9375d
@ -21,7 +21,7 @@ Currently Zeal requires Qt 5.0. To compile it, run `qmake` and `make` in the `ze
|
||||
|
||||
After compiling it you need to download docsets and put them in `$HOME/.local/share/zeal/docsets/` -- after creating the directory first. Currently there are docsets available from Qt 5 and Python 2.7.3, generated using scripts from `gendoctests` directory, but for convenience can be downloaded from Dropbox:
|
||||
|
||||
* [Qt5.tar.bz2](https://www.dropbox.com/s/o8uy2iz0wivs04j/Qt5.tar.bz2) (55M)
|
||||
* [Qt5.tar.bz2](https://www.dropbox.com/s/qnpjfphph2z1yqw/Qt5.tar.bz2) (55M)
|
||||
* [python-2.7.3-docs-html.tar.bz2](https://www.dropbox.com/s/2xehy4d2umwg574/python-2.7.3-docs-html.tar.bz2) (4.3M)
|
||||
|
||||
Do `tar -jxvf file.tar.bz2` in docsets directory to enable given docset.
|
||||
|
@ -16,6 +16,7 @@ for tbl in tree.xpath('//table[@class="generic"]'):
|
||||
a = tr.find('td').find('a')
|
||||
c.execute('INSERT INTO things(type, name, path) values("module", ?, ?)', (a.text, a.attrib['href'].replace('../', '')))
|
||||
|
||||
|
||||
def parseClass(class_id, path):
|
||||
tree = parse(path)
|
||||
basepath = path.split('/')[0]
|
||||
@ -31,5 +32,16 @@ for cls in tree.xpath('//dd'):
|
||||
c.execute('INSERT INTO things(type, name, path) values("class", ?, ?)', (a.text, url))
|
||||
parseClass(c.lastrowid, url)
|
||||
|
||||
|
||||
# global functions:
|
||||
tree = parse('qtdoc/functions.html')
|
||||
for fun in tree.xpath('//li'):
|
||||
if fun.find('a') is None: continue
|
||||
if fun.find('a').text == 'global':
|
||||
url = fun.find('a').attrib['href'].replace('../', '')
|
||||
c.execute('INSERT INTO things(type, name, path) values("function", ?, ?)',
|
||||
(fun.text.strip(': '), url))
|
||||
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
@ -19,7 +19,8 @@ bool ZealSearchEdit::eventFilter(QObject *obj, QEvent *ev)
|
||||
if(obj == this && ev->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(ev);
|
||||
if(keyEvent->key() == Qt::Key_Down || keyEvent->key() == Qt::Key_Up ||
|
||||
keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) {
|
||||
keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return ||
|
||||
keyEvent->key() == Qt::Key_PageUp || keyEvent->key() == Qt::Key_PageDown) {
|
||||
QCoreApplication::instance()->sendEvent(treeView, keyEvent);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user