Using QFrame to display different panes of information? - python

I'm trying to get a QFrame to serve as a "display area" for a couple different kinds of information, eg: you click on something in a list view and an info pane shows up in the frame
to give you information about it, you click on a different item and a different pane shows up.
Having trouble swapping the different frames in and out of the QFrame though, is there a way to do this?

Using QStackedWidget is probably the most standard solution.

Related

Show "Loading..." or "Fetching.." on screen for a while after selecting a value in dash dropdown

I am curious to know if I can print something like "Loading.." on the screen for a while after clicking a value in dash dropdown.
sample dropdown :https://dashr.plotly.com/dash-core-components/dropdown from dash website
I just want to let the user know that the results are being fetched for the option he has selected from the drop down list and then display the results.
There is a Loading Component in dash core :
The Loading component can be used to wrap components that you want to
display a spinner for, if they take too long to load. It does this by
checking if any of the Loading components' children have a
loading_state prop set where is_loading is true. If true, it will
display one of the built-in CSS spinners.
You will find some examples in the documentation page.

How to modify panels individually in a wxPython wizard?

I am quite new to wxPython and want to build a wizzard. I used this guide as a base ("wxPython: How to Create a Generic Wizard"). I tried to add some widgets the panel, e.g. some radio buttons at the second page by inserting the following code at line 56 in add_page():
if(title=="Page 2"):
k1=wx.RadioButton(panel,-1,'Argument1',(35,60),(150,20), style = wx.RB_GROUP)
k2=wx.RadioButton(panel,-1,'Argument2',(35,80),(150,20))
But as soon as I try to add some sizer to the the second panel, all pages are affected. I tried quite a few variations of where to place the sizers, but without success. So my question is: is this the appropriate place to modify the individual pages and could someone give me a hint of how to write a minimalistic example of e.g inserting a boxSizer and a button in the first page and a boxSizer and a RadioButton in the second page?

Search text and scroll down with qwebview

I'm using Qwebview with Pyside/Qt to view an HTML page on a GUI I'm working on.
I need the possibility to add a search text function, otherwise it is useless for the purpose the GUI is made.
I've searched but I didn't find anything useful for build a code that search the text and scrolls down the page as it is made in the common browsers.
The only function I found is findText but it returns a boolean and I cannot see how it can be useful.
Do somebody have an hint / advice / guide or code for this request?
Thank you.
Okay, so it turns out that i had an example of this using a QTextBrowser, which has a lot of this built into utility functions.
You can still do it with a QWebBrowser though.
Bind ctrl-f to open a search panel, and then make it so that the search box sends out two signals;
(presuming it's a QLineEdit), returnPressed, and textChanged.
Each of them then calls findText on the QWebPage object.
The important part is setting the correct flag in the findText call (which you'll want to set with checkboxes in your search functionality, i'd say).
You set the flags so that HighlightAllOccurrences is not set.
I cannot see any way to get details on a selection. Are you sure that when you do not set the HighlightAllOccurences flag it does not scroll to the next selection automatically?

pygtk TextView and WebKit.WebView synchronized scrolling

I've got a text view and a web view, each inside a scrolled window of their own and I'm trying to achieve synchronized scrolling between the two but I can't seem to get it to work.
The web view is basically taking the text from the text view and rendering it as marked up HTML via webview.load_html_string(). I think the problem could be the delay in loading the HTML as every time the web view is refreshed it is scrolled back to the very start.
Right now I call a function every time the content of the text view is changed and then modify the vadjustment.value of the scrolled window containing the web view.
But this doesn't work. Is it because of the delay? I can't think of any way to solve this issue.
why do you want sync those scrollbars? You can achieve this by using the same Gtk.Adjustment (number of pages sets to 0).
I haven't use much of webkit but it essentialy a widget. so maybe a workaround would be disconnect a signal "value-changed" from Gtk.Adjustment until "load-status" signal from WebKitView reached Webkit.LoadStatus.FINISHED (if that's the correct syntax).
If that doesn't work, maybe you use WebKitView.move_cursor () (if i remember the function properly) based on Gtk.Adjustment on your text view (we use 2 adjustments this time)

Loading images and text in pyqt

Im not sure what this is called, so its hard to lookup. I want to get a set of images that have a unique identifier and the put some corresponding text information next to it, inside of an application. When more images are loading a scroll bar can go through them. I dont know which methods or how this is possible. For example, through other threads i found how to load images using a list widget and switching the items to an icon. However with this method I dont see how to put text next to it. Can this be done with a table, or a tree? I have been using qt Designer but I dont see anything like this available.
You can use QListWidget for that. Each item would represent an image (item's icon) and all text to the right of it. Define iconSize property of list widget to enlarge item icons. Use \n in item texts to add line breaks.

Categories

Resources