Exemplo n.º 1
0
def main():
    """
    Application entry point
    """
    logging.basicConfig(level=logging.DEBUG)
    # create the application and the main window
    app = QtWidgets.QApplication(sys.argv)
    #app.setStyle(QtWidgets.QStyleFactory.create("fusion"))
    window = QtWidgets.QMainWindow()

    # setup ui
    ui = example.Ui_MainWindow()
    ui.setupUi(window)
    ui.bt_delay_popup.addActions([ui.actionAction, ui.actionAction_C])
    ui.bt_instant_popup.addActions([ui.actionAction, ui.actionAction_C])
    ui.bt_menu_button_popup.addActions([ui.actionAction, ui.actionAction_C])
    window.setWindowTitle("BreezeDark example")

    # tabify dock widgets to show bug #6
    window.tabifyDockWidget(ui.dockWidget1, ui.dockWidget2)

    # setup stylesheet
    file = QFile(":/dark.qss")
    file.open(QFile.ReadOnly | QFile.Text)
    stream = QTextStream(file)
    app.setStyleSheet(stream.readAll())

    # auto quit after 2s when testing on travis-ci
    if "--travis" in sys.argv:
        QtCore.QTimer.singleShot(2000, app.exit)

    # run
    window.show()
    app.exec_()
Exemplo n.º 2
0
    def __init__(self):
        super(TestWindow, self).__init__()
        self.timer = QtCore.QTimer(self)

        self.ui = example.Ui_MainWindow() # in this and next line you say that you will use all widgets from testUI over self.ui

        self.page2 = QtWidgets.QWidget()
        self.pg2 = page2.Ui_widget()
        self.pg2.setupUi(self.page2)

        self.page3 = QtWidgets.QWidget()
        self.pg3 = qtgrapher.Ui_Form()
        self.pg3.setupUi(self.page3)

        self.ui.setupUi(self)
        
        self.ui.stackedWidget.addWidget(self.page2)
        self.ui.stackedWidget.addWidget(self.page3)
        #so, when you say self.ui.myButton ,that is pushButton in testUI that has name myButton
        self.ui.pushButton.clicked.connect(self.DoSomething)# connect button clicked with action
        self.pg2.Home.clicked.connect(self.goHome);
        self.pg3.pushButton.clicked.connect(self.goHome)
Exemplo n.º 3
0
from PyQt5 import QtWidgets
from PyQt5.QtCore import QFile, QTextStream
import breeze_resources,sys
import example



app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QMainWindow()
ui = example.Ui_MainWindow()
ui.setupUi(window)
# set stylesheet
file = QFile(":/light.qss")
file.open(QFile.ReadOnly | QFile.Text)
stream = QTextStream(file)
app.setStyleSheet(stream.readAll())

# code goes here
window.show()
app.exec_()