Search code examples
pythonpython-3.xpyqtpyqt5fbs

Application name displayed as Unknown with fbs and PyQt5


I wrote an application with fbs and PyQt5. When starting any window, the application name is displayed as "Unknown" on Ubuntu 19.04.

I added the lines:

app = AppContext()
app.app.setApplicationName("MyApplication")
app.app.setApplicationDisplayName("MyApplication)

The application name is still displayed as "Unknown" like in the picture. Is there any other way to change the name? And is this a bug or am I doing something wrong?

In the base.json of fbs the app_name is also set.

{
    "app_name": "MyApplication",
    ...

Solution

  • I know this thread is over a year old, but if you're still running into this problem, I hope this helps. Recently, I also encountered this issue (Python 3.7, PyQt 5.15.0, Ubuntu 18.04), and this is what solved it for me:

    from PyQt5 import QtWidgets
    from app import MainWindow
    import os
    import sys
    
    app = QtWidgets.QApplication(sys.argv)
    window = MainWindow()
    QtWidgets.qApp.setApplicationName("Some other name here")
    window.show()
    app.exec_()
    

    Where MainWindow is a class that extends QMainWindow. It also works if I put QtWidgets.qApp.setApplicationName("Some other name here") in the __init__ of MainWindow. Hope this solves your problem.