QWebPage crash
-
I don't know how but after some hours and without making any changes (!) my project began to work. Very strange. One problem that left is that the window icon doesn't want to show.
-
How are you setting it ?
-
I did it in two ways: in window property "Window icon" I set my image and in the constructor of the form I had written:
@this->setWindowIcon(QIcon(QPixmap(":valuta")));@
P.S. This image is already in resource file. -
Check that the pixmap is valid. You might have an invalid path e.g. missing the prefix to the image file
-
I have found this post https://qt-project.org/forums/viewthread/32268 and understood that I used '' instead of '/'. Code that must set form icon works but if I set this icon using form properties nothing changes.
-
And my code works only if I use absolute path to the file. My resouce file doesn't work.
-
Then you might be using a wrong path for the resource. How does the qrc file look like ?
-
@<RCC>
<qresource prefix="/">
<file>valuta.png</file>
</qresource>
</RCC>
@ -
@this->setWindowIcon(QIcon(QPixmap(":/valuta.png")));@
You were missing the extension
-
Code works even without extension ;)
But if I set icon in form design mode the setting is not working. -
I'm not sure I'm following you there. When setting the icon in designer it doesn't work ? How do you set it ? Are you modifying it ?
-
Yes, when I set the window's icon in creator it doesn't work. I found property "windowIcon" in the right side and chose my icon in .png extension.
-
Okay, but it doesn't work when running from Qt Creator ?
-
Yes, after setting icon shows normal in creator, but during execution programm has standard icon.
-
That I understood, but my question is: are you running the application through Qt Creator ? Or from the explorer ?
-
I'm running application throught Qt Creator.
-
What's the path to the icon ?
-
Absolute or relative?
-
Which one of them are you using ?
-
I think that we have some misunderstanding ;)
How I can use icons path during setting windows icon in form design mode? In that mode I can only choose icon but not to set path.