Ejemplo n.º 1
0
    def submitClicked(self):#if submit button pressed
        print('userName = '******'password = '******',')
           
               #0:date, 1:login time, 2: logout time, 3: status, 4: user name, 5: pwd
                dic[PersonGroupObj.name].append([data[3], data[4],data[5], p.name, p.person_id])
               

        keys = list(dic.keys())  
        done = 0
        count = 0;
        for key in keys:
            print(dic[key])
            for human in dic[key]:
                count = count + 1 
                if (userName == human[1]):
                    if (password == human[2]):
                        #password matches for login                   
                        if (human[0] == "Admin"):
                           # print('logged in as an Admin')
                            self.w.hide()
                            self.window = QtWidgets.QMainWindow()
                            self.ui = page5.Ui_MainWindow(human[3], human[4])
                            self.ui.setupUi(self.window)
                            self.window.show()
                 

                        else:
                            print('logged in as a normal user')
                            self.w.hide()
                            self.window = QtWidgets.QMainWindow()
                            self.ui = page3.Ui_MainWindow(human[3], human[4])
                            self.ui.setupUi(self.window)
                            self.window.show()


                    else: 
                        self.changeToRed()
                        print("password doesn't match the username")

                else:
                    done = done + 1

        if(count == done):
            self.changeToRed()
            print("no username found in the database")
Ejemplo n.º 2
0
    def open_settings(self):
        self.window = QtWidgets.QMainWindow()
        self.ui = Ui_MainWindow1()
        self.ui.setup(self.window)
        self.ui.checkBox_15.setChecked(True)
        self.ui.checkBox_15.toggled.connect(self.vid)
        self.ui.checkBox_14.toggled.connect(self.phnno)
        self.ui.checkBox_7.toggled.connect(self.barcode)
        self.ui.checkBox_2.setChecked(True)
        self.ui.checkBox_2.toggled.connect(self.frontpageheadermargin)
        self.ui.checkBox_5.setChecked(True)
        self.ui.checkBox_5.toggled.connect(self.RearPageFooterMargin)
        self.ui.checkBox.setChecked(True)
        self.ui.checkBox.toggled.connect(self.frontpageheader)
        self.ui.checkBox_6.setChecked(True)
        self.ui.checkBox_6.toggled.connect(self.rearpagefooter)
        # self.ui.checkBox_10.setChecked(True)
        self.ui.checkBox_10.toggled.connect(self.photoframe)
        self.ui.checkBox_4.setChecked(True)
        self.ui.checkBox_4.toggled.connect(self.rearpageheader)
        self.ui.checkBox_16.setChecked(True)
        self.ui.checkBox_16.toggled.connect(self.hindifooter)
        self.ui.checkBox_17.toggled.connect(self.Tamilfooter)
        self.ui.checkBox_18.toggled.connect(self.Punjabifooter)
        self.ui.checkBox_19.toggled.connect(self.Marathifooter)
        self.ui.checkBox_3.setChecked(True)
        self.ui.checkBox_3.toggled.connect(self.FrontPageFooter)
        self.ui.checkBox_11.toggled.connect(self.dd)
        self.ui.checkBox_12.toggled.connect(self.id)
        self.ui.checkBox_8.toggled.connect(self.uid)

        self.window.show()
Ejemplo n.º 3
0
def test():

	import sys
	app = QtWidgets.QApplication(sys.argv)
	win = QtWidgets.QMainWindow()

	def printValue(member):
		print("new enum value", member)

	class TestEnum(Enum):
		OptionA = "option_a"
		OptionB = "other_option"

	options = TestEnum

	options = ("a", "b", "c")

	#options = {"optionB" : "valueB", 33 : 55}

	widg = OptionRadioWidget(options, label=TestEnum.__name__,
	                       orientation=QtCore.Qt.Horizontal,
	                       parent=win)
	# widg = OptionComboWidget(TestEnum, value=TestEnum.OptionA, parent=win)
	widg.atomValueChanged.connect(printValue)
	print("w value", widg.atomValue())

	win.setCentralWidget(widg)
	win.show()
	sys.exit(app.exec_())
