久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  1. <legend id='refGW'><style id='refGW'><dir id='refGW'><q id='refGW'></q></dir></style></legend>
        <bdo id='refGW'></bdo><ul id='refGW'></ul>

    1. <tfoot id='refGW'></tfoot>

    2. <small id='refGW'></small><noframes id='refGW'>

    3. <i id='refGW'><tr id='refGW'><dt id='refGW'><q id='refGW'><span id='refGW'><b id='refGW'><form id='refGW'><ins id='refGW'></ins><ul id='refGW'></ul><sub id='refGW'></sub></form><legend id='refGW'></legend><bdo id='refGW'><pre id='refGW'><center id='refGW'></center></pre></bdo></b><th id='refGW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='refGW'><tfoot id='refGW'></tfoot><dl id='refGW'><fieldset id='refGW'></fieldset></dl></div>

      如何使用按鈕打開新窗口

      How to open new window with push button(如何使用按鈕打開新窗口)
      <tfoot id='cSWoi'></tfoot>
    4. <i id='cSWoi'><tr id='cSWoi'><dt id='cSWoi'><q id='cSWoi'><span id='cSWoi'><b id='cSWoi'><form id='cSWoi'><ins id='cSWoi'></ins><ul id='cSWoi'></ul><sub id='cSWoi'></sub></form><legend id='cSWoi'></legend><bdo id='cSWoi'><pre id='cSWoi'><center id='cSWoi'></center></pre></bdo></b><th id='cSWoi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cSWoi'><tfoot id='cSWoi'></tfoot><dl id='cSWoi'><fieldset id='cSWoi'></fieldset></dl></div>

          <tbody id='cSWoi'></tbody>

          • <bdo id='cSWoi'></bdo><ul id='cSWoi'></ul>
            • <legend id='cSWoi'><style id='cSWoi'><dir id='cSWoi'><q id='cSWoi'></q></dir></style></legend>

                <small id='cSWoi'></small><noframes id='cSWoi'>

                本文介紹了如何使用按鈕打開新窗口的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                如何打開一個允許我從以下代碼中選擇時間的新窗口?我嘗試使用connect函數(shù)連接到windows2,但似乎出現(xiàn)錯誤.

                How do I open a new window which allows me to select the time from the following code? I tried to use connect function to connect to windows2 however it appears that there is an error.

                我想通過 Dropbox 選擇時間,我可以在上午 10 點(diǎn)、上午 11 點(diǎn)等之前選擇時間.有誰知道您也可以如何實(shí)現(xiàn)這一點(diǎn)?

                I would like to select time by a dropbox where I could choose time by 10 am, 11 am, ect.. Does anyone know how you could implement this as well?

                class Window(QMainWindow):
                    def __init__(self):
                        super().__init__()
                
                        self.label = QLabel()
                        self.calendar = QCalendarWidget()
                        self.title="Select date from calendar"
                        self.left = 600
                        self.top = 300
                        self.width = 500
                        self.height = 480
                        self.iconName = "home.png"
                        self.setWindowTitle(self.title)
                        self.setWindowIcon(QtGui.QIcon(self.iconName))
                        self.setGeometry(self.left, self.top, self.width, self.height)
                
                        self.proceedbutton = QPushButton("Proceed to select time", self)
                        self.proceedbutton.setGeometry(290, 430, 190, 40)
                        self.proceedbutton.setToolTip("<h3>Start the Session</h3>")
                        self.proceedbutton.clicked.connect(self.window2)
                
                        self.hide()
                
                        self.backbutton = QPushButton("Back", self)
                        self.backbutton.setGeometry(200, 430, 80, 40)
                        self.backbutton.setToolTip("<h3>Start the Session</h3>")
                
                        self.Calendar()
                        self.show()
                
                    def Calendar(self):
                        CalendarVbox = QVBoxLayout()
                        self.calendar.setGridVisible(True)
                
                        self.label.setFont(QtGui.QFont("Sanserif", 10))
                        self.label.setStyleSheet('color:black')
                        CalendarVbox.addWidget(self.calendar)
                        CalendarVbox.addWidget(self.label)
                
                        self.setLayout(CalendarVbox)
                        self.calendar.selectionChanged.connect(self.onSelectionChanged)
                
                    def window2(self):
                        self.label = QLabel("Select Time", self)
                        self.label.move(200,430)
                        self.setWindowTitle("Select Time")
                        self.setGeometry(self.left, self.top, self.width, self.height)
                        self.show()
                
                    def onSelectionChanged(self):
                        ca = self.calendar.selectedDate()
                        self.label.setText(ca.toString())
                
                App = QApplication(sys.argv)
                window = Window()
                sys.exit(App.exec())
                

                推薦答案

                開始使用layouts

                沒有父級的小部件 - 有一個窗口.

                A widget without a parent - there is a window.

                import sys
                from PyQt5 import QtCore, QtGui, QtWidgets
                from PyQt5.QtWidgets import *
                from PyQt5.QtCore import *
                from PyQt5.QtGui import *
                
                class Window(QWidget):         #(QMainWindow):
                    def __init__(self):
                        super().__init__()
                
                        self.title="Select date from calendar"
                        self.left, self.top, self.width, self.height  = 600, 100, 500, 480
                        self.iconName = "Ok.png"             # <--- home.png
                        self.setWindowTitle(self.title)
                        self.setWindowIcon(QtGui.QIcon(self.iconName))
                        self.setGeometry(self.left, self.top, self.width, self.height)
                
                        self.calendar = QCalendarWidget()
                        self.calendar.setGridVisible(True)
                        self.calendar.selectionChanged.connect(self.onSelectionChanged)
                
                        self.label = QLabel()
                        self.label.setFont(QtGui.QFont("Sanserif", 10))
                        self.label.setStyleSheet('color: blue;')
                
                        self.proceedbutton = QPushButton("Proceed to select time", self)
                        self.proceedbutton.setToolTip("<h3>Start the Session</h3>")
                        self.proceedbutton.clicked.connect(self.window2)
                
                        self.backbutton = QPushButton("Back", self)
                        self.backbutton.setToolTip("<h3>Start the Session</h3>")
                
                        self.comboBox = None
                
                        self.grid = QtWidgets.QGridLayout(self)
                        self.grid.addWidget(self.calendar, 0, 0, 1, 3)
                        self.grid.addWidget(self.label, 1, 0, 1, 3)
                        self.grid.addWidget(self.backbutton, 2, 1, 1, 1)
                        self.grid.addWidget(self.proceedbutton, 2, 2, 1, 1)
                
                    def window2(self):
                        self.window = QWidget() 
                        self.window.setWindowTitle("Select Time")
                        self.window.setGeometry(self.left/3, self.top, self.width/3, self.height/3)
                
                        self.label = QLabel("Select Time")                       # --- , self)
                
                        self.comboBox = QtWidgets.QComboBox()
                        self.comboBox.addItems(["choose time", "10", "11", "12"])       
                        self.comboBox.activated[str].connect(self.onComboActivated)
                
                        layout = QFormLayout(self.window)
                        layout.addRow('Choose Time', self.comboBox)
                
                        self.window.show()
                
                    def onSelectionChanged(self):
                        ca = self.calendar.selectedDate()
                        self.label.setText(ca.toString())
                
                    def onComboActivated(self, text):
                        print("choose time: {}".format(text))
                
                if __name__ == '__main__':
                    App = QApplication(sys.argv)
                    window = Window()
                    window.show()
                    sys.exit(App.exec())
                

                這篇關(guān)于如何使用按鈕打開新窗口的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                How to bind a function to an Action from Qt menubar?(如何將函數(shù)綁定到 Qt 菜單欄中的操作?)
                PyQt progress jumps to 100% after it starts(PyQt 啟動后進(jìn)度躍升至 100%)
                How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標(biāo)簽設(shè)置在固定位置,以便當(dāng)我向左或向右滾動時,yaxis 刻度標(biāo)簽應(yīng)該可見
                `QImage` constructor has unknown keyword `data`(`QImage` 構(gòu)造函數(shù)有未知關(guān)鍵字 `data`)
                Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進(jìn)度條?)
                      <tbody id='HBsg6'></tbody>

                  1. <i id='HBsg6'><tr id='HBsg6'><dt id='HBsg6'><q id='HBsg6'><span id='HBsg6'><b id='HBsg6'><form id='HBsg6'><ins id='HBsg6'></ins><ul id='HBsg6'></ul><sub id='HBsg6'></sub></form><legend id='HBsg6'></legend><bdo id='HBsg6'><pre id='HBsg6'><center id='HBsg6'></center></pre></bdo></b><th id='HBsg6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='HBsg6'><tfoot id='HBsg6'></tfoot><dl id='HBsg6'><fieldset id='HBsg6'></fieldset></dl></div>
                      <bdo id='HBsg6'></bdo><ul id='HBsg6'></ul>
                    • <tfoot id='HBsg6'></tfoot>
                    • <small id='HBsg6'></small><noframes id='HBsg6'>

                      <legend id='HBsg6'><style id='HBsg6'><dir id='HBsg6'><q id='HBsg6'></q></dir></style></legend>

                          主站蜘蛛池模板: 国产成人aⅴ| 五十女人一级毛片 | 日本字幕在线观看 | 国产精品久久久久免费 | 日韩免费一区二区 | 国产蜜臀97一区二区三区 | 91色在线视频 | 91网站在线播放 | 亚洲性视频 | 国产一区二区毛片 | 91色网站| 亚洲高清视频在线观看 | 久久久999成人 | 夜夜操天天干 | 精品久久久久久久久久久 | 成人激情视频免费在线观看 | 欧美区在线 | 91国内精品久久 | 亚洲韩国精品 | 国产福利资源在线 | 国产精品久久久久久久久久 | www日| 国产视频一区在线 | 国内精品视频一区二区三区 | 亚洲人一区 | 亚洲精品美女 | 九九国产 | а_天堂中文最新版地址 | 久久天天躁狠狠躁夜夜躁2014 | 欧美最猛黑人xxxⅹ 粉嫩一区二区三区四区公司1 | 久久精品国产精品青草 | 色姑娘av | 中文字幕视频三区 | 国产不卡一区 | 日韩久久精品视频 | 国产精品久久久久久网站 | 欧美一区成人 | 国产日韩视频 | 成人免费视频网站在线看 | 国产男女猛烈无遮掩视频免费网站 | 国产 日韩 欧美 制服 另类 |