Results 1 to 3 of 3

Thread: QTableView for hexagon map?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView for hexagon map?

    I think QGraphicsView is definitely the way to go here.
    Creating a custom QTableView means not only rewriting the painting but also the widget interaction part, which could be a nightmare.

    What is wrong displaying the hexagons in a gview? You could still minimize memory usage by storing hexagon types as pixmaps and just use QGraphicsPixmapItem's with a clipping mask applied(a hexagon) to define its bounds.

    Regards

  2. #2
    Join Date
    Jun 2007
    Posts
    62
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView for hexagon map?

    Quote Originally Posted by marcel View Post
    Ihat is wrong displaying the hexagons in a gview? You could still minimize memory usage by storing hexagon types as pixmaps and just use QGraphicsPixmapItem's with a clipping mask applied(a hexagon) to define its bounds.
    Nothing is wrong with using a gview. But as I learn Qt I find it often has easier ways to do common tasks. So I just wanted to make sure that I wasn't doing things the hard way.

    I actually have hex map drawing code that I wrote for Microsoft Foundation Classes many years ago, it should be easy enough to adapt.

    I was bemused, however. The original program in MFC took me the better part of a week to get the user interface working. In PyQt4 with the Qt Designer, it took less than 15 minutes.

Similar Threads

  1. Set height of QTableView to fit exact number of rows.
    By Ben.Hines in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2019, 01:49
  2. QTableView sorting
    By gabriels in forum Qt Programming
    Replies: 11
    Last Post: 6th October 2010, 17:13
  3. QTableView currentChanged <> selecting header
    By Everall in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2009, 08:24
  4. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42
  5. Multi-line messages in QTableView
    By Conel in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 13:49

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.