Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] qLowerBound and qLess do not work together?
QtWS25 Last Chance

[Solved] qLowerBound and qLess do not work together?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 659 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    The following code does not compile with Qt 4.8

    @ QList<int> list;
    list << 1 << 4 << 7 << 8;
    QList<int>::Iterator qLowerBound(list.begin(), list.end(), 4, qLess<int>());@

    Error message is

    bq. tscd_recordingtrackdataaccess.cpp: In member function 'HIPASE::CTdev_CurveRecordingPoint HIPASE::CTscd_RecordingTrackDataAccess::getPointForTimeOffset(int64) const':
    tscd_recordingtrackdataaccess.cpp:64: error: no matching function for call to 'QList<int>::iterator::iterator(QList<int>::iterator, QList<int>::iterator, int, qLess<int>)'
    c:\Qt482_MinGW\include/QtCore/../../src/corelib/tools/qlist.h:173: note: candidates are: QList<T>::iterator::iterator(const QList<T>::iterator&) [with T = int]
    c:\Qt482_MinGW\include/QtCore/../../src/corelib/tools/qlist.h:172: note: QList<T>::iterator::iterator(QList<T>::Node*) [with T = int]
    c:\Qt482_MinGW\include/QtCore/../../src/corelib/tools/qlist.h:171: note: QList<T>::iterator::iterator() [with T = int]

    I know that I could use the default operator< of int in this case, but I want to expand to a custom lessThan later on, so tested the "out of the box" stuff first to understand it.

    EDIT:
    Stupid syntax mistake. The error message threw me off.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved