Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use resource files without using .ui or form files in Qt?
Forum Updated to NodeBB v4.3 + New Features

How to use resource files without using .ui or form files in Qt?

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 6 Posters 636 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Swati777999
    wrote on 16 Nov 2021, 01:38 last edited by
    #1

    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!

    “ In order to be irreplaceable, one must always be different” – Coco Chanel

    E 1 Reply Last reply 16 Nov 2021, 01:46
    0
    • S Swati777999
      16 Nov 2021, 01:38

      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!

      E Offline
      E Offline
      eyllanesc
      wrote on 16 Nov 2021, 01:46 last edited by
      #2

      @Swati777999 To use Qt Resource (.qrc) it is not necessary to use .ui. Your question is unclear.

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      S 1 Reply Last reply 16 Nov 2021, 02:20
      0
      • S Offline
        S Offline
        Swati777999
        wrote on 16 Nov 2021, 02:02 last edited by
        #3

        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>

        “ In order to be irreplaceable, one must always be different” – Coco Chanel

        1 Reply Last reply
        0
        • E eyllanesc
          16 Nov 2021, 01:46

          @Swati777999 To use Qt Resource (.qrc) it is not necessary to use .ui. Your question is unclear.

          S Offline
          S Offline
          Swati777999
          wrote on 16 Nov 2021, 02:20 last edited by
          #4

          @eyllanesc

          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>

          “ In order to be irreplaceable, one must always be different” – Coco Chanel

          E J 2 Replies Last reply 16 Nov 2021, 05:01
          0
          • S Swati777999
            16 Nov 2021, 02:20

            @eyllanesc

            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>

            E Offline
            E Offline
            eyllanesc
            wrote on 16 Nov 2021, 05:01 last edited by
            #5

            @Swati777999 what is the problem?

            If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

            S 2 Replies Last reply 17 Nov 2021, 09:48
            0
            • S Swati777999
              16 Nov 2021, 02:20

              @eyllanesc

              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>

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 16 Nov 2021, 06:31 last edited by
              #6

              @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"...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              S 1 Reply Last reply 17 Nov 2021, 10:00
              0
              • E eyllanesc
                16 Nov 2021, 05:01

                @Swati777999 what is the problem?

                S Offline
                S Offline
                Swati777999
                wrote on 17 Nov 2021, 09:48 last edited by
                #7

                @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.

                “ In order to be irreplaceable, one must always be different” – Coco Chanel

                1 Reply Last reply
                0
                • J jsulm
                  16 Nov 2021, 06:31

                  @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"...

                  S Offline
                  S Offline
                  Swati777999
                  wrote on 17 Nov 2021, 10:00 last edited by
                  #8

                  @jsulm Yes, I put it in my code, still not getting the desired result; pic for the icon logos.. :(

                  “ In order to be irreplaceable, one must always be different” – Coco Chanel

                  Pablo J. RoginaP 1 Reply Last reply 17 Nov 2021, 11:23
                  0
                  • VRoninV Offline
                    VRoninV Offline
                    VRonin
                    wrote on 17 Nov 2021, 10:09 last edited by
                    #9

                    Did you add it to your project file (.pro or CMakeLists.txt)?

                    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                    ~Napoleon Bonaparte

                    On a crusade to banish setIndexWidget() from the holy land of Qt

                    1 Reply Last reply
                    0
                    • S Swati777999
                      17 Nov 2021, 10:00

                      @jsulm Yes, I put it in my code, still not getting the desired result; pic for the icon logos.. :(

                      Pablo J. RoginaP Offline
                      Pablo J. RoginaP Offline
                      Pablo J. Rogina
                      wrote on 17 Nov 2021, 11:23 last edited by
                      #10

                      @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.

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      1 Reply Last reply
                      0
                      • E eyllanesc
                        16 Nov 2021, 05:01

                        @Swati777999 what is the problem?

                        S Offline
                        S Offline
                        Swati777999
                        wrote on 18 Nov 2021, 01:07 last edited by
                        #11

                        @eyllanesc after successfully creating icons, i want to put the images for them and it's not done. :( My bad luck with Qt

                        “ In order to be irreplaceable, one must always be different” – Coco Chanel

                        Pl45m4P 1 Reply Last reply 18 Nov 2021, 02:32
                        0
                        • S Swati777999
                          18 Nov 2021, 01:07

                          @eyllanesc after successfully creating icons, i want to put the images for them and it's not done. :( My bad luck with Qt

                          Pl45m4P Offline
                          Pl45m4P Offline
                          Pl45m4
                          wrote on 18 Nov 2021, 02:32 last edited by
                          #12

                          @Swati777999

                          Show what you've done so far. Have you added your rc-file to your project?


                          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                          ~E. W. Dijkstra

                          1 Reply Last reply
                          1

                          1/12

                          16 Nov 2021, 01:38

                          • Login

                          • Login or register to search.
                          1 out of 12
                          • First post
                            1/12
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved