Results 1 to 6 of 6

Thread: QDataTable to bloquer modified value

  1. #1
    Join Date
    Sep 2006
    Posts
    42
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default QDataTable to bloquer modified value

    People, I have a QDataTable, I would like that when a value of the QDataTable was modified, the user I could not more modify, these values I am white.

    Here he is form.

    http://200.193.29.195/qt3/form.png

    In the case above, if the user modified value e if it tried to modify an error message again would be shown. It would like to make this for the application and not for the database.

    It is possible to block this with the QDataTable.

    Cris

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDataTable to bloquer modified value

    You can override one of the protected members of QDataTable to deny an edit if data was already modified.

  3. #3
    Join Date
    Sep 2006
    Posts
    42
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QDataTable to bloquer modified value

    I would like to make something thus.

    if ((HCO!="") || (HCO is NULL)) {
    msg="Error";
    }

    Cris

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDataTable to bloquer modified value

    My answer still stands - it should be possible to do that by overriding updateCurrent() or beginUpdate().

  5. #5
    Join Date
    Sep 2006
    Posts
    42
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QDataTable to bloquer modified value

    Ok, more I get error trying to use QDataTable::updateCurrent

    dataTable->updateCurrent()

    Cris

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDataTable to bloquer modified value

    Quote Originally Posted by cristiano View Post
    dataTable->updateCurrent()
    I didn't tell you to call the method but to override it. You have to subclass QDataTable and reimplement the method.

Similar Threads

  1. Retrieving modified date of file using QHttp
    By hardgeus in forum Qt Programming
    Replies: 9
    Last Post: 3rd December 2006, 23:20
  2. Refresh QDataTable
    By shamik in forum Qt Programming
    Replies: 25
    Last Post: 1st December 2006, 05:04
  3. displaying any table on a qdatatable
    By Philip_Anselmo in forum Newbie
    Replies: 4
    Last Post: 9th May 2006, 22:12
  4. How to link modified file
    By awalesminfo in forum Newbie
    Replies: 4
    Last Post: 22nd March 2006, 17:24

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.