Ejemplo n.º 4
0
def test():

    from tree.test.constant import midTree
    import sys
    from tree.lib.constant import UI_PROPERTY_KEY
    from tree.ui.atomicwidget import AtomicWidgetParams, AtomicWidgetType
    app = QtWidgets.QApplication(sys.argv)
    win = QtWidgets.QMainWindow()

    # test referencing
    refTargetBranch = midTree("branchA")
    refParentBranch = midTree("branchB")
    #proxyBranch = refParentBranch.addReferenceBranch(refTargetBranch)
    #refParentBranch.addChild(refTargetBranch.copy())
    widg = TreeWidget(
        win,
        tree=midTree,
        showRoot=True,
        #showValues=False
        collapsible=True)
    win.setCentralWidget(widg)

    # test custom atom widgets
    midTree("branchA").value = True

    params = AtomicWidgetParams(AtomicWidgetType.BoolCheckBox)
    midTree("branchA").setProperty(UI_PROPERTY_KEY, params)
    #widg.view.addValueWidgetForBranchParams(midTree("branchA"))
    widg.view.generateWidgetsByProperties()

    midTree("branchA").v = False

    win.show()
    sys.exit(app.exec_())
Ejemplo n.º 5
0
def browser_link_gui():
    links = [
        'CAVENDISHFARMS', 'CLIFBAR', 'DANONE', 'DANNON', 'DANNONWAVE', 'GSK',
        'KRAFTHEINZCO', 'KROGER', 'LEGO', 'NESTLE', 'PG', 'PHILLIPS', 'POST',
        'PURINA', 'STONYFIELD', 'UNILEVER', 'WRIGLEY'
    ]
    windowName = "link_shortcuts"
    if cmds.window(windowName, exists=True):
        cmds.deleteUI(windowName, wnd=True)
    pointer = mui.MQtUtil.mainWindow()
    parent = shiboken2.wrapInstance(long(pointer), QtWidgets.QWidget)
    window = QtWidgets.QMainWindow(parent)
    window.setObjectName(windowName)
    window.setWindowTitle(windowName)
    window.setFixedSize(250, 50)
    mainWidget = QtWidgets.QWidget()
    window.setCentralWidget(mainWidget)
    vertical_layout_main = QtWidgets.QVBoxLayout(mainWidget)
    website_shortcut_combobox = QtWidgets.QComboBox()
    website_shortcut_combobox.setMaximumHeight(30)
    vertical_layout_main.addWidget(website_shortcut_combobox)
    for link in links:
        website_shortcut_combobox.addItem(link)
    website_shortcut_combobox.activated[str].connect(
        lambda: website_picker(website_shortcut_combobox))
    window.show()
Ejemplo n.º 6
0
 def goToMainPage(self):#back to main page button
     self.w.hide()
     self.window = QtWidgets.QMainWindow()
     self.ui = page1.Ui_MainWindow()
     self.ui.setupUi(self.window)
     self.window.show()
     print("go back to main page")
Ejemplo n.º 7
0
    def __init__(self, parent=None):
        MayaQWidgetDockableMixin.__init__(self, parent=parent)
        self.setSizePolicy(QtWidgets.QSizePolicy.Preferred,
                           QtWidgets.QSizePolicy.Preferred)

        # create a frame that other windows can dock into
        self.docking_frame = QtWidgets.QMainWindow(self)
        self.docking_frame.layout().setContentsMargins(0, 0, 0, 0)
        self.docking_frame.setWindowFlags(QtCore.Qt.Widget)
        self.docking_frame.setDockOptions(QtWidgets.QMainWindow.AnimatedDocks)

        self.central_widget = MirrorerWidget()
        self.setObjectName(self.central_widget.objectName() + "Window")
        self.setWindowTitle(self.central_widget.windowTitle())

        self.docking_frame.setCentralWidget(self.central_widget)

        layout = QtWidgets.QVBoxLayout(self)
        layout.setAlignment(QtCore.Qt.AlignTop)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self.docking_frame)
        self.setLayout(layout)

        self.minimum_size = self.central_widget.minimumSizeHint()
        self.preferred_size = QtCore.QSize(self.minimum_size.width(),
                                           self.minimum_size.height())
