Krita Source Code Documentation
Loading...
Searching...
No Matches
lastdocumentsdocker.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: CC0-1.0
2
3
try
:
4
from
PyQt6.QtWidgets
import
QWidget, QVBoxLayout, QListView, QPushButton
5
except
:
6
from
PyQt5.QtWidgets
import
QWidget, QVBoxLayout, QListView, QPushButton
7
from
krita
import
DockWidget
8
from
builtins
import
i18n
9
from
.
import
lastdocumentslistmodel
10
11
12
class
LastDocumentsDocker
(DockWidget):
13
14
def
__init__
(self):
15
super(LastDocumentsDocker, self).
__init__
()
16
17
self.
baseWidget
= QWidget()
18
self.
layout
= QVBoxLayout()
19
self.
listView
= QListView()
20
self.
loadButton
= QPushButton(i18n(
"Refresh"
))
21
self.
listModel
=
lastdocumentslistmodel.LastDocumentsListModel
(self.devicePixelRatioF())
22
23
self.
listView
.setModel(self.
listModel
)
24
self.
listView
.setFlow(QListView.Flow.LeftToRight)
25
26
self.
layout
.addWidget(self.
listView
)
27
self.
layout
.addWidget(self.
loadButton
)
28
29
self.
baseWidget
.setLayout(self.
layout
)
30
self.setWidget(self.
baseWidget
)
31
32
self.
loadButton
.clicked.connect(self.
refreshRecentDocuments
refreshRecentDocuments
)
33
self.setWindowTitle(i18n(
"Last Documents Docker"
))
34
35
def
canvasChanged
(self, canvas):
36
pass
37
38
def
refreshRecentDocuments
(self):
39
self.listModel.loadRecentDocuments()
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker
Definition
lastdocumentsdocker.py:12
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker.listModel
listModel
Definition
lastdocumentsdocker.py:21
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker.canvasChanged
canvasChanged(self, canvas)
Definition
lastdocumentsdocker.py:35
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker.refreshRecentDocuments
refreshRecentDocuments
Definition
lastdocumentsdocker.py:32
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker.loadButton
loadButton
Definition
lastdocumentsdocker.py:20
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker.baseWidget
baseWidget
Definition
lastdocumentsdocker.py:17
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker.refreshRecentDocuments
refreshRecentDocuments(self)
Definition
lastdocumentsdocker.py:38
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker.listView
listView
Definition
lastdocumentsdocker.py:19
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker.layout
layout
Definition
lastdocumentsdocker.py:18
lastdocumentsdocker.lastdocumentsdocker.LastDocumentsDocker.__init__
__init__(self)
Definition
lastdocumentsdocker.py:14
lastdocumentsdocker.lastdocumentslistmodel.LastDocumentsListModel
Definition
lastdocumentslistmodel.py:14
QtWidgets
QtWidgets
plugins
python
lastdocumentsdocker
lastdocumentsdocker.py
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52