Your ROOT_URL in app.ini is http://git.osmesh.ru/ but you are visiting http://91.221.70.94:3000/MOS/OpenBoard/commit/cc9ddea6aebbf97400ee0470e906b55e2211bb7d
You should set ROOT_URL correctly, otherwise the web may not work correctly.
6 changed files with
29 additions and
20 deletions
src/board/UBBoardView.cpp
src/domain/UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.h
src/domain/UBGraphicsPixmapItem.cpp
src/domain/UBGraphicsPixmapItem.h
src/domain/UBGraphicsVideoItem.cpp
@ -421,9 +421,7 @@ UBBoardView::mousePressEvent (QMouseEvent *event)
}
else if ( currentTool = = UBStylusTool : : Selector )
{
QSet < QGraphicsItem * > existingTools = scene ( ) - > tools ( ) ;
movingItem = scene ( ) - > itemAt ( this - > mapToScene ( event - > posF ( ) . toPoint ( ) ) ) ;
movingItem = scene ( ) - > itemAt ( this - > mapToScene ( event - > posF ( ) . toPoint ( ) ) ) ;
if ( ! movingItem
| | movingItem - > isSelected ( )
@ -432,7 +430,8 @@ UBBoardView::mousePressEvent (QMouseEvent *event)
| | movingItem - > type ( ) = = UBGraphicsCompass : : Type
| | movingItem - > type ( ) = = UBGraphicsPDFItem : : Type
| | movingItem - > type ( ) = = UBGraphicsPolygonItem : : Type
| | movingItem - > type ( ) = = UBGraphicsCache : : Type )
| | movingItem - > type ( ) = = UBGraphicsCache : : Type
| | scene ( ) - > isBackgroundObject ( movingItem ) )
{
movingItem = NULL ;
QGraphicsView : : mousePressEvent ( event ) ;
@ -147,12 +147,7 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
bool UBGraphicsItemDelegate : : mousePressEvent ( QGraphicsSceneMouseEvent * event )
{
if ( NULL ! = mMimeData )
{
QDrag * mDrag = new QDrag ( event - > widget ( ) ) ;
mDrag - > setMimeData ( mMimeData ) ;
mDrag - > start ( ) ;
}
mDragStartPosition = event - > pos ( ) ;
startUndoStep ( ) ;
@ -186,13 +181,27 @@ void UBGraphicsItemDelegate::setMimeData(QMimeData *mimeData)
bool UBGraphicsItemDelegate : : mouseMoveEvent ( QGraphicsSceneMouseEvent * event )
{
if ( ( NULL ! = mMimeData ) & & ( ( event - > pos ( ) - mDragStartPosition ) . manhattanLength ( ) < QApplication : : startDragDistance ( ) ) )
{
QDrag * mDrag = new QDrag ( event - > widget ( ) ) ;
mDrag - > setMimeData ( mMimeData ) ;
if ( ! mDragPixmap . isNull ( ) ) {
mDrag - > setPixmap ( mDragPixmap ) ;
mDrag - > setHotSpot ( mDragPixmap . rect ( ) . center ( ) ) ;
}
mDrag - > exec ( ) ;
mDragPixmap = QPixmap ( ) ;
return true ;
}
if ( isLocked ( ) )
{
event - > accept ( ) ;
return true ;
}
else
return false ;
return tru e;
}
bool UBGraphicsItemDelegate : : weelEvent ( QGraphicsSceneWheelEvent * event )
@ -129,6 +129,7 @@ class UBGraphicsItemDelegate : public QObject
QMimeData * mimeData ( ) { return mMimeData ; }
void setMimeData ( QMimeData * mimeData ) ;
void setDragPixmap ( const QPixmap & pix ) { mDragPixmap = pix ; }
signals :
void showOnDisplayChanged ( bool shown ) ;
@ -174,12 +175,15 @@ private:
QPointF mOffset ;
QTransform mPreviousTransform ;
QPointF mPreviousPosition ;
QPointF mDragStartPosition ;
qreal mPreviousZValue ;
QSizeF mPreviousSize ;
bool mCanRotate ;
bool mCanDuplicate ;
bool mRespectRatio ;
QMimeData * mMimeData ;
QPixmap mDragPixmap ;
} ;
@ -53,6 +53,11 @@ void UBGraphicsPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
QMimeData * pMime = new QMimeData ( ) ;
pMime - > setImageData ( pixmap ( ) . toImage ( ) ) ;
mDelegate - > setMimeData ( pMime ) ;
int k = pixmap ( ) . width ( ) / 100 ;
QSize newSize ( pixmap ( ) . width ( ) / k , pixmap ( ) . height ( ) / k ) ;
mDelegate - > setDragPixmap ( pixmap ( ) . scaled ( newSize , Qt : : IgnoreAspectRatio , Qt : : SmoothTransformation ) ) ;
if ( mDelegate - > mousePressEvent ( event ) )
{
//NOOP
@ -62,9 +62,6 @@ protected:
virtual QVariant itemChange ( GraphicsItemChange change , const QVariant & value ) ;
// UBGraphicsItemDelegate* mDelegate;
} ;
# endif /* UBGRAPHICSPIXMAPITEM_H_ */
@ -109,11 +109,6 @@ void UBGraphicsVideoItem::showOnDisplayChanged(bool shown)
void UBGraphicsVideoItem : : mousePressEvent ( QGraphicsSceneMouseEvent * event )
{
QDrag * mDrag = new QDrag ( event - > widget ( ) ) ;
QMimeData * pMime = new QMimeData ( ) ;
mDrag - > setMimeData ( pMime ) ;
mDrag - > start ( ) ;
mShouldMove = ( event - > buttons ( ) & Qt : : LeftButton ) ;
mMousePressPos = event - > scenePos ( ) ;
mMouseMovePos = mMousePressPos ;