Ejemplo n.º 8
0
 def cleaner_window(self):
     print "cleaner_window"
     self.window_name = 'cleaner'
     if cmds.window(self.window_name, exists=True):
         cmds.deleteUI(self.window_name)
     pointer = mui.MQtUtil.mainWindow()
     parent = shiboken2.wrapInstance(long(pointer), QtWidgets.QWidget)
     window = QtWidgets.QMainWindow(parent)
     window.setObjectName(self.window_name)
     window.setWindowTitle(self.window_name)
     mainWidget = QtWidgets.QWidget()
     window.setCentralWidget(mainWidget)
     window.setFixedSize(250, 50)
     self.horizontal_layout = QtWidgets.QHBoxLayout(mainWidget)
     self.save_scene_button = QtWidgets.QPushButton("save")
     self.save_scene_button.pressed.connect(partial(self.save_scene))
     self.horizontal_layout.addWidget(self.save_scene_button)
     self.exit_button = QtWidgets.QPushButton("exit")
     self.exit_button.pressed.connect(partial(self.exit_cleaner))
     self.horizontal_layout.addWidget(self.exit_button)
     self.cleaner_button = QtWidgets.QPushButton("clean")
     self.cleaner_button.pressed.connect(partial(self.run_cleaner))
     self.horizontal_layout.addWidget(self.cleaner_button)
     window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
     window.show()
 def openWindow(self):
     self.window = QtWidgets.QMainWindow()
     self.ui = Ui_ExecuteWindow()
     self.ui.setupUi(self.window)
     MainWindow.hide()
     QtGui.qApp.processEvents()
     self.window.show()
Ejemplo n.º 10
0
 def changetoPlaylist(self):
     from playlist import Ui_playlistWindow
     self.window = QtWidgets.QMainWindow()
     self.ui = Ui_playlistWindow(self.window)
     self.ui.setupUi(self.window)
     self.window.show()
     self.playlist = Ui_playlistWindow.playlist
Ejemplo n.º 11
0
 def powrot(self):
     self.window = QtWidgets.QMainWindow()
     self.ui = main.Ui_MainWindow()
     self.ui.setupUi(self.window)
     QApplication.closeAllWindows()
     self.qt2_app = oknoAdmin.App()
     self.qt2_app.show()
 def render_overrides_prop_UI(self):
     window_name = "render_overrides_prop"
     if cmds.window(window_name,exists = True):
         cmds.deleteUI(window_name, wnd = True)
     pointer = mui.MQtUtil.mainWindow()
     parent = shiboken2.wrapInstance(long(pointer),QtWidgets.QWidget)
     self.window = QtWidgets.QMainWindow(parent)
     self.window.setObjectName(window_name)
     self.window.setWindowTitle(window_name)
     #self.window.setFixedSize(1015,300)
     self.window.setFixedWidth(550)
     self.window.setFixedHeight(575)
     self.main_widget = QtWidgets.QWidget()
     self.window.setCentralWidget(self.main_widget)
     self.base_vertical_layout = QtWidgets.QVBoxLayout(self.main_widget)
     self.main_horizontal_layout = QtWidgets.QHBoxLayout(self.main_widget)
     self.base_vertical_layout.addLayout(self.main_horizontal_layout)
     self.button_horizontal_layout = QtWidgets.QVBoxLayout(self.main_widget)
     self.base_vertical_layout.addLayout(self.button_horizontal_layout)
     self.myScriptJobID = cmds.scriptJob(p = window_name, event=["renderLayerManagerChange", self.populate_gui])
     self.myScriptJobID = cmds.scriptJob(p = window_name, event=["renderLayerChange", self.populate_gui])
     self.myScriptJobID = cmds.scriptJob(p = window_name, event=["NameChanged", self.populate_gui])
     self.populate_gui()
     self.window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
     self.window.show()
