I'm very new. Suppose I have a toolbar with 2 buttons: Foo and Bar. Is there a way to make each triggering a different "frame"? That is, the toolbar icons work like tabs. Should each trigger a new window by an on-click event?
Thanks
You can use QStackedWidget. It provides a way to have multiple widgets on each other where only one is displayed at a time (Like a QTabWidget). Here is an example :
self.stackedWidget = QtWidgets.QStackedWidget(self)
self.stackedWidget.addWidget(firstPageWidget)
self.stackedWidget.addWidget(secondPageWidget)
self.ayout = QtWidgets.QVBoxLayout(self)
layout.addWidget(stackedWidget)
setLayout(layout)
Now on each button click you can change the current page using setCurrentIndex.
Related
I have a project including 3 UI files: win_main.ui, win_table.ui and win_table2.ui.
I want to show one of them inside of win_main.ui, and with a button, change them.
I mean, there is a Box containing win_table.ui, and when I clicked the button, the box will change to win_table2.ui.
Example
I tried using QWidget, QQuickWidget, but they didn't worked.
Is it possible ? If yes, how ?
Try using a QTabWidget. You can flip between tables using tabs.
If there is a specific reason why you wouldn't want win_table2.ui showing before a button is pressed, you can disable that tab programmatically until it is ready. You can also flip between which tab is currently showing using code as well.
I'm very new to pywinauto ans I love it already. But I have a problem:
I want to automate an old software program with pywinauto and can control most of the buttons. But there is a certain button when clicked, there appaers a menu with icons (not the windows style of menu but a custom menu). The button's name is "Toolbar2" so I guess it's not a normal button.
With this code I can click the button I want to. When I use "ctrl.Click(), the button doesn't get clicked, I need to use ClickInput(). With the normal buttons I do can use Click().
w_handle = pywinauto.findwindows.find_windows(title=u'P2-NLTlog013', class_name='TfrmDisplayFilteredData')[0]
window = pwa_app.window_(handle=w_handle)
window.Click()
ctrl = window['ToolBar2']
ctrl.ClickInput()
My question now is: How can I get the names of the items of the hidden menu And click them. I already used this code, but then he gives a 'MatchError'.
window = pwa_app.Window_(best_match='ToolBar2', top_level_only=True).ChildWindow(best_match='PopupMenu').Click()
window.Click()
I don't know what language the software was written in...
Thanks in advance,
Fred
You may get the menu object by window.Menu() and then try to access subitem by menu.Items()
Useful methods: menu_item.Index(), menu_item.SubMenu()
I want to create an application in which i will create a button and by pressing that button as list of options will open and i can choose one of them.for example i will create a button named "searching algorithm" and by clicking this button a list will open at same place which display two options as linear search and binary search.can anyone give me an idea how to do that?
You want a QComboBox:
The QComboBox widget is a combined button and popup list.
I believe what you need is a popup window where you can have list of options, whenever your button is clicked show this window, hide it when user selects an item in the list or clicks outside of the working area. There is an example you can use as a reference:
QT 4.7 Google Suggest Example
hope this helps,
regards
I have a problem in my project.I want to implement Tab bar function under a drop down selection and when once tab bar is clicked it has to be navigated to a data grid.Can any body suggest me the proper direction to implement it.
Thanks,
Brenda
Use a tab navigator, add canvases as children to that navigator, put your datagrid on one of those children.
In my flex app I have custom tooltips on buttons that hide and show based on user context.
The problem that I dealing with is that when I call my showTips() function I only want to show tooltips on the buttons that visible in the view. So buttons that on a un-selected tab (tabNavigator) should not show the tooltips.
For some reason all tooltips are showing.
Is there a way to detect if a button is not in current view, like on a un-selected tab?
If you gave us some code I could check this out, but would this work?
if(button.parent.visible) { showTip(button);}
Instead of custom coding for each button, make use your tabnavigator's creation policy is set to "auto".
Check this link for more details
http://livedocs.adobe.com/flex/3/html/help.html?content=layoutperformance_05.html