pixmap in QLabel or icon in QPushButton is gone after add some other widgets
-
I am a new comer learning QT, after I added up some QLabels and QPushButton with QT Designers and compile the project with Visual studio, and run the application.

The icons or pixmaps show, but after that, if I want to add a QTimer to show system time(for example) and set it at the construction function of the MainWindow(after SetupUi()),result: the application can run but the icons and pixmaps gone. the icon I set for window gone, too. But the texts are stiil there.

Could you please tell me how to deal with this situation if I have to add other widgets in the Mainwindow class, I am so confused that the orders when updating the display.Great thanks!
-
I am a new comer learning QT, after I added up some QLabels and QPushButton with QT Designers and compile the project with Visual studio, and run the application.

The icons or pixmaps show, but after that, if I want to add a QTimer to show system time(for example) and set it at the construction function of the MainWindow(after SetupUi()),result: the application can run but the icons and pixmaps gone. the icon I set for window gone, too. But the texts are stiil there.

Could you please tell me how to deal with this situation if I have to add other widgets in the Mainwindow class, I am so confused that the orders when updating the display.Great thanks!
-
@Hedwig13
We need to know how/what you set the icons to in Designer. Did you use Qt resources or did you point to external files? If the latter it may be a runtime path issue, you are probably best using Qt resources. -
Hi,
Can you show the code you added that modifies your widget ?
-
And does maybe your style/platform does not show icons by default? I think Mac has no icons
-
@SGaist
Thanks! But I found that the problem might cause by Visual Studio's QT plugin. After I reboot the computer, some coding errors occured in my ui file and qrc file. After I re-opened these files with QT Creator and compile my application again in VS, this problem seems fixed.@Christian-Ehrlicher
The platform is Win10, Qt5, VS2019.
