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 pictures to a qt widget table in qt
Forum Updated to NodeBB v4.3 + New Features

how to add pictures to a qt widget table in qt

Scheduled Pinned Locked Moved Solved General and Desktop
18 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.
  • T Offline
    T Offline
    the_owler
    wrote on last edited by
    #1

    i am new to qt
    how to create a table that show information about student so what would i use in the program
    i have an idea of creating a table but i don't know how to add pics inside of it
    any ideas ?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you mean some sort of address book ?

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

      T 1 Reply Last reply
      0
      • T Offline
        T Offline
        the_owler
        wrote on last edited by the_owler
        #3

        thanks for replying back
        and thank you,

        i saw the example on the qt documentation about the address books, and i liked it but,
        my program is some sort of school management
        in the center of it there is tabs of different functionalities
        inside those tabs i want my data which is a mysql data to get displayed to the user
        like picture,first names,last names and so
        what is the best thing i can do about this idea
        thanks again <3

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          Do you mean some sort of address book ?

          T Offline
          T Offline
          the_owler
          wrote on last edited by
          #4

          @SGaist and what u think sir,
          creating a web site and getting it inside a web widget
          whats the best path to use/follow

          jsulmJ 1 Reply Last reply
          0
          • T the_owler

            @SGaist and what u think sir,
            creating a web site and getting it inside a web widget
            whats the best path to use/follow

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @the_owler said in how to add pictures to a qt widget table in qt:

            creating a web site

            Well, there are many many possibilities/frameworks and this is out of Qt scope (even if you could use Qt to create a web page).
            "and getting it inside a web widget" - do you mean you want to render a web page in your app? If so take a look at https://doc.qt.io/qt-5/qtwebengine-index.html

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

            T 1 Reply Last reply
            1
            • jsulmJ jsulm

              @the_owler said in how to add pictures to a qt widget table in qt:

              creating a web site

              Well, there are many many possibilities/frameworks and this is out of Qt scope (even if you could use Qt to create a web page).
              "and getting it inside a web widget" - do you mean you want to render a web page in your app? If so take a look at https://doc.qt.io/qt-5/qtwebengine-index.html

              T Offline
              T Offline
              the_owler
              wrote on last edited by
              #6

              @jsulm
              i give you the general approach and tell me what to do
              i have created a full c++ console app
              which is a school management console app
              with c++ connector(with mysql)
              then i get in with the qt to have the desktop app
              but am getting a lot of difficulties in learning and implementing things inside the mainwindow and getting a good design as i want
              so i decided maybe to create a website then implement it inside my app
              what do you recommend
              and thanx for replying,
              and sorry for the long text

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Well, user management systems are often coupled with web technologies.

                Is it your case ?

                As for getting data into widget, QDataWidgetMapper comes to mind.

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

                T 1 Reply Last reply
                1
                • SGaistS SGaist

                  Well, user management systems are often coupled with web technologies.

                  Is it your case ?

                  As for getting data into widget, QDataWidgetMapper comes to mind.

                  T Offline
                  T Offline
                  the_owler
                  wrote on last edited by
                  #8

                  @SGaist and is it possible to put pictures inside QDataWidgetMapper ?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    QDataWidgetMapper does the link between widgets and database fields.

                    How are you storing images in that database ?

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

                    T 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      QDataWidgetMapper does the link between widgets and database fields.

                      How are you storing images in that database ?

                      T Offline
                      T Offline
                      the_owler
                      wrote on last edited by
                      #10

                      @SGaist its a mysql server with a database
                      i am using c++ connector
                      and reading a pic image binary and store it inside the database in a longblob or blob var type

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Is the format of the picture fixed ?

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

                        T 1 Reply Last reply
                        1
                        • SGaistS SGaist

                          Is the format of the picture fixed ?

                          T Offline
                          T Offline
                          the_owler
                          wrote on last edited by
                          #12

                          sorry for late xD 600 second cooldown
                          @SGaist u mean by fixed is that a single format ? like png or jpg ?
                          if so no it wwill be just one format
                          and its controlable by the user

                          *its a desktop app that is controlable by just one user so the format type is not an issue

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Will you use a QTableView ? If so you can either use a custom QIdentityProxyModel that will create a QPixmap from the blob for the DecorationRole or a custom QStyledItemDelegate to draw the blob.

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

                            T 1 Reply Last reply
                            1
                            • SGaistS SGaist

                              Will you use a QTableView ? If so you can either use a custom QIdentityProxyModel that will create a QPixmap from the blob for the DecorationRole or a custom QStyledItemDelegate to draw the blob.

                              T Offline
                              T Offline
                              the_owler
                              wrote on last edited by
                              #14

                              @SGaist you think qtableview is the best way to show the data ? or there is other better way to do it
                              if not thank you so much
                              that was very helpful <3

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                It depends on how you want your user to access the data.

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

                                T 1 Reply Last reply
                                0
                                • SGaistS SGaist

                                  It depends on how you want your user to access the data.

                                  T Offline
                                  T Offline
                                  the_owler
                                  wrote on last edited by
                                  #16

                                  i want something like this picture :
                                  Student Management System
                                  with some pics on each student

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    This looks like a classic web application.

                                    While you can do the front end with Qt, I think you should first rethink your backend architecture to provide all the services needed to manage such an application.

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

                                    1 Reply Last reply
                                    1
                                    • T Offline
                                      T Offline
                                      the_owler
                                      wrote on last edited by
                                      #18

                                      thank you so much <3

                                      1 Reply Last reply
                                      0

                                      • Login

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