Ejemplo n.º 13
0
 def lights_palette_window(self):
     windowName = "lights palatte"
     if cmds.window(windowName, exists=True):
         cmds.deleteUI(windowName, wnd=True)
     pointer = mui.MQtUtil.mainWindow()
     parent = shiboken2.wrapInstance(long(pointer), QtWidgets.QWidget)
     window = QtWidgets.QMainWindow(parent)
     window.setObjectName(windowName)
     window.setWindowTitle(windowName)
     mainWidget = QtWidgets.QWidget()
     window.setCentralWidget(mainWidget)
     window.setFixedSize(250, 390)
     self.vertical_layout = QtWidgets.QVBoxLayout(mainWidget)
     self.grid_layout_top = QtWidgets.QGridLayout()
     self.vertical_layout.addLayout(self.grid_layout_top)
     self.grid_layout_bottom = QtWidgets.QGridLayout()
     self.vertical_layout.addLayout(self.grid_layout_bottom)
     self.myScriptJobID = cmds.scriptJob(
         p=windowName, event=["NameChanged", self.populate_window])
     self.myScriptJobID = cmds.scriptJob(
         p=windowName,
         event=["renderLayerManagerChange", self.populate_window])
     self.myScriptJobID = cmds.scriptJob(
         p=windowName, event=["renderLayerChange", self.populate_window])
     self.myScriptJobID = cmds.scriptJob(
         p=windowName, event=["SelectionChanged", self.populate_window])
     self.myScriptJobID = cmds.scriptJob(
         p=windowName, event=["SceneOpened", self.populate_window])
     self.populate_window()
     window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
     window.show()
Ejemplo n.º 14
0
def run(main_gui_class):
	# https://leomoon.com/journal/python/high-dpi-scaling-in-pyqt5/
	QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) #enable highdpi scaling
	QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) #use highdpi icons

	app = QtWidgets.QApplication(sys.argv)

	# START APPLICATION
	MainWindow = QtWidgets.QMainWindow()
	ui = main_gui_class()
	ui.MainWindow = MainWindow  # Allow class to set internals
	ui.setupUi(MainWindow)
	if hasattr(ui, 'save_defaults'):
		MainWindow.closeEvent = lambda self: ui.save_defaults()
	MainWindow.show()

	app.setStyle('Fusion')
	stylesheet_file = config.resource_path(Path("apps/GUI/shared/stylesheets/darkorange.css"))
	with open(stylesheet_file) as f:
		MainWindow.setStyleSheet(f.read())

	# APPLICATION EXIT
	try:
		ret = app.exec_()
	except:  # This doesn't catch a lot of things, since often abort is called
		if hasattr(ui, 'save_defaults'):
			ui.save_defaults()
		raise
	sys.exit(ret)
Ejemplo n.º 15
0
def main():
    """
    Application entry point
    """
    logging.basicConfig(level=logging.DEBUG)
    # create the application and the main window
    app = QtWidgets.QApplication(sys.argv)

    #splash
    splash = QtWidgets.QSplashScreen(QtGui.QPixmap("splash/splash_img.png"))
    splash.show()
    app.processEvents()
    time.sleep(3)
    window = QtWidgets.QMainWindow()
    # setup ui
    ui = mainui.Ui_MainWindow()
    ui.setupUi(window)
    icon = QtGui.QIcon()
    icon.addPixmap(QtGui.QPixmap("splash/logo.ico"), QtGui.QIcon.Normal,
                   QtGui.QIcon.Off)
    window.setWindowIcon(icon)
    window.setWindowTitle("空间地理大数据整理与质检系统 - Beta v 0.5.0")
    # setup stylesheet
    app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=True))
    # run
    window.show()
    splash.finish(window)
    app.exec_()
