class MainWindow2(QMainWindow):
    def __init__(self, *args, **kwargs):
        super(MainWindow2, self).__init__(*args, **kwargs)

    @pyqtSlot()
    def kon(self, link):
        self.browser = QWebEngineView()
        self.browser.setUrl(QUrl(link))

        self.qwerty = QBoxLayout(QBoxLayout.LeftToRight, self)
        self.qwerty.addWidget(self.browser)
        self.qwerty.stretch(1)
        return self.qwerty
    def only_(self):
        self.lala = QLabel(self)
        self.lala.setText("Welcome")
        self.lala.setAlignment(Qt.AlignCenter)
        self.lala.setFont(QFont("Times", 25, QFont.Bold))

        self.redbull = QPushButton('Sign-In', self)
        self.bluebull = QPushButton('Sign-Up', self)

        asasasas = QBoxLayout(QBoxLayout.TopToBottom)
        asasasas.addWidget(self.lala)

        boxeraa = QBoxLayout(QBoxLayout.LeftToRight)
        boxeraa.stretch(1)
        boxeraa.setSpacing(1)
        asasasas.addWidget(self.bull)
        boxeraa.addWidget(self.redbull)
        boxeraa.addWidget(self.bluebull)
        asasasas.addLayout(boxeraa)
        self.dummy.setLayout(asasasas)
    def newbeta(self):
        #self.setStyleSheet("QPushButton { margin: 450pxself.setLayout(self.box)
        try:
            self.labe = QLabel(self)
            self.labe.setText("Welcome")
            self.labe.setAlignment(Qt.AlignCenter)
            self.labe.setFont(lf)
            self.labe.resize(160, 100)
            self.label = QLabel(self)

            self.label.setText("**Enter your credentials to login to Register")
            self.l1 = QLabel(self)
            self.l1.setText('        Registration Form')
            self.l1.resize(150, 100)
            self.l2 = QLabel(self)
            self.l2.setText('                Full Name')
            self.l2.resize(150, 100)
            self.l2.move(0.32 * sw, 0.22 * sh)
            self.fnme = QLineEdit(self)
            self.fnme.setText("Full Name")

            self.l3 = QLabel(self)
            self.l3.setText('                Username')
            self.us = QLineEdit(self)
            self.us.setText("Username")
            self.l4 = QLabel(self)
            self.l4.setText('                Password')
            self.us1 = QLineEdit(self)
            self.us1.setText("Password")
            self.us1.setEchoMode(QLineEdit.PasswordEchoOnEdit)

            self.l5 = QLabel(self)
            self.l5.setText('    Confirm Password')
            self.l5.resize(150, 100)
            self.l5.move(0.32 * sw, 0.40 * sh)
            self.us2 = QLineEdit(self)
            self.us2.setText("Confirm ")
            self.us2.setEchoMode(QLineEdit.Password)

            self.l6 = QLabel(self)
            self.l6.setText('                    Roll No')
            self.us3 = QLineEdit(self)
            self.us3.setText("Roll No")

            self.l7 = QLabel(self)
            self.l7.setText('                    Gender')
            self.gen = QComboBox(self)
            self.gen.addItem("        Male", )
            self.gen.addItem("      Female", )
            self.gen.addItem("      Others", )
            self.current = 'None'
            self.gen.activated.connect(self.handleActivated)

            self.l8 = QLabel(self)
            self.l8.setText('            Date of Birth')
            self.dt = QPushButton('Calendar', self)
            self.dt.setToolTip('Click Here to see the Calendar ')
            #self.dt.clicked.connect(dante)

            self.l9 = QLabel(self)
            self.l9.setText('                  email ID')
            self.us6 = QLineEdit(self)
            self.us6.setText(" email ID")

            self.ag = QCheckBox("I Agree To Terms And Condition", self)

            self.but1 = QPushButton('Reset', self)
            self.but1.setToolTip('Click Here To Go Back To Sign-In Form')
            self.but1.resize(170, 20)
            self.but1.clicked.connect(lambda: self.on_reset1('regclear'))

            self.butt2 = QPushButton('Back', self)
            self.butt2.setToolTip('Click Here to Reset The Form')
            self.butt2.clicked.connect(lambda: self.on_back)

            self.butt3 = QPushButton('Register', self)
            self.butt3.setToolTip('Click here to Register And use the App')
            self.butt3.clicked.connect(self.on_yes)

            box = QBoxLayout(QBoxLayout.LeftToRight)
            box.stretch(1)
            box.setSpacing(1)
            box.addWidget(self.but1)
            box.addWidget(self.butt2)
            box.addWidget(self.butt3)

            ay1 = QBoxLayout(QBoxLayout.LeftToRight)
            aya = QBoxLayout(QBoxLayout.LeftToRight)
            ay2 = QBoxLayout(QBoxLayout.LeftToRight)
            ay3 = QBoxLayout(QBoxLayout.LeftToRight)
            ay4 = QBoxLayout(QBoxLayout.LeftToRight)
            ay5 = QBoxLayout(QBoxLayout.LeftToRight)
            ay6 = QBoxLayout(QBoxLayout.LeftToRight)
            ay7 = QBoxLayout(QBoxLayout.LeftToRight)
            ay8 = QBoxLayout(QBoxLayout.LeftToRight)
            ay9 = QBoxLayout(QBoxLayout.LeftToRight)
            ay10 = QBoxLayout(QBoxLayout.LeftToRight)

            ay1.addWidget(self.labe)
            aya.addWidget(self.label)
            aya.addWidget(self.l1)
            ay2.addWidget(self.l2)
            ay2.addWidget(self.fnme)
            ay3.addWidget(self.l3)
            ay3.addWidget(self.us)
            ay4.addWidget(self.l4)
            ay4.addWidget(self.us1)
            ay5.addWidget(self.l5)
            ay5.addWidget(self.us2)
            ay6.addWidget(self.l6)
            ay6.addWidget(self.us3)
            ay7.addWidget(self.l7)
            ay7.addWidget(self.gen)
            ay8.addWidget(self.l8)
            ay8.addWidget(self.dt)
            #ay8.addWidget(self.us5)
            ay9.addWidget(self.l9)
            ay9.addWidget(self.us6)
            ay10.addWidget(self.ag)
            #self.la.setContentsMargins(0.44*sw, 0.2*sh, 0.44*sw,0

            box1 = QVBoxLayout()
            box1.stretch(1)
            box1.setSpacing(8)
            #box1.setContentsMargins(0.44*sw, 0.1*sh, 0.44*sw,0.1*sh)

            box1.addLayout(ay1)
            box1.addLayout(aya)
            box1.addLayout(ay2)
            box1.addLayout(ay3)
            box1.addLayout(ay4)
            box1.addLayout(ay5)
            box1.addLayout(ay6)
            box1.addLayout(ay7)
            box1.addLayout(ay8)
            box1.addLayout(ay9)
            box1.addLayout(ay10)
            box1.addLayout(box)

            self.reGGG.setLayout(box1)

        except Exception as dumm1:
            print(dumm1)
    def orange(self):
        try:
            d = 'ss'
            #self.setStyleSheet("QPushButton { margin: 10px,4ex; }")
            self.label1 = QLabel(self)
            self.label1.setText("Welcome")
            self.label1.setAlignment(Qt.AlignCenter)
            self.label1.setFont(QFont("Times", 25, QFont.Bold))
            self.label2 = QLabel(self)
            self.label2.setText("                        Login")
            self.label2.setAlignment(Qt.AlignRight)
            self.label2.setFont(QFont("Times", 10, QFont.Bold))
            self.log = QLabel(self)
            self.log.setText("**Enter your credentials to login")
            self.log.setAlignment(Qt.AlignLeft)
            self.log.setFont(QFont("Times", 10, QFont.Bold))
            self.bel2 = QLabel(self)
            self.bel2.setText("Username    ")
            self.bel2.setAlignment(Qt.AlignLeft)
            self.bel2.setFont(QFont("Times", 10, QFont.Bold))
            self.bel3 = QLabel(self)
            self.bel3.setText("Password     ")
            self.bel3.setAlignment(Qt.AlignCenter)
            self.bel3.setFont(QFont("Times", 10, QFont.Bold))
            self.entry1 = QLineEdit(self)
            self.entry1.setText("Username")
            self.entry1.setAlignment(Qt.AlignCenter)
            self.entry2 = QLineEdit(self)
            self.entry2.setText("Passwor")
            self.entry2.setAlignment(Qt.AlignCenter)
            self.entry2.setEchoMode(QLineEdit.Password)

            self.try1 = QLineEdit(self)
            self.try1.setText("Roll Number")
            self.try1.setAlignment(Qt.AlignCenter)
            self.rol_1 = QLabel(self)
            self.rol_1.setText("Roll Number   ")
            self.rol_1.setAlignment(Qt.AlignLeft)
            self.rol_1.setFont(QFont("Times", 9.8, QFont.Bold))

            self.button = QPushButton('Sign-In', self)
            self.button.setToolTip('Click here if you are an existing user')
            self.button.clicked.connect(lambda: self.on_signin())

            self.button3 = QPushButton('Forgot Password', self)
            self.button3.setToolTip(
                "Click here if you don't remember your password")
            self.button3.clicked.connect(self.on_forget)
            self.button22 = QPushButton('Reset', self)
            self.button22.setToolTip('Click here To Reset Form')
            self.c = str('logclear')
            self.button22.clicked.connect(lambda: self.on_reset1(self.c))

            lay1 = QBoxLayout(QBoxLayout.LeftToRight)
            lay2 = QBoxLayout(QBoxLayout.LeftToRight)
            lay3 = QBoxLayout(QBoxLayout.LeftToRight)
            lay4 = QBoxLayout(QBoxLayout.LeftToRight)
            lay5 = QBoxLayout(QBoxLayout.LeftToRight)
            lay6 = QBoxLayout(QBoxLayout.LeftToRight)

            lay1.addWidget(self.label1)
            lay2.addWidget(self.label2)
            lay2.addWidget(self.log)
            lay3.addWidget(self.bel2)
            lay3.addWidget(self.entry1)
            lay4.addWidget(self.bel3)
            lay4.addWidget(self.entry2)

            lay6.addWidget(self.rol_1)
            lay6.addWidget(self.try1)

            lay5.addWidget(self.button)
            lay5.addWidget(self.button22)
            lay5.addWidget(self.button3)

            box1a = QBoxLayout(QBoxLayout.TopToBottom)
            boxnew = QBoxLayout(QBoxLayout.TopToBottom)
            box1a.stretch(1)
            box1a.setSpacing(50)
            #box1a.setContentsMargins(0.44*sw, 0.08*sh, 0.44*sw,0.2*sh)
            box1a.addLayout(lay1)
            box1a.addLayout(lay2)
            box1a.addLayout(lay3)
            box1a.addLayout(lay4)
            box1a.addLayout(lay6)
            box1a.addLayout(lay5)

            #box1a.addLayout(self.newbeta.boxer)
            self.lo.setLayout(box1a)
        except Exception as dumm:
            print(dumm)
    def now(self):

        self.mediaPlayer = QMediaPlayer(None, QMediaPlayer.VideoSurface)

        videoWidget = QVideoWidget()
        #self.videoWidget.setFullscreen(False)

        self.playButton = QPushButton()
        self.playButton.setEnabled(False)
        self.playButton.setIcon(self.style().standardIcon(QStyle.SP_MediaPlay))
        self.playButton.clicked.connect(self.play)

        self.positionSlider = QSlider(Qt.Horizontal)
        self.positionSlider.setRange(0, 0)
        self.positionSlider.sliderMoved.connect(self.setPosition)

        self.errorLabel = QLabel()
        self.errorLabel.setSizePolicy(QSizePolicy.Preferred,
                                      QSizePolicy.Maximum)

        # Create new action
        openAction = QPushButton(QIcon('open.png'), '&Open', self)
        openAction.setShortcut('Ctrl+O')
        openAction.setStatusTip('Open movie')
        openAction.clicked.connect(self.openFile)

        self.setStyleSheet("QPushButton { margin: 150px; }")
        # Create a widget for window contents
        wid = QWidget(self)
        #self.setCentralWidget(wid)

        # Create layouts to place inside widget
        frm = QFormLayout()
        #frm.setContentsMargins(50, 300,100,10)
        frm.addRow(openAction, self.playButton)

        #50, 100,100,10
        mylay = QBoxLayout(QBoxLayout.TopToBottom)
        mylay.stretch(1)

        #videoWidget.setFullscreen(False)

        mylay.addWidget(videoWidget)
        mylay.addLayout(frm)
        mylay.addWidget(self.positionSlider)

        controlLayout = QHBoxLayout()
        controlLayout.stretch(1)
        controlLayout.setContentsMargins(0, 0, 0, 0)
        controlLayout.addLayout(mylay)

        layout = QVBoxLayout()
        layout.stretch(1)
        layout.addWidget(videoWidget)

        layout.addWidget(self.errorLabel)
        layout.addLayout(controlLayout)

        # Set widget to contain window contents
        wid.setLayout(layout)

        self.mediaPlayer.setVideoOutput(videoWidget)
        self.mediaPlayer.stateChanged.connect(self.mediaStateChanged)
        self.mediaPlayer.positionChanged.connect(self.positionChanged)
        self.mediaPlayer.durationChanged.connect(self.durationChanged)
        self.mediaPlayer.error.connect(self.handleError)

        self.tabk.setLayout(layout)