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

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

      1. <small id='gYoFF'></small><noframes id='gYoFF'>

          <bdo id='gYoFF'></bdo><ul id='gYoFF'></ul>

      2. <legend id='gYoFF'><style id='gYoFF'><dir id='gYoFF'><q id='gYoFF'></q></dir></style></legend>

        如何制作動態組合框PYQT5

        How to make dynamic combobox PYQT5(如何制作動態組合框PYQT5)
        <i id='LHuEa'><tr id='LHuEa'><dt id='LHuEa'><q id='LHuEa'><span id='LHuEa'><b id='LHuEa'><form id='LHuEa'><ins id='LHuEa'></ins><ul id='LHuEa'></ul><sub id='LHuEa'></sub></form><legend id='LHuEa'></legend><bdo id='LHuEa'><pre id='LHuEa'><center id='LHuEa'></center></pre></bdo></b><th id='LHuEa'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='LHuEa'><tfoot id='LHuEa'></tfoot><dl id='LHuEa'><fieldset id='LHuEa'></fieldset></dl></div>

          • <small id='LHuEa'></small><noframes id='LHuEa'>

              <tbody id='LHuEa'></tbody>
            <tfoot id='LHuEa'></tfoot>

              <bdo id='LHuEa'></bdo><ul id='LHuEa'></ul>

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

                  本文介紹了如何制作動態組合框PYQT5的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想制作一個動態組合框,如果我在下一個組合框中選擇Gasto"選項,我想查看例如Agua"、Gas"等,如果選擇Financas",則只有"Fundos de tesouraria" 和 " Fundos deinvestimento de obriga??es"

                  I want to make a dynamic combobox, if i choose the option "Gasto" in the next combobox, I want to see for example "Agua", "Gas" etc, and if, choose "Financas", have only " Fundos de tesouraria " and " Fundos de investimento de obriga??es"

                  def initUI(self):
                      #self.setWindowTitle(self.title)
                      for t in self.tipos:
                          self.comboBoxCategoriaGasto.addItem(t)
                      for i in self.tipos2:
                          self.comboBoxTiposGasto_2.addItem(i)
                  
                  
                      self.tipos = ["Gasto", "Fina?as"]
                      self.tipos2 = ["Alimenta??o", "Transporte", "água","Luz","Gás","Internet", "Faculdade", "Depósitos a prazo","Fundos de tesouraria","Fundos de investimento de obriga??es","Fundos de investimento de a??es",]
                  

                  推薦答案

                  你必須創建一個樹型模型,其中第 n 個 QComboBox 的選中項是第 (n+1) 個 QComboBox 的 rootModelIndex:

                  You have to create a tree type model where the selected item of the nth QComboBox is the rootModelIndex of the (n+1)-th QComboBox:

                  import sys
                  
                  from PyQt5 import QtCore, QtGui, QtWidgets
                  
                  
                  class Widget(QtWidgets.QWidget):
                      def __init__(self, parent=None):
                          super().__init__(parent)
                  
                          self.model = QtGui.QStandardItemModel(self)
                  
                          self.combo1 = QtWidgets.QComboBox()
                          self.combo2 = QtWidgets.QComboBox()
                  
                          self.combo1.setModel(self.model)
                          self.combo2.setModel(self.model)
                  
                          d = {
                              "Gasto": ["Agua", "Gas"],
                              "Financas": [
                                  "Fundos de tesouraria",
                                  "Fundos de investimento de obriga??es",
                              ],
                          }
                  
                          for key, options in d.items():
                              root_it = QtGui.QStandardItem(key)
                              self.model.appendRow(root_it)
                              for option in options:
                                  it = QtGui.QStandardItem(option)
                                  root_it.appendRow(it)
                  
                          self.combo1.currentIndexChanged.connect(self.onCurrentIndexChanged)
                          self.onCurrentIndexChanged(0)
                  
                          hlay = QtWidgets.QHBoxLayout(self)
                          hlay.addWidget(self.combo1)
                          hlay.addWidget(self.combo2)
                  
                      @QtCore.pyqtSlot(int)
                      def onCurrentIndexChanged(self, index):
                          ix = self.model.index(index, 0, self.combo1.rootModelIndex())
                          self.combo2.setRootModelIndex(ix)
                          self.combo2.setCurrentIndex(0)
                  
                  
                  if __name__ == "__main__":
                      app = QtWidgets.QApplication(sys.argv)
                      w = Widget()
                      w.resize(640, 120)
                      w.show()
                      sys.exit(app.exec_())
                  

                  這篇關于如何制作動態組合框PYQT5的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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時顯示進度條?)
                    <tbody id='hDaWM'></tbody>
                    <bdo id='hDaWM'></bdo><ul id='hDaWM'></ul>

                        • <small id='hDaWM'></small><noframes id='hDaWM'>

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

                          1. 主站蜘蛛池模板: 国产黄色网 | 九九在线视频 | 一级毛片视频在线 | 手机av在线 | 国产欧美一区二区三区国产幕精品 | 亚洲高清三级 | 亚洲欧美日韩在线不卡 | 操到爽| 波多野吉衣久久 | av毛片在线免费观看 | h视频亚洲| 久久久精彩视频 | 毛片网站在线观看 | 欧美久久一级特黄毛片 | 欧美在线 | 精品综合久久 | 亚洲不卡在线观看 | 久久精品国产一区老色匹 | 7777精品伊人久久精品影视 | 国产精品99久久久久久动医院 | 91色视频在线观看 | 在线91 | 一级全黄少妇性色生活免费看 | 成人在线观看免费视频 | 91综合网| 欧美日韩在线一区二区 | 久久精品av麻豆的观看方式 | 国产色片在线 | 精品中文字幕在线观看 | 国产精品免费福利 | 一级做a爰片性色毛片16 | 欧美一级在线观看 | av在线三级| 日韩三级免费网站 | 一级黄大片| 九九九久久国产免费 | 99成人精品 | 国产高清亚洲 | 精品日韩| 成人免费视频网站在线看 | 亚洲国产精品99久久久久久久久 |