Results 1 to 20 of 25

Thread: apply change to filtered rows is it possible?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2014
    Posts
    25
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: apply change to filtered rows is it possible?

    no problem bro

    i just need some help on how combobox apply change to those filtered rows maybe i should write something like this:

    Qt Code:
    1. void EditDlvrDialog::on_myFirstComboBox_somethingChanged(something)
    2. {
    3. something
    4. something
    5. }
    To copy to clipboard, switch view to plain text mode 


  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: apply change to filtered rows is it possible?

    Well, you take the value from the combobox and using that value you update your model. Do you know how to update values from your model?
    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
    Mar 2014
    Posts
    25
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: apply change to filtered rows is it possible?

    no bro i am sorry i don't know


    can you tell me how

  4. #4
    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: apply change to filtered rows is it possible?

    You use the QAbstractItemModel::setData() method. In general if you want to use models, you should read about them first.
    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. The following user says thank you to wysota for this useful post:

    jaafari (3rd April 2015)

  6. #5
    Join Date
    Mar 2014
    Posts
    25
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: apply change to filtered rows is it possible?

    and how to use QAbstractItemModel::setData() ?

  7. #6
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: apply change to filtered rows is it possible?

    Quote Originally Posted by jaafari View Post
    and how to use QAbstractItemModel::setData() ?
    Easy:
    1. you stop being lazy;
    2. you go read the documentation as you were already advised to;
    3. you try to solve your problem;
    4. you come back and explain the approaches you tried, and ask specific questions.

    Does that sound reasonable to you, or would you rather have other people do for free the work you are paid for?

  8. #7
    Join Date
    Mar 2014
    Posts
    25
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: apply change to filtered rows is it possible?

    Quote Originally Posted by yeye_olive View Post
    Does that sound reasonable to you, or would you rather have other people do for free the work you are paid for?
    i am not a programmer bro.. i am just here to learn and in fact there is no documentation in my language thank you

  9. #8
    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: apply change to filtered rows is it possible?

    Quote Originally Posted by jaafari View Post
    i am not a programmer bro.. i am just here to learn and in fact there is no documentation in my language thank you
    There is documentation in English. This forum is English. If you can't understand English documentation, how are you going to understand my English explanation?
    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.


  10. The following user says thank you to wysota for this useful post:

    jaafari (3rd April 2015)

  11. #9
    Join Date
    Mar 2014
    Posts
    25
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: apply change to filtered rows is it possible?

    Quote Originally Posted by wysota View Post
    There is documentation in English. This forum is English. If you can't understand English documentation, how are you going to understand my English explanation?
    it is very difficult for me and in some conversation i try translator (thanks to google).. i hope one day other people can find Qt in other languages

  12. #10
    Join Date
    Mar 2014
    Posts
    25
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: apply change to filtered rows is it possible?

    any help guys or should i pay to someone to tell how?

  13. #11
    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: apply change to filtered rows is it possible?

    Quote Originally Posted by jaafari View Post
    any help guys or should i pay to someone to tell how?
    What's wrong with the solution already given in comment #11?

    Cheers,
    _

  14. The following user says thank you to anda_skoa for this useful post:

    jaafari (5th April 2015)

  15. #12
    Join Date
    Mar 2014
    Posts
    25
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: apply change to filtered rows is it possible?

    my dear i just want an example even if i will pay for it no problem


    Added after 5 minutes:


    Quote Originally Posted by yeye_olive View Post
    Easy:
    Does that sound reasonable to you, or would you rather have other people do for free the work you are paid for?
    give me a example pravite and i am ready to pay for it.. just tell me how much that will cust?
    Last edited by jaafari; 5th April 2015 at 20:32.

  16. #13
    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: apply change to filtered rows is it possible?

    I can give you an example for free.

    Qt Code:
    1. model.setData(model.index(0, 0), 7, Qt::EditRole); // sets 7 into default role of item (0, 0)
    To copy to clipboard, switch view to plain text mode 
    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.


  17. The following user says thank you to wysota for this useful post:

    jaafari (9th July 2015)

  18. #14
    Join Date
    Mar 2014
    Posts
    25
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: apply change to filtered rows is it possible?

    and what about combobox:
    Qt Code:
    1. void myEditDialog::on_myFirstComboBox_currentIndexChanged(int index)
    2. {
    3.  
    4. }
    To copy to clipboard, switch view to plain text mode 

    should i do it like this?

  19. #15
    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: apply change to filtered rows is it possible?

    What about it?
    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.


  20. #16
    Join Date
    Mar 2014
    Posts
    25
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Re: apply change to filtered rows is it possible?

    i mean should i use it in this way?

    Qt Code:
    1. void myEditDialog::on_myFirstComboBox_currentIndexChanged(int index)
    2. {
    3. model.setData(model.index(0, 0), 7, Qt::EditRole); // sets 7 into default role of item (0, 0)
    4. }
    To copy to clipboard, switch view to plain text mode 

  21. #17
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: apply change to filtered rows is it possible?

    So every time someone selects a different item from the combo box, you want to store the value 7 into item( 0, 0 )? Why?

    Why don't you try to explain what you really want to do when someone changes the combo box selection?

  22. The following user says thank you to d_stranz for this useful post:

    jaafari (11th July 2015)

  23. #18
    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: apply change to filtered rows is it possible?

    Call it on your model passing the index, value and role in the model you wish to change (e.g. Qt::EditRole).
    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.


  24. The following user says thank you to wysota for this useful post:

    jaafari (3rd April 2015)

Similar Threads

  1. Replies: 1
    Last Post: 27th September 2012, 22:07
  2. Filter a Filtered QSortFilterProxyModel !?
    By solook in forum Qt Programming
    Replies: 4
    Last Post: 25th October 2011, 19:22
  3. WM_INPUT not being filtered by winEventFilter()
    By been_1990 in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2010, 03:19
  4. QTableView How to change height for all rows?
    By sergey_85 in forum Qt Programming
    Replies: 2
    Last Post: 1st December 2009, 19:49
  5. Replies: 4
    Last Post: 20th September 2007, 13:11

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.