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

    1. <legend id='QUkZ4'><style id='QUkZ4'><dir id='QUkZ4'><q id='QUkZ4'></q></dir></style></legend>
    2. <tfoot id='QUkZ4'></tfoot>
      • <bdo id='QUkZ4'></bdo><ul id='QUkZ4'></ul>

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

        PyQt5 从 PyQt4 转换信号代码

        时间:2023-08-05
        <i id='xqWUq'><tr id='xqWUq'><dt id='xqWUq'><q id='xqWUq'><span id='xqWUq'><b id='xqWUq'><form id='xqWUq'><ins id='xqWUq'></ins><ul id='xqWUq'></ul><sub id='xqWUq'></sub></form><legend id='xqWUq'></legend><bdo id='xqWUq'><pre id='xqWUq'><center id='xqWUq'></center></pre></bdo></b><th id='xqWUq'></th></span></q></dt></tr></i><div id='xqWUq'><tfoot id='xqWUq'></tfoot><dl id='xqWUq'><fieldset id='xqWUq'></fieldset></dl></div>

        • <legend id='xqWUq'><style id='xqWUq'><dir id='xqWUq'><q id='xqWUq'></q></dir></style></legend>

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

              <tbody id='xqWUq'></tbody>

                <tfoot id='xqWUq'></tfoot>
                  <bdo id='xqWUq'></bdo><ul id='xqWUq'></ul>
                • 本文介绍了PyQt5 从 PyQt4 转换信号代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我是新手,很难将一行代码从 PyQT4 更改为 PyQT5,这与信号和插槽.我怀疑它是因为参数正在传递给插槽.

                  I'm a newbie and am having difficulty changing a line of code from PyQT4 to PyQT5, its to do with signals & slots. I suspect its because arguments are being passed to the slot.

                  原行是:

                  self.connect(self.assetView.selectionModel(), SIGNAL(("currentRowChanged(QModelIndex,QModelIndex)")),self.assetChanged)
                  

                  我试过了:

                  self.assetView.selectionModel.currentRowChanged(QModelIndex,QModelIndex).connect(self.assetChanged)
                  

                  我得到:AttributeError: 'builtin_function_or_method' 对象没有属性 'currentRowChanged'

                  self.assetView 是一个 QTableView 并且 self.assetChanged 有定义:

                  self.assetView is a QTableView and self.assetChanged has def:

                    def assetChanged(self, index):
                  

                  感谢任何帮助

                  推荐答案

                  新语法如下:

                  sender.signal.connect(some_slot)
                  

                  在你的情况下:

                  self.assetView.selectionModel().currentRowChanged.connect(self.assetChanged)
                  
                  #   ^^^^^^^^^sender^^^^^^^^       ^^^^signal^^^^            ^^^^^^slot^^^^^^
                  

                  def assetChanged(self, current, previous):
                      print(current, previous)
                  

                  这篇关于PyQt5 从 PyQt4 转换信号代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:QTableWidget - 自动公式驱动的单元格 下一篇:使用folium在python中添加一个大的shapefile来映射

                  相关文章

                  最新文章

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

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

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