Merge branch 'OEFUniboard' of github.com:stayonshadow/PrivateBoard into OEFUniboard

preferencesAboutTextFull
Didier Clerc 12 years ago
commit 30e51f5a88
  1. 15
      src/board/UBBoardController.cpp
  2. 2
      src/board/UBBoardController.h
  3. 3
      src/core/UBMimeData.cpp
  4. 12
      src/domain/UBGraphicsGroupContainerItem.cpp
  5. 5
      src/domain/UBGraphicsItemDelegate.cpp
  6. 3
      src/domain/UBGraphicsProxyWidget.cpp
  7. 5
      src/domain/UBGraphicsScene.cpp
  8. 18
      src/domain/UBSelectionFrame.cpp

@ -543,7 +543,7 @@ void UBBoardController::duplicateScene()
duplicateScene(mActiveSceneIndex);
}
UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item)
{
if (!item)
return NULL;
@ -602,12 +602,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
if (mitem)
{
sourceUrl = mitem->mediaFileUrl();
if (bAsync)
{
downloadURL(sourceUrl, srcFile, itemPos, QSize(itemSize.width(), itemSize.height()), false, false);
return NULL; // async operation
}
}
}break;
case UBMimeType::VectorImage:
@ -643,8 +640,8 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
mActiveScene->setURStackEnable(false);
foreach(QGraphicsItem* pIt, children){
UBItem* pItem = dynamic_cast<UBItem*>(pIt);
if(pItem){ // we diong sync duplication of all childs.
QGraphicsItem * itemToGroup = dynamic_cast<QGraphicsItem *>(duplicateItem(pItem, false));
if(pItem){
QGraphicsItem * itemToGroup = dynamic_cast<QGraphicsItem *>(duplicateItem(pItem));
if (itemToGroup)
duplicatedItems.append(itemToGroup);
}
@ -2220,11 +2217,7 @@ void UBBoardController::copy()
UBItem* ubItem = dynamic_cast<UBItem*>(gi);
if (ubItem && !mActiveScene->tools().contains(gi))
{
UBItem *itemCopy = ubItem->deepCopy();
if (itemCopy)
selected << itemCopy;
}
selected << ubItem;
}
if (selected.size() > 0)

@ -168,7 +168,7 @@ class UBBoardController : public UBDocumentContainer
void moveSceneToIndex(int source, int target);
void duplicateScene(int index);
UBGraphicsItem *duplicateItem(UBItem *item, bool bAsync = true);
UBGraphicsItem *duplicateItem(UBItem *item);
void deleteScene(int index);
bool cacheIsVisible() {return mCacheWidgetIsEnabled;}

@ -61,6 +61,5 @@ UBMimeDataGraphicsItem::UBMimeDataGraphicsItem(QList<UBItem*> pItems)
UBMimeDataGraphicsItem::~UBMimeDataGraphicsItem()
{
foreach(UBItem* item, mItems)
delete item;
// Explanation: selected items are owned by the scene and handled by this class
}

@ -183,16 +183,6 @@ void UBGraphicsGroupContainerItem::paint(QPainter *painter, const QStyleOptionGr
Q_UNUSED(painter);
Q_UNUSED(option);
// we would not use paint smth for the moment
// if (option->state & QStyle::State_Selected) {
// painter->setBrush(Qt::NoBrush);
// QPen tmpPen;
// qreal tmpPenWidth = 1.0;
// tmpPen.setWidth(tmpPenWidth);
// tmpPen.setColor(Qt::lightGray);
// painter->setPen(tmpPen);
// painter->drawRect(itemsBoundingRect.adjusted(tmpPenWidth / 2, tmpPenWidth / 2, -tmpPenWidth / 2, -tmpPenWidth / 2));
// }
Delegate()->postpaint(painter, option, widget);
}
@ -211,8 +201,6 @@ UBGraphicsGroupContainerItem *UBGraphicsGroupContainerItem::deepCopy() const
copyItemParameters(copy);
// copy->resize(this->size());
return copy;
}

@ -120,14 +120,17 @@ void DelegateButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void DelegateButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
painter->save();
painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
QGraphicsSvgItem::paint(painter, option, widget);
painter->restore();
if (mIsPressed && mShowProgressIndicator) {
QPen pen;
pen.setBrush(Qt::white);
pen.setWidth(3);
painter->save();
painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
painter->setPen(pen);
int spanAngle = qMin(mPressProgres, UBSettings::longClickInterval) * 360 / UBSettings::longClickInterval;

@ -49,8 +49,11 @@ UBGraphicsProxyWidget::~UBGraphicsProxyWidget()
void UBGraphicsProxyWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
painter->save();
painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
QGraphicsProxyWidget::paint(painter,option,widget);
Delegate()->postpaint(painter, option, widget);
painter->restore();
}
QVariant UBGraphicsProxyWidget::itemChange(GraphicsItemChange change, const QVariant &value)

@ -319,8 +319,6 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent, bool enableUndoRedoSta
mShouldUseOMP = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5;
#endif
// setItemIndexMethod(QGraphicsScene::BspTreeIndex);
setUuid(QUuid::createUuid());
setDocument(parent);
createEraiser();
@ -1070,9 +1068,6 @@ void UBGraphicsScene::notifyZChanged(QGraphicsItem *item, qreal zValue)
void UBGraphicsScene::updateSelectionFrame()
{
qDebug() << "selected item count" << selectedItems().count();
// if (!mMultipleSelectionProcess) {
// return;
// }
if (!mSelectionFrame) {
mSelectionFrame = new UBSelectionFrame();

@ -133,12 +133,6 @@ void UBSelectionFrame::mousePressEvent(QGraphicsSceneMouseEvent *event)
} else {
mOperationMode = om_moving;
}
// foreach (UBGraphicsItemDelegate *curDelegate, mEnclosedtems) {
// qDebug() << "TransformBefore" << curDelegate->delegated()->transform();
// }
// QGraphicsRectItem::mousePressEvent(event);
}
void UBSelectionFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
@ -191,9 +185,6 @@ void UBSelectionFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
item->update();
item->setTransform(ownTransform, false);
// int resultAngle = (int)mRotationAngle % 360;
// setCursorFromAngle(QString::number(resultAngle));
qDebug() << "curAngle" << mRotationAngle;
} break;
@ -219,11 +210,6 @@ void UBSelectionFrame::mouseReleaseEvent(QGraphicsSceneMouseEvent */*event*/)
}
mOperationMode = om_idle;
// foreach (UBGraphicsItemDelegate *curDelegate, mEnclosedtems) {
// qDebug() << "TransformBefore" << curDelegate->delegated()->transform();
// }
// QGraphicsRectItem::mouseReleaseEvent(event);
}
void UBSelectionFrame::onZoomChanged(qreal pZoom)
@ -232,11 +218,7 @@ void UBSelectionFrame::onZoomChanged(qreal pZoom)
qDebug() << "Board current zoom" << UBApplication::boardController->currentZoom();
qDebug() << "UBApplication::boardController->systemScaleFactor()" << UBApplication::boardController->systemScaleFactor();
mAntiscaleRatio = 1 / (UBApplication::boardController->systemScaleFactor() * pZoom);
// updateScale();
// QTransform tr;
// tr.scale(mAntiscaleRatio, mAntiscaleRatio);
// this->setTransform(tr);
}
void UBSelectionFrame::remove()

Loading…
Cancel
Save