Exemplo n.º 1
0
def qapp(qapp_args: list[str], pytestconfig) -> Iterator[widgets.Application]:
    app = widgets.Application(qapp_args)
    name = pytestconfig.getini("qt_qapp_name")
    app.set_metadata(
        app_name=name, app_version="1.0.0", org_name="test", org_domain="test"
    )
    yield app
Exemplo n.º 2
0
# -*- coding: utf-8 -*-
"""
@author: Philipp Temminghoff
"""

import pathlib
import sys

from prettyqt import widgets


class ImageViewer(widgets.Widget):
    def __init__(self, title="", parent=None):
        super().__init__(parent)
        self.title = title
        self.left = 10
        self.top = 10
        self.width = 640
        self.height = 480
        self.setWindowTitle(self.title)
        self.setGeometry(self.left, self.top, self.width, self.height)
        path = pathlib.Path("decisiontree.png")
        self.image = widgets.Label.image_from_path(path, parent=self)
        self.show()


if __name__ == "__main__":
    app = widgets.Application(sys.argv)
    ex = ImageViewer()
    sys.exit(app.exec_())
Exemplo n.º 3
0
                    upsideDown=True)

                bottom = y_loc + length // 2 + rect.height(
                ) // 2 + self.top_margin - 3
                # there is a 3 px offset that I can't attribute to any metric

                left = self.left_margin - rect.width()
                if left <= 0:
                    self.left_margin = rect.width() + 2
                    self.layout.setContentsMargins(self.left_margin,
                                                   self.top_margin,
                                                   self.right_margin,
                                                   self.bottom_margin)
            painter.drawText(left, bottom, v_str)

        return


if __name__ == '__main__':
    app = widgets.Application([])
    frame = widgets.Widget()
    ha = widgets.BoxLayout("horizontal")
    frame.setLayout(ha)

    w = LabeledSlider(labels=["test", "test2", "test3"],
                      orientation=QtCore.Qt.Vertical)

    ha.addWidget(w)
    frame.show()
    app.exec_()