parent
bff3e8343d
commit
ff90ddf3d7
File diff suppressed because it is too large
Load Diff
@ -1,129 +1,135 @@ |
|||||||
/*
|
/*
|
||||||
* This program is free software: you can redistribute it and/or modify |
* This program is free software: you can redistribute it and/or modify |
||||||
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
||||||
* the Free Software Foundation, either version 3 of the License, or |
* the Free Software Foundation, either version 3 of the License, or |
||||||
* (at your option) any later version. |
* (at your option) any later version. |
||||||
* |
* |
||||||
* This program is distributed in the hope that it will be useful, |
* This program is distributed in the hope that it will be useful, |
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
* GNU General Public License for more details. |
* GNU General Public License for more details. |
||||||
* |
* |
||||||
* You should have received a copy of the GNU General Public License |
* You should have received a copy of the GNU General Public License |
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/ |
*/ |
||||||
|
|
||||||
#ifndef UBBOARDVIEW_H_ |
#ifndef UBBOARDVIEW_H_ |
||||||
#define UBBOARDVIEW_H_ |
#define UBBOARDVIEW_H_ |
||||||
|
|
||||||
#include <QtGui> |
#include <QtGui> |
||||||
#include "core/UB.h" |
#include "core/UB.h" |
||||||
|
#include "domain/UBGraphicsDelegateFrame.h" |
||||||
class UBBoardController; |
|
||||||
class UBAppleWidget; |
class UBBoardController; |
||||||
class UBGraphicsScene; |
class UBAppleWidget; |
||||||
class UBGraphicsWidgetItem; |
class UBGraphicsScene; |
||||||
|
class UBGraphicsWidgetItem; |
||||||
class UBBoardView : public QGraphicsView |
|
||||||
{ |
class UBBoardView : public QGraphicsView |
||||||
Q_OBJECT; |
{ |
||||||
|
Q_OBJECT; |
||||||
public: |
|
||||||
|
public: |
||||||
UBBoardView(UBBoardController* pController, QWidget* pParent = 0); |
|
||||||
UBBoardView(UBBoardController* pController, int pStartLayer, int pEndLayer, QWidget* pParent = 0); |
UBBoardView(UBBoardController* pController, QWidget* pParent = 0); |
||||||
virtual ~UBBoardView(); |
UBBoardView(UBBoardController* pController, int pStartLayer, int pEndLayer, QWidget* pParent = 0); |
||||||
|
virtual ~UBBoardView(); |
||||||
UBGraphicsScene* scene(); |
|
||||||
|
UBGraphicsScene* scene(); |
||||||
void forcedTabletRelease(); |
|
||||||
|
void forcedTabletRelease(); |
||||||
void setToolCursor(int tool); |
|
||||||
|
void setToolCursor(int tool); |
||||||
signals: |
|
||||||
|
signals: |
||||||
void resized(QResizeEvent* event); |
|
||||||
void hidden(); |
void resized(QResizeEvent* event); |
||||||
void shown(); |
void hidden(); |
||||||
|
void shown(); |
||||||
protected: |
|
||||||
|
protected: |
||||||
virtual bool event (QEvent * e); |
|
||||||
|
virtual bool event (QEvent * e); |
||||||
virtual void keyPressEvent(QKeyEvent *event); |
|
||||||
virtual void tabletEvent(QTabletEvent * event); |
virtual void keyPressEvent(QKeyEvent *event); |
||||||
virtual void mouseDoubleClickEvent(QMouseEvent *event); |
virtual void tabletEvent(QTabletEvent * event); |
||||||
virtual void mousePressEvent(QMouseEvent *event); |
virtual void mouseDoubleClickEvent(QMouseEvent *event); |
||||||
virtual void mouseMoveEvent(QMouseEvent *event); |
virtual void mousePressEvent(QMouseEvent *event); |
||||||
virtual void mouseReleaseEvent(QMouseEvent *event); |
virtual void mouseMoveEvent(QMouseEvent *event); |
||||||
virtual void wheelEvent(QWheelEvent *event); |
virtual void mouseReleaseEvent(QMouseEvent *event); |
||||||
virtual void leaveEvent ( QEvent * event); |
virtual void wheelEvent(QWheelEvent *event); |
||||||
|
virtual void leaveEvent ( QEvent * event); |
||||||
virtual void focusOutEvent ( QFocusEvent * event ); |
|
||||||
|
virtual void focusOutEvent ( QFocusEvent * event ); |
||||||
virtual void drawItems(QPainter *painter, int numItems, |
|
||||||
QGraphicsItem *items[], |
virtual void drawItems(QPainter *painter, int numItems, |
||||||
const QStyleOptionGraphicsItem options[]); |
QGraphicsItem *items[], |
||||||
|
const QStyleOptionGraphicsItem options[]); |
||||||
// virtual void dragEnterEvent(QDragEnterEvent * event);
|
|
||||||
virtual void dropEvent(QDropEvent *event); |
// virtual void dragEnterEvent(QDragEnterEvent * event);
|
||||||
virtual void dragMoveEvent(QDragMoveEvent *event); |
virtual void dropEvent(QDropEvent *event); |
||||||
|
virtual void dragMoveEvent(QDragMoveEvent *event); |
||||||
virtual void resizeEvent(QResizeEvent * event); |
|
||||||
|
virtual void resizeEvent(QResizeEvent * event); |
||||||
virtual void drawBackground(QPainter *painter, const QRectF &rect); |
|
||||||
|
virtual void drawBackground(QPainter *painter, const QRectF &rect); |
||||||
virtual void showEvent(QShowEvent * event); |
|
||||||
virtual void hideEvent(QHideEvent * event); |
virtual void showEvent(QShowEvent * event); |
||||||
|
virtual void hideEvent(QHideEvent * event); |
||||||
private: |
|
||||||
|
private: |
||||||
void init(); |
|
||||||
|
void init(); |
||||||
inline bool shouldDisplayItem(QGraphicsItem *item) |
|
||||||
{ |
inline bool shouldDisplayItem(QGraphicsItem *item) |
||||||
bool ok; |
{ |
||||||
int itemLayerType = item->data(UBGraphicsItemData::ItemLayerType).toInt(&ok); |
bool ok; |
||||||
return (ok && (itemLayerType >= mStartLayer && itemLayerType <= mEndLayer)); |
int itemLayerType = item->data(UBGraphicsItemData::ItemLayerType).toInt(&ok); |
||||||
} |
return (ok && (itemLayerType >= mStartLayer && itemLayerType <= mEndLayer)); |
||||||
|
} |
||||||
QList<QUrl> processMimeData(const QMimeData* pMimeData); |
|
||||||
|
QList<QUrl> processMimeData(const QMimeData* pMimeData); |
||||||
UBBoardController* mController; |
|
||||||
|
UBBoardController* mController; |
||||||
int mStartLayer, mEndLayer; |
|
||||||
bool mFilterZIndex; |
int mStartLayer, mEndLayer; |
||||||
|
bool mFilterZIndex; |
||||||
bool mTabletStylusIsPressed; |
|
||||||
bool mUsingTabletEraser; |
bool mTabletStylusIsPressed; |
||||||
|
bool mUsingTabletEraser; |
||||||
bool mPendingStylusReleaseEvent; |
|
||||||
|
bool mPendingStylusReleaseEvent; |
||||||
bool mMouseButtonIsPressed; |
|
||||||
QPointF mPreviousPoint; |
bool mMouseButtonIsPressed; |
||||||
QPoint mMouseDownPos; |
QPointF mPreviousPoint; |
||||||
|
QPoint mMouseDownPos; |
||||||
bool mPenPressureSensitive; |
|
||||||
bool mMarkerPressureSensitive; |
bool mPenPressureSensitive; |
||||||
bool mUseHighResTabletEvent; |
bool mMarkerPressureSensitive; |
||||||
|
bool mUseHighResTabletEvent; |
||||||
QRubberBand *mRubberBand; |
|
||||||
bool mIsCreatingTextZone; |
QRubberBand *mRubberBand; |
||||||
bool mIsCreatingSceneGrabZone; |
bool mIsCreatingTextZone; |
||||||
|
bool mIsCreatingSceneGrabZone; |
||||||
bool isAbsurdPoint(QPoint point); |
|
||||||
|
bool isAbsurdPoint(QPoint point); |
||||||
bool mVirtualKeyboardActive; |
|
||||||
bool mOkOnWidget; |
bool mVirtualKeyboardActive; |
||||||
|
bool mOkOnWidget; |
||||||
private slots: |
|
||||||
|
bool mWidgetMoved; |
||||||
void settingChanged(QVariant newValue); |
QPointF mLastPressedMousePos; |
||||||
|
QGraphicsItem *movingItem; |
||||||
public slots: |
QMouseEvent *suspendedMousePressEvent; |
||||||
|
|
||||||
void virtualKeyboardActivated(bool b); |
private slots: |
||||||
|
|
||||||
}; |
void settingChanged(QVariant newValue); |
||||||
|
|
||||||
#endif /* UBBOARDVIEW_H_ */ |
public slots: |
||||||
|
|
||||||
|
void virtualKeyboardActivated(bool b); |
||||||
|
|
||||||
|
}; |
||||||
|
|
||||||
|
#endif /* UBBOARDVIEW_H_ */ |
||||||
|
Loading…
Reference in new issue