новые иконки в OpenBoard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OpenBoard/src/gui/UBToolWidget.h

70 lines
2.0 KiB

/*
14 years ago
* 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
13 years ago
* the Free Software Foundation, either version 2 of the License, or
14 years ago
* (at your option) any later version.
*
14 years ago
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBTOOLWIDGET_H_
#define UBTOOLWIDGET_H_
#include <QtGui>
class UBGraphicsWidgetItem;
class QWidget;
class UBGraphicsScene;
class UBToolWidget : public QGraphicsWidget
{
Q_OBJECT
public:
UBToolWidget(const QUrl& pUrl, QGraphicsItem *pParent = 0);
UBToolWidget(UBGraphicsWidgetItem* pGraphicsWidgetItem, QGraphicsItem *pParent = 0);
virtual ~UBToolWidget();
void centerOn(const QPointF& pos);
QPointF naturalCenter() const;
UBGraphicsWidgetItem* graphicsWidgetItem() const;
virtual UBGraphicsScene* scene();
protected:
void initialize();
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
virtual bool eventFilter(QObject *obj, QEvent *event);
private slots:
void javaScriptWindowObjectCleared();
protected:
static QPixmap *sClosePixmap;
static QPixmap *sUnpinPixmap;
UBGraphicsWidgetItem *mGraphicsWidgetItem;
QPointF mMousePressPos;
bool mShouldMoveWidget;
int mContentMargin;
int mFrameWidth;
};
#endif /* UBTOOLWIDGET_H_ */