It looks like you're new here. If you want to get involved, click one of these buttons!
Hello,
I am trying to create a menu in the toolbar in the style of the Ruler or the Technology selector.
A action trig and a drop down menu together. I manage to do the two separately but not together.
I have no idea how to bin the action with the menu. Anybody did this before ?
Alex
Comments
Hi, Alex!
I think you need to call
QToolButton::setDefaultAction
.Hi sir,
Can you get us more detail sample code for that ?
I want to create a menu buttom in Klayout to call my Ruby/DRC code.
But , I don't know how to call QToolButtom.. in my code...
Thanks.
@jiunnweiyeh KLayout employs a menu abstraction instead of direct Qt element access. The reason is that I cannot ensure compatibility of the Widget hierarchy across multiple releases.
The involved classes here are AbstractMenu and Action:
Here is an example:
Matthias
Hello Matthias,
Ruby is cool ! But I am still far away from building it as a master. I start to do something by using above submenu code,
and wonder if I can get the submenu just launching Klayout, without running the code again ?
Maybe there is some magic skill here ?
Thanks
Vincent
HI Vincent Lin,
you can enabling "run on startup" from the setup.
Thanks for your help, I learned lots of coding skill from your awesome sharing on other topics 😁
Good day,
Vincent