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

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

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

    1. <tfoot id='rMrQq'></tfoot>
      <legend id='rMrQq'><style id='rMrQq'><dir id='rMrQq'><q id='rMrQq'></q></dir></style></legend>

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

    3. 如何在右側 cilck 上的 Qdoublespinbox 上向 QtCore.Qt.

      how to add an action to QtCore.Qt.DefaultContextMenu on Qdoublespinbox on right cilck?(如何在右側 cilck 上的 Qdoublespinbox 上向 QtCore.Qt.DefaultContextMenu 添加操作?)
      <i id='Avq8O'><tr id='Avq8O'><dt id='Avq8O'><q id='Avq8O'><span id='Avq8O'><b id='Avq8O'><form id='Avq8O'><ins id='Avq8O'></ins><ul id='Avq8O'></ul><sub id='Avq8O'></sub></form><legend id='Avq8O'></legend><bdo id='Avq8O'><pre id='Avq8O'><center id='Avq8O'></center></pre></bdo></b><th id='Avq8O'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Avq8O'><tfoot id='Avq8O'></tfoot><dl id='Avq8O'><fieldset id='Avq8O'></fieldset></dl></div>

        • <bdo id='Avq8O'></bdo><ul id='Avq8O'></ul>
                <tbody id='Avq8O'></tbody>
              <legend id='Avq8O'><style id='Avq8O'><dir id='Avq8O'><q id='Avq8O'></q></dir></style></legend>
              <tfoot id='Avq8O'></tfoot>
            • <small id='Avq8O'></small><noframes id='Avq8O'>

                本文介紹了如何在右側 cilck 上的 Qdoublespinbox 上向 QtCore.Qt.DefaultContextMenu 添加操作?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我使用 Qt Designer 開發了一個相當復雜的 GUI 工具.

                有關該工具的更多詳細信息,請參閱:

                然后點擊添加按鈕,然后點擊提升按鈕.

                對于另一個QDoubleSpinBox,右鍵單擊并選擇DoubleSpinBox選項所在的新Promote To選項.

                <小時>

                您可以在這里找到一個示例

                I have developed a fairly complex GUI tool using the Qt Designer.

                For more details about the tool see: https://github.com/3fon3fonov/trifon

                I have defined many QDoubleSpinBox entries and by default the Qt Designer sets their right-click menu policy to:

                setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
                

                Now I want to add few more actions to this menu, but I simply cannot understand how this works! There is nothing in the Qt Designer which will allow me to make a "CustomContextMenu". I understand that for this I may need some coding (with which I will need help, and thus I am asking for help here), but I also need to make it globally for all SpinBox-es.

                Sorry for not posting the code since it is fairly large for this form. If interested, please look at the github under "gui.py". However, there and in the .ui file there is no sign of any possibility to control the contextmenu policy for these buttons. Instead I am posting an image of the tool (sorry for the bad image but PrtSc does not seem to work when the right button in clicked and the menu is displayed)

                see GUI image here

                解決方案

                As we want to add a QAction to the default context menu we first overwrite the contextMenuEvent event and use a QTimer to call a function that filters the toplevels and get the QMenu that is displayed and there we add the QAction:

                doublespinbox.py

                from PyQt5 import QtCore, QtWidgets
                
                class DoubleSpinBox(QtWidgets.QDoubleSpinBox):
                    minimize_signal = QtCore.pyqtSignal()
                
                    def __init__(self, *args, **kwargs):
                        super(DoubleSpinBox, self).__init__(*args, **kwargs)
                        self.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
                
                    def contextMenuEvent(self, event):
                        QtCore.QTimer.singleShot(0, self.add_actions)
                        super(DoubleSpinBox, self).contextMenuEvent(event)
                
                    @QtCore.pyqtSlot()
                    def add_actions(self):
                        for w in QtWidgets.QApplication.topLevelWidgets():
                            if isinstance(w, QtWidgets.QMenu) and w.objectName() == "qt_edit_menu":
                                w.addSeparator()
                                minimize_action = w.addAction("minimize this parameter")
                                minimize_action.triggered.connect(self.minimize_signal)
                
                if __name__ == '__main__':
                    import sys
                    app = QtWidgets.QApplication(sys.argv)
                    w = DoubleSpinBox()
                    w.show()
                    sys.exit(app.exec_())
                


                To use DoubleSpinBox in Qt Designer, first place doublespinbox.py next to your .ui:

                ├── ..
                ├── rvmod_gui.ui
                ├── doublespinbox.py?? 
                ├── ...
                

                then you must promote the widget to do so right click on the QDoubleSpinBox and select the option "Promote to ..." by adding the following to the dialog:

                Then click on the Add button and then the Promote button.

                For the other QDoubleSpinBox, right click and select the new Promote To option where the DoubleSpinBox option is.


                You can find an example here

                這篇關于如何在右側 cilck 上的 Qdoublespinbox 上向 QtCore.Qt.DefaultContextMenu 添加操作?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='ojKQD'></tbody>

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

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

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

                          <tfoot id='ojKQD'></tfoot>
                        1. <i id='ojKQD'><tr id='ojKQD'><dt id='ojKQD'><q id='ojKQD'><span id='ojKQD'><b id='ojKQD'><form id='ojKQD'><ins id='ojKQD'></ins><ul id='ojKQD'></ul><sub id='ojKQD'></sub></form><legend id='ojKQD'></legend><bdo id='ojKQD'><pre id='ojKQD'><center id='ojKQD'></center></pre></bdo></b><th id='ojKQD'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ojKQD'><tfoot id='ojKQD'></tfoot><dl id='ojKQD'><fieldset id='ojKQD'></fieldset></dl></div>
                        2. 主站蜘蛛池模板: 成年男女免费视频网站 | 日本aⅴ中文字幕 | 国产精品久久国产精品99 | 伊人欧美视频 | 色综合99 | 盗摄精品av一区二区三区 | 久久99精品久久久久久国产越南 | 理论片87福利理论电影 | h片免费在线观看 | 韩三级在线观看 | 日韩免费| 久久一级 | 黄色片网站在线观看 | 一级大黄 | 99热这里 | 99久久夜色精品国产亚洲96 | 一区二区在线 | 浴室洗澡偷拍一区二区 | 精品在线观看入口 | 91av视频在线免费观看 | 特级黄一级播放 | 日韩av一区二区在线观看 | 中文字幕高清av | 亚洲 欧美 日韩 在线 | 羞羞的视频网站 | 中文字幕av一区二区三区 | 精品久久影院 | 国产粉嫩尤物极品99综合精品 | 免费在线视频一区二区 | 午夜视频在线视频 | 日韩视频一区二区 | 91精品国产综合久久久久 | 国产美女永久免费无遮挡 | 在线成人福利 | 一区精品在线观看 | 精品国产一区二区三区久久狼黑人 | 国产一区在线免费观看视频 | 国产精品国产a | 久久小视频 | 亚洲+变态+欧美+另类+精品 | 亚洲一区精品在线 |