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

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

        <small id='2WpuM'></small><noframes id='2WpuM'>

          <bdo id='2WpuM'></bdo><ul id='2WpuM'></ul>
        <legend id='2WpuM'><style id='2WpuM'><dir id='2WpuM'><q id='2WpuM'></q></dir></style></legend>

        在按鈕按下的滾動區(qū)域中加載 QTableWidgets

        Load QTableWidgets in a Scroll Area on Button Push(在按鈕按下的滾動區(qū)域中加載 QTableWidgets)
        <tfoot id='3QtNe'></tfoot>

              <tbody id='3QtNe'></tbody>

              <bdo id='3QtNe'></bdo><ul id='3QtNe'></ul>

                <small id='3QtNe'></small><noframes id='3QtNe'>

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

                • 本文介紹了在按鈕按下的滾動區(qū)域中加載 QTableWidgets的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有一個名為test()"的方法,它將 3 個單行表加載到滾動條中.

                  I have a method named 'test()' that loads 3 one-row tables into a scrollbar.

                  由于某種原因,我無法弄清楚,但是,如果我只是在加載時激活 test() 它會起作用,但如果我將其注釋掉然后嘗試通過按下按鈕來激活它,它就不起作用.

                  For some reason that I cannot figure out, however, the while it works if I simply activate test() on load, it doesn't work if I comment it out and then try to activate it via the push of a button.

                  這里是主模塊(帶有 test())

                  Here is the main module (with test())

                  from PyQt5 import QtCore, QtWidgets
                  from design import Ui_MainWindow
                  
                  class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
                      def __init__(self, *args, **kwargs):
                          QtWidgets.QMainWindow.__init__(self, *args, **kwargs)
                          self.setupUi(self)
                          #test(self)
                  
                  def test(self):
                      from random import randint
                      x = randint(0, 99)
                      print(x)
                      height = 30
                      yPos = 0
                      for i in range(3):
                  
                          rowVals = ['test%s' % str(x + i)]
                  
                          qTbl = QtWidgets.QTableWidget(self.sawDoc)
                          qTbl.setObjectName("tbl%s" % (i))
                          qTbl.setGeometry(QtCore.QRect(0, yPos, 880, height))
                          qTbl.horizontalHeader().setVisible(False)
                          qTbl.verticalHeader().setVisible(False)
                          yPos += height
                  
                          qTbl.setRowCount(1)
                          qTbl.setColumnCount(len(rowVals))
                          for r, cell in enumerate(rowVals):
                              item = QtWidgets.QTableWidgetItem()
                              item.setText(str(cell))
                              qTbl.setItem(0, r, item)
                  
                  if __name__ == "__main__":
                      import sys
                      app = QtWidgets.QApplication(sys.argv)
                      w = MainWindow()
                      w.show()
                      sys.exit(app.exec_())
                  

                  這里是設(shè)計模塊(帶有按鈕)

                  And here is the design module (with the button)

                  from PyQt5 import QtCore, QtGui, QtWidgets
                  
                  class Ui_MainWindow(object):
                      def setupUi(self, MainWindow):
                          MainWindow.setObjectName("MainWindow")
                          MainWindow.resize(896, 453)
                          self.centralwidget = QtWidgets.QWidget(MainWindow)
                          self.centralwidget.setObjectName("centralwidget")
                          self.scrDoc = QtWidgets.QScrollArea(self.centralwidget)
                          self.scrDoc.setGeometry(QtCore.QRect(0, 0, 891, 391))
                          self.scrDoc.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
                          self.scrDoc.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
                          self.scrDoc.setWidgetResizable(False)
                          self.scrDoc.setObjectName("scrTest")
                          self.sawDoc = QtWidgets.QWidget()
                          self.sawDoc.setGeometry(QtCore.QRect(0, 0, 869, 300))
                          self.sawDoc.setObjectName("sawDoc")
                          self.scrDoc.setWidget(self.sawDoc)
                          self.btnTest = QtWidgets.QPushButton(self.centralwidget)
                          self.btnTest.setGeometry(QtCore.QRect(430, 400, 80, 15))
                          self.btnTest.setObjectName("btnTest")
                          MainWindow.setCentralWidget(self.centralwidget)
                          self.statusbar = QtWidgets.QStatusBar(MainWindow)
                          self.statusbar.setObjectName("statusbar")
                          MainWindow.setStatusBar(self.statusbar)
                  
                          self.retranslateUi(MainWindow)
                          QtCore.QMetaObject.connectSlotsByName(MainWindow)
                  
                          self.btnTest.clicked.connect(self.test)
                  
                      def test(self):
                          import main
                          main.test(self)
                  
                      def retranslateUi(self, MainWindow):
                          _translate = QtCore.QCoreApplication.translate
                          MainWindow.setWindowTitle(_translate("MainWindow", "昊珩のCAT工具"))
                          self.btnTest.setText(_translate("MainWindow", "Test"))
                  
                  
                  
                  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_())
                  

                  當(dāng)我按下按鈕時,什么也沒有發(fā)生(除了打印成功).

                  Simply nothing happens when I push the button (except for the print out working successfully).

                  誰能告訴我怎么了?

                  推薦答案

                  一開始是父母給孩子看,之后孩子自己負(fù)責(zé)展示自己,簡單的解決方案是使用show():

                  The parents show the children at the beginning, but afterwards it is the responsibility of the children to show themselves, the simple solution is to use show():

                  qTbl = QtWidgets.QTableWidget(self.sawDoc)
                  qTbl.show()
                  

                  但是我看到你以一種不優(yōu)雅的方式實現(xiàn)解決方案,連接在 main.py 中完成,不要修改 Qt Designer 生成的文件(刪除 design.py 中的連接和測試方法)您必須使用布局并在其中添加 QTableWidget.

                  But I see that you are implementing the solution in an inelegant way, the connection do it in main.py, do not modify the file generated by Qt Designer (delete the connection and the test method in design.py) You must use a layout and there add the QTableWidget.

                  class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
                      def __init__(self, *args, **kwargs):
                          QtWidgets.QMainWindow.__init__(self, *args, **kwargs)
                          self.setupUi(self)
                          self.btnTest.clicked.connect(self.test)
                  
                      def test(self):
                          from random import randint
                          x = randint(0, 99)
                  
                          lay = QtWidgets.QVBoxLayout(self.sawDoc)
                          for i in range(3):
                              rowVals = ['test%s' % str(x + i)]
                              qTbl = QtWidgets.QTableWidget()
                              qTbl.setObjectName("tbl%s" % (i))
                              qTbl.horizontalHeader().hide()
                              qTbl.verticalHeader().hide()
                              qTbl.setRowCount(1)
                              qTbl.setColumnCount(len(rowVals))
                              for r, cell in enumerate(rowVals):
                                  item = QtWidgets.QTableWidgetItem()
                                  item.setText(str(cell))
                                  qTbl.setItem(0, r, item)
                              qTbl.resize(qTbl.sizeHint())
                              lay.addWidget(qTbl)
                  

                  這篇關(guān)于在按鈕按下的滾動區(qū)域中加載 QTableWidgets的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 啟動后進度躍升至 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時顯示進度條?)
                      <tbody id='o8gRH'></tbody>

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

                      • <bdo id='o8gRH'></bdo><ul id='o8gRH'></ul>

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

                          <legend id='o8gRH'><style id='o8gRH'><dir id='o8gRH'><q id='o8gRH'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 精产国产伦理一二三区 | 亚洲成人一区 | 日韩av三区| 天天看天天操 | 午夜精品久久 | 国产精品成人品 | 亚洲国产aⅴ精品 | 国产精品伦一区二区三级视频 | 欧美黄色性生活视频 | 91免费在线| 日韩精品1区2区3区 国产精品国产成人国产三级 | 99精品国产一区二区三区 | 成人久久久 | 亚洲精品1区 | 精品视频一区二区三区在线观看 | 国产精品午夜电影 | 精品熟人一区二区三区四区 | 国产精品久久久久久久久久不蜜臀 | 一级a性色生活片久久毛片 一级特黄a大片 | 中文字幕一区二区三区四区五区 | 亚洲小视频在线观看 | 视频在线观看亚洲 | 美女131mm久久爽爽免费 | 视频一二三区 | 天天射天天干 | 一本色道精品久久一区二区三区 | 国产精品九九九 | 毛片免费视频 | 欧美成人精品二区三区99精品 | 午夜av一区二区 | 成人亚洲精品 | 精产嫩模国品一二三区 | 一区二区免费在线观看 | 中文字幕成人在线 | 手机在线一区二区三区 | 亚洲五码在线 | 国产免费视频在线 | 成人精品国产一区二区4080 | 日韩中文在线观看 | 毛片一区二区 | 亚洲欧美在线一区 |