Ejemplo n.º 16
0
 def texture_linker_UI(self):
     window_name = "texture_swap"
     if cmds.window(window_name,exists = True):
         cmds.deleteUI(window_name, wnd = True)
     pointer = mui.MQtUtil.mainWindow()
     parent = shiboken2.wrapInstance(long(pointer),QtWidgets.QWidget)
     window = QtWidgets.QMainWindow(parent)
     window.setObjectName(window_name)
     window.setWindowTitle(window_name)
     main_widget = QtWidgets.QWidget()
     window.setCentralWidget(main_widget)
     window.setFixedSize(500,700)
     main_vertical_layout = QtWidgets.QVBoxLayout(main_widget)
     self.texture_thumbnails_listWidget = QtWidgets.QListWidget()
     self.texture_thumbnails_listWidget.setStyleSheet('QListWidget {background-color: #292929; color: #B0E0E6;}')
     self.texture_thumbnails_listWidget.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
     self.texture_thumbnails_listWidget.setIconSize(QtCore.QSize(214, 214))
     self.texture_thumbnails_listWidget.setViewMode(QtWidgets.QListView.IconMode)
     main_vertical_layout.addWidget(self.texture_thumbnails_listWidget)
     self.texture_thumbnails_listWidget.itemDoubleClicked.connect(self.fCheckLaunch)
     self.texture_thumbnails_listWidget.setFocusPolicy(QtCore.Qt.NoFocus)
     swap_textures_button = QtWidgets.QPushButton('swap textures')
     swap_textures_button.setFixedHeight(50)
     swap_textures_button.setStyleSheet("background-color:rgb(105,110,120)")
     swap_textures_button.setFont(QtGui.QFont('SansSerif', 12))
     main_vertical_layout.addWidget(swap_textures_button)
     swap_textures_button.pressed.connect(partial(self.texture_replace))
     self.populate_texture_window()
     fg = window.frameGeometry()
     cp = QtWidgets.QDesktopWidget().availableGeometry().center()
     fg.moveCenter(cp)
     window.move(fg.topLeft())
     window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
     self.myScriptJobID = cmds.scriptJob(p = window_name, event=["SelectionChanged", self.populate_texture_window])
     window.show()
 def __stubs(self):
     """ This just enables code completion. It should never be called """
     self.MainWindow = QtWidgets.QMainWindow()
     self.centralwidget = QtWidgets.QWidget()
     self.title = QtWidgets.QLabel()
     self.label_2 = QtWidgets.QLabel()
     self.logo = QtWidgets.QLabel()
     self.okButton = QtWidgets.QPushButton()
     self.equationLineEdit = QtWidgets.QLineEdit()
     self.graphButton = QtWidgets.QPushButton()
     self.label = QtWidgets.QLabel()
     self.equationLabel = QtWidgets.QLabel()
     self.label_3 = QtWidgets.QLabel()
     self.startIntervalDoubleSpinBox = QtWidgets.QDoubleSpinBox()
     self.label_4 = QtWidgets.QLabel()
     self.endIntervalDoubleSpinBox = QtWidgets.QDoubleSpinBox()
     self.bisezioneTable = QtWidgets.QTableWidget()
     self.bisezioneResultLabel = QtWidgets.QLabel()
     self.menubar = QtWidgets.QMenuBar()
     self.menuFile = QtWidgets.QMenu()
     self.menuStrumenti = QtWidgets.QMenu()
     self.menuAiuto = QtWidgets.QMenu()
     self.statusbar = QtWidgets.QStatusBar()
     self.actionApriDaCSV = QtWidgets.QAction()
     self.actionEsportaInCSV = QtWidgets.QAction()
     self.actionEsci = QtWidgets.QAction()
     self.actionCronologia = QtWidgets.QAction()
     self.actionImpostazioni = QtWidgets.QAction()
     self.actionLaTex = QtWidgets.QAction()
     self.actionInformazioni = QtWidgets.QAction()
     self.actionInformazioniQt = QtWidgets.QAction()
     raise AssertionError("This should never be called")
Ejemplo n.º 18
0
    def __init__(self):
        #I kind of understand this super line, its just making sure that QtWidget init is not overridden
        super(QtWidgets.QWidget).__init__()
        self.mode = "Importer"

        self.MainWindow = QtWidgets.QMainWindow()

        self.setupUi()
        self.main_menus = Main_Menus(self)
        self.main_menus.All_Menus_Init()

        #These two lines force the icon in the taskbar to be the one I want, instead of the random python one
        myappid = u'device_manager'  # arbitrary string
        ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)

        #This way, the app always starts with the mode being Importer by default
        self.Change_Mode("Importer")

        self.MainWindow.show()

        with open(
                os.path.dirname(__file__) + r'/System Settings/Settings.txt',
                'r') as file:
            system_settings = json.load(file)
            self.user = system_settings['Username']
