How to use resource files without using .ui or form files in Qt?
-
wrote on 16 Nov 2021, 01:38 last edited by
Hi All,
I have a doubt about using resource files in Qt. How to use resource files without using .ui or form files? I don't want to implement the GUI part of Qt , so how can it be achieved?
Any suggestion will be highly appreciated.
Thanks!
-
Hi All,
I have a doubt about using resource files in Qt. How to use resource files without using .ui or form files? I don't want to implement the GUI part of Qt , so how can it be achieved?
Any suggestion will be highly appreciated.
Thanks!
wrote on 16 Nov 2021, 01:46 last edited by@Swati777999 To use Qt Resource (.qrc) it is not necessary to use .ui. Your question is unclear.
-
wrote on 16 Nov 2021, 02:02 last edited by
Re: How to use resource files without using .ui or form files in Qt?
I checked https://doc.qt.io/qt-5/resources.html for help but am not sure about the RCC version in the following XML codes. Can you provide more clarity on it?
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/copy.png</file>
<file>images/cut.png</file>
<file>images/new.png</file>
<file>images/open.png</file>
<file>images/paste.png</file>
<file>images/save.png</file>
</qresource>
</RCC> -
@Swati777999 To use Qt Resource (.qrc) it is not necessary to use .ui. Your question is unclear.
wrote on 16 Nov 2021, 02:20 last edited byI checked this link: https://doc.qt.io/qt-5/resources.html but I am not sure about which version of RCC to use in the first line. Can you provide more clarity on the following XML codes?
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/copy.png</file>
<file>images/cut.png</file>
<file>images/new.png</file>
<file>images/open.png</file>
<file>images/paste.png</file>
<file>images/save.png</file>
</qresource>
</RCC> -
I checked this link: https://doc.qt.io/qt-5/resources.html but I am not sure about which version of RCC to use in the first line. Can you provide more clarity on the following XML codes?
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/copy.png</file>
<file>images/cut.png</file>
<file>images/new.png</file>
<file>images/open.png</file>
<file>images/paste.png</file>
<file>images/save.png</file>
</qresource>
</RCC>wrote on 16 Nov 2021, 05:01 last edited by@Swati777999 what is the problem?
-
I checked this link: https://doc.qt.io/qt-5/resources.html but I am not sure about which version of RCC to use in the first line. Can you provide more clarity on the following XML codes?
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/copy.png</file>
<file>images/cut.png</file>
<file>images/new.png</file>
<file>images/open.png</file>
<file>images/paste.png</file>
<file>images/save.png</file>
</qresource>
</RCC>@Swati777999 said in How to use resource files without using .ui or form files in Qt?:
I am not sure about which version of RCC to use in the first line
As shown in the link you posted it should be "1.0"...
-
@Swati777999 what is the problem?
wrote on 17 Nov 2021, 09:48 last edited by@eyllanesc even after using these codes for XML files, I can't find pics as logos for the icons. .. :( don't know where the problem lies.
-
@Swati777999 said in How to use resource files without using .ui or form files in Qt?:
I am not sure about which version of RCC to use in the first line
As shown in the link you posted it should be "1.0"...
wrote on 17 Nov 2021, 10:00 last edited by@jsulm Yes, I put it in my code, still not getting the desired result; pic for the icon logos.. :(
-
wrote on 17 Nov 2021, 10:09 last edited by
Did you add it to your project file (.pro or CMakeLists.txt)?
-
@jsulm Yes, I put it in my code, still not getting the desired result; pic for the icon logos.. :(
wrote on 17 Nov 2021, 11:23 last edited by@Swati777999 said in How to use resource files without using .ui or form files in Qt?:
still not getting the desired result; pic for the icon logos
please show your code snippet where you are using/retrieving the icons from the resource component.
-
@Swati777999 what is the problem?
wrote on 18 Nov 2021, 01:07 last edited by@eyllanesc after successfully creating icons, i want to put the images for them and it's not done. :( My bad luck with Qt
-
@eyllanesc after successfully creating icons, i want to put the images for them and it's not done. :( My bad luck with Qt
wrote on 18 Nov 2021, 02:32 last edited byShow what you've done so far. Have you added your rc-file to your project?
1/12