Results 1 to 5 of 5

Thread: Controlable histogram table

  1. #1
    Join Date
    Sep 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    MacOS X Windows Symbian S60

    Question Controlable histogram table

    Hello, I am new to Qt and need help on how to program this table.

    I want to design a histogram style table which can be controlled by mouse, like the two table on the left in this picture

    http://audiocookbook.org/wp-content/...pleStepSeq.png

    So, when you click in the area, the corresponding (x,y) grid will be selected (turn black in the above example), and the value will be stored in a variable.

    How can I program this?

    Thanks very much!

    EDIT: something like this,
    https://youtu.be/xwCht7td0FE?t=1m39s
    Last edited by markzzz; 1st September 2015 at 07:45.

  2. #2
    Join Date
    Sep 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    MacOS X Windows Symbian S60

    Default Re: Controlable histogram table

    I don't need the code, but really need some advice on how to create something like this, what method do I need to use? Create a custom widget? Use Qpaint? I am new to GUI programming, have no idea at all.

    Thanks!

  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: Controlable histogram table

    You could try with a QTableView and a QTableModel that has the state of each cell and have it use that state to report different values for the Qt::BackgroundRole.
    Might be easier to work with a QTableWidget though.

    Cheers,
    _

  4. #4
    Join Date
    Sep 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    MacOS X Windows Symbian S60

    Default Re: Controlable histogram table

    I just tried QTableModel+View and QTableWidget, but now have a new problem, the selection. Is there any way to remove the topleft/bottomright style selection and just let it select the cells you clicked on/ or the cells you move your mouse over while hold the click? I tried to connect the activated cell and select but it doesn't work : (

    connect(ui->tableView,SIGNAL(activated(QModelIndex)),
    QItemSelectionModel,SLOT(select(QModelIndex,QItemS electionModel::SelectionFlags)));

  5. #5
    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: Controlable histogram table

    Hmm. Maybe disabling selection and just handling the clicks to toggle the data/state?

    Cheers,
    _

Similar Threads

  1. Histogram
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 9th March 2010, 08:54
  2. Gradient in histogram
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 1st August 2009, 11:48
  3. Qwt(histogram) in eclipse?
    By kid17 in forum Qwt
    Replies: 1
    Last Post: 29th November 2008, 12:38
  4. How display an histogram?
    By kid17 in forum Qt Programming
    Replies: 3
    Last Post: 24th November 2008, 15:22
  5. Histogram with different colors
    By NoRulez in forum Qwt
    Replies: 1
    Last Post: 14th September 2008, 17:57

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.