We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
the following code is not setting the icon on the BaseWidget
from pysettings import conf import settings conf+=settings from pyforms import BaseWidget import pyforms from os import path from PyQt4 import QtGui class WinForm(BaseWidget): def __init__(self): ROOT_DIR = path.dirname(path.abspath(__file__)) iconPath = path.join(ROOT_DIR, 'logo2.ico') print iconPath BaseWidget.__init__(self,'WinForm') #BaseWidget.setWindowIcon(self, QtGui.QIcon(iconPath)) self.setWindowIcon(QtGui.QIcon(iconPath)) if __name__ == "__main__": pyforms.start_app( WinForm, geometry=(200, 200, 500, 400) )
Is this a bug or is there an issue with my code.
The text was updated successfully, but these errors were encountered:
I had the same problem. I am new to Qt. But I think that the method setWindowIcon should be a method to the main window. My solution is like this:
from pysettings import conf import settings conf+=settings from pyforms import BaseWidget import pyforms from os import path from PyQt4 import QtGui class WinForm(BaseWidget): def __init__(self): BaseWidget.__init__(self,'WinForm') def init_form(self): super(WinForm, self).init_form() ROOT_DIR = path.dirname(path.abspath(__file__)) iconPath = path.join(ROOT_DIR, 'logo2.ico') print iconPath self.app_main_window.setWindowIcon(QtGui.QIcon(iconPath)) if __name__ == "__main__": pyforms.start_app( WinForm, geometry=(200, 200, 500, 400) )
I had to use init_form since the reference to the app_main_window isn't set when _init_ is runned
Sorry, something went wrong.
UmSenhorQualquer
No branches or pull requests
the following code is not setting the icon on the BaseWidget
Is this a bug or is there an issue with my code.
The text was updated successfully, but these errors were encountered: