Results 1 to 4 of 4

Thread: Good way to make a standard tree model for develop CLI and GUI application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2018
    Posts
    19
    Thanks
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Good way to make a standard tree model for develop CLI and GUI application

    because I want to develop CLI app
    in .pro file, I set
    Qt Code:
    1. QT-= GUI
    To copy to clipboard, switch view to plain text mode 
    Because QStandardModelItemModel is a GUI class
    Last edited by madawg; 13th November 2018 at 02:08.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Good way to make a standard tree model for develop CLI and GUI application

    Yes, QStandardItemModel requires the QtGui library but it does not require you to use a GUI. You can have a usable command-line only application and use the standard model. It may have issues running in an environment without X though... haven't tried.

    You state you want a QAbstractItemModel interface. That interface is in QtCore so you can do this without QtGui. Take a look at Editable Tree Model Example. It is not trivial to fully implement a model, but the example goes through a working internal data structure and extensions for editing.
    Last edited by ChrisW67; 13th November 2018 at 05:24.

  3. The following user says thank you to ChrisW67 for this useful post:

    madawg (13th November 2018)

Similar Threads

  1. How to use standard model?
    By freiza in forum Newbie
    Replies: 6
    Last Post: 19th February 2015, 09:22
  2. Replies: 1
    Last Post: 29th August 2013, 05:41
  3. develop a tree.
    By tkms in forum Qt Programming
    Replies: 1
    Last Post: 8th January 2009, 04:18
  4. QSql*Model + QTreeView : make a tree
    By punkypogo in forum Qt Programming
    Replies: 18
    Last Post: 24th October 2008, 18:14
  5. Should I develop my own model and view?
    By dandanch in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2006, 06:09

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.