This question already has answers here:
PySide switching widgets with events?
(2 answers)
How to change UI in same window using PyQt5?
(1 answer)
Closed 2 years ago.
The project is based in Python 3.7.
I'm working on a project that requires the use of the tabs widget. Lets say I have two tabs. On tab 1 there is a drop down menu with two different options. I need these two options to determine what will be displayed on tab 2. For example, if option 1 on tab 1 is selected then tab 2 could show a simple list or, if option 2 on tab 1 were selected then tab 2 will show a check box.
My naive thought it I might be able to create three different widget panels, each with the required widgets and displays for tab 2. Then a simple if/else check could determine which option number is selected and thus which widget panel to display can be selected. This is a guess at best though and I'm not sure how one would implement this.
Related
So I made a fairly simply GUI, it has 3 tabs for organization - I can show pictures below.
As you can see there are 3 main tabs for general organization. However I was wondering if it was possible to add a Sub-Tab to one of the existing ones. For example in Non-Host would it be possible to add another tab called Combat that only shows once you click into the menu of Non-Host?
Sorry if my wording is bad, but essentially what I'm asking is if it's possible to add a tab within another tab, that's only accessible when the parent tab is already open.
This question already has answers here:
PyQT QPushButton.setMenu? How to make it work?
(1 answer)
Qt: Drop-down button?
(8 answers)
Closed 9 months ago.
In my application, I don't want to clutter the screen with too many buttons, so I want to add multiple actions to one button. Even thought I could accomplish it through things like double clicking or modifier keys, those solutions are in no way intuitive for the user. I want to have a button that has an additional dropdown menu, which can be used to change the action of the button. To illustrate, here is a rough sketch of what that would look like:
Is this possible PyQt5 or PySide6? Thank you for your help.
This question already has an answer here:
Set default caret position inside entry widget in Tkinter Python
(1 answer)
Closed 3 years ago.
My GUI is structured such that I have a main class, and each page of my GUI, of which I can navigate between, is instantiated whenever I call it. One of my pages has an entry box, but i have to manually move my cursor and select the entry box to begin typing. Is there a way for the entry box to automatically be selected when I call that page?
Seems like an interesting problem
You should use focus().
For Example, if your entry widget is e. Then use e.focus().
This question already has answers here:
Load whole *ui file in an frame/widget of another *.ui file
(1 answer)
PyQt: How to switch widgets in QStackedWidget
(5 answers)
Creating a custom widget in PyQT5
(2 answers)
Closed 3 years ago.
I am making a simple app and was wondering what the standard is for multiple windows when using Qt Designer and python.
I need to be able to have functional back and next buttons which will take me to the previous screen like in simple .exe installers.
I do not want to use the tab widget.
I have tried using the stacked widget but when using layouts on my first screen it gets inserted into the grid layout.
This question already has answers here:
Creating menus using wxpython
(2 answers)
Closed 7 years ago.
When I create a button in wxpython I can do:
self.all = wx.Button(self, -1, _("&ALL"))
or
self.all = wx.Button(self, -1, _("ALL"))
both generate a button named ALL
So, what is the meaning of the & in the name parameter?
ducomntation doesn't specify anything about it.
the question here is similar but it's not the same. The solution there is set focus. while you can set focus to a menu, you can not set focus to a button.
I think the & indicates the keyboard shortcut that can be used to activate the button. So &All means you can press A instead of clicking on the All button.
You can put the & anywhere in the label, the character after it becomes the shortcut. For instance, one of the stock labels on the documentation page is:
wx.ID_CUT 'Cu&t'
This means that T is the shortcut for the Cut button.
I guess (keyword: GUESS) is since you are building a GUI, you may want to consider internationalisation link. This is done by searching through your *.py file and search for any string that could be replaced to a different language, using UNICODE. By having & in front of the string displaying your button, you can easily search for it using, maybe, gettext.
Again, a guessing answer :)