What is the best way to a text based output in a Qt widget? what I mean by this is... like in win RAR or some windows installers where there is a drop down arrow showing more details and it shows live text output of files modified and things of that nature. how would I go about doing that in a Qt app?
I was thinking maybe a none editable multiple line text box... but I'm not sure, because I don't wan't it to be editable.
any help on this would be greatly appreciated.
QLabel
QTextDocument
QTextEdit
Almost all of the options above, can be configured to be "Read-only" or even unclickable by making them disabled.
QTextStream is also a really useful class.
Hope that helps.
Related
I have C# experience, and I'm making my first Python app. I'm part way done the UI in QT Designer, and soon I'll try PyQt to integrate it with my code. This is a general guidance question for best approach.
I have a tab widget containing various things in each tab. I would like the entire tab widget to be duplicatable with a plus button. So basically, a scroll view containing as many of these tab widgets as the user wants. The user could duplicate an existing one as a new instance, or create a blank one.
Could someone please help me understand how to accomplish this? Does it work like this?
Create the scroll view.
Put the tab widget inside the scroll view.
Add duplicate and delete buttons in the corner of the tab widget.
Put a plus button just outside the scroll view.
Accomplish all of the rest via python code? Or would I be missing out on some Qt Designer tricks?
Any tips on how to do this in QT Designer and also coding in PyQt would be appreciated.
Additionally, perhaps off topic, but any general tips on PyQt installation and usage would be nice. v5 not v4? I'm running Python 3.6 32 bit, which I was told should run 3.5 packages fine (but 64 bit may not).
Thanks,
First the out of topic : use PyQt5 if you start a new project. Qt 4 has reached end of life and won't see any new release unless it's a critical security fix.
As for most of your questions: if you want to use Designer then you should start by taking a look at Qt Designer's documentation. It will get you started nicely.
As for 5, it depends on tastes. Developers have been using both for various reasons. It's really up to you decide which style fits your needs best. There's no tricks in designer that you can't accomplish in code.
This question is the exact same as this one except that I'm looking for such a widget to be used in PySide. Anyone knows some code out there that provide easy-to-reuse property editor widget?
There is the proposal of using QTreeView or QTableView to build such a widget that is an option with PySide, but this is not a straight forward solution...
I don't know if you would be OK with this, but if you are happy to add the whole of pyqtgraph as a dependency, then you might want to try using pyqtgraph's ParameterTree.
There is a pretty comprehensive set of examples, just install pyqtgraph and then run:
import pyqtgraph.examples
pyqtgraph.examples.run()
Launch the ParameterTree example!
I begin with Python programming and I need some help!
Actually I'm working on a graphical application using wxpython and I would like to be able to change dynamically the size & color of the border of any widgets like a "TextCtrl", a "Panel" and a "ListBox".
Have you any ideas about this ?
Thanks
You should check out the Widget Inspection Tool (http://wiki.wxpython.org/Widget%20Inspection%20Tool). It has a highlight function that basically does what you need. The wxPython demo has it in the Help menu, but you can add it to your own code. Just check out the instructions in the link above.
I am trying to extend a unity appindicator for project hamster. What I want to do is have a text entry directly in the indicator menu. I have seen this for example in the ubuntu memenu, but I cannot figure out how to get it to work with pygtk. I have searched for a while and found nothing. Does anyone know how to do this?
I'm pretty sure there is no way to add that in a menu in PyGTK, but you might try a borderless window popup.
In order to indicate activity, some applications (e.g. Pidgin) highlight their entry in GNOME's Window List panel widget (e.g. via bold font or flashing color). This indication is reset automatically when the window is activated.
I have a terminal application for which I would like to achieve the same thing (preferably via Perl, but Python would work too) - but I have no idea where to start. I imagine I'd first have to find the terminal window (based on window title) and then trigger some kind of GTK action.
Any help would be greatly appreciated!
In a GTK application, use gtk_window_set_urgency_hint(). If you have a terminal application, you can't really do that - with libwnck you can get information about other application's windows, but as far as I know you can't get a GtkWindow pointer to another application's window.
May I suggest using the terminal beep? Of course this isn't a sure way to attract the user's attention, but some terminals are able to flash the title bar instead of beeping, or such things.
I'm not really into GTK programming, but as far as i know you want to set an "URGENT"-Flag for the Window which should be highlighted. Maybe this will get you any further. :)