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

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

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

          <bdo id='a0yDh'></bdo><ul id='a0yDh'></ul>
      1. 檢測 Widget-window resized 信號中的調整大小

        Detect resizing in Widget-window resized signal(檢測 Widget-window resized 信號中的調整大小)

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

              <tfoot id='1XUnw'></tfoot>
                <bdo id='1XUnw'></bdo><ul id='1XUnw'></ul>
                  <tbody id='1XUnw'></tbody>
                <legend id='1XUnw'><style id='1XUnw'><dir id='1XUnw'><q id='1XUnw'></q></dir></style></legend>
                  本文介紹了檢測 Widget-window resized 信號中的調整大小的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我使用 Qt Designer 創建了一個簡單的 UI,并將其轉換為 Python 代碼.我搜索了任何方法來檢測窗口大小的變化.

                  I create a simple UI with Qt Designer and convert it to Python codes. I searched for any method to detect changing window size.

                  這是生成的代碼:

                  from PyQt5 import QtCore, QtGui, QtWidgets
                  
                  class Ui_MainWindow(object):
                      def onResize(event):
                          print(event)
                  
                      def setupUi(self, MainWindow):
                          MainWindow.setObjectName("MainWindow")
                          MainWindow.setWindowTitle("MainWindow")
                          MainWindow.resize(200, 200)
                          self.centralwidget = QtWidgets.QWidget(MainWindow)
                          self.centralwidget.setObjectName("centralwidget")
                          MainWindow.setCentralWidget(self.centralwidget)
                  
                          MainWindow.resized.connect(self.someFunction)
                  
                          QtCore.QMetaObject.connectSlotsByName(MainWindow)
                  
                  if __name__ == "__main__":
                      import sys
                      app = QtWidgets.QApplication(sys.argv)
                      MainWindow = QtWidgets.QMainWindow()
                      ui = Ui_MainWindow()
                      ui.setupUi(MainWindow)
                      MainWindow.show()
                      sys.exit(app.exec_())
                  

                  我發現了一個類似的問題QWidget resize signal?和本教程處理大小 建議覆蓋 resizeEvent 方法QMainWindow.

                  I found a similar question QWidget resize signal? and this tutorial to handle size that recommended overriding resizeEvent method of QMainWindow.

                  但其中任何一個都不能解決我的問題.是否有任何 resized 函數來檢測窗口調整大小,如下所示:

                  But any of them doesn't solve my problem. Is there any resized function to detect window resizing like below:

                  MainWindow.resized.connect(self.someFunction)
                  

                  推薦答案

                  默認沒有這個信號,但是你可以創建resized信號,我們在resizeEvent 函數.

                  There is no such signal by default, but you can create the resized signal, we emit it in the resizeEvent function.

                  例如:

                  from PyQt5 import QtCore, QtGui, QtWidgets
                  
                  class Ui_MainWindow(object):
                      def setupUi(self, MainWindow):
                          MainWindow.setObjectName("MainWindow")
                          MainWindow.setWindowTitle("MainWindow")
                          MainWindow.resize(200, 200)
                          self.centralwidget = QtWidgets.QWidget(MainWindow)
                          self.centralwidget.setObjectName("centralwidget")
                          MainWindow.setCentralWidget(self.centralwidget)
                          QtCore.QMetaObject.connectSlotsByName(MainWindow)
                  
                  
                  class Window(QtWidgets.QMainWindow):
                      resized = QtCore.pyqtSignal()
                      def  __init__(self, parent=None):
                          super(Window, self).__init__(parent=parent)
                          ui = Ui_MainWindow()
                          ui.setupUi(self)
                          self.resized.connect(self.someFunction)
                  
                      def resizeEvent(self, event):
                          self.resized.emit()
                          return super(Window, self).resizeEvent(event)
                  
                      def someFunction(self):
                          print("someFunction")
                  
                  
                  if __name__ == "__main__":
                      import sys
                      app = QtWidgets.QApplication(sys.argv)
                      w = Window()
                      w.show()
                      sys.exit(app.exec_())
                  

                  這篇關于檢測 Widget-window resized 信號中的調整大小的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 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 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)
                  <tfoot id='7okw3'></tfoot>
                  • <i id='7okw3'><tr id='7okw3'><dt id='7okw3'><q id='7okw3'><span id='7okw3'><b id='7okw3'><form id='7okw3'><ins id='7okw3'></ins><ul id='7okw3'></ul><sub id='7okw3'></sub></form><legend id='7okw3'></legend><bdo id='7okw3'><pre id='7okw3'><center id='7okw3'></center></pre></bdo></b><th id='7okw3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7okw3'><tfoot id='7okw3'></tfoot><dl id='7okw3'><fieldset id='7okw3'></fieldset></dl></div>
                    <legend id='7okw3'><style id='7okw3'><dir id='7okw3'><q id='7okw3'></q></dir></style></legend>

                        • <bdo id='7okw3'></bdo><ul id='7okw3'></ul>

                          <small id='7okw3'></small><noframes id='7okw3'>

                            <tbody id='7okw3'></tbody>

                            主站蜘蛛池模板: 欧美日韩1区 | av天天看 | 国产精品久久毛片av大全日韩 | 欧美日韩毛片 | 性欧美精品一区二区三区在线播放 | 亚洲国产精品一区二区第一页 | 欧美精品久久 | 精品国产伦一区二区三区观看说明 | 精品国产一区二区三区久久久蜜月 | 久久这里只有精品首页 | 韩国主播午夜大尺度福利 | 99视频免费看 | 免费在线一区二区 | 狠狠的日 | jlzzxxxx18hd护士| 99国内精品久久久久久久 | 国产精品久久久久久久一区二区 | 中文字幕av在线播放 | 青草视频在线 | 久久av一区二区 | 欧美成人免费电影 | 五月天国产在线 | 日韩免费 | 国产一级在线 | 日本视频免费观看 | 亚洲国产一区二区三区四区 | 亚洲精品日韩精品 | 99久久国产免费 | 国产成人高清成人av片在线看 | 欧美一区二区三区一在线观看 | 成人在线精品视频 | 欧美a∨ | av毛片 | 欧美视频xxx | 久久久久黑人 | 欧美影院 | 国产精品毛片一区二区三区 | 精品一区二区三区四区视频 | 成人精品国产一区二区4080 | 先锋资源网站 | 一区二区三区精品视频 |