0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-23 16:22:58 +03:00

border width precision has been improved

This commit is contained in:
yanis60 2022-05-07 19:07:43 +01:00
parent db57157690
commit f0da654e7f
6 changed files with 36 additions and 33 deletions

View File

@ -7,6 +7,7 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
DesignerSettingManager manager;
QTranslator limeReportTranslator;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -554,53 +554,53 @@ p, li { white-space: pre-wrap; }
<context>
<name>LimeReport::BaseDesignIntf</name>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1428"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1856"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1430"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1858"/>
<source>Lock item geometry</source>
<translation>Verrouiller la géométrie d&apos;un élément</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1434"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1436"/>
<source>Copy</source>
<translation>Copier</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1436"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1438"/>
<source>Cut</source>
<translation>Couper</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1438"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1440"/>
<source>Paste</source>
<translation>Coller</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1448"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1450"/>
<source>Bring to top</source>
<translation>Placer au premier-plan</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1449"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1451"/>
<source>Send to back</source>
<translation>Placer en arrière-plan</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1452"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1454"/>
<source>Create Horizontal Layout</source>
<translation>Créer une disposition horizontale</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1456"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1458"/>
<source>Create Vertical Layout</source>
<translation>Créer une disposition verticale</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1459"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1461"/>
<source>No borders</source>
<translation>Aucune bordure</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1460"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1462"/>
<source>All borders</source>
<translation>Toutes les bordures</translation>
</message>

View File

@ -566,53 +566,53 @@ p, li { white-space: pre-wrap; }
<context>
<name>LimeReport::BaseDesignIntf</name>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1428"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1856"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1430"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1858"/>
<source>Lock item geometry</source>
<translation>Zablokuj geometrię pozycji</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1434"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1436"/>
<source>Copy</source>
<translation>Kopiuj</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1436"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1438"/>
<source>Cut</source>
<translation>Wytnij</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1438"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1440"/>
<source>Paste</source>
<translation>Wklej</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1448"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1450"/>
<source>Bring to top</source>
<translation>Przenieś na górę</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1449"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1451"/>
<source>Send to back</source>
<translation>Przenieś na dół</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1452"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1454"/>
<source>Create Horizontal Layout</source>
<translation>Utwórz układ poziomy</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1456"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1458"/>
<source>Create Vertical Layout</source>
<translation>Utwórz układ pionowy</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1459"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1461"/>
<source>No borders</source>
<translation>Bez obramowania</translation>
</message>
<message>
<location filename="../limereport/lrbasedesignintf.cpp" line="1460"/>
<location filename="../limereport/lrbasedesignintf.cpp" line="1462"/>
<source>All borders</source>
<translation>Pełne obramowanie</translation>
</message>