People edit and improved Session
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from .books import Book
|
from .books import Book
|
||||||
|
from .person import PersonDialog
|
||||||
from .read import EditDialog
|
from .read import EditDialog
|
||||||
from .session import SessionDialog
|
from .session import SessionDialog
|
||||||
from .person import PersonDialog
|
|
||||||
|
|||||||
220
lib/person.py
220
lib/person.py
@@ -1,12 +1,224 @@
|
|||||||
|
from html.parser import HTMLParser
|
||||||
|
from io import StringIO
|
||||||
|
|
||||||
|
from PyQt6.QtCore import QSize, Qt, pyqtSlot
|
||||||
|
from PyQt6.QtGui import QStandardItem, QStandardItemModel
|
||||||
|
from PyQt6.QtSql import QSqlQuery, QSqlQueryModel
|
||||||
|
from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QStyledItemDelegate
|
||||||
|
|
||||||
from main import query_error
|
from main import query_error
|
||||||
from ui.PeopleDialog import Ui_Dialog
|
from ui.PeopleDialog import Ui_Dialog
|
||||||
from PyQt6.QtCore import Qt, pyqtSlot
|
|
||||||
from PyQt6.QtSql import QSqlQuery
|
|
||||||
from PyQt6.QtWidgets import QDialog
|
class MLStripper(HTMLParser):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.reset()
|
||||||
|
return
|
||||||
|
|
||||||
|
def reset(self):
|
||||||
|
super().reset()
|
||||||
|
self.strict = False
|
||||||
|
self.convert_charrefs = True
|
||||||
|
self.text = StringIO()
|
||||||
|
self.first = True
|
||||||
|
return
|
||||||
|
|
||||||
|
def handle_data(self, d):
|
||||||
|
if self.first:
|
||||||
|
self.text.write(d)
|
||||||
|
self.first = False
|
||||||
|
return
|
||||||
|
|
||||||
|
def get_data(self):
|
||||||
|
return self.text.getvalue()
|
||||||
|
|
||||||
|
|
||||||
class PersonDialog(QDialog, Ui_Dialog):
|
class PersonDialog(QDialog, Ui_Dialog):
|
||||||
def __init__(self,*args, **kwargs):
|
SectionIdRole = Qt.ItemDataRole.UserRole
|
||||||
|
SectionSequenceRole = Qt.ItemDataRole.UserRole + 1
|
||||||
|
BookIdRole = Qt.ItemDataRole.UserRole + 2
|
||||||
|
person_id = 0
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
self.person_id = kwargs.pop("person_id", 0)
|
||||||
super(PersonDialog, self).__init__(*args, **kwargs)
|
super(PersonDialog, self).__init__(*args, **kwargs)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.show()
|
self.show()
|
||||||
|
model = QSqlQueryModel()
|
||||||
|
query = QSqlQuery()
|
||||||
|
query.prepare("SELECT book_id, title " "FROM books " "ORDER BY title")
|
||||||
|
if not query.exec():
|
||||||
|
query_error(query)
|
||||||
|
model.setQuery(query)
|
||||||
|
self.bookCombo.setPlaceholderText("Select A Book")
|
||||||
|
self.bookCombo.setModel(model)
|
||||||
|
self.bookCombo.setModelColumn(1)
|
||||||
|
self.bookCombo.setCurrentIndex(-1)
|
||||||
|
model = QStandardItemModel()
|
||||||
|
self.sectionCombo.setPlaceholderText("Select A Section")
|
||||||
|
self.sectionCombo.setModel(model)
|
||||||
|
self.sectionCombo.setEnabled(False)
|
||||||
|
self.sectionCombo.setCurrentIndex(-1)
|
||||||
|
|
||||||
|
button = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok)
|
||||||
|
button.setEnabled(False)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Connections
|
||||||
|
#
|
||||||
|
self.bookCombo.currentIndexChanged.connect(self.bookSelected)
|
||||||
|
self.sectionCombo.currentIndexChanged.connect(self.sectionSelected)
|
||||||
|
self.nameEdit.editingFinished.connect(self.checkLineEdits)
|
||||||
|
self.orgEdit.editingFinished.connect(self.checkLineEdits)
|
||||||
|
if self.person_id > 0:
|
||||||
|
self.setPerson(self.person_id)
|
||||||
|
return
|
||||||
|
|
||||||
|
def setPerson(self, person_id: int) -> None:
|
||||||
|
query = QSqlQuery()
|
||||||
|
query.prepare(
|
||||||
|
"SELECT p.name, p.organization, p.book_id, s.sequence "
|
||||||
|
"FROM people p "
|
||||||
|
"LEFT JOIN person_book pb "
|
||||||
|
"ON (p.book_id = pb.book_id "
|
||||||
|
"AND p.person_id = pb.person_id) "
|
||||||
|
"LEFT JOIN sections s "
|
||||||
|
"ON (s.section_id = pb.section_id) "
|
||||||
|
"WHERE p.person_id = :person_id"
|
||||||
|
)
|
||||||
|
query.bindValue(":person_id", person_id)
|
||||||
|
if not query.exec():
|
||||||
|
query_error(query)
|
||||||
|
if not query.next():
|
||||||
|
raise Exception(f"No person record for {person_id}")
|
||||||
|
self.person_id = person_id
|
||||||
|
self.nameEdit.setText(query.value("name"))
|
||||||
|
self.orgEdit.setText(query.value("organization"))
|
||||||
|
model = self.bookCombo.model()
|
||||||
|
matches = model.match(
|
||||||
|
model.createIndex(0, 0),
|
||||||
|
Qt.ItemDataRole.DisplayRole,
|
||||||
|
query.value("book_id"),
|
||||||
|
1,
|
||||||
|
Qt.MatchFlag.MatchExactly,
|
||||||
|
)
|
||||||
|
if len(matches) != 1:
|
||||||
|
raise Excpetion(
|
||||||
|
f"Match failed looking for book_id: {query.value('book_id')}"
|
||||||
|
)
|
||||||
|
row = int(matches[0].row())
|
||||||
|
self.bookCombo.setCurrentIndex(row)
|
||||||
|
self.sectionCombo.setCurrentIndex(query.value("sequence"))
|
||||||
|
return
|
||||||
|
|
||||||
|
@pyqtSlot(int)
|
||||||
|
def bookSelected(self, index: int) -> None:
|
||||||
|
book_index = self.bookCombo.model().createIndex(index, 0)
|
||||||
|
book_id = book_index.data()
|
||||||
|
model = self.sectionCombo.model()
|
||||||
|
query = QSqlQuery()
|
||||||
|
query.prepare(
|
||||||
|
"SELECT section_id, sequence, content "
|
||||||
|
"FROM sections "
|
||||||
|
"WHERE book_id = :book_id "
|
||||||
|
"ORDER BY sequence"
|
||||||
|
)
|
||||||
|
query.bindValue(":book_id", book_id)
|
||||||
|
if not query.exec():
|
||||||
|
query_error(query)
|
||||||
|
model.clear()
|
||||||
|
stripper = MLStripper()
|
||||||
|
while query.next():
|
||||||
|
stripper.feed(query.value("content"))
|
||||||
|
content = stripper.get_data()
|
||||||
|
stripper.reset()
|
||||||
|
item = QStandardItem()
|
||||||
|
item.setData(content[:40], Qt.ItemDataRole.DisplayRole)
|
||||||
|
item.setData(
|
||||||
|
query.value("sequence"), PersonDialog.SectionSequenceRole
|
||||||
|
)
|
||||||
|
item.setData(query.value("section_id"), PersonDialog.SectionIdRole)
|
||||||
|
model.appendRow(item)
|
||||||
|
self.sectionCombo.setEnabled(True)
|
||||||
|
return
|
||||||
|
|
||||||
|
@pyqtSlot(int)
|
||||||
|
def sectionSelected(self, row: int) -> None:
|
||||||
|
self.checkLineEdits()
|
||||||
|
return
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def accept(self) -> None:
|
||||||
|
query = QSqlQuery()
|
||||||
|
if self.person_id > 0:
|
||||||
|
query.prepare(
|
||||||
|
"UPDATE people SET "
|
||||||
|
"name = :name, "
|
||||||
|
"organization = :org, "
|
||||||
|
"email = :email, "
|
||||||
|
"book_id = :book_id "
|
||||||
|
"WHERE person_id = :person_id"
|
||||||
|
)
|
||||||
|
query.bindValue(":person_id", self.person_id)
|
||||||
|
else:
|
||||||
|
query.prepare(
|
||||||
|
"INSERT INTO people "
|
||||||
|
"(name, organization, email, book_id) "
|
||||||
|
"VALUES (:name, :org, :email, :book_id)"
|
||||||
|
)
|
||||||
|
query.bindValue(":name", self.nameEdit.text().strip())
|
||||||
|
query.bindValue(":org", self.nameEdit.text().strip())
|
||||||
|
query.bindValue(":email", self.emailEdit.text().strip())
|
||||||
|
row = self.bookCombo.currentIndex()
|
||||||
|
model = self.bookCombo.model()
|
||||||
|
book_id = model.data(model.createIndex(row, 0))
|
||||||
|
query.bindValue(":book_id", book_id)
|
||||||
|
section_id = self.sectionCombo.currentData(PersonDialog.SectionIdRole)
|
||||||
|
print(f"section_id: {section_id}")
|
||||||
|
if not section_id:
|
||||||
|
raise Exception(f"Section id is null")
|
||||||
|
if not query.exec():
|
||||||
|
query_error(query)
|
||||||
|
if self.person_id <= 0:
|
||||||
|
self.person_id = query.lastInsertId()
|
||||||
|
query.prepare(
|
||||||
|
"SELECT * FROM person_book pb "
|
||||||
|
"WHERE pb.person_id = :person_id "
|
||||||
|
"AND pb.book_id = :book_id"
|
||||||
|
)
|
||||||
|
query.bindValue(":person_id", self.person_id)
|
||||||
|
query.bindValue(":book_id", book_id)
|
||||||
|
if not query.exec():
|
||||||
|
query_error(query)
|
||||||
|
if query.next():
|
||||||
|
query.prepare(
|
||||||
|
"UPDATE person_book SET "
|
||||||
|
"section_id = :section_id "
|
||||||
|
"WHERE person_id = :person_id "
|
||||||
|
"AND book_id = :book_id"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
query.prepare(
|
||||||
|
"INSERT INTO person_book "
|
||||||
|
"(person_id, book_id, section_id, block) "
|
||||||
|
"VALUES (:person_id, :book_id, :section_id, 0 )"
|
||||||
|
)
|
||||||
|
query.bindValue(":person_id", self.person_id)
|
||||||
|
query.bindValue(":book_id", book_id)
|
||||||
|
query.bindValue(":section_id", section_id)
|
||||||
|
if not query.exec():
|
||||||
|
query_error(query)
|
||||||
|
super().accept()
|
||||||
|
return
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def checkLineEdits(self):
|
||||||
|
name = self.nameEdit.text().strip()
|
||||||
|
org = self.orgEdit.text().strip()
|
||||||
|
button = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok)
|
||||||
|
if name and org:
|
||||||
|
button.setEnabled(True)
|
||||||
|
else:
|
||||||
|
button.setEnabled(False)
|
||||||
return
|
return
|
||||||
|
|||||||
12
lib/read.py
12
lib/read.py
@@ -40,7 +40,9 @@ from ui.EditDialog import Ui_Dialog
|
|||||||
class EditDialog(QDialog, Ui_Dialog):
|
class EditDialog(QDialog, Ui_Dialog):
|
||||||
block: int
|
block: int
|
||||||
paragraphs = True
|
paragraphs = True
|
||||||
|
sessionSignal = pyqtSignal()
|
||||||
displayedWord = pyqtSignal(int)
|
displayedWord = pyqtSignal(int)
|
||||||
|
newParagraph = pyqtSignal(int, int)
|
||||||
|
|
||||||
def __init__(self, session, person_id: int) -> None:
|
def __init__(self, session, person_id: int) -> None:
|
||||||
self.session = session
|
self.session = session
|
||||||
@@ -76,17 +78,26 @@ class EditDialog(QDialog, Ui_Dialog):
|
|||||||
self.scrollBtn.clicked.connect(self.scrollAction)
|
self.scrollBtn.clicked.connect(self.scrollAction)
|
||||||
self.nextBtn.clicked.connect(self.nextAction)
|
self.nextBtn.clicked.connect(self.nextAction)
|
||||||
self.prevBtn.clicked.connect(self.prevAction)
|
self.prevBtn.clicked.connect(self.prevAction)
|
||||||
|
#self.sessionSignal.connect(self.session.timerAction)
|
||||||
|
#self.sessionBtn.clicked.connect(self.sessionAction)
|
||||||
self.sessionBtn.clicked.connect(self.session.timerAction)
|
self.sessionBtn.clicked.connect(self.session.timerAction)
|
||||||
self.paraEdit.verticalScrollBar().valueChanged.connect(self.scrollSlot)
|
self.paraEdit.verticalScrollBar().valueChanged.connect(self.scrollSlot)
|
||||||
#
|
#
|
||||||
# Connect signals
|
# Connect signals
|
||||||
#
|
#
|
||||||
self.displayedWord.connect(self.session.addWord)
|
self.displayedWord.connect(self.session.addWord)
|
||||||
|
self.newParagraph.connect(self.session.addBlock)
|
||||||
return
|
return
|
||||||
|
|
||||||
#
|
#
|
||||||
# slots
|
# slots
|
||||||
#
|
#
|
||||||
|
@pyqtSlot()
|
||||||
|
def sessionAction(self) -> None:
|
||||||
|
self.sessionSignal.emit()
|
||||||
|
self.session.addParagraph(self.section_id, self.block)
|
||||||
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def printAction(self) -> None:
|
def printAction(self) -> None:
|
||||||
html = "<!DOCTYPE html>\n<html>\n<head>\n"
|
html = "<!DOCTYPE html>\n<html>\n<head>\n"
|
||||||
@@ -378,6 +389,7 @@ class EditDialog(QDialog, Ui_Dialog):
|
|||||||
self.nextSection()
|
self.nextSection()
|
||||||
return
|
return
|
||||||
self.savePosition()
|
self.savePosition()
|
||||||
|
self.newParagraph.emit(self.section_id, self.block)
|
||||||
return
|
return
|
||||||
|
|
||||||
def prevParagraph(self) -> None:
|
def prevParagraph(self) -> None:
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from PyQt6.QtCore import Qt, QTime, QTimer, pyqtSignal, pyqtSlot
|
from PyQt6.QtCore import Qt, QTime, QTimer, pyqtSignal, pyqtSlot
|
||||||
from PyQt6.QtGui import QStandardItem, QStandardItemModel, QTextCursor
|
from PyQt6.QtGui import (
|
||||||
|
QStandardItem,
|
||||||
|
QStandardItemModel,
|
||||||
|
QTextCursor,
|
||||||
|
QTextDocument,
|
||||||
|
QTextBlockFormat
|
||||||
|
)
|
||||||
from PyQt6.QtSql import QSqlQuery
|
from PyQt6.QtSql import QSqlQuery
|
||||||
from PyQt6.QtWidgets import QDialog
|
from PyQt6.QtWidgets import QDialog
|
||||||
|
|
||||||
@@ -10,9 +16,16 @@ from ui.SessionDialog import Ui_Dialog
|
|||||||
|
|
||||||
|
|
||||||
class SessionDialog(QDialog, Ui_Dialog):
|
class SessionDialog(QDialog, Ui_Dialog):
|
||||||
|
WordIdRole = Qt.ItemDataRole.UserRole
|
||||||
|
SectionIdRole = Qt.ItemDataRole.UserRole + 1
|
||||||
|
BlockRole = Qt.ItemDataRole.UserRole + 2
|
||||||
|
|
||||||
timer = QTimer()
|
timer = QTimer()
|
||||||
startTime = datetime.now()
|
startTime = datetime.now()
|
||||||
totalTime = 0 # seconds
|
totalTime = 0 # seconds
|
||||||
|
sessionStart = None
|
||||||
|
sessionEnd = None
|
||||||
|
blocks = QStandardItemModel()
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super(SessionDialog, self).__init__()
|
super(SessionDialog, self).__init__()
|
||||||
@@ -26,8 +39,18 @@ class SessionDialog(QDialog, Ui_Dialog):
|
|||||||
self.activeBox.stateChanged.connect(self.activeAction)
|
self.activeBox.stateChanged.connect(self.activeAction)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def resetForm(self) -> None:
|
||||||
|
self.nameLbl.setText("")
|
||||||
|
self.totalTime = timedelta()
|
||||||
|
self.wordView.model().clear()
|
||||||
|
self.textBrowser.document().clear()
|
||||||
|
return
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def setPerson(self, person_id) -> None:
|
def setPerson(self, person_id) -> None:
|
||||||
|
self.resetForm()
|
||||||
|
self.person_id = person_id
|
||||||
query = QSqlQuery()
|
query = QSqlQuery()
|
||||||
query.prepare("SELECT * FROM people " "WHERE person_id = :person_id")
|
query.prepare("SELECT * FROM people " "WHERE person_id = :person_id")
|
||||||
query.bindValue(":person_id", person_id)
|
query.bindValue(":person_id", person_id)
|
||||||
@@ -37,16 +60,26 @@ class SessionDialog(QDialog, Ui_Dialog):
|
|||||||
raise Exception(f"Bad person_id: {person_id}")
|
raise Exception(f"Bad person_id: {person_id}")
|
||||||
self.nameLbl.setText(query.value("name"))
|
self.nameLbl.setText(query.value("name"))
|
||||||
self.totalTime = timedelta()
|
self.totalTime = timedelta()
|
||||||
|
self.wordView.model().clear()
|
||||||
|
return
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def accept(self) -> None:
|
||||||
|
print("Accepted")
|
||||||
|
super().accept()
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def activeAction(self, state: int) -> None:
|
def activeAction(self, state: int) -> None:
|
||||||
if state:
|
if state:
|
||||||
|
if not self.sessionStart:
|
||||||
|
self.sessionStart = datetime.now()
|
||||||
self.startTime = datetime.now()
|
self.startTime = datetime.now()
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
else:
|
else:
|
||||||
self.totalTime = self.totalTime + (datetime.now() - self.startTime)
|
self.totalTime = self.totalTime + (datetime.now() - self.startTime)
|
||||||
self.timer.stop()
|
self.timer.stop()
|
||||||
|
self.sessionEnd = datetime.now()
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
@@ -81,22 +114,56 @@ class SessionDialog(QDialog, Ui_Dialog):
|
|||||||
raise Exception(f"Word_id({word_id}) not found in DB")
|
raise Exception(f"Word_id({word_id}) not found in DB")
|
||||||
word = QStandardItem()
|
word = QStandardItem()
|
||||||
word.setData(query.value("word"), Qt.ItemDataRole.DisplayRole)
|
word.setData(query.value("word"), Qt.ItemDataRole.DisplayRole)
|
||||||
word_id = QStandardItem()
|
word.setData(query.value("word_id"), SessionDialog.WordIdRole)
|
||||||
word_id.setData(
|
|
||||||
query.value("word_id"), Qt.ItemDataRole.UserRole + 1
|
|
||||||
)
|
|
||||||
model = self.wordView.model()
|
model = self.wordView.model()
|
||||||
matches = model.match(
|
matches = model.match(
|
||||||
model.createIndex(0, 1),
|
model.createIndex(0, 0),
|
||||||
Qt.ItemDataRole.UserRole + 1,
|
SessionDialog.WordIdRole,
|
||||||
query.value("word_id"),
|
query.value("word_id"),
|
||||||
1,
|
1,
|
||||||
Qt.MatchFlag.MatchExactly,
|
Qt.MatchFlag.MatchExactly,
|
||||||
)
|
)
|
||||||
if len(matches) > 0:
|
if len(matches) > 0:
|
||||||
return
|
return
|
||||||
self.wordView.model().appendRow([word, word_id])
|
self.wordView.model().appendRow(word)
|
||||||
self.wordView.model().sort(0)
|
self.wordView.model().sort(0)
|
||||||
else:
|
else:
|
||||||
print(f"Not active: {word_id}")
|
print(f"Not active: {word_id}")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@pyqtSlot(int, int)
|
||||||
|
def addBlock(self, section_id, block) -> None:
|
||||||
|
new_block = QStandardItem()
|
||||||
|
new_block.setData(section_id, SessionDialog.SectionIdRole)
|
||||||
|
new_block.setData(block, SessionDialog.BlockRole)
|
||||||
|
|
||||||
|
matches = self.blocks.match(
|
||||||
|
self.blocks.createIndex(0, 0),
|
||||||
|
SessionDialog.BlockRole,
|
||||||
|
block,
|
||||||
|
1,
|
||||||
|
Qt.MatchFlag.MatchExactly,
|
||||||
|
)
|
||||||
|
if len(matches) > 0:
|
||||||
|
return
|
||||||
|
self.blocks.appendRow(new_block)
|
||||||
|
query = QSqlQuery()
|
||||||
|
query.prepare(
|
||||||
|
"SELECT * FROM sections " "WHERE section_id = :section_id"
|
||||||
|
)
|
||||||
|
query.bindValue(":section_id", section_id)
|
||||||
|
if not query.exec():
|
||||||
|
query_error(query)
|
||||||
|
if not query.next():
|
||||||
|
raise Exception(f"Section not found {section_id}")
|
||||||
|
document = QTextDocument()
|
||||||
|
cursor = QTextCursor(document)
|
||||||
|
cursor.setPosition(0)
|
||||||
|
cursor.insertHtml(query.value("content"))
|
||||||
|
textBlock = document.findBlockByNumber(block)
|
||||||
|
blockFormat = QTextBlockFormat()
|
||||||
|
blockFormat.setTextIndent(25.0)
|
||||||
|
self.textBrowser.textCursor().setBlockFormat(blockFormat)
|
||||||
|
self.textBrowser.textCursor().insertHtml('<p>'+textBlock.text()+'</p>')
|
||||||
|
self.textBrowser.textCursor().insertBlock()
|
||||||
|
return
|
||||||
|
|||||||
43
main.py
43
main.py
@@ -1,10 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# TODO:
|
# TODO:
|
||||||
# Start/Stop Session
|
|
||||||
# Record all words examined
|
# Record all words examined
|
||||||
# Record all words defined after start session
|
|
||||||
# Record paragraph start and stop
|
|
||||||
#
|
#
|
||||||
# Add definition to definition
|
# Add definition to definition
|
||||||
# Follow definition links
|
# Follow definition links
|
||||||
@@ -60,11 +57,12 @@ def query_error(query: QSqlQuery) -> None:
|
|||||||
)
|
)
|
||||||
raise Exception("SQL Error")
|
raise Exception("SQL Error")
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow, Ui_MainWindow):
|
class MainWindow(QMainWindow, Ui_MainWindow):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super(MainWindow, self).__init__()
|
super(MainWindow, self).__init__()
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
#model = ModelOverride()
|
# model = ModelOverride()
|
||||||
model = QSqlQueryModel()
|
model = QSqlQueryModel()
|
||||||
query = QSqlQuery("SELECT * FROM people ORDER BY name")
|
query = QSqlQuery("SELECT * FROM people ORDER BY name")
|
||||||
model.setQuery(query)
|
model.setQuery(query)
|
||||||
@@ -76,16 +74,18 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
#
|
#
|
||||||
# Action Connections
|
# Action Connections
|
||||||
#
|
#
|
||||||
self.actionQuit.triggered.connect(self.close) # Y
|
self.actionQuit.triggered.connect(self.close) # Y
|
||||||
self.actionAddBook.triggered.connect(self.addBook) # Y
|
self.actionAddBook.triggered.connect(self.addBook) # Y
|
||||||
self.actionEditBook.triggered.connect(self.editBook) # Y
|
self.actionEditBook.triggered.connect(self.editBook) # Y
|
||||||
self.actionRead.triggered.connect(self.readBook) # Y
|
self.actionRead.triggered.connect(self.readBook) # Y
|
||||||
self.actionRead.enabledChanged.connect(self.readBtn.setEnabled)
|
self.actionRead.enabledChanged.connect(self.readBtn.setEnabled)
|
||||||
self.actionAddPerson.triggered.connect(self.addPerson) # Y
|
self.actionAddPerson.triggered.connect(self.addPerson) # Y
|
||||||
self.actionEditPerson.triggered.connect(self.editPerson) # Y
|
self.actionEditPerson.triggered.connect(self.editPerson) # Y
|
||||||
self.actionEditPerson.enabledChanged.connect(self.editBtn.setEnabled) # Y
|
self.actionEditPerson.enabledChanged.connect(
|
||||||
self.peopleView.doubleClicked.connect(self.editPerson) # Y
|
self.editBtn.setEnabled
|
||||||
self.peopleView.clicked.connect(self.selectedPerson) # Y
|
) # Y
|
||||||
|
self.peopleView.doubleClicked.connect(self.editPerson) # Y
|
||||||
|
self.peopleView.clicked.connect(self.selectedPerson) # Y
|
||||||
self.show()
|
self.show()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -102,7 +102,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
@pyqtSlot(bool)
|
@pyqtSlot(bool)
|
||||||
def enablePerson(self, flag: bool) -> None:
|
def enablePerson(self, flag: bool) -> None:
|
||||||
|
|
||||||
if flag:
|
if flag:
|
||||||
self.editBtn.setEnabled(False)
|
self.editBtn.setEnabled(False)
|
||||||
self.readBtn.setEnabled(False)
|
self.readBtn.setEnabled(False)
|
||||||
@@ -115,12 +114,20 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
def addPerson(self) -> None:
|
def addPerson(self) -> None:
|
||||||
dlg = PersonDialog()
|
dlg = PersonDialog()
|
||||||
dlg.exec()
|
dlg.exec()
|
||||||
|
model = self.peopleView.model()
|
||||||
|
model.setQuery(model.query())
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
@pyqtSlot(QModelIndex)
|
@pyqtSlot(QModelIndex)
|
||||||
def editPerson(self, index = None ) -> None:
|
def editPerson(self, index=None) -> None:
|
||||||
print("Edit a person")
|
if not index:
|
||||||
|
indexes = self.peopleView.selectedIndexes()
|
||||||
|
if len(indexes) < 1:
|
||||||
|
return
|
||||||
|
index = indexes[0]
|
||||||
|
dlg = PersonDialog(person_id=index.siblingAtColumn(0).data())
|
||||||
|
dlg.exec()
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
@@ -133,6 +140,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
def editBook(self) -> None:
|
def editBook(self) -> None:
|
||||||
print("Edit Book")
|
print("Edit Book")
|
||||||
return
|
return
|
||||||
|
|
||||||
session = None
|
session = None
|
||||||
setPerson = pyqtSignal(int)
|
setPerson = pyqtSignal(int)
|
||||||
|
|
||||||
@@ -171,7 +179,8 @@ SQL_CMDS = [
|
|||||||
#
|
#
|
||||||
"CREATE TABLE IF NOT EXISTS people "
|
"CREATE TABLE IF NOT EXISTS people "
|
||||||
"(person_id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, "
|
"(person_id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, "
|
||||||
"organization TEXT, book_id INTEGER REFERENCES books ON DELETE CASCADE)",
|
"organization TEXT, book_id INTEGER REFERENCES books ON DELETE CASCADE, "
|
||||||
|
"email TEXT)",
|
||||||
#
|
#
|
||||||
"CREATE TABLE IF NOT EXISTS person_book "
|
"CREATE TABLE IF NOT EXISTS person_book "
|
||||||
"(person_id INTEGER REFERENCES people ON DELETE CASCADE, "
|
"(person_id INTEGER REFERENCES people ON DELETE CASCADE, "
|
||||||
|
|||||||
@@ -23,32 +23,42 @@ class Ui_Dialog(object):
|
|||||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.nameEdit)
|
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.nameEdit)
|
||||||
self.label_2 = QtWidgets.QLabel(parent=Dialog)
|
self.label_2 = QtWidgets.QLabel(parent=Dialog)
|
||||||
self.label_2.setObjectName("label_2")
|
self.label_2.setObjectName("label_2")
|
||||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
||||||
self.orgEdit = QtWidgets.QLineEdit(parent=Dialog)
|
self.orgEdit = QtWidgets.QLineEdit(parent=Dialog)
|
||||||
self.orgEdit.setObjectName("orgEdit")
|
self.orgEdit.setObjectName("orgEdit")
|
||||||
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.orgEdit)
|
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.orgEdit)
|
||||||
self.label_3 = QtWidgets.QLabel(parent=Dialog)
|
self.label_3 = QtWidgets.QLabel(parent=Dialog)
|
||||||
self.label_3.setObjectName("label_3")
|
self.label_3.setObjectName("label_3")
|
||||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_3)
|
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_3)
|
||||||
self.bookCombo = QtWidgets.QComboBox(parent=Dialog)
|
self.bookCombo = QtWidgets.QComboBox(parent=Dialog)
|
||||||
self.bookCombo.setObjectName("bookCombo")
|
self.bookCombo.setObjectName("bookCombo")
|
||||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.bookCombo)
|
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.bookCombo)
|
||||||
self.label_4 = QtWidgets.QLabel(parent=Dialog)
|
self.label_4 = QtWidgets.QLabel(parent=Dialog)
|
||||||
self.label_4.setObjectName("label_4")
|
self.label_4.setObjectName("label_4")
|
||||||
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_4)
|
self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_4)
|
||||||
self.sectionCombo = QtWidgets.QComboBox(parent=Dialog)
|
self.sectionCombo = QtWidgets.QComboBox(parent=Dialog)
|
||||||
self.sectionCombo.setObjectName("sectionCombo")
|
self.sectionCombo.setObjectName("sectionCombo")
|
||||||
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.sectionCombo)
|
self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.FieldRole, self.sectionCombo)
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
|
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||||
self.buttonBox.setObjectName("buttonBox")
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
self.formLayout.setWidget(5, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.buttonBox)
|
||||||
|
self.label_5 = QtWidgets.QLabel(parent=Dialog)
|
||||||
|
self.label_5.setObjectName("label_5")
|
||||||
|
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_5)
|
||||||
|
self.emailEdit = QtWidgets.QLineEdit(parent=Dialog)
|
||||||
|
self.emailEdit.setObjectName("emailEdit")
|
||||||
|
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.emailEdit)
|
||||||
|
|
||||||
self.retranslateUi(Dialog)
|
self.retranslateUi(Dialog)
|
||||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
||||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||||
|
Dialog.setTabOrder(self.nameEdit, self.emailEdit)
|
||||||
|
Dialog.setTabOrder(self.emailEdit, self.orgEdit)
|
||||||
|
Dialog.setTabOrder(self.orgEdit, self.bookCombo)
|
||||||
|
Dialog.setTabOrder(self.bookCombo, self.sectionCombo)
|
||||||
|
|
||||||
def retranslateUi(self, Dialog):
|
def retranslateUi(self, Dialog):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
@@ -57,3 +67,4 @@ class Ui_Dialog(object):
|
|||||||
self.label_2.setText(_translate("Dialog", "Organization"))
|
self.label_2.setText(_translate("Dialog", "Organization"))
|
||||||
self.label_3.setText(_translate("Dialog", "Book"))
|
self.label_3.setText(_translate("Dialog", "Book"))
|
||||||
self.label_4.setText(_translate("Dialog", "Section"))
|
self.label_4.setText(_translate("Dialog", "Section"))
|
||||||
|
self.label_5.setText(_translate("Dialog", "Email"))
|
||||||
|
|||||||
@@ -24,37 +24,37 @@
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLineEdit" name="nameEdit"/>
|
<widget class="QLineEdit" name="nameEdit"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Organization</string>
|
<string>Organization</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLineEdit" name="orgEdit"/>
|
<widget class="QLineEdit" name="orgEdit"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Book</string>
|
<string>Book</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QComboBox" name="bookCombo"/>
|
<widget class="QComboBox" name="bookCombo"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Section</string>
|
<string>Section</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="QComboBox" name="sectionCombo"/>
|
<widget class="QComboBox" name="sectionCombo"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0" colspan="2">
|
<item row="5" column="0" colspan="2">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@@ -64,8 +64,25 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Email</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="emailEdit"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>nameEdit</tabstop>
|
||||||
|
<tabstop>emailEdit</tabstop>
|
||||||
|
<tabstop>orgEdit</tabstop>
|
||||||
|
<tabstop>bookCombo</tabstop>
|
||||||
|
<tabstop>sectionCombo</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ from PyQt6 import QtCore, QtGui, QtWidgets
|
|||||||
class Ui_Dialog(object):
|
class Ui_Dialog(object):
|
||||||
def setupUi(self, Dialog):
|
def setupUi(self, Dialog):
|
||||||
Dialog.setObjectName("Dialog")
|
Dialog.setObjectName("Dialog")
|
||||||
Dialog.resize(621, 569)
|
Dialog.resize(842, 569)
|
||||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(Dialog)
|
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
|
||||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
self.verticalLayout.setObjectName("verticalLayout")
|
||||||
self.nameLbl = QtWidgets.QLabel(parent=Dialog)
|
self.nameLbl = QtWidgets.QLabel(parent=Dialog)
|
||||||
self.nameLbl.setObjectName("nameLbl")
|
self.nameLbl.setObjectName("nameLbl")
|
||||||
self.verticalLayout_3.addWidget(self.nameLbl)
|
self.verticalLayout.addWidget(self.nameLbl)
|
||||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||||
self.label_2 = QtWidgets.QLabel(parent=Dialog)
|
self.label_2 = QtWidgets.QLabel(parent=Dialog)
|
||||||
@@ -32,16 +32,24 @@ class Ui_Dialog(object):
|
|||||||
self.activeBox.setEnabled(True)
|
self.activeBox.setEnabled(True)
|
||||||
self.activeBox.setObjectName("activeBox")
|
self.activeBox.setObjectName("activeBox")
|
||||||
self.horizontalLayout.addWidget(self.activeBox)
|
self.horizontalLayout.addWidget(self.activeBox)
|
||||||
self.verticalLayout_3.addLayout(self.horizontalLayout)
|
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
|
||||||
self.verticalLayout.setObjectName("verticalLayout")
|
|
||||||
self.label = QtWidgets.QLabel(parent=Dialog)
|
self.label = QtWidgets.QLabel(parent=Dialog)
|
||||||
self.label.setObjectName("label")
|
self.label.setObjectName("label")
|
||||||
self.verticalLayout.addWidget(self.label)
|
self.verticalLayout.addWidget(self.label)
|
||||||
|
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||||
self.wordView = QtWidgets.QListView(parent=Dialog)
|
self.wordView = QtWidgets.QListView(parent=Dialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.wordView.sizePolicy().hasHeightForWidth())
|
||||||
|
self.wordView.setSizePolicy(sizePolicy)
|
||||||
self.wordView.setObjectName("wordView")
|
self.wordView.setObjectName("wordView")
|
||||||
self.verticalLayout.addWidget(self.wordView)
|
self.horizontalLayout_2.addWidget(self.wordView)
|
||||||
self.verticalLayout_3.addLayout(self.verticalLayout)
|
self.textBrowser = QtWidgets.QTextBrowser(parent=Dialog)
|
||||||
|
self.textBrowser.setObjectName("textBrowser")
|
||||||
|
self.horizontalLayout_2.addWidget(self.textBrowser)
|
||||||
|
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||||
self.label_4 = QtWidgets.QLabel(parent=Dialog)
|
self.label_4 = QtWidgets.QLabel(parent=Dialog)
|
||||||
@@ -50,12 +58,12 @@ class Ui_Dialog(object):
|
|||||||
self.textEdit = QtWidgets.QTextEdit(parent=Dialog)
|
self.textEdit = QtWidgets.QTextEdit(parent=Dialog)
|
||||||
self.textEdit.setObjectName("textEdit")
|
self.textEdit.setObjectName("textEdit")
|
||||||
self.verticalLayout_2.addWidget(self.textEdit)
|
self.verticalLayout_2.addWidget(self.textEdit)
|
||||||
self.verticalLayout_3.addLayout(self.verticalLayout_2)
|
self.verticalLayout.addLayout(self.verticalLayout_2)
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
|
self.buttonBox = QtWidgets.QDialogButtonBox(parent=Dialog)
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||||
self.buttonBox.setObjectName("buttonBox")
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
self.verticalLayout_3.addWidget(self.buttonBox)
|
self.verticalLayout.addWidget(self.buttonBox)
|
||||||
|
|
||||||
self.retranslateUi(Dialog)
|
self.retranslateUi(Dialog)
|
||||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>621</width>
|
<width>842</width>
|
||||||
<height>569</height>
|
<height>569</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Session</string>
|
<string>Session</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="nameLbl">
|
<widget class="QLabel" name="nameLbl">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -63,16 +63,26 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Words</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QListView" name="wordView">
|
||||||
<property name="text">
|
<property name="sizePolicy">
|
||||||
<string>Words</string>
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QListView" name="wordView"/>
|
<widget class="QTextBrowser" name="textBrowser"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user