QTfrontend/itemNum.cpp
changeset 1886 0bb8f61e5630
parent 1455 7d0a4ecd8210
child 1904 20348675b015
equal deleted inserted replaced
1885:75489216b5b0 1886:0bb8f61e5630
    35 void ItemNum::mousePressEvent ( QMouseEvent * event )
    35 void ItemNum::mousePressEvent ( QMouseEvent * event )
    36 {
    36 {
    37   if(nonInteractive) return;
    37   if(nonInteractive) return;
    38   if(event->button()==Qt::LeftButton) {
    38   if(event->button()==Qt::LeftButton) {
    39     event->accept();
    39     event->accept();
    40     if(infinityState && numItems==maxItems) {
    40     if((infinityState && numItems <= maxItems) || (!infinityState && numItems < maxItems)) {
    41       incItems();
    41       incItems();
    42     }
    42     } else {
    43     if(numItems < maxItems) {
    43       numItems = minItems+1;
    44       incItems();
    44       // appears there's an emit in there
       
    45       decItems();
    45     }
    46     }
    46   } else if (event->button()==Qt::RightButton) {
    47   } else if (event->button()==Qt::RightButton) {
    47     event->accept();
    48     event->accept();
    48     if(numItems > minItems) {
    49     if(numItems > minItems) {
    49       decItems();
    50       decItems();
       
    51     } else {
       
    52       numItems = maxItems+(infinityState?0:-1);
       
    53       incItems();
    50     }
    54     }
    51   } else {
    55   } else {
    52     event->ignore();
    56     event->ignore();
    53     return;
    57     return;
    54   }
    58   }