Lint
This commit is contained in:
@@ -241,7 +241,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.loadButton.clicked.connect(self.loadCases)
|
||||
self.update_status.connect(self.statusBarUpdate)
|
||||
self.update_status.emit()
|
||||
self.docketLabel.setText('')
|
||||
self.docketLabel.setText("")
|
||||
return
|
||||
|
||||
def closeEvent(self, event: QCloseEvent) -> None:
|
||||
|
||||
@@ -13,7 +13,7 @@ from PySide6.QtCore import (
|
||||
QUrl,
|
||||
Signal,
|
||||
Slot,
|
||||
)
|
||||
)
|
||||
from PySide6.QtGui import (
|
||||
QMouseEvent,
|
||||
QPainter,
|
||||
@@ -58,23 +58,31 @@ class docketEntryDelegate(QStyledItemDelegate):
|
||||
doc.setTextWidth(options.rect.width())
|
||||
return QSize(int(doc.idealWidth()), int(doc.size().height()))
|
||||
|
||||
def paint(self, painter: QPainter, option: QStyleOptionViewItem, index: QModelIndex | QPersistentModelIndex) -> None:
|
||||
def paint(
|
||||
self,
|
||||
painter: QPainter,
|
||||
option: QStyleOptionViewItem,
|
||||
index: QModelIndex | QPersistentModelIndex,
|
||||
) -> None:
|
||||
options = cast(QStyleOptionViewItemInit, option)
|
||||
self.initStyleOption(options, index)
|
||||
painter.save()
|
||||
|
||||
|
||||
doc = QTextDocument()
|
||||
doc.setHtml(options.text)
|
||||
doc.setTextWidth(options.rect.width())
|
||||
|
||||
options.text = ''
|
||||
options.widget.style().drawControl(QStyle.ControlElement.CE_ItemViewItem, options, painter)
|
||||
options.text = ""
|
||||
options.widget.style().drawControl(
|
||||
QStyle.ControlElement.CE_ItemViewItem, options, painter
|
||||
)
|
||||
painter.translate(options.rect.left(), options.rect.top())
|
||||
clip = QRect(0,0, options.rect.width(), options.rect.height())
|
||||
clip = QRect(0, 0, options.rect.width(), options.rect.height())
|
||||
doc.drawContents(painter, clip)
|
||||
painter.restore()
|
||||
return
|
||||
|
||||
|
||||
|
||||
class docketTableView(QTableView):
|
||||
|
||||
manager: QNetworkAccessManager
|
||||
@@ -138,16 +146,19 @@ class docketTableView(QTableView):
|
||||
# We need to map our click position to a position within the cell.
|
||||
#
|
||||
pos = event.position()
|
||||
new_pos = QPointF(pos.x() - self.horizontalScrollBar().value(),
|
||||
pos.y() - self.verticalScrollBar().value())
|
||||
new_pos = QPointF(
|
||||
pos.x() - self.horizontalScrollBar().value(),
|
||||
pos.y() - self.verticalScrollBar().value(),
|
||||
)
|
||||
rowHeight = 0
|
||||
for row in range(0, index.row()):
|
||||
rowHeight += self.rowHeight(row)
|
||||
cell_pos = QPointF(new_pos.x() - self.columnWidth(0),
|
||||
new_pos.y() - rowHeight)
|
||||
cell_pos = QPointF(
|
||||
new_pos.x() - self.columnWidth(0), new_pos.y() - rowHeight
|
||||
)
|
||||
te = QTextEdit()
|
||||
te.setDocument(doc)
|
||||
anchor = te.anchorAt(cell_pos.toPoint())
|
||||
if anchor:
|
||||
self.anchorSignal.emit(index,anchor)
|
||||
self.anchorSignal.emit(index, anchor)
|
||||
return
|
||||
|
||||
@@ -35,8 +35,9 @@ def main() -> int:
|
||||
updateDatabase(settings)
|
||||
db = QSqlDatabase.addDatabase("QMYSQL")
|
||||
db.setHostName(settings.value("hostname"))
|
||||
portStr = cast(str, settings.value("port", "3306"))
|
||||
db.setPort(int(portStr))
|
||||
port = settings.value("port", "3306")
|
||||
assert isinstance(port, str)
|
||||
db.setPort(int(port))
|
||||
db.setDatabaseName(settings.value("databasename", "scotus")) # type: ignore
|
||||
db.setUserName(settings.value("user", "scotus")) # type: ignore
|
||||
db.setPassword(settings.value("password"))
|
||||
|
||||
Reference in New Issue
Block a user