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 add many images into label
Forum Updated to NodeBB v4.3 + New Features

How to add many images into label

Scheduled Pinned Locked Moved Unsolved General and Desktop
images
5 Posts 3 Posters 1.7k 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.
  • B Offline
    B Offline
    Bochen
    wrote on 4 Jul 2017, 18:15 last edited by Bochen 7 Apr 2017, 18:16
    #1

    Hi,

    I am totally new in QT. I am developing chess game and I would like to add few pictures of pawns in my program. Right know I have added background of label but I do not know how to add many images and how to place it with proper x-y co-ordinates.

    Please take a look on this screenshot and my code:

    0_1499191849092_chessboard.png

    Very simple:

    QPixmap szachownica_grafika("D:/Users/Dominik/Desktop/dokumenty/PRYWATNE/SZKOLA/INFORMATYKA/Przedmioty/wybrane/_Zaawansowane C++/szachownica_2.jpg");
        ui->label_test_grafika->setPixmap(szachownica_grafika);
    

    How can I add another images and place it in the label?

    Thanks in advance for help.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on 4 Jul 2017, 18:39 last edited by
      #2

      Hi! QGraphicsView is probably what you're looking for.

      1 Reply Last reply
      2
      • B Offline
        B Offline
        Bochen
        wrote on 4 Jul 2017, 19:36 last edited by Bochen 7 Apr 2017, 19:56
        #3

        Thank You, but could you explain me a liitle bit more?

        In the Internet there is a lot of examples of using QGraphicsView with QGraphicsScene but in my application I use QDialog object and labels and I am a bit confussed right know. Cannot find any examples how to deal with this case...

        Is this possible to add graphics without using QLabel objects?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 4 Jul 2017, 21:23 last edited by
          #4

          Hi and welcome to devnet,

          Did you took the time to read the introduction to that framework ?

          In the list of related classes you have QGraphicsPixmapItem

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          B 1 Reply Last reply 4 Jul 2017, 21:43
          2
          • S SGaist
            4 Jul 2017, 21:23

            Hi and welcome to devnet,

            Did you took the time to read the introduction to that framework ?

            In the list of related classes you have QGraphicsPixmapItem

            B Offline
            B Offline
            Bochen
            wrote on 4 Jul 2017, 21:43 last edited by
            #5

            @SGaist

            Thank you! Right now I am just looking around yet... I will read the introduction and I will be back for sure :)

            1 Reply Last reply
            1

            2/5

            4 Jul 2017, 18:39

            • Login

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