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. Create treeview Use in log file tags
QtWS25 Last Chance

Create treeview Use in log file tags

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 2.1k 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.
  • D Offline
    D Offline
    Diluka
    wrote on last edited by
    #1

    Hi
    I am new to Qt development and i need some advice ,My problem is like that I had Qt application with treeview i want to fill that tree view use in log file data Some one have better idea about that please help me to solve that problem.

    (Assume log file had tags like main item,sub main item etc... i want to get that tags in to treeview )

    Thanks

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

      Hi!
      Did you try do something? Is your question about using treeview, or reading log file or make model for treeview? There are few examples for treeviews: "Itemview Examples":http://qt-project.org/doc/qt-5.0/qtwidgets/examples-itemviews.html

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Diluka
        wrote on last edited by
        #3

        Really thanks for your fast reply actually its like that i had log file with tags in this tags in some order like
        <1>
        <1.1>
        <1.1.1>
        data ....
        <\1.1.1>
        <\1.1>
        <\1>
        Now i want create treeview base on that tags simply i plan create XML file use in that log file tags after use in that XML file data i decide to create treeview its possible or cost effictive or their are any solution to do that requirement ?

        Thanks

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          It is can be effective and convenient if you make "lazy tree model".

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Diluka
            wrote on last edited by
            #5

            Really thanks for your reply i will check

            1 Reply Last reply
            0
            • P Offline
              P Offline
              prady_80
              wrote on last edited by
              #6

              You could basically write your own model derived from the QAbstractItemModel and load data only when the use clicks the parent indexes to view the child indexes. Basically, functions
              QAbstractItemModel::canFetchMore, QAbstractItemModel::fetchMore, QAbstractItemModel::hasChildren and QAbstractItemModel::rowCount. need to be overridden and manipulated.
              Just to cut short "this":http://www.qtcentre.org/archive/index.php/t-28082.html will help you.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Diluka
                wrote on last edited by
                #7

                Thanks for your reply i will try

                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