Page 3 of 3 FirstFirst 123
Results 41 to 47 of 47

Thread: A few queries about Model View Programming

  1. #41
    Join Date
    Oct 2008
    Location
    Europe
    Posts
    37
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Red face Re: A few queries about Model View Programming

    uhm....any idea what class?..

  2. #42
    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: A few queries about Model View Programming

    If you are not using any specific style then it's best to either use style sheets or implement a [wiki]Proxy style[/wiki].

  3. #43
    Join Date
    Oct 2008
    Location
    Europe
    Posts
    37
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Re: A few queries about Model View Programming

    I did a : myQTableView->setStyleSheet(styleSheet) but unfortunately it doesnt appear to affect the checkbox. Or did you mean something else maybe?


    cheers

  4. #44
    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: A few queries about Model View Programming

    Maybe you used a wrong stylesheet? I'm not sure if you can move the checkbox to the right using a stylesheet, so you'll probably have to implement a proxy style.
    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.


  5. #45
    Join Date
    Oct 2007
    Location
    India
    Posts
    162
    Thanks
    20
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: A few queries about Model View Programming

    i think george used the method i gave him i.e. to draw a custom checkbox image in the table view cell and trap mouserelease event inside the cell. So, if the mouse release event falls inside the cell containing the checkbox, then toggle the checkbox.

  6. #46
    Join Date
    Oct 2008
    Location
    Europe
    Posts
    37
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: A few queries about Model View Programming

    monty: yes i did, forever gratefull

    wysota: i want to implement some filtering on data coming from a model (from a database) and from what I understand the QSortFilterProxyModel is suppose to have been created exactly for this.
    What would be the best way to add a column to the proxymodel so that the sourcemodel stays untouched (unaware of the extra column) ? Subclass it ?

  7. #47
    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: A few queries about Model View Programming

    Either use a model proxy or subclass the original model, depending what's easier in your case.
    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.


Similar Threads

  1. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 20:17
  2. model View programming problem
    By mismael85 in forum Qt Programming
    Replies: 3
    Last Post: 2nd April 2008, 21:44
  3. Model, View and Proxy
    By No-Nonsense in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 08:50
  4. Model - View Programming doubt.
    By munna in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2006, 13:01
  5. Replies: 6
    Last Post: 20th April 2006, 10:23

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