r15298 by jghali - #9225: improvements to the fix
scribus-commit
scribus-commit at lists.scribus.net
Thu Jul 1 20:50:51 CEST 2010
Revision: 15298
Author: jghali
Date: 2010-07-01T18:43:44.477364Z
Commit message: #9225: improvements to the fix
Changeset:
M /trunk/Scribus/scribus/ui/vruler.cpp
M /trunk/Scribus/scribus/ui/hruler.cpp
M /trunk/Scribus/scribus/ui/vruler.h
M /trunk/Scribus/scribus/ui/hruler.h
Diffs:
Index: scribus/ui/vruler.cpp
===================================================================
--- scribus/ui/vruler.cpp (revision 15297)
+++ scribus/ui/vruler.cpp (revision 15298)
@@ -63,6 +63,7 @@
oldMark = 0;
Mpressed = false;
drawMark = false;
+ setMouseTracking(true);
rulerGesture = new RulerGesture(currView, RulerGesture::VERTICAL);
unitChange();
}
@@ -95,8 +96,11 @@
else
{
QCursor* cursor = qApp->overrideCursor();
- if (cursor && (cursor->shape() != Qt::ArrowCursor))
+ Qt::CursorShape shape = cursor ? cursor->shape() : Qt::ArrowCursor;
+ if ((shape == Qt::SplitHCursor) || (shape == Qt::SplitVCursor))
+ {
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+ }
}
}
Index: scribus/ui/hruler.cpp
===================================================================
--- scribus/ui/hruler.cpp (revision 15297)
+++ scribus/ui/hruler.cpp (revision 15298)
@@ -454,8 +454,11 @@
else
{
QCursor* cursor = qApp->overrideCursor();
- if (cursor && (cursor->shape() != Qt::ArrowCursor))
+ Qt::CursorShape shape = cursor ? cursor->shape() : Qt::ArrowCursor;
+ if ((shape == Qt::SplitHCursor) || (shape == Qt::SplitVCursor))
+ {
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+ }
}
}
}
Index: scribus/ui/hruler.h
===================================================================
--- scribus/ui/hruler.h (revision 15297)
+++ scribus/ui/hruler.h (revision 15298)
@@ -71,11 +71,12 @@
void setItem(PageItem * item);
private:
- void paintEvent(QPaintEvent *e);
+ virtual void paintEvent(QPaintEvent *e);
+ virtual void mousePressEvent(QMouseEvent *m);
+ virtual void mouseReleaseEvent(QMouseEvent *);
+ virtual void mouseMoveEvent(QMouseEvent *m);
+
void drawNumber(QString num, int startx, int starty, QPainter & p);
- void mousePressEvent(QMouseEvent *m);
- void mouseReleaseEvent(QMouseEvent *);
- void mouseMoveEvent(QMouseEvent *m);
void UpdateTabList();
int Markp;
Index: scribus/ui/vruler.h
===================================================================
--- scribus/ui/vruler.h (revision 15297)
+++ scribus/ui/vruler.h (revision 15298)
@@ -44,17 +44,21 @@
public:
Vruler(ScribusView *pa, ScribusDoc *doc);
~Vruler() {};
- void paintEvent(QPaintEvent *e);
- void mousePressEvent(QMouseEvent *m);
- void mouseReleaseEvent(QMouseEvent *m);
- void mouseMoveEvent(QMouseEvent *m);
- void drawNumber(QString num, int starty, QPainter *p);
+
double offs;
bool repainted;
int oldMark;
bool Mpressed;
double ruleSpacing();
+
private: // Private attributes
+ virtual void paintEvent(QPaintEvent *e);
+ virtual void mousePressEvent(QMouseEvent *m);
+ virtual void mouseReleaseEvent(QMouseEvent *m);
+ virtual void mouseMoveEvent(QMouseEvent *m);
+
+ void drawNumber(QString num, int starty, QPainter *p);
+
/** Zeichensatz des Lineals */
ScribusDoc *currDoc;
ScribusView *currView;
More information about the scribus-commit
mailing list