問題タブ [qmenu]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - メニュー、PyQtにカラーアイコンを表示するには?
私が達成しようとしているのは、Python のコンテキスト メニューにカラー アイコンを表示することです。テーブルをマークするために使用される色の一部が表示されるようにします。
これが私が達成しようとしているものの例です。
これを行う方法を推測しますか?
更新 これは私のビジョンのより詳細なバージョンです。
Mark をクリックすると、サブメニューが開き、色のオプションが表示されます。
c++ - QMenu の非インタラクティブ項目
QT でインタラクティブでない項目を含むメニューを作成しようとしています。MyCustomMenuClass で QMenu をサブクラス化します。ユーザーにとってより明確になるように、セクションのタイトルをメニューに追加しようとしています。
たとえば、次のようになります。
問題は、セクションのタイトルが常にマウスに反応することですが、マウスオーバーに反応しないようにして、見栄えを良くしたいと思います。それを行う方法について何か考えはありますか?
python - Passing argument to PyQt SIGNAL connection
Is it possible to pass an argument to PyQt4 Signal connections? In my case I have n buttons with set the same menu dinamically created on the interface, depending on user's input:
Although the menu is the same for all the buttons into the interface, the user should be able to select a value from any of the buttons and, for any of them, the action is the same ("add the selected value to a line edit") with the only difference that the line edit might be the 1st as well as the 2nd, the 3rd.
What I would like to ask, then, is if there's any way to pass an argument j here:
EXAMPLE:
At this execution the user's inputs are 3, so I will have 3 line edits and three push buttons with the same menu:
Using the same function SomeFunction
, I'd like to edit the value of the Line Edits. So if the user is touching the menu attached to the 2nd line edit, the function SomeFunction
shall be called with the argument 2 SomeFunction(2)
, so the same method will understand itself which Line Edit is the right one:
I need this because the number of Line Edits on the main window depends on what the user is selecting. I'm a newbie and so far I've always created one function for any object into the GUI, but this time the number is dynamic and I'm sure there are some more elegant ways to create this kind of signal connections, that I have not understood though so far from my documentations reading.
qt - ブロックせずに QPushButton にメニューを表示するには?
Qt4を使用QPushButton
しQMenu
ています( で設定setMenu()
)。無関係なイベントが発生したときにこのメニューを表示する必要があります。
メソッドQPushButton::showMenu()
はこれを行いますが、ユーザーがメニューを閉じるまでブロックします。
QMenu::show()
もこれを行いますが、画面の左上隅にメニューが表示されます。
メニューをブロックせずに適切な位置にプログラムで表示するにはどうすればよいですか?
qt - Qt: メニュー項目の横にあるチェック マーク
私のアプリケーションでは、ユーザーは利用可能なすべてのコンポートのリストからコンポートを選択できます。これは、QAction ウィジェットが取り込まれたメニューで行われます。しかし、現在のコードはどのポートが選択されているかを示していないため、アプリケーションをより直感的にするために、どのポートが選択されているかを示して、プログラムがどのような状態にあるかをユーザーに示したいと考えています。選択したポートのすぐ横にあるメニューのアイコン (チェック マークなど) を確認すると、どのポートが選択されているかがわかります。これを行う正しい方法は何ですか?
私のコード:
このコードは、各メニュー項目の横にチェックボックスを配置するため、明らかに私が望んでいることを行いません。さらに、ユーザーは一度に複数のコンポートをチェックすることができますが、これはまったく望ましくありません。
c++ - Qt: MainWindow を削除した後、QMenu が削除されないようです
MainWindow のコンストラクターには、コードのチャンクがあります。
メモリチェックを実行するまでは、すべて問題ないようでした。Valgrind は、ここでメモリ リークが発生していると言っているようです。MainWindow が削除される直前に QMenu が自動的に削除されるべきではありませんか? Filemenu へのポインターを記憶し、MainWindow デストラクタで手動で削除しようとしましたが、何も変わりませんでした。誰かが私が間違っていることを知っていますか?
c++ - QToolButton のメニューを下部ではなく左側に表示しますか? 出来ますか?
QToolButton の下部ではなく左側に QMenu ポップアップを表示することは可能ですか? 私は現在、このようなことをしています