Merge branch 'master' of https://git.wmi.amu.edu.pl/s406917/VisionScore
This commit is contained in:
commit
6f22a62e91
1
win_venv/files/input/test.txt
Normal file
1
win_venv/files/input/test.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
test txt file
|
@ -17,14 +17,19 @@ def files(path):
|
|||||||
|
|
||||||
|
|
||||||
class LibraryTableButtons(QWidget):
|
class LibraryTableButtons(QWidget):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, filename, parent=None):
|
||||||
super(LibraryTableButtons,self).__init__(parent)
|
super(LibraryTableButtons,self).__init__(parent)
|
||||||
layout = QHBoxLayout()
|
|
||||||
|
|
||||||
|
def viewFile():
|
||||||
|
os.startfile(filePath + '\\' + filename)
|
||||||
|
|
||||||
|
layout = QHBoxLayout()
|
||||||
layout.setContentsMargins(0,0,0,0)
|
layout.setContentsMargins(0,0,0,0)
|
||||||
layout.setSpacing(0)
|
layout.setSpacing(0)
|
||||||
|
|
||||||
layout.addWidget(QPushButton('View'))
|
view_btn = QPushButton('View')
|
||||||
|
view_btn.clicked.connect(viewFile)
|
||||||
|
layout.addWidget(view_btn)
|
||||||
layout.addWidget(QPushButton('Delete'))
|
layout.addWidget(QPushButton('Delete'))
|
||||||
|
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
@ -51,14 +56,7 @@ class LibraryTable(QTableWidget):
|
|||||||
for index, date in enumerate(dates):
|
for index, date in enumerate(dates):
|
||||||
self.setItem(index,0,date)
|
self.setItem(index,0,date)
|
||||||
self.setItem(index,1,names[index])
|
self.setItem(index,1,names[index])
|
||||||
self.setCellWidget(index,2,LibraryTableButtons())
|
self.setCellWidget(index,2,LibraryTableButtons(names[index].text()))
|
||||||
|
|
||||||
def handleButtonClicked(w):
|
|
||||||
button = qApp.focusWidget()
|
|
||||||
# or button = self.sender()
|
|
||||||
index = self.table.indexAt(button.pos())
|
|
||||||
if index.isValid():
|
|
||||||
print(index.row(), index.column())
|
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
|
Loading…
Reference in New Issue
Block a user