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 save QList to a HTML table?
Forum Updated to NodeBB v4.3 + New Features

How to save QList to a HTML table?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 459 Views
  • 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.
  • tovaxT Offline
    tovaxT Offline
    tovax
    wrote on last edited by
    #1

    There are many different QList in my projects, for the convenience of viewing the data, I have write some QList to Html files.
    But the method of writing is too complicated, I searched other methods, and found that QWebEngine can read html file easily.
    Then, how to write an HTML file please?
    For example:

    typedef struct {
      QString name;
      int score[10];
    } StudentNode;
    
    QList<StudentNode> studentList;
    

    How to write "studentList" to a html table?
    Best Regards!

    jsulmJ 1 Reply Last reply
    0
    • tovaxT tovax

      There are many different QList in my projects, for the convenience of viewing the data, I have write some QList to Html files.
      But the method of writing is too complicated, I searched other methods, and found that QWebEngine can read html file easily.
      Then, how to write an HTML file please?
      For example:

      typedef struct {
        QString name;
        int score[10];
      } StudentNode;
      
      QList<StudentNode> studentList;
      

      How to write "studentList" to a html table?
      Best Regards!

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

      @tovax said in How to save QList to a HTML table?:

      Then, how to write an HTML file please?

      Well, you should learn HTML basics first: https://www.w3schools.com/html/html_basic.asp
      Here you can see how tables are created in HTML:https://www.w3schools.com/html/html_tables.asp

      For your specific use case: iterate over studentList in a loop and create a row in the HTML table for each entry.

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

      tovaxT JonBJ 2 Replies Last reply
      5
      • jsulmJ jsulm

        @tovax said in How to save QList to a HTML table?:

        Then, how to write an HTML file please?

        Well, you should learn HTML basics first: https://www.w3schools.com/html/html_basic.asp
        Here you can see how tables are created in HTML:https://www.w3schools.com/html/html_tables.asp

        For your specific use case: iterate over studentList in a loop and create a row in the HTML table for each entry.

        tovaxT Offline
        tovaxT Offline
        tovax
        wrote on last edited by
        #3

        @jsulm
        Hi, jsulm, Thank you very much.
        Best Regards!

        1 Reply Last reply
        0
        • jsulmJ jsulm

          @tovax said in How to save QList to a HTML table?:

          Then, how to write an HTML file please?

          Well, you should learn HTML basics first: https://www.w3schools.com/html/html_basic.asp
          Here you can see how tables are created in HTML:https://www.w3schools.com/html/html_tables.asp

          For your specific use case: iterate over studentList in a loop and create a row in the HTML table for each entry.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @jsulm
          Just to say: I totally understand why you referenced w3schools for examples, especially since the darn thing comes out top in Goggle searches. But, like others on the web, I find their stuff often incomplete/unexplained etc. Personally I prefer to search/start from, say, https://developer.mozilla.org/en-US/docs/Web/HTML (mozilla/MDN) for things HTML/CSS/JS etc. But maybe that is less beginner-friendly. Just a heads-up for @tovax.

          tovaxT 1 Reply Last reply
          1
          • JonBJ JonB

            @jsulm
            Just to say: I totally understand why you referenced w3schools for examples, especially since the darn thing comes out top in Goggle searches. But, like others on the web, I find their stuff often incomplete/unexplained etc. Personally I prefer to search/start from, say, https://developer.mozilla.org/en-US/docs/Web/HTML (mozilla/MDN) for things HTML/CSS/JS etc. But maybe that is less beginner-friendly. Just a heads-up for @tovax.

            tovaxT Offline
            tovaxT Offline
            tovax
            wrote on last edited by
            #5

            @JonB
            Hi, thanks a lot for your reply! I will read it.
            Best regards!

            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