python recoll qt GUI ghost of a sample: (partial?) port to qt5
This commit is contained in:
parent
de5ef27aaf
commit
67d6fe2e4d
@ -1,7 +1,8 @@
|
|||||||
|
PYUIC = pyuic5
|
||||||
all: rclmain.py
|
all: rclmain.py
|
||||||
|
|
||||||
rclmain.py: rclmain.ui
|
rclmain.py: rclmain.ui
|
||||||
pyuic4 -o rclmain.py rclmain.ui
|
$(PYUIC) -o rclmain.py rclmain.ui
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f rclmain.py rclmain.pyc
|
rm -f rclmain.py rclmain.pyc
|
||||||
|
|||||||
@ -13,8 +13,10 @@ except:
|
|||||||
import rclmain
|
import rclmain
|
||||||
from getopt import getopt
|
from getopt import getopt
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt5 import QtCore
|
||||||
from PyQt4.QtCore import pyqtSlot
|
from PyQt5.QtCore import pyqtSlot
|
||||||
|
from PyQt5.QtGui import QKeySequence
|
||||||
|
from PyQt5.QtWidgets import *
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# Highlighting methods. Just for showing the groups usage, we add the
|
# Highlighting methods. Just for showing the groups usage, we add the
|
||||||
@ -146,15 +148,15 @@ class RecollQuery(QtCore.QAbstractTableModel):
|
|||||||
|
|
||||||
###
|
###
|
||||||
# UI interaction code
|
# UI interaction code
|
||||||
class RclGui_Main(QtGui.QMainWindow):
|
class RclGui_Main(QMainWindow):
|
||||||
def __init__(self, db, parent=None):
|
def __init__(self, db, parent=None):
|
||||||
QtGui.QWidget.__init__(self, parent)
|
QMainWindow.__init__(self, parent)
|
||||||
self.ui = rclmain.Ui_MainWindow()
|
self.ui = rclmain.Ui_MainWindow()
|
||||||
self.ui.setupUi(self)
|
self.ui.setupUi(self)
|
||||||
self.db = db
|
self.db = db
|
||||||
self.qmodel = RecollQuery()
|
self.qmodel = RecollQuery()
|
||||||
scq = QtGui.QShortcut(QtGui.QKeySequence("Ctrl+Q"), self);
|
scq = QShortcut(QKeySequence("Ctrl+Q"), self);
|
||||||
self.connect(scq, QtCore.SIGNAL("activated()"), self.onexit)
|
scq.activated.connect(self.onexit)
|
||||||
header = self.ui.resTable.horizontalHeader();
|
header = self.ui.resTable.horizontalHeader();
|
||||||
header.setSortIndicatorShown(True);
|
header.setSortIndicatorShown(True);
|
||||||
header.setSortIndicator(-1, QtCore.Qt.AscendingOrder);
|
header.setSortIndicator(-1, QtCore.Qt.AscendingOrder);
|
||||||
@ -213,7 +215,7 @@ class RclGui_Main(QtGui.QMainWindow):
|
|||||||
ipath = doc.ipath
|
ipath = doc.ipath
|
||||||
if not ipath:
|
if not ipath:
|
||||||
return
|
return
|
||||||
fn = QtGui.QFileDialog.getSaveFileName(self)
|
fn = QFileDialog.getSaveFileName(self)
|
||||||
if fn:
|
if fn:
|
||||||
docitems = doc.items()
|
docitems = doc.items()
|
||||||
fn = extractofile(doc, str(fn.toLocal8Bit()))
|
fn = extractofile(doc, str(fn.toLocal8Bit()))
|
||||||
@ -236,7 +238,7 @@ def Usage():
|
|||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
|
|
||||||
app = QtGui.QApplication(args)
|
app = QApplication(args)
|
||||||
|
|
||||||
confdir=""
|
confdir=""
|
||||||
extra_dbs = []
|
extra_dbs = []
|
||||||
|
|||||||
@ -109,7 +109,7 @@
|
|||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>actionExit</sender>
|
<sender>actionExit</sender>
|
||||||
<signal>activated()</signal>
|
<signal>triggered()</signal>
|
||||||
<receiver>MainWindow</receiver>
|
<receiver>MainWindow</receiver>
|
||||||
<slot>close()</slot>
|
<slot>close()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user