Results 1 to 3 of 3

Thread: Inheriting QAbstractItemView

  1. #1
    Join Date
    May 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Inheriting QAbstractItemView

    Which methods needs to be reimplemented in class that inherits QAbstractItemView? In documentation I've found that custom View class "only need to implement their own view-specific functionality". I've implemented pure virtual functions with drawing in visualRect(), but there is nothing showed after setting model in my custom View widget.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Inheriting QAbstractItemView

    All the pure virtual methods and at least paintEvent() need to be reimplemented.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Inheriting QAbstractItemView

    It might help if you elaborate a bit on why you want to create your own view class.
    In a lot of cases this is not required and other solutions can be employed, e.g. custom delegates.

    Cheers,
    _

Similar Threads

  1. Inheriting
    By tuxit in forum Qt Programming
    Replies: 4
    Last Post: 13th August 2011, 12:28
  2. Inheriting QwtPlot and Q_OBJECT
    By gpsgek in forum Qwt
    Replies: 2
    Last Post: 5th July 2011, 06:09
  3. Replies: 3
    Last Post: 26th November 2009, 18:28
  4. Inheriting from QwtPlotCurve problems
    By dbrmik in forum Qwt
    Replies: 5
    Last Post: 1st April 2009, 14:02
  5. Inheriting QListViewItem
    By ct in forum Newbie
    Replies: 1
    Last Post: 17th March 2006, 05:52

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.