Commit 1566b02a authored by Dag Andersen's avatar Dag Andersen
Browse files

Fix bug 186639 - Use a more "descriptive" mouse cursor for wiring tasks in the graphic

Use Qt::DragLinkCursor for qt version 4.7 and later
BUG: 186639
parent 605d5aee
......@@ -2,6 +2,8 @@
Calligra Plan current:
----------------------
* Bug 186639 - Use a more "descriptive" mouse cursor for wiring tasks in the graphic
* Bug 286332 - Auto allocate selected resources to new tasks
* Improve printing:
......
......@@ -55,6 +55,13 @@
#include <kactioncollection.h>
#include <kdeversion.h>
#if QT_VERSION >= 0x040700
#define ConnectCursor Qt::DragLinkCursor
#else
#define ConnectCursor Qt::UpArrowCursor
#endif
namespace KPlato
{
......@@ -478,7 +485,7 @@ DependencyConnectorItem::DependencyConnectorItem( DependencyNodeItem::ConnectorT
m_ctype( type ),
m_editable( false )
{
setCursor( Qt::UpArrowCursor );
setCursor( ConnectCursor);
setAcceptsHoverEvents( true );
setZValue( 500.0 );
......@@ -1060,7 +1067,7 @@ void DependencyScene::setFromItem( DependencyConnectorItem *item )
}
}
}
item->setCursor( Qt::UpArrowCursor );
item->setCursor( ConnectCursor );
m_connectionitem->setPredConnector( item );
m_connectionitem->show();
} else {
......@@ -1087,8 +1094,7 @@ bool DependencyScene::connectionIsValid( DependencyConnectorItem *pred, Dependen
void DependencyScene::connectorEntered( DependencyConnectorItem *item, bool entered )
{
//kDebug(planDependencyEditorDbg())<<entered;
//TODO special cursor
item->setCursor( Qt::UpArrowCursor );
item->setCursor( ConnectCursor );
if ( ! entered ) {
// when we leave a connector we don't have a successor
m_connectionitem->setSuccConnector( 0 );
......@@ -1096,7 +1102,7 @@ void DependencyScene::connectorEntered( DependencyConnectorItem *item, bool ente
}
if ( m_connectionitem->predConnector == item ) {
// when inside the predecessor, clicking is allowed (deselects connector)
item->setCursor( Qt::UpArrowCursor );
item->setCursor( ConnectCursor );
return;
}
if ( ! m_connectionitem->isVisible() ) {
......@@ -1929,17 +1935,19 @@ void DependencyView::mouseMoveEvent( QMouseEvent *mouseEvent )
foreach ( QGraphicsItem *i, itemScene()->items( spos ) ) {
if ( i->type() == DependencyConnectorItem::Type ) {
if ( i == itemScene()->fromItem() ) {
c = Qt::UpArrowCursor;
c = ConnectCursor;
} else {
if ( itemScene()->connectionIsValid( itemScene()->fromItem(), static_cast<DependencyConnectorItem*>( i ) ) ) {
c = Qt::UpArrowCursor;
c = ConnectCursor;
} else {
c = Qt::ForbiddenCursor;
}
}
}
}
viewport()->setCursor( c );
if ( viewport()->cursor().shape() != c ) {
viewport()->setCursor( c );
}
}
QGraphicsView::mouseMoveEvent( mouseEvent );
//kDebug(planDependencyEditorDbg())<<mouseEvent->scenePos()<<","<<mouseEvent->isAccepted();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment