コード例 #1
0
    def initToolbar(self):
        self.toolbar.setMovable(False)
        self.toolbar.setObjectName("MainToolBar")
        self.toolbar.setStyleSheet(utils.parseStyleSheet())

        self.toolbar.addActions([self.new, self.exit, self.sync])
        self.toolbar.addActions([self.scrollbar])
        self.toolbar.addActions(
            [self.expand, self.collapse, self.expandall, self.collapseall])
コード例 #2
0
ファイル: graphics.py プロジェクト: hanknitli/Profile
	def __init__(self, parent=None):
		super(ErrorWindow, self).__init__(parent)

		self.setWindow()

		font = QApplication.font()
		font.setStyleStrategy(QFont.PreferAntialias)
		QApplication.setFont(font)

		self.windowtitle = QLabel()
		self.windowtitle.setObjectName("titleLabel")
		self.windowtitle.setStyleSheet(utils.parseStyleSheet())
		self.windowtitle.setAlignment(Qt.AlignCenter)

		self.bodylabel = QLabel()
		self.bodylabel.setObjectName("bodyLabel")
		self.bodylabel.setStyleSheet(utils.parseStyleSheet())
		self.bodylabel.setAlignment(Qt.AlignCenter)

		self.closebutton = QPushButton("&Close")
		self.closebutton.clicked.connect(self.close)
		self.closebutton.setObjectName("closeButton")
		self.closebutton.setStyleSheet(utils.parseStyleSheet())
		self.closebutton.setMinimumWidth(80)
		self.closebutton.setToolTip("Close and Quit")

		mainlayout = QGridLayout()
		mainlayout.addWidget(self.windowtitle, 0, 0, 1, 6)
		mainlayout.addWidget(self.bodylabel, 1, 1, 3, 2, Qt.AlignCenter)
		mainlayout.addWidget(self.closebutton, 2, 4, 1, 1)
		mainlayout.setRowMinimumHeight(0, 24)
		mainlayout.setColumnMinimumWidth(0, 10)
		mainlayout.setColumnMinimumWidth(3, 10)
		mainlayout.setColumnMinimumWidth(4, 80)
		mainlayout.setColumnMinimumWidth(5, 10)
		mainlayout.setSpacing(0)
		mainlayout.setMargin(1)

		self.setLayout(mainlayout)
		self.setObjectName("errorWindow")
		self.setStyleSheet(utils.parseStyleSheet())
		self.setWindowFlags(Qt.FramelessWindowHint)
		self.setWindowIcon(QIcon("resources/Icons/profile.ico"))
コード例 #3
0
    def __init__(self, parent=None):
        super(MainWidget, self).__init__(parent)

        # this variable is used to get the current selected item
        self.currentitem = None

        self.editor = QTextEdit(self)
        self.inittextedit()

        self.treewidget = QTreeWidget(self)
        self.inittree()

        layout = QHBoxLayout(self)
        layout.addWidget(self.treewidget)
        layout.addWidget(self.editor)
        layout.setSpacing(0)
        layout.setMargin(1)
        self.setLayout(layout)

        self.setObjectName("MainWidget")
        self.setStyleSheet(utils.parseStyleSheet())
        self.connections()
コード例 #4
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

        self.initWindow()

        # status bar for the main window
        self.statusbar = self.statusBar()
        self.initStatusbar()

        # menu bar for the main window
        self.menubar = self.menuBar()
        self.initMenubar()

        # tool bar for the main window
        self.toolbar = self.addToolBar("MainToolBar")
        self.initToolbar()

        self.mainwidget = MainWidget(self)
        self.setCentralWidget(self.mainwidget)

        self.setObjectName("Profile")
        self.setStyleSheet(utils.parseStyleSheet())

        self.connections()
コード例 #5
0
    def initMenubar(self):
        self.menubar.setObjectName("MainMenuBar")
        self.menubar.setStyleSheet(utils.parseStyleSheet())
        self.menubar.setStatusTip("ToolBar")

        # File menu item for the menu bar
        self.file = QMenu("&File", self)
        self.file.setStyleSheet(utils.parseStyleSheet())
        self.menubar.addMenu(self.file)

        # sub items in File menu
        self.new = QAction("&New", self)
        self.new.setIcon(QIcon())  # TODO fix the icon popup
        self.new.setShortcut("Ctrl+Shift+N")

        self.sync = QAction("&Synchronize", self)
        self.sync.setIcon(QIcon())  # TODO set an icon
        self.sync.setShortcut("")  # TODO define a shortcut

        self.exit = QAction("&Exit", self)
        self.exit.setShortcut("Alt+F4")
        self.exit.setStatusTip("Exit the application")

        # add the sub items to the File menu
        self.file.addActions([self.new, self.sync, self.exit])

        # Edit menu item for the menu bar
        self.edit = QMenu("&Edit")
        self.edit.setStyleSheet(utils.parseStyleSheet())
        self.menubar.addMenu(self.edit)

        # View menu item for the menu bar
        self.view = QMenu("&View")
        self.view.setStyleSheet(utils.parseStyleSheet())
        self.menubar.addMenu(self.view)

        # sub items in View menu
        self.scrollbar = QAction("Scrollbar", self)
        self.scrollbar.setIcon(QIcon())  # TODO add the checkmark icon
        self.scrollbar.setStatusTip("Show/Hide the tree's scrollbar")

        self.showtoolbar = QAction("Toolbar", self)
        self.showtoolbar.setIcon(QIcon())  # TODO add the checkmark icon
        self.showtoolbar.setStatusTip("Show/Hide the main toolbar")

        # add the sub items to the View menu
        self.view.addActions([self.scrollbar, self.showtoolbar])

        # Tools menu item
        self.tools = QMenu("&Tools")
        self.tools.setStyleSheet(utils.parseStyleSheet())
        self.menubar.addMenu(self.tools)

        # sub items in Tools menu

        self.expand = QAction("Expand This", self)
        self.expand.setIcon(QIcon())  # TODO add an icon
        self.expand.setStatusTip("Expand all the elements under this item")

        self.collapse = QAction("Collapse This", self)
        self.collapse.setIcon(QIcon())  # TODO add an icon
        self.collapse.setStatusTip("Collapse all the elements under this item")

        self.expandall = QAction("Expand All", self)
        self.expandall.setIcon(QIcon())  # TODO add an icon
        self.expandall.setStatusTip("Expand all the tree elements")

        self.collapseall = QAction("Collapse All", self)
        self.collapseall.setIcon(QIcon())  # TODO add an icon
        self.collapseall.setStatusTip("Collapse all the tree elements")

        # add the sub items to the Tools menu
        self.tools.addActions(
            [self.expand, self.collapse, self.expandall, self.collapseall])
コード例 #6
0
 def initStatusbar(self):
     self.statusbar.setObjectName("MainStatusBar")
     self.statusbar.setStyleSheet(utils.parseStyleSheet())
コード例 #7
0
 def inittree(self):
     self.treewidget.setObjectName("TreeWidget")
     self.treewidget.setStyleSheet(utils.parseStyleSheet())
     self.treewidget.setHeaderHidden(True)
     self.maketree()
     self.setTreeStyle()
コード例 #8
0
 def inittextedit(self):
     self.editor.setObjectName("editor")
     self.editor.setStyleSheet(utils.parseStyleSheet())