mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-10-01 03:39:48 +03:00
border width precision has been improved
This commit is contained in:
@@ -426,6 +426,7 @@ void BaseDesignIntf::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *o
|
||||
{
|
||||
Q_UNUSED(option);
|
||||
Q_UNUSED(widget);
|
||||
|
||||
ppainter->save();
|
||||
setupPainter(ppainter);
|
||||
drawBorder(ppainter, rect());
|
||||
@@ -968,7 +969,7 @@ void BaseDesignIntf::emitObjectNamePropertyChanged(const QString &oldName, const
|
||||
emit propertyObjectNameChanged(oldName,newName);
|
||||
}
|
||||
|
||||
int BaseDesignIntf::borderLineSize() const
|
||||
qreal BaseDesignIntf::borderLineSize() const
|
||||
{
|
||||
return m_borderLineSize;
|
||||
}
|
||||
@@ -981,9 +982,9 @@ void BaseDesignIntf::setBorderStyle(Qt::PenStyle b)
|
||||
notify("borderStyle",(BorderStyle)oldValue,(BorderStyle)b);
|
||||
}
|
||||
|
||||
void BaseDesignIntf::setBorderLineSize(int value)
|
||||
void BaseDesignIntf::setBorderLineSize(qreal value)
|
||||
{
|
||||
int oldValue = m_borderLineSize;
|
||||
qreal oldValue = m_borderLineSize;
|
||||
m_borderLineSize = value;
|
||||
update();
|
||||
notify("borderLineSize",oldValue,value);
|
||||
@@ -1076,6 +1077,7 @@ void BaseDesignIntf::drawBootomLine(QPainter *painter, QRectF rect) const
|
||||
{
|
||||
if(isShapeItem())
|
||||
return;
|
||||
|
||||
painter->setPen(borderPen(BottomLine));
|
||||
painter->drawLine(rect.x(), rect.height(), rect.width(), rect.height());
|
||||
}
|
||||
@@ -1215,8 +1217,8 @@ QPen BaseDesignIntf::borderPen(BorderSide side/*, bool selected*/) const
|
||||
if (m_borderLinesFlags & side) {
|
||||
pen.setColor(m_borderColor);
|
||||
pen.setStyle(m_borderStyle);
|
||||
pen.setCosmetic(true);
|
||||
pen.setWidthF(m_borderLineSize);
|
||||
//pen.setCosmetic(true);
|
||||
pen.setWidthF(m_borderLineSize+1);
|
||||
|
||||
} else {
|
||||
pen.setColor(Qt::darkGray);
|
||||
|
@@ -90,7 +90,7 @@ class BaseDesignIntf :
|
||||
Q_PROPERTY(qreal zOrder READ zValue WRITE setZValueProperty DESIGNABLE false)
|
||||
Q_PROPERTY(BorderLines borders READ borderLines WRITE setBorderLinesFlags)
|
||||
Q_PROPERTY(QString parentName READ parentReportItemName WRITE setParentReportItem DESIGNABLE false)
|
||||
Q_PROPERTY(int borderLineSize READ borderLineSize WRITE setBorderLineSize)
|
||||
Q_PROPERTY(qreal 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)
|
||||
@@ -298,9 +298,9 @@ public:
|
||||
QString itemTypeName() const;
|
||||
void setItemTypeName(const QString &itemTypeName);
|
||||
|
||||
int borderLineSize() const;
|
||||
qreal borderLineSize() const;
|
||||
void setBorderStyle(Qt::PenStyle b);
|
||||
void setBorderLineSize(int value);
|
||||
void setBorderLineSize(qreal value);
|
||||
void showEditorDialog();
|
||||
ItemAlign itemAlign() const;
|
||||
virtual void setItemAlign(const ItemAlign &itemAlign);
|
||||
@@ -444,7 +444,7 @@ private:
|
||||
QFont m_font;
|
||||
QColor m_fontColor;
|
||||
bool m_fixedPos;
|
||||
int m_borderLineSize;
|
||||
qreal m_borderLineSize;
|
||||
|
||||
|
||||
QRectF m_rect;
|
||||
|
@@ -152,7 +152,7 @@ void PreviewReportWidget::initPreview()
|
||||
ui->graphicsView->centerOn(0, 0);
|
||||
ui->graphicsView->scene()->setBackgroundBrush(QColor(m_previewPageBackgroundColor));
|
||||
setScalePercent(d_ptr->m_scalePercent);
|
||||
|
||||
qDebug()<<d_ptr->m_scalePercent;
|
||||
PageDesignIntf* page = dynamic_cast<PageDesignIntf*>(ui->graphicsView->scene());
|
||||
if (page)
|
||||
connect(page, SIGNAL(itemInserted(LimeReport::PageDesignIntf*, QPointF, QString)),
|
||||
@@ -484,7 +484,7 @@ void PreviewReportWidget::reportEngineDestroyed(QObject *object)
|
||||
|
||||
void PreviewReportWidget::slotZoomed(double )
|
||||
{
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 1))
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
|
||||
d_ptr->m_scalePercent = ui->graphicsView->matrix().m11()*100;
|
||||
#else
|
||||
d_ptr->m_scalePercent = ui->graphicsView->transform().m11()*100;
|
||||
|
Reference in New Issue
Block a user