Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some equivalent to QApplication.setApplicationDisplayName("Anything") #920

Open
marcomontevechi1 opened this issue Sep 16, 2022 · 3 comments

Comments

@marcomontevechi1
Copy link

Im not sure if this is a bug report or a feature request since i figure it should be do-able in some way as it is in pure PyQt. I might be trying in the wrong way.
It would be pretty useful to have tooltips for the application in the OS applications bar such as in the image below:

Screenshot from 2022-09-16 08-52-37

In the image, the tooltip name was set to "testing" because the .py file that uses pydm was called with

pydm -m "MY_MACROS=blah" python_script.py testing

However, this compromises my args usage and cant be done dynamically via python code in PyDM. At least not in any way i tried. Also, it propagates to other displays called by PyDMRelatedDIsplayButton and it would be useful to define other tooltips for windows called by these.

I tried QApplication.setApplicationDisplayName("Anything"), PyDMApplication.setApplicationDisplayName("BLAH") and other similars but nothing worked. I append some links where there might be useful information about the functionality.

Is it do-able in any way that im not aware of?

https://doc.qt.io/qt-5/qcoreapplication.html#applicationName-prop
https://doc.qt.io/qt-6/qguiapplication.html#applicationDisplayName-prop
https://stackoverflow.com/questions/53993195/pyqt5-how-to-set-application-name-and-icon-in-activities-bar-fedora-29

@jbellister-slac
Copy link
Collaborator

Hi, thanks for reaching out! I haven't tried to do this before, so I'm afraid I don't know of a better way of doing it besides using the command line option. As far as I can tell, it's not possible to dynamically change the app name once it has been set without re-starting the python process even if it's using PyQt only without any pydm. With a simple pyqt window, I can use that applicationName setter to set the name just fine on startup. But once the window is visible, I don't see any way of updating it further unless I am not seeing something...

As for the related displays, we could add an option to associate a new application name for each, but I think it would only work when creating new PyDM processes, not when just opening in the same window.

@marcomontevechi1
Copy link
Author

Thanks for the attention!

IMO, setting the application name dynamically is not necessary, but setting it at application startup is. I didnt understand your answer completely: for an application using pydm, is it possible to set at least the main application name at startup via python code?

All ways i tried failed.

@jbellister-slac
Copy link
Collaborator

Not that I am aware of, I don't know any way that doesn't involve the command line option. The setting of startup options is all done through those (or environment variables). And unfortunately it doesn't appear there is a way to change it afterwards, which is what I was looking into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants