[email protected]
[Top] [All Lists]

[Qt-interest] assert error in qmap "item_exists()"

Subject: [Qt-interest] assert error in qmap "item_exists()"
From: Matthias Pospiech
Date: Mon, 12 Apr 2010 16:57:33 +0200
The assert error happens in qmap.h in this line:

The QMap I am using contains 3 values which I can insert with no problem 
or error.
However if I try to access the value (last line) I get this assertion:

    QMapIterator<PiezoStage, int> i(stageToChannelMap);
    while (i.hasNext()) {
        if (i.value() == currentChannel) {...

The map is filled using:

    piezoController->mapStageToChannel(PiezoJenaController::X, 0);
    piezoController->mapStageToChannel(PiezoJenaController::Y, 1);
    piezoController->mapStageToChannel(PiezoJenaController::Z, 2);


void PiezoJenaController::mapStageToChannel(PiezoStage stage, int channel)
    if (stageToChannelMap.contains(stage)) {
        stageToChannelMap[stage] = channel;
    } else {
        stageToChannelMap.insert(stage, channel);

What am I possibly doing wrong?
Qt-interest mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>