Ejemplo n.º 19
0
    def __init__(self):
        super(MyFirstApp, self).__init__()
        self.setupUi(self)

        self.w_about = QtWidgets.QMainWindow()
        self.u_about = about.Ui_About()

        self.btnAdd.clicked.connect(self.me_add)
        self.btnClear.clicked.connect(self.me_clear)
        self.actAbout.triggered.connect(self.me_about)
        self.actExit.triggered.connect(self.me_close)
        self.actOpen.triggered.connect(self.me_open)
        self.lswMain.setAlternatingRowColors(True)
        self.lswMain.currentTextChanged()

        QtCore.QObject.connect(self.lswMain,
                               QtCore.SIGNAL("itemSelectionChanged()"),
                               self.btnClear.hide)

        db = sqlite3.connect('mydb')
        cursor = db.cursor()
        cursor.execute('''SELECT name, email, phone FROM users''')

        all_rows = cursor.fetchall()
        for row in all_rows:
            item = row[1]
            self.lswMain.addItem(item)
Ejemplo n.º 20
0
    def __init__(self, args):
        super(PigsApp, self).__init__(args)
        rounds = 10  # default number of games in tournament
        to_score = 100  # default score to play to
        self.MainWindow = QtWidgets.QMainWindow()
        self.icon = QIcon("pig_nose.ico")
        self.icon.addFile("pig-nose-16x16.png")
        self.icon.addFile("pig-nose-24x24.png")
        self.icon.addFile("pig-nose-32x32.png")
        self.icon.addFile("pig-nose-48x48.png")
        self.icon.addFile("pig-nose-256x256.png")
        self.setWindowIcon(self.icon)
        self.ui = pigs_ui.Ui_MainWindow()
        self.ui.setupUi(self.MainWindow)
        self.MainWindow.show()
        self.ui.rounds_lineEdit.setText(str(rounds))
        self.ui.rounds_lineEdit.setValidator(QIntValidator(1, 1_000_000, self))
        self.ui.score_lineEdit.setText(str(to_score))
        self.ui.score_lineEdit.setValidator(QIntValidator(1, 1_000_000, self))

        # dynamically add checkboxes for defined participant strategies
        self.stratboxes_and_strats = []
        for strategy in strategies:
            newbox = QtWidgets.QCheckBox(self.ui.centralwidget)
            newbox.setText(strategy.name)
            newbox.setToolTip(strategy.__doc__)
            newbox.setChecked(True)
            self.ui.participants_verticalLayout.addWidget(newbox)
            self.stratboxes_and_strats.append((newbox, strategy(0)))
        self.ui.startButton.clicked.connect(self.start_clicked)
        self.ui.checkall_pushButton.clicked.connect(self.check_all_strats)
        self.ui.uncheckall_pushButton.clicked.connect(self.uncheck_all_strats)
        self.exec_()
Ejemplo n.º 21
0
 def __init__(self):
     super(Window, self).__init__()
     parent = getMayaWindow()
     self.wind = QtWidgets.QMainWindow(parent)
     self.wind.setWindowTitle(" VPN_Drive   Switcher ")
     self.wind.setGeometry(500, 200, 1000, 735)
     self.InitUI()
Ejemplo n.º 22
0
 def renamer_window(self):
     windowName = "renamer"
     if cmds.window(windowName,exists = True):
         cmds.deleteUI(windowName, wnd = True)
     pointer = mui.MQtUtil.mainWindow()
     parent = shiboken2.wrapInstance(long(pointer),QtWidgets.QWidget)
     window = QtWidgets.QMainWindow(parent)
     window.setObjectName(windowName)
     window.setWindowTitle(windowName)
     window.setFixedSize(200,100)
     mainWidget = QtWidgets.QWidget()
     window.setCentralWidget(mainWidget)
     vertical_layout_main = QtWidgets.QVBoxLayout(mainWidget)
     horiz_layout_main = QtWidgets.QHBoxLayout(mainWidget)
     renamer_button = QtWidgets.QPushButton('rename shading engine nodes')
     renamer_button.pressed.connect(partial(self.find_shading_engines))
     vertical_layout_main.addWidget(renamer_button)
     self.postfix_line_edit = QtWidgets.QLineEdit()
     self.postfix_line_edit.setFixedSize(50,30)
     horiz_layout_main.addWidget(self.postfix_line_edit)
     vertical_layout_main.addLayout(horiz_layout_main)
     postfix_button = QtWidgets.QPushButton('set postfix on shaders')
     postfix_button.pressed.connect(partial(self.set_postfix))
     horiz_layout_main.addWidget(postfix_button)
     window.show()
