Esempio n. 1
0
Params
Settings::Impl::updateContentSizeAndGetParams(
	PageId const& page_id, QSizeF const& content_size_mm,
	QSizeF* agg_hard_size_before, QSizeF* agg_hard_size_after)
{
	QMutexLocker const locker(&m_mutex);
	
	if (agg_hard_size_before) {
		*agg_hard_size_before = getAggregateHardSizeMMLocked();
	}
	
	Container::iterator const it(m_items.lower_bound(page_id));
	Container::iterator item_it(it);
	if (it == m_items.end() || page_id < it->pageId) {
		Item const item(
			page_id, m_defaultHardMarginsMM,
			content_size_mm, m_defaultAlignment
		);
		item_it = m_items.insert(it, item);
	} else {
		m_items.modify(it, ModifyContentSize(content_size_mm));
	}
	
	if (agg_hard_size_after) {
		*agg_hard_size_after = getAggregateHardSizeMMLocked();
	}
	
	return Params(
		item_it->hardMarginsMM,
		item_it->contentSizeMM, item_it->alignment
	);
}
Esempio n. 2
0
int LinePath::onLinePath( const QPoint &position ) {
    QCanvasItemList list = getCanvas() -> collisions( position );
    int index = -1;

    QCanvasItemList::iterator end(list.end());
    for(QCanvasItemList::iterator item_it(list.begin()); item_it != end; ++item_it ) {
        if( ( index = m_LineList.findRef( (QCanvasLine*)*item_it ) ) != -1 )
            break;
    }//end for
    return index;
}
Esempio n. 3
0
/**
 * Returns -1 if the given point is not on the line.
 * else returns the line segment the point is on.
 * Use the value to insert points at the point position.
 */
int AssociationLine::onLinePath( const QPoint &position )
{
    UMLSceneItemList list = getScene()->collisions( position );
    int index = -1;

    UMLSceneItemList::iterator end(list.end());
    for(UMLSceneItemList::iterator item_it(list.begin()); item_it != end; ++item_it ) {
        if( ( index = m_LineList.indexOf( (UMLSceneLine*)*item_it ) ) != -1 )
            break;
    }//end for
    return index;
}
Esempio n. 4
0
void DlgTrackInfo::cueDelete() {
    QList<QTableWidgetItem*> selected = cueTable->selectedItems();
    QListIterator<QTableWidgetItem*> item_it(selected);

    QSet<int> rowsToDelete;
    while(item_it.hasNext()) {
        QTableWidgetItem* item = item_it.next();
        rowsToDelete.insert(item->row());
    }

    QList<int> rowsList = QList<int>::fromSet(rowsToDelete);
    qSort(rowsList);

    QListIterator<int> it(rowsList);
    it.toBack();
    while (it.hasPrevious()) {
        cueTable->removeRow(it.previous());
    }
}