Results 1 to 9 of 9

Thread: Unable to use the operator== of QValueList

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default Unable to use the operator== of QValueList

    Hi !

    I have a compilation error whilie trying to use the operator == of a QValueList and I don't know why.

    Here is the problem :
    I have a simple class named CClassA which has :
    * a default constructor
    * a copy constructor
    * an operator =
    * an operator ==

    I did compile and test the code of this class and everything is good.

    I have another class named CClassB which has the same kind of constructors and operators, but it also has a member declared as follow :
    Qt Code:
    1. QValueList<CClassA> m_vlListOfClassA;
    To copy to clipboard, switch view to plain text mode 

    My problem is in the operator== of CClassB where I have the following code :
    Qt Code:
    1. if( m_vlListOfClassA == ra.m_vlListOfClassA )
    2. return true;
    3. else
    4. return false;
    To copy to clipboard, switch view to plain text mode 

    It seems good to me but the compilation always fails and send the following message :
    c:\qt\3.3.3\include\qvaluelist.h(582) : error C2678: binary '==' : no operator defined which takes a left-hand operand of type 'const class CClassA' (or there is no acceptable conversion)
    c:\qt\3.3.3\include\qmap.h(240) : while compiling class-template member function 'bool __thiscall QValueList<class CClassA>::operator ==(const class QValueList<class CClassA> &) const'
    What should I do in my operator== to check if both list content are equal if it is not possible to use the QValueList operator== ? Should I check every objet of boths lists ?

    Thanks in advance.
    Last edited by jacek; 16th June 2006 at 12:31. Reason: changed [ code ] to [ quote ] to allow wrapping of long lines

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.