久久久久久久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. 主站蜘蛛池模板: 3p视频在线观看 | 国产精品美女久久久久久久网站 | 国产在线视频一区二区 | 久久成人综合 | 精品一二区 | 国产精品自产拍在线观看蜜 | 一区欧美| 日韩中文在线观看 | 美女国内精品自产拍在线播放 | 成人福利电影 | 久久久久综合 | 久久久久久国产精品久久 | 一区二区三区成人 | 一区二区不卡视频 | 日韩美香港a一级毛片免费 国产综合av | 国产伦一区二区三区四区 | 五月激情综合网 | 男女精品网站 | 久久久国产精品入口麻豆 | 日韩和的一区二区 | 黄色a级一级片 | 亚洲一区二区三区在线播放 | 日韩和的一区二区 | 91国内外精品自在线播放 | 亚洲视频区 | 国产美女久久 | 综合一区二区三区 | 国产欧美日韩精品一区二区三区 | 色视频欧美 | 久久久久国产视频 | 99精品免费| 成人不卡视频 | 91欧美激情一区二区三区成人 | 日韩成人影院 | www.9191.com| 国产一区二区三区四区在线观看 | 大伊人久久 | 天天久久| 性高湖久久久久久久久aaaaa | 日本一区二区三区视频在线 | 99一级毛片 |