Skip to content

Commit

Permalink
qt类
Browse files Browse the repository at this point in the history
  • Loading branch information
CberYellowstone committed Mar 27, 2022
1 parent 31424ab commit 0aef42c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dict_style.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file '.\dict_style.ui'
#
# Created by: PyQt6 UI code generator 6.1.0
# Created by: PyQt6 UI code generator 6.2.3
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
Expand Down Expand Up @@ -66,11 +66,11 @@ def setupUi(self, dict_Window):
dict_Window.setCentralWidget(self.dictMain)

self.retranslateUi(dict_Window)
dict_Window.selectionTextChange.connect(dict_Window.setQueryWord)
self.wordsList.currentRowChanged['int'].connect(dict_Window.showWordDetails)
self.autoSearchCheckBox.clicked['bool'].connect(dict_Window.updateAutoSearch)
self.inputLineEdit.editingFinished.connect(dict_Window.editingFinished)
self.inputLineEdit.returnPressed.connect(dict_Window.returnPressed)
dict_Window.selectionTextChange.connect(dict_Window.setQueryWord) # type: ignore
self.wordsList.currentRowChanged['int'].connect(dict_Window.showWordDetails) # type: ignore
self.autoSearchCheckBox.clicked['bool'].connect(dict_Window.updateAutoSearch) # type: ignore
self.inputLineEdit.editingFinished.connect(dict_Window.editingFinished) # type: ignore
self.inputLineEdit.returnPressed.connect(dict_Window.returnPressed) # type: ignore
QtCore.QMetaObject.connectSlotsByName(dict_Window)

def retranslateUi(self, dict_Window):
Expand Down
14 changes: 14 additions & 0 deletions oneKeyQKeySequenceEdit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from PyQt6.QtGui import QKeySequence
from PyQt6.QtWidgets import QKeySequenceEdit
from var_dump import var_dump

class oneKeyQKeySequenceEdit(QKeySequenceEdit):
def __init__(self, parent=None):
super(oneKeyQKeySequenceEdit, self).__init__(parent)
self._string = ''
def keyPressEvent(self, QKeyEvent):
super(oneKeyQKeySequenceEdit, self).keyPressEvent(QKeyEvent)
value = self.keySequence()
self._string = self.keySequence().toString()
self.setKeySequence(value)

0 comments on commit 0aef42c

Please sign in to comment.