mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-23 16:22:58 +03:00
added shadow property for baseitem
This commit is contained in:
parent
52f43f946b
commit
db57157690
@ -80,7 +80,7 @@ void ShapeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
painter->save();
|
||||
|
||||
QPen pen(m_shapeColor);
|
||||
pen.setWidthF(m_lineWidth+1);
|
||||
pen.setWidthF(m_lineWidth);
|
||||
pen.setStyle(m_penStyle);
|
||||
pen.setJoinStyle(Qt::MiterJoin);
|
||||
painter->setPen(pen);
|
||||
|
@ -87,7 +87,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
|
||||
m_unitType(Millimeters),
|
||||
m_itemGeometryLocked(false),
|
||||
m_isChangingPos(false),
|
||||
m_isMoveable(false)
|
||||
m_isMoveable(false),
|
||||
m_shadow(false)
|
||||
|
||||
|
||||
{
|
||||
@ -103,7 +104,7 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
|
||||
QRectF BaseDesignIntf::boundingRect() const
|
||||
{
|
||||
qreal halfpw = pen().widthF() / 2;
|
||||
halfpw += 2;
|
||||
halfpw += 2;
|
||||
return rect().adjusted(-halfpw, -halfpw, halfpw, halfpw);
|
||||
}
|
||||
|
||||
@ -426,16 +427,17 @@ void BaseDesignIntf::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *o
|
||||
Q_UNUSED(option);
|
||||
Q_UNUSED(widget);
|
||||
ppainter->save();
|
||||
ppainter->setRenderHint(QPainter::HighQualityAntialiasing);
|
||||
setupPainter(ppainter);
|
||||
drawBorder(ppainter, rect());
|
||||
// if (m_joinMarkerOn) { drawMarker(ppainter, Const::JOIN_COLOR);}
|
||||
// if (isSelected() && !m_joinMarkerOn) {drawMarker(ppainter, Const::SELECTION_COLOR);}
|
||||
if(m_shadow)
|
||||
drawShadow(ppainter, rect());
|
||||
// if (m_joinMarkerOn) { drawMarker(ppainter, Const::JOIN_COLOR);}
|
||||
// if (isSelected() && !m_joinMarkerOn) {drawMarker(ppainter, Const::SELECTION_COLOR);}
|
||||
drawResizeZone(ppainter);
|
||||
ppainter->restore();
|
||||
// if (m_hovered) ppainter->drawImage(
|
||||
// QRectF(QPointF(rect().topRight().x()-24, rect().bottomLeft().y()-24),
|
||||
// QSizeF(24, 24)),QImage(":/items/images/settings.png"));
|
||||
// if (m_hovered) ppainter->drawImage(
|
||||
// QRectF(QPointF(rect().topRight().x()-24, rect().bottomLeft().y()-24),
|
||||
// QSizeF(24, 24)),QImage(":/items/images/settings.png"));
|
||||
}
|
||||
|
||||
QColor calcColor(QColor color){
|
||||
@ -445,9 +447,9 @@ QColor calcColor(QColor color){
|
||||
int B = color.blue();
|
||||
|
||||
if (0.222*R + 0.707*G + 0.071*B <= 127)
|
||||
return Qt::white;
|
||||
return Qt::white;
|
||||
else
|
||||
return Qt::black;
|
||||
return Qt::black;
|
||||
}
|
||||
|
||||
void BaseDesignIntf::prepareRect(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
||||
@ -488,22 +490,22 @@ void BaseDesignIntf::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
case ResizeRight:
|
||||
case ResizeLeft:
|
||||
setCursor(Qt::SizeHorCursor);
|
||||
break;
|
||||
break;
|
||||
case ResizeBottom:
|
||||
case ResizeTop:
|
||||
setCursor(Qt::SizeVerCursor);
|
||||
break;
|
||||
break;
|
||||
case ResizeRight | ResizeBottom:
|
||||
case ResizeLeft | ResizeTop:
|
||||
setCursor(Qt::SizeFDiagCursor);
|
||||
break;
|
||||
break;
|
||||
case ResizeLeft | ResizeBottom:
|
||||
case ResizeRight | ResizeTop:
|
||||
setCursor(Qt::SizeBDiagCursor);
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
setCursor(Qt::ArrowCursor);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -513,7 +515,7 @@ void BaseDesignIntf::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
void BaseDesignIntf::invalidateRects(QVector<QRectF *> rects)
|
||||
{
|
||||
foreach(QRectF * rect, rects)
|
||||
scene()->update(mapToScene(*rect).boundingRect());
|
||||
scene()->update(mapToScene(*rect).boundingRect());
|
||||
}
|
||||
|
||||
void BaseDesignIntf::hoverLeaveEvent(QGraphicsSceneHoverEvent *)
|
||||
@ -546,8 +548,8 @@ void BaseDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
||||
if (m_resizeDirectionFlags & ResizeLeft) {
|
||||
if ((event->scenePos().x()) <= (mapToScene(0, 0).x() + (width() - Const::MINIMUM_ITEM_WIDTH)) &&
|
||||
(width() + (event->lastScenePos().x() - event->scenePos().x()) > Const::MINIMUM_ITEM_WIDTH)
|
||||
) {
|
||||
(width() + (event->lastScenePos().x() - event->scenePos().x()) > Const::MINIMUM_ITEM_WIDTH)
|
||||
) {
|
||||
qreal posRightCorner = mapToScene(0, 0).x() + width();
|
||||
qreal posLeftCorner = div(mapToParent(event->pos()).x(), hStep).quot * hStep;
|
||||
if (posLeftCorner < 0 )
|
||||
@ -559,15 +561,15 @@ void BaseDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
||||
if (m_resizeDirectionFlags & ResizeRight) {
|
||||
if ((event->scenePos().x() >= (mapToScene(0, 0).x() + Const::MINIMUM_ITEM_WIDTH)) ||
|
||||
(event->scenePos().x() >= (mapToScene(0, 0).x() + width()))) {
|
||||
(event->scenePos().x() >= (mapToScene(0, 0).x() + width()))) {
|
||||
setWidth(div(event->scenePos().x() - mapToScene(0, 0).x(), hStep).quot * hStep);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_resizeDirectionFlags & ResizeTop) {
|
||||
if ((event->scenePos().y()) <= (mapToScene(0, 0).y() + (height() - Const::MINIMUM_ITEM_HEIGHT)) &&
|
||||
(height() + (event->lastScenePos().y() - event->scenePos().y()) > Const::MINIMUM_ITEM_HEIGHT)
|
||||
) {
|
||||
(height() + (event->lastScenePos().y() - event->scenePos().y()) > Const::MINIMUM_ITEM_HEIGHT)
|
||||
) {
|
||||
qreal posBottomCorner = mapToScene(0, 0).y() + height();
|
||||
qreal posTopCorner = div(mapToParent(event->pos()).y(), vStep).quot * vStep;
|
||||
if (posTopCorner < 0 )
|
||||
@ -579,8 +581,8 @@ void BaseDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
||||
if (m_resizeDirectionFlags & ResizeBottom) {
|
||||
if ((event->scenePos().y() > (mapToScene(0, 0).y() + height())) ||
|
||||
(event->scenePos().y() > (mapToScene(0, 0).y() + Const::MINIMUM_ITEM_HEIGHT))
|
||||
) {
|
||||
(event->scenePos().y() > (mapToScene(0, 0).y() + Const::MINIMUM_ITEM_HEIGHT))
|
||||
) {
|
||||
setHeight(div(event->scenePos().y() - mapToScene(0, 0).y(), vStep).quot * vStep);
|
||||
}
|
||||
}
|
||||
@ -656,11 +658,11 @@ Qt::CursorShape BaseDesignIntf::getPossibleCursor(int cursorFlags)
|
||||
if ((cursorFlags == Fixed) || (scene()->selectedItems().count() > 1)) return Qt::ArrowCursor;
|
||||
|
||||
if (((cursorFlags & ResizeRight) && (cursorFlags & ResizeTop)) ||
|
||||
((cursorFlags & ResizeLeft) && (cursorFlags & ResizeBottom))) {
|
||||
((cursorFlags & ResizeLeft) && (cursorFlags & ResizeBottom))) {
|
||||
return Qt::SizeBDiagCursor;
|
||||
}
|
||||
if (((cursorFlags & ResizeLeft) && (cursorFlags & ResizeTop)) ||
|
||||
((cursorFlags & ResizeRight) && (cursorFlags & ResizeBottom))) {
|
||||
((cursorFlags & ResizeRight) && (cursorFlags & ResizeBottom))) {
|
||||
return Qt::SizeFDiagCursor;
|
||||
}
|
||||
if ((cursorFlags & ResizeLeft) || (cursorFlags & ResizeRight)) { return Qt::SizeHorCursor; }
|
||||
@ -705,7 +707,7 @@ QPointF BaseDesignIntf::modifyPosForAlignedItem(const QPointF& pos){
|
||||
case ParentWidthItemAlign:
|
||||
result.setX(leftBorder);
|
||||
case DesignedItemAlign:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@ -753,7 +755,7 @@ void BaseDesignIntf::updatePossibleDirectionFlags(){
|
||||
setPossibleResizeDirectionFlags(ResizeBottom|ResizeTop);
|
||||
case CenterItemAlign:
|
||||
case DesignedItemAlign:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -772,6 +774,21 @@ bool BaseDesignIntf::isShapeItem() const
|
||||
return QString(metaObject()->className()) == "LimeReport::ShapeItem";
|
||||
}
|
||||
|
||||
bool BaseDesignIntf::hasShadow()
|
||||
{
|
||||
return m_shadow;
|
||||
}
|
||||
|
||||
void BaseDesignIntf::setShadow(bool sh)
|
||||
{
|
||||
if (m_shadow != sh){
|
||||
bool oldValue = m_shadow;
|
||||
m_shadow = sh;
|
||||
notify("shadow",oldValue,m_shadow);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
bool BaseDesignIntf::isGeometryLocked() const
|
||||
{
|
||||
return m_itemGeometryLocked;
|
||||
@ -996,7 +1013,7 @@ void BaseDesignIntf::moveUp()
|
||||
void BaseDesignIntf::sizeRight()
|
||||
{
|
||||
if ((m_possibleResizeDirectionFlags & ResizeLeft) ||
|
||||
(m_possibleResizeDirectionFlags & ResizeRight)) {
|
||||
(m_possibleResizeDirectionFlags & ResizeRight)) {
|
||||
if (page()) setWidth(width() + page()->horizontalGridStep());
|
||||
}
|
||||
}
|
||||
@ -1004,7 +1021,7 @@ void BaseDesignIntf::sizeRight()
|
||||
void BaseDesignIntf::sizeLeft()
|
||||
{
|
||||
if ((m_possibleResizeDirectionFlags & ResizeLeft) ||
|
||||
(m_possibleResizeDirectionFlags & ResizeRight)) {
|
||||
(m_possibleResizeDirectionFlags & ResizeRight)) {
|
||||
if(page()) setWidth(width() - page()->horizontalGridStep());
|
||||
}
|
||||
}
|
||||
@ -1012,7 +1029,7 @@ void BaseDesignIntf::sizeLeft()
|
||||
void BaseDesignIntf::sizeUp()
|
||||
{
|
||||
if ((m_possibleResizeDirectionFlags & ResizeTop) ||
|
||||
(m_possibleResizeDirectionFlags & ResizeBottom)) {
|
||||
(m_possibleResizeDirectionFlags & ResizeBottom)) {
|
||||
if (page()) setHeight(height() - page()->verticalGridStep());
|
||||
}
|
||||
}
|
||||
@ -1020,7 +1037,7 @@ void BaseDesignIntf::sizeUp()
|
||||
void BaseDesignIntf::sizeDown()
|
||||
{
|
||||
if ((m_possibleResizeDirectionFlags & ResizeTop) ||
|
||||
(m_possibleResizeDirectionFlags & ResizeBottom)) {
|
||||
(m_possibleResizeDirectionFlags & ResizeBottom)) {
|
||||
if (page()) setHeight(height() + page()->verticalGridStep());
|
||||
}
|
||||
}
|
||||
@ -1050,7 +1067,7 @@ Qt::PenStyle BaseDesignIntf::borderStyle() const
|
||||
void BaseDesignIntf::drawTopLine(QPainter *painter, QRectF rect) const
|
||||
{
|
||||
if(isShapeItem())
|
||||
return;
|
||||
return;
|
||||
painter->setPen(borderPen(TopLine));
|
||||
painter->drawLine(rect.x(), rect.y(), rect.width(), rect.y());
|
||||
}
|
||||
@ -1058,7 +1075,7 @@ void BaseDesignIntf::drawTopLine(QPainter *painter, QRectF rect) const
|
||||
void BaseDesignIntf::drawBootomLine(QPainter *painter, QRectF rect) const
|
||||
{
|
||||
if(isShapeItem())
|
||||
return;
|
||||
return;
|
||||
painter->setPen(borderPen(BottomLine));
|
||||
painter->drawLine(rect.x(), rect.height(), rect.width(), rect.height());
|
||||
}
|
||||
@ -1066,7 +1083,7 @@ void BaseDesignIntf::drawBootomLine(QPainter *painter, QRectF rect) const
|
||||
void BaseDesignIntf::drawRightLine(QPainter *painter, QRectF rect) const
|
||||
{
|
||||
if(isShapeItem())
|
||||
return;
|
||||
return;
|
||||
painter->setPen(borderPen(RightLine));
|
||||
|
||||
painter->drawLine(rect.width(), rect.y(), rect.width(), rect.height());
|
||||
@ -1075,7 +1092,7 @@ void BaseDesignIntf::drawRightLine(QPainter *painter, QRectF rect) const
|
||||
void BaseDesignIntf::drawLeftLine(QPainter *painter, QRectF rect) const
|
||||
{
|
||||
if(isShapeItem())
|
||||
return;
|
||||
return;
|
||||
painter->setPen(borderPen(LeftLine));
|
||||
painter->drawLine(rect.x(), rect.y(), rect.x(), rect.height());
|
||||
}
|
||||
@ -1083,7 +1100,7 @@ void BaseDesignIntf::drawLeftLine(QPainter *painter, QRectF rect) const
|
||||
void BaseDesignIntf::drawDesignModeBorder(QPainter *painter, QRectF rect) const
|
||||
{
|
||||
if(isShapeItem())
|
||||
return;
|
||||
return;
|
||||
drawTopLine(painter, rect);
|
||||
drawBootomLine(painter, rect);
|
||||
drawLeftLine(painter, rect);
|
||||
@ -1093,7 +1110,7 @@ void BaseDesignIntf::drawDesignModeBorder(QPainter *painter, QRectF rect) const
|
||||
void BaseDesignIntf::drawRenderModeBorder(QPainter *painter, QRectF rect) const
|
||||
{
|
||||
if(isShapeItem())
|
||||
return;
|
||||
return;
|
||||
if (m_borderLinesFlags & RightLine) drawRightLine(painter, rect);
|
||||
if (m_borderLinesFlags & LeftLine) drawLeftLine(painter, rect);
|
||||
if (m_borderLinesFlags & TopLine ) drawTopLine(painter, rect);
|
||||
@ -1110,6 +1127,32 @@ void BaseDesignIntf::drawBorder(QPainter *painter, QRectF rect) const
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
void BaseDesignIntf::drawShadow(QPainter *painter, QRectF rect) const
|
||||
{
|
||||
|
||||
qreal shWidth = rect.width()/100;
|
||||
QRectF rshadow(rect.topRight() + QPointF(0, shWidth),
|
||||
rect.bottomRight() + QPointF(shWidth, 0));
|
||||
QLinearGradient rgrad(rshadow.topLeft(), rshadow.topRight());
|
||||
rgrad.setColorAt(0.0, QColor(0,0,0,255));
|
||||
rgrad.setColorAt(1.0, QColor(0,0,0,0));
|
||||
painter->fillRect(rshadow, QBrush(rgrad));
|
||||
QRectF bshadow(rect.bottomLeft() + QPointF(shWidth, 0),
|
||||
rect.bottomRight() + QPointF(0, shWidth));
|
||||
QLinearGradient bgrad(bshadow.topLeft(), bshadow.bottomLeft());
|
||||
bgrad.setColorAt(0.0, QColor(0,0,0,255));
|
||||
bgrad.setColorAt(1.0, QColor(0,0,0,0));
|
||||
painter->fillRect(bshadow, QBrush(bgrad));
|
||||
QRectF cshadow(rect.bottomRight(),
|
||||
rect.bottomRight() + QPointF(shWidth, shWidth));
|
||||
QRadialGradient cgrad(cshadow.topLeft(), shWidth, cshadow.topLeft());
|
||||
cgrad.setColorAt(0.0, QColor(0,0,0,255));
|
||||
cgrad.setColorAt(1.0, QColor(0,0,0,0));
|
||||
painter->fillRect(cshadow, QBrush(cgrad));
|
||||
|
||||
|
||||
}
|
||||
|
||||
void BaseDesignIntf::setGeometry(QRectF rect)
|
||||
{
|
||||
if (m_rect == rect) return;
|
||||
@ -1270,13 +1313,13 @@ void BaseDesignIntf::drawMarker(QPainter *painter, QColor color) const
|
||||
painter->drawRect(QRectF(rect().right()-markerSize,rect().top()-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().left()-markerSize,rect().bottom()-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().left()-markerSize,
|
||||
rect().bottom()-rect().height()/2-markerSize,markerSize*2,markerSize*2));
|
||||
rect().bottom()-rect().height()/2-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().right()-markerSize,
|
||||
rect().bottom()-rect().height()/2-markerSize,markerSize*2,markerSize*2));
|
||||
rect().bottom()-rect().height()/2-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().left()+rect().width()/2-markerSize,
|
||||
rect().top()-markerSize,markerSize*2,markerSize*2));
|
||||
rect().top()-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().left()+rect().width()/2-markerSize,
|
||||
rect().bottom()-markerSize,markerSize*2,markerSize*2));
|
||||
rect().bottom()-markerSize,markerSize*2,markerSize*2));
|
||||
|
||||
pen.setStyle(Qt::DotLine);
|
||||
painter->setPen(pen);
|
||||
@ -1366,7 +1409,7 @@ void BaseDesignIntf::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton &&
|
||||
((itemMode()&EditMode)||(itemMode()&DesignMode))
|
||||
) {
|
||||
) {
|
||||
showEditorDialog();
|
||||
}
|
||||
QGraphicsItem::mouseDoubleClickEvent(event);
|
||||
@ -1468,14 +1511,14 @@ void BaseDesignIntf::setMarginSize(int value)
|
||||
void BaseDesignIntf::drawResizeZone(QPainter* /*painter*/)
|
||||
{
|
||||
|
||||
// if (m_resizeAreas.count() > 0) {
|
||||
// painter->save();
|
||||
// painter->setPen(QPen(Const::RESIZE_ZONE_COLOR));
|
||||
// (isSelected()) ? painter->setOpacity(Const::SELECTED_RESIZE_ZONE_OPACITY) : painter->setOpacity(Const::RESIZE_ZONE_OPACITY);
|
||||
// painter->setBrush(QBrush(Qt::green, Qt::SolidPattern));
|
||||
// foreach(QRectF * resizeArea, m_resizeAreas) painter->drawRect(*resizeArea);
|
||||
// painter->restore();
|
||||
// }
|
||||
// if (m_resizeAreas.count() > 0) {
|
||||
// painter->save();
|
||||
// painter->setPen(QPen(Const::RESIZE_ZONE_COLOR));
|
||||
// (isSelected()) ? painter->setOpacity(Const::SELECTED_RESIZE_ZONE_OPACITY) : painter->setOpacity(Const::RESIZE_ZONE_OPACITY);
|
||||
// painter->setBrush(QBrush(Qt::green, Qt::SolidPattern));
|
||||
// foreach(QRectF * resizeArea, m_resizeAreas) painter->drawRect(*resizeArea);
|
||||
// painter->restore();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -1706,7 +1749,7 @@ void BaseDesignIntf::notify(const QString &propertyName, const QVariant& oldValu
|
||||
void BaseDesignIntf::notify(const QVector<QString>& propertyNames)
|
||||
{
|
||||
if (!isLoading())
|
||||
emit propertyesChanged(propertyNames);
|
||||
emit propertyesChanged(propertyNames);
|
||||
}
|
||||
|
||||
|
||||
@ -1752,11 +1795,11 @@ void Marker::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*)
|
||||
painter->drawRect(QRectF(rect().right()-markerSize,rect().top()-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().left()-markerSize,rect().bottom()-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().left()-markerSize,
|
||||
rect().bottom()-rect().height()/2-markerSize,markerSize*2,markerSize*2));
|
||||
rect().bottom()-rect().height()/2-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().right()-markerSize,
|
||||
rect().bottom()-rect().height()/2-markerSize,markerSize*2,markerSize*2));
|
||||
rect().bottom()-rect().height()/2-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().left()+rect().width()/2-markerSize,
|
||||
rect().top()-markerSize,markerSize*2,markerSize*2));
|
||||
rect().top()-markerSize,markerSize*2,markerSize*2));
|
||||
painter->drawRect(QRectF(rect().left()+rect().width()/2-markerSize,
|
||||
rect().bottom()-markerSize,markerSize*2,markerSize*2));
|
||||
}
|
||||
|
@ -92,6 +92,7 @@ class BaseDesignIntf :
|
||||
Q_PROPERTY(QString parentName READ parentReportItemName WRITE setParentReportItem DESIGNABLE false)
|
||||
Q_PROPERTY(int borderLineSize READ borderLineSize WRITE setBorderLineSize)
|
||||
Q_PROPERTY(bool isVisible READ isVisible WRITE setItemVisible DESIGNABLE false)
|
||||
Q_PROPERTY(bool shadow READ hasShadow WRITE setShadow)
|
||||
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
|
||||
Q_PROPERTY(bool geometryLocked READ isGeometryLocked WRITE setGeometryLocked)
|
||||
Q_PROPERTY(Qt::PenStyle borderStyle READ borderStyle WRITE setBorderStyle)
|
||||
@ -335,7 +336,8 @@ public:
|
||||
bool isChangingPos() const;
|
||||
void setIsChangingPos(bool isChangingPos);
|
||||
bool isShapeItem() const;
|
||||
|
||||
bool hasShadow();
|
||||
void setShadow(bool sh);
|
||||
Q_INVOKABLE QString setItemWidth(qreal width);
|
||||
Q_INVOKABLE QString setItemHeight(qreal height);
|
||||
Q_INVOKABLE qreal getItemWidth();
|
||||
@ -384,6 +386,7 @@ protected:
|
||||
|
||||
|
||||
void drawBorder(QPainter* painter, QRectF rect) const;
|
||||
void drawShadow(QPainter* painter, QRectF rect) const;
|
||||
void drawDesignModeBorder(QPainter* painter, QRectF rect) const;
|
||||
void drawRenderModeBorder(QPainter *painter, QRectF rect) const;
|
||||
void drawResizeZone(QPainter*);
|
||||
@ -443,6 +446,7 @@ private:
|
||||
bool m_fixedPos;
|
||||
int m_borderLineSize;
|
||||
|
||||
|
||||
QRectF m_rect;
|
||||
mutable QRectF m_boundingRect;
|
||||
|
||||
@ -487,6 +491,7 @@ private:
|
||||
bool m_itemGeometryLocked;
|
||||
bool m_isChangingPos;
|
||||
bool m_isMoveable;
|
||||
bool m_shadow;
|
||||
|
||||
signals:
|
||||
void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
|
||||
|
@ -98,6 +98,26 @@ void PageItemDesignIntf::paint(QPainter *ppainter, const QStyleOptionGraphicsIte
|
||||
paintGrid(ppainter, rect);
|
||||
ppainter->setPen(gridColor());
|
||||
ppainter->drawRect(boundingRect());
|
||||
//Draw shadow
|
||||
qreal shWidth = boundingRect().width()/100;
|
||||
QRectF rshadow(boundingRect().topRight() + QPointF(0, shWidth),
|
||||
boundingRect().bottomRight() + QPointF(shWidth, 0));
|
||||
QLinearGradient rgrad(rshadow.topLeft(), rshadow.topRight());
|
||||
rgrad.setColorAt(0.0, QColor(0,0,0,255));
|
||||
rgrad.setColorAt(1.0, QColor(0,0,0,0));
|
||||
ppainter->fillRect(rshadow, QBrush(rgrad));
|
||||
QRectF bshadow(boundingRect().bottomLeft() + QPointF(shWidth, 0),
|
||||
boundingRect().bottomRight() + QPointF(0, shWidth));
|
||||
QLinearGradient bgrad(bshadow.topLeft(), bshadow.bottomLeft());
|
||||
bgrad.setColorAt(0.0, QColor(0,0,0,255));
|
||||
bgrad.setColorAt(1.0, QColor(0,0,0,0));
|
||||
ppainter->fillRect(bshadow, QBrush(bgrad));
|
||||
QRectF cshadow(boundingRect().bottomRight(),
|
||||
boundingRect().bottomRight() + QPointF(shWidth, shWidth));
|
||||
QRadialGradient cgrad(cshadow.topLeft(), shWidth, cshadow.topLeft());
|
||||
cgrad.setColorAt(0.0, QColor(0,0,0,255));
|
||||
cgrad.setColorAt(1.0, QColor(0,0,0,0));
|
||||
ppainter->fillRect(cshadow, QBrush(cgrad));
|
||||
if (m_isExtendedInDesignMode){
|
||||
QPen pen;
|
||||
pen.setColor(Qt::red);
|
||||
@ -109,6 +129,7 @@ void PageItemDesignIntf::paint(QPainter *ppainter, const QStyleOptionGraphicsIte
|
||||
ppainter->restore();
|
||||
}
|
||||
|
||||
|
||||
if (itemMode() & PreviewMode) {
|
||||
ppainter->save();
|
||||
ppainter->fillRect(rect(), Qt::white);
|
||||
@ -123,6 +144,9 @@ void PageItemDesignIntf::paint(QPainter *ppainter, const QStyleOptionGraphicsIte
|
||||
ppainter->restore();
|
||||
BaseDesignIntf::paint(ppainter,option,widget);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
BaseDesignIntf *PageItemDesignIntf::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
|
||||
|
@ -554,53 +554,53 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>LimeReport::BaseDesignIntf</name>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1385"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1813"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1428"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1856"/>
|
||||
<source>Lock item geometry</source>
|
||||
<translation>Verrouiller la géométrie d'un élément</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1391"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1434"/>
|
||||
<source>Copy</source>
|
||||
<translation>Copier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1393"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1436"/>
|
||||
<source>Cut</source>
|
||||
<translation>Couper</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1395"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1438"/>
|
||||
<source>Paste</source>
|
||||
<translation>Coller</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1405"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1448"/>
|
||||
<source>Bring to top</source>
|
||||
<translation>Placer au premier-plan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1406"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1449"/>
|
||||
<source>Send to back</source>
|
||||
<translation>Placer en arrière-plan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1409"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1452"/>
|
||||
<source>Create Horizontal Layout</source>
|
||||
<translation>Créer une disposition horizontale</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1413"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1456"/>
|
||||
<source>Create Vertical Layout</source>
|
||||
<translation>Créer une disposition verticale</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1416"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1459"/>
|
||||
<source>No borders</source>
|
||||
<translation>Aucune bordure</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1417"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1460"/>
|
||||
<source>All borders</source>
|
||||
<translation>Toutes les bordures</translation>
|
||||
</message>
|
||||
@ -1697,37 +1697,37 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>LimeReport::PageItemDesignIntf</name>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="750"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="774"/>
|
||||
<source>Paste</source>
|
||||
<translation>Coller</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="756"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="784"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="780"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="808"/>
|
||||
<source>Page is TOC</source>
|
||||
<translation>Table de contenus</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="760"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="787"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="784"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="811"/>
|
||||
<source>Reset page number</source>
|
||||
<translation>Réinitialiser le numéro de page</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="764"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="790"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="788"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="814"/>
|
||||
<source>Full page</source>
|
||||
<translation>Page entière</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="768"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="793"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="792"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="817"/>
|
||||
<source>Set page size to printer</source>
|
||||
<translation>Adapterr la taille de la page à l'imprimante</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="772"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="797"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="796"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="821"/>
|
||||
<source>Mix with prior page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1745,7 +1745,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>%1 nom de fichier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpreviewreportwidget.cpp" line="289"/>
|
||||
<location filename="../limereport/lrpreviewreportwidget.cpp" line="290"/>
|
||||
<source>Report file name</source>
|
||||
<translation>Nom du fichier du rapport</translation>
|
||||
</message>
|
||||
|
@ -566,53 +566,53 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>LimeReport::BaseDesignIntf</name>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1385"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1813"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1428"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1856"/>
|
||||
<source>Lock item geometry</source>
|
||||
<translation>Zablokuj geometrię pozycji</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1391"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1434"/>
|
||||
<source>Copy</source>
|
||||
<translation>Kopiuj</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1393"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1436"/>
|
||||
<source>Cut</source>
|
||||
<translation>Wytnij</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1395"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1438"/>
|
||||
<source>Paste</source>
|
||||
<translation>Wklej</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1405"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1448"/>
|
||||
<source>Bring to top</source>
|
||||
<translation>Przenieś na górę</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1406"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1449"/>
|
||||
<source>Send to back</source>
|
||||
<translation>Przenieś na dół</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1409"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1452"/>
|
||||
<source>Create Horizontal Layout</source>
|
||||
<translation>Utwórz układ poziomy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1413"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1456"/>
|
||||
<source>Create Vertical Layout</source>
|
||||
<translation>Utwórz układ pionowy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1416"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1459"/>
|
||||
<source>No borders</source>
|
||||
<translation>Bez obramowania</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1417"/>
|
||||
<location filename="../limereport/lrbasedesignintf.cpp" line="1460"/>
|
||||
<source>All borders</source>
|
||||
<translation>Pełne obramowanie</translation>
|
||||
</message>
|
||||
@ -1709,37 +1709,37 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>LimeReport::PageItemDesignIntf</name>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="750"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="774"/>
|
||||
<source>Paste</source>
|
||||
<translation>Wklej</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="756"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="784"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="780"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="808"/>
|
||||
<source>Page is TOC</source>
|
||||
<translation>Strona to spis treści</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="760"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="787"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="784"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="811"/>
|
||||
<source>Reset page number</source>
|
||||
<translation>Zresetuj numer strony</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="764"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="790"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="788"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="814"/>
|
||||
<source>Full page</source>
|
||||
<translation>Cała strona</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="768"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="793"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="792"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="817"/>
|
||||
<source>Set page size to printer</source>
|
||||
<translation>Ustaw rozmiar strony na drukarkę</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="772"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="797"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="796"/>
|
||||
<location filename="../limereport/lrpageitemdesignintf.cpp" line="821"/>
|
||||
<source>Mix with prior page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1757,7 +1757,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>%1 nazwa pliku</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../limereport/lrpreviewreportwidget.cpp" line="289"/>
|
||||
<location filename="../limereport/lrpreviewreportwidget.cpp" line="290"/>
|
||||
<source>Report file name</source>
|
||||
<translation>Nazwa pliku raportu</translation>
|
||||
</message>
|
||||
|
Loading…
Reference in New Issue
Block a user