Пример #1
0
 def updateEditorGeometry(self, editor: QWidget,
                          option: QStyleOptionViewItem,
                          index: QModelIndex) -> None:
     itemOption = QStyleOptionViewItem(option)
     # set size of editor to size of cell
     geom: QRect = QApplication.style().subElementRect(
         QStyle.SE_ItemViewItemText, itemOption, editor)
     geom.setTop(geom.top())
     editor.setGeometry(geom)
Пример #2
0
    def __init__(self):
        super(MainWindow, self).__init__()
        #self.ui = ()
        self.setupUi(self)

        self.p: QProcess = None

        dirname = r"K:\Media Library"

        processing_dirs = getBaseDirs(dirname)

        s: QtCore.QSize = self.treeView.iconSize()
        self.message(f'size = {s}')
        s = QtCore.QSize(16, 16)  # Set icon sizing here
        self.treeView.setIconSize(s)

        style = QApplication.style()
        self.running_icon = style.standardIcon(QStyle.SP_BrowserReload)
        self.done_icon = style.standardIcon(QStyle.SP_DialogApplyButton)
        self.failed_icon = style.standardIcon(QStyle.SP_MessageBoxCritical)
        self.missing_icon = style.standardIcon(
            QStyle.SP_TitleBarContextHelpButton)
        self.added_icon = style.standardIcon(QStyle.SP_ArrowUp)
        self.warning_icon = style.standardIcon(QStyle.SP_MessageBoxWarning)

        self.checksum_sets = []

        for dirname in processing_dirs:
            self.checksum_sets.append(ChecksumSet(dirname))

        self.updateStats()

        self.populateModel()
        self.treeView.setModel(self.model)
        #   self.treeView.setExpandsOnDoubleClick(True)

        #      for x in self.iterItems(self.model.invisibleRootItem()):
        #    y = x.data(role=DisplayRole)
        #     z = x.data(role=UserRole)
        #    self.message(f'y = {y}, z = {z}')
        #    x.setText('hi')
        #         y = x.data(role=QtCore.Qt.UserRole)
        #        self.message(x.text())

        #        self.message('HI' + y.baseDirname)
        #        self.message('HI' + str(y))

        self.start_process()
Пример #3
0
 def proteinsSearchLineEditTextChanged(self, text):
     # Sets back text to standard color (in case it was set to red)
     self.proteinsSearchLineEdit.setPalette(
         QApplication.style().standardPalette())
Пример #4
0
)

import natsort  # type: ignore

from .. import core, iso639, models
from ..sources.base import Parser
from ..utils import CONFIG

from ..__version__ import __version__

from . import common, resources, template, utils

_app = QApplication([])
_app.setAttribute(Qt.AA_UseHighDpiPixmaps)

QStyle = _app.style()

LOGO = QPixmap(":/logo.jpg")

HOME = pathlib.Path.home()

CACHE = core.Cache()

T_ADD = "Add Manga"
T_DELETE = "Delete Manga"
T_DOWNLOAD = "Download Manga"

MANGA = {}
MANGA_LOCK = threading.Lock()