久久久久久久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. 主站蜘蛛池模板: 91精品国产自产精品男人的天堂 | 成年免费大片黄在线观看岛国 | 中文字幕电影在线观看 | 久久中文字幕一区 | 日韩高清黄色 | 国产99精品 | 成人午夜影院 | 一久久久 | 亚洲性视频网站 | 日韩国产中文字幕 | 欧美色欧美亚洲另类七区 | 国产午夜精品一区二区三区嫩草 | 免费观看一级特黄欧美大片 | 日本字幕在线观看 | 成人影| 看黄在线 | 精品产国自在拍 | 免费视频一区二区 | 国产精品国产成人国产三级 | 三级特黄特色视频 | 一区二区三区精品视频 | 国产精品自产av一区二区三区 | www.日韩系列 | 久久久国产一区二区三区四区小说 | 亚洲精品国产电影 | 日日艹夜夜艹 | 成人av一区 | 中文成人在线 | wwww.xxxx免费 | 久久久久成人精品免费播放动漫 | 国产精品99一区二区 | 99精品久久久久久中文字幕 | 欧美天堂| 日韩乱码av| 2020天天操| 亚洲色图在线观看 | 国产成人精品免高潮在线观看 | 国产美女在线播放 | 毛片大全 | 日韩三区 | 成人网av|