Example #1
0
void VPAbstractNode::setupSlots()
{
	int slotSize = VPAbstractNode::SlotSize;

	inputSlots.clear();
	inputSlots.resize(myInCount);

	for (int i(0); i<myInCount; i++)
	{
		QPointF tRectCenter = slotOffset(i, IN);
		QRectF tRect(tRectCenter.x()-slotSize/2, tRectCenter.y()-slotSize/2, slotSize, slotSize);

		inputSlots[i] = new ConnectorType(tRect, tRectCenter, true, i, this);
	}

	outputSlots.clear();
	outputSlots.resize(myOutCount);

	for (int i(0); i<myOutCount; i++)
	{
		QPointF tRectCenter = slotOffset(i, OUT);
		QRectF tRect(tRectCenter.x()-slotSize/2, tRectCenter.y()-slotSize/2, slotSize, slotSize);

		outputSlots[i] = new ConnectorType(tRect, tRectCenter, false, i, this);
	}
}
Example #2
0
/*! \internal
  Returns the index of the slot with name \n or -1 if no such slot exists.

  If  \a super is TRUE, inherited slots are included.
 */
int QMetaObject::findSlot( const char* n, bool super ) const
{
    const QMetaData *md = slotDict ? slotDict->find( n ) : 0;
    if ( md )
	return slotOffset() + ( md - slotData );
    if ( !super || !superclass)
	return -1;
    return superclass->findSlot( n, super );
}
Example #3
0
/*!  \internal

  Returns the meta data of the slot with the name \a n or 0 if no
  such slot exists.

  If  \a super is TRUE, inherited slots are included.
 */
const QMetaData* QMetaObject::slot( int index, bool super ) const
{
    int idx = index - ( super ? slotOffset() : 0 );
    if ( slotDict && idx >= 0 && idx < (int) slotDict->count() ) {
	return slotData + idx;
    }
    if ( !super || !superclass )
	return 0;
    return superclass->slot( index, super );
}