Results 1 to 9 of 9

Thread: Unable to use the operator== of QValueList

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Unable to use the operator== of QValueList

    const is pretty handy, since it will catch some programmer errors. Like, when you accidentally try to change a value you aren't supposed to.

    The general rule is: Either don't use const at all, or use it everywhere.

    QT wisely does use it, so you have to use it as well if you use QT classes.

    The compiler was only warning you. You were basically calling a non-const function from a const function . Or rather, the QValueList was doing this, since the CClassA operator== was not const and the QValueList operator== is.
    Last edited by Michiel; 18th June 2006 at 17:14.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

Similar Threads

  1. Problem using QValueList
    By yellowmat in forum Newbie
    Replies: 2
    Last Post: 7th February 2006, 20:01

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.