Exemple #1
0
    def __init__(self, c, mode="nav", parent=None):

        QtGui.QWidget.__init__(self, parent)

        self.ui = qt_quicksearch.Ui_LeoQuickSearchWidget()
        self.ui.setupUi(self)

        # set to True after return is pressed in nav mode, to disable live updates until field is cleaned again
        self.frozen = False
        w = self.ui.listWidget

        cc = QuickSearchController(c, w)
        self.scon = cc

        if mode == "popout":
            self.setWindowTitle("Go anywhere")
            self.connect(self.ui.lineEdit, QtCore.SIGNAL("returnPressed()"),
                         self.selectAndDismiss)
            threadutil.later(self.ui.lineEdit.setFocus)

        else:
            self.connect(self.ui.lineEdit, QtCore.SIGNAL("returnPressed()"),
                         self.returnPressed)

        self.connect(self.ui.lineEdit, QtCore.SIGNAL("textChanged(QString)"),
                     self.liveUpdate)

        self.ev_filter = QuickSearchEventFilter(c, w, self.ui.lineEdit)
        self.ui.lineEdit.installEventFilter(self.ev_filter)

        self.c = c
Exemple #2
0
    def __init__(self, c, mode="nav", parent=None):

        super().__init__(parent)
        self.ui = qt_quicksearch.Ui_LeoQuickSearchWidget()
        self.ui.setupUi(self)
        self.frozen = False  # True: disable live updates.
        w = self.ui.listWidget
        u = self.ui
        cc = QuickSearchController(c, w, u)
        self.scon = cc
        if mode == "popout":
            self.setWindowTitle("Go anywhere")
            self.ui.lineEdit.returnPressed.connect(self.selectAndDismiss)
            threadutil.later(self.ui.lineEdit.setFocus)
        else:
            self.ui.lineEdit.returnPressed.connect(self.returnPressed)
        self.ui.lineEdit.textChanged.connect(self.liveUpdate)
        self.ev_filter = QuickSearchEventFilter(c, w, self.ui.lineEdit)
        self.ui.lineEdit.installEventFilter(self.ev_filter)
        self.c = c
Exemple #3
0
    def __init__(self,c, mode = "nav", parent=None):

        QtWidgets.QWidget.__init__(self, parent)
        self.ui = qt_quicksearch.Ui_LeoQuickSearchWidget()
        self.ui.setupUi(self)
        self.frozen = False # True: disable live updates.
        w = self.ui.listWidget
        u = self.ui
        cc = QuickSearchController(c,w,u)
        self.scon = cc
        if mode == "popout":
            self.setWindowTitle("Go anywhere")
            self.ui.lineEdit.returnPressed.connect(self.selectAndDismiss)
            threadutil.later(self.ui.lineEdit.setFocus)
        else:
            self.ui.lineEdit.returnPressed.connect(self.returnPressed)
        self.ui.lineEdit.textChanged.connect(self.liveUpdate)
        self.ev_filter = QuickSearchEventFilter(c,w, self.ui.lineEdit)
        self.ui.lineEdit.installEventFilter(self.ev_filter)
        self.c = c
Exemple #4
0
    def __init__(self,c, mode = "nav", parent=None):

        QtWidgets.QWidget.__init__(self, parent)

        self.ui = qt_quicksearch.Ui_LeoQuickSearchWidget()
        self.ui.setupUi(self)

        # set to True after return is pressed in nav mode, to disable live updates until field is cleaned again
        self.frozen = False
        w = self.ui.listWidget
        u = self.ui
        cc = QuickSearchController(c,w,u)
        self.scon = cc

        if mode == "popout":
            self.setWindowTitle("Go anywhere")
            if 1:
                self.ui.lineEdit.returnPressed.connect(self.selectAndDismiss)
            # else:
                # self.connect(self.ui.lineEdit,
                    # QtCore.SIGNAL("returnPressed()"),
                    # self.selectAndDismiss)
            threadutil.later(self.ui.lineEdit.setFocus)
        else:
            if 1:
                self.ui.lineEdit.returnPressed.connect(self.returnPressed)
            # else:
                # self.connect(self.ui.lineEdit,
                    # QtCore.SIGNAL("returnPressed()"),
                    # self.returnPressed)
        if 1:
            self.ui.lineEdit.textChanged.connect(self.liveUpdate)
        # else:
            # self.connect(self.ui.lineEdit,
                # QtCore.SIGNAL("textChanged(QString)"),
                # self.liveUpdate)

        self.ev_filter = QuickSearchEventFilter(c,w, self.ui.lineEdit)
        self.ui.lineEdit.installEventFilter(self.ev_filter)
        self.c = c