Results 1 to 4 of 4

Thread: Could you help to customize my model ??

  1. #1
    Join Date
    Jul 2013
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question Could you help to customize my model ??

    Hi, every body

    i have a probleme with inserting a row from a table call tableProduct to another table call tableSalle

    when the user click entre key in the first table “tableProduct”

    i can’t figured out, how this work

    this is an image explains what i means

    sell1.jpg

    i think we implement insertrow function


    bool MyModel::insertRows(int position, int rows, const QModelIndex &parent)
    {
    beginInsertRows(QModelIndex(), position, position+rows-1);
    // i want to get the event when the user click "Keydown"
    if (true)
    {
    // we add row with empty fields to allow user to fill them
    }


    endInsertRows();
    return true;
    }

  2. #2
    Join Date
    Aug 2012
    Location
    Loughborough, UK
    Posts
    29
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Could you help to customize my model ??

    you need to implement the editrole then use that to insert the data into your underlying model calling reset on the model to force the update to the screen.

  3. #3
    Join Date
    Jul 2013
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Could you help to customize my model ??

    Quote Originally Posted by rockdemon View Post
    you need to implement the editrole then use that to insert the data into your underlying model calling reset on the model to force the update to the screen.
    can you give me an example ??

  4. #4
    Join Date
    Aug 2012
    Location
    Loughborough, UK
    Posts
    29
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Could you help to customize my model ??

    nothing that isnt proprietary. If i get time i'll knock something up later.

Similar Threads

  1. Customize QListWidgetItem, how to?
    By martinn in forum Qt Programming
    Replies: 24
    Last Post: 12th December 2016, 10:47
  2. How to customize the X axis?
    By lvdong in forum Qwt
    Replies: 2
    Last Post: 10th August 2010, 02:53
  3. Customize QFileDialog
    By Swankee in forum Newbie
    Replies: 10
    Last Post: 25th November 2009, 20:21
  4. How to customize the icon?
    By snowdream in forum Qt Programming
    Replies: 2
    Last Post: 12th November 2009, 06:59
  5. How customize my .exe with a icon.
    By jiveaxe in forum Qt Programming
    Replies: 2
    Last Post: 30th December 2007, 18:30

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.