示例#1
0
void QSplitter::moveAfter( int pos, int id, bool upLeft )
{
    QSplitterLayoutStruct *s = id < int(data->list.count()) ?
			       data->list.at(id) : 0;
    if ( !s )
	return;
    QWidget *w = s->wid;
    if ( w->isHidden() ) {
	moveAfter( pos, id+1, upLeft );
    } else if ( pick( w->pos() ) == pos ) {
	//No need to do anything if it's already there.
	return;
    } else if ( s->isSplitter ) {
	int dd = s->sizer;
	if ( upLeft ) {
	    setG( w, pos, dd );
	    moveAfter( pos+dd, id+1, upLeft );
	} else {
	    moveAfter( pos+dd, id+1, upLeft );
	    setG( w, pos, dd );
	}
    } else {
	int right = pick( w->geometry().bottomRight() );

       	int dd = right - pos + 1;
	dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize())));
	int newRight = pos+dd-1;
	setG( w, pos, dd );
	moveAfter( newRight+1, id+1, upLeft );
    }
}
示例#2
0
文件: query.cpp 项目: c24b/indexd
bool NotNode::init()
{
    if(! node->init())
        return false;
    moveAfter(1);
    return true;
}
示例#3
0
文件: query.cpp 项目: c24b/indexd
bool AndNode::init()
{
    if(! (left->init() && right->init()))
        return false;
    moveAfter(0);
    return true;
}
示例#4
0
  /*!
  * \bug Segmentationfault when last cell.
  *
  * \todo It is better that Commands take care of how to change
  * state of cells.(Ingemar Axelsson)
  *
  * 2006-08-24 AF, changed so the function returns a boolean value, true if
  * the cursor is moved.
  */
  bool CellCursor::moveDown()
  {
    // 2006-08-24 AF,
        bool moved( false );

    // 2006-04-27 AF,
    cursorIsMoved();

    if( !hasNext() )
    {
      if( parentCell()->hasParentCell() )
      {
        moveAfter( parentCell() );
        moved = true;
      }
    }
    else //Has next.
    {
      if(next()->hasChilds())
      {
        if(!next()->isClosed())
        {
          moveToFirstChild(next());
          moved = true;
        }
        else
        {
          moveAfter(next());
          moved = true;
        }
      }
      else
      {
        moveAfter(next());
        moved = true;
      }
    }
    // TMP EMIT
    emit changedPosition();
    emit positionChanged(x(), y(), 5,5);
    return moved;
  }
示例#5
0
void UmlItem::move_after(anItemKind k, const char * name) {
  const QVector<UmlItem> ch = parent()->children();
  unsigned i;
  
  for (i = 0; i != ch.size(); i += 1) {
    if ((ch[i]->kind() == k) &&
	(ch[i]->name() == name)) {
      moveAfter(ch[i]);
      break;
    }
  }
}
示例#6
0
/*!
  Moves the left/top edge of the splitter handle with id \a id as
  close as possible to \a p which is the distance from the left (or
  top) edge of the widget.

  \sa idAfter()
*/
void QSplitter::moveSplitter( QCOORD p, int id )
{
    p = adjustPos( p, id );

    QSplitterLayoutStruct *s = data->list.at(id);
    int oldP = orient == Horizontal? s->wid->x() : s->wid->y();
    bool upLeft = p < oldP;

    moveAfter( p, id, upLeft );
    moveBefore( p-1, id-1, upLeft );

    storeSizes();
}
示例#7
0
文件: query.cpp 项目: c24b/indexd
bool ApproxNode::init()
{
    for(unsigned short i = 0, size = nodes.size(); i < size; ++i)
    {
        if(! nodes[i]->init())
            return false;
        if(nodes[i]->getDocID() == 0)
            return true;
    }

    moveAfter(0);
    return true;
}
示例#8
0
  /*!
  * \bug This does not seem to work correctly.
  */
  void CellCursor::moveToLastChild(Cell *parent)
  {
    // 2006-04-27 AF,
    cursorIsMoved();

    if(parent->hasChilds())
    {
      parent->removeCellWidgets();
      moveAfter(parent->last());
      parent->addCellWidgets();
    }
    else
    {
      throw runtime_error("LAST CHILD: Tried to move to a child that did not exist.");
    }

    // TMP EMIT
    emit changedPosition();
  }
示例#9
0
llvm::BasicBlock *IRState::insertBBAfter(llvm::BasicBlock *predecessor,
                                         const llvm::Twine &name) {
  auto bb = llvm::BasicBlock::Create(context(), name, topfunc());
  bb->moveAfter(predecessor);
  return bb;
}