Ejemplo n.º 23
0
def test_image_slice_item(qtbot: QtBot):
    window = QtWidgets.QMainWindow()
    qtbot.addWidget(window)

    scene = QtWidgets.QGraphicsScene(0, 0, 100, 100)
    view = QtWidgets.QGraphicsView(scene)
    window.setCentralWidget(view)

    array = np.random.random((10, 10))
    img = ScaledImageItem.fromArray(array, QtCore.QRectF(0, 0, 100, 100))
    item = ImageSliceWidgetItem(img, array)
    scene.addItem(item)

    item.mousePressEvent(
        FakeSceneMouseEvent(QtCore.Qt.LeftButton, QtCore.QPointF(1, 1)))
    item.mouseMoveEvent(
        FakeSceneMouseEvent(QtCore.Qt.LeftButton, QtCore.QPointF(1, 99)))
    item.mouseReleaseEvent(
        FakeSceneMouseEvent(QtCore.Qt.LeftButton, QtCore.QPointF(1, 99)))

    assert item.sliced.size == 10
    assert np.all(item.sliced == array[:, 0])

    item.actionCopyToClipboard()
    item.shape()  # For redraw

    # Draw everything
    window.show()
    qtbot.waitExposed(window)
Ejemplo n.º 24
0
	def buildUI(self):
		print("build UI")
		#window = IdemWindow(parent=None, session=self)
		window = QtWidgets.QMainWindow()
		widget = IdemWindow(parent=window, session=self)
		window.setCentralWidget(widget)
		self.mainWindow = window
Ejemplo n.º 25
0
def main():
    app = QtWidgets.QApplication(sys.argv)
    Crypt_Gui = QtWidgets.QMainWindow()
    ui = Ui_Crypt_Gui()
    ui.setupUi(Crypt_Gui)
    controller = Controller(ui)
    Crypt_Gui.show()
    sys.exit(app.exec_())
Ejemplo n.º 26
0
def get_main_window():
    parent = None
    for widget in QtWidgets.QApplication.allWidgets():
        # For nuke11 and upper.
        if nuke.NUKE_VERSION_MAJOR >= 11:
            if type(widget) == type(QtWidgets.QMainWindow()):
                parent = widget
        return parent
Ejemplo n.º 27
0
 def goAddUser(self):
     self.w.hide()
     print("Go to add user page")
     self.MainWindow = QtWidgets.QMainWindow()
     self.ui = page4.Ui_MainWindow(self._name, self._person_id)
     self.ui.setupUi(self.MainWindow)
     self.MainWindow.show()
     return 0
Ejemplo n.º 28
0
 def resizeimage(self):
     self.Resize = QtWidgets.QMainWindow()
     self.ui2 = Ui_MainWindow9()
     self.ui2.setupUi(self.Resize)
     self.ui2.horizontalSlider_11.valueChanged[int].connect(self.height)
     self.ui2.horizontalSlider_10.valueChanged[int].connect(self.Width)
     self.ui2.horizontalSlider_9.valueChanged[int].connect(self.side)
     self.Resize.show()
Ejemplo n.º 29
0
    def __init__(self, s):
        self._window = QtWidgets.QMainWindow()
        self._window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)
        self._window.setWindowTitle("Demo!")

        self._s = s
        self._s.s1.connect(self._on_signal)
        self._s.s2.connect(self._on_signal)
Ejemplo n.º 30
0
 def show(self):
  import sys
  app = QtWidgets.QApplication(sys.argv)
  authorizeWindow = QtWidgets.QMainWindow()
  ui = Ui_authorizeWindow()
  ui.setupUi(authorizeWindow)
  authorizeWindow.show()
  sys.exit(app.exec_())