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

Merge pull request #427 from yanis60/master

added position info when dragging
This commit is contained in:
Alexander Arin 2023-02-02 11:28:26 +03:00 committed by GitHub
commit 3fbedf0860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 685 deletions

View File

@ -73,6 +73,7 @@ PageDesignIntf::PageDesignIntf(QObject *parent):
m_itemInsertRect(0),
m_itemMode(DesignMode),
m_cutterBorder(0),
m_infoPosRect(0),
m_currentCommand(-1),
m_changeSizeMode(false),
m_changePosMode(false),
@ -93,6 +94,7 @@ PageDesignIntf::PageDesignIntf(QObject *parent):
m_magneticMovement(false),
m_reportSettings(0),
m_currentPage(0)
{
m_reportEditor = dynamic_cast<ReportEnginePrivate *>(parent);
updatePageRect();
@ -314,6 +316,7 @@ void PageDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event)
void PageDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
PageItemDesignIntf* page = pageItem() ? pageItem() : getCurrentPage();
if (event->buttons() & Qt::LeftButton) {
if (!m_changePosOrSizeMode) {
@ -321,6 +324,25 @@ void PageDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
saveSelectedItemsGeometry();
m_changePosOrSizeMode = true;
}
qreal posY = div(page->mapFromScene(event->scenePos()).y(), verticalGridStep()).quot * verticalGridStep();
qreal posX = div(page->mapFromScene(event->scenePos()).x(), verticalGridStep()).quot * horizontalGridStep();
if(!m_infoPosRect)
{
m_infoPosRect = new QGraphicsTextItem();
m_infoPosRect->setDefaultTextColor(QColor(100,150,50));
QFont font("Arial");
font.setPointSize(16);
font.setBold(true);
m_infoPosRect->setFont(font);
addItem(m_infoPosRect);
}
m_infoPosRect->setPlainText("(x: "+QString::number(posX/100)+", y: "+QString::number(posY/100)+") cm");
m_infoPosRect->setPos(posX,posY+30);
}
if (event->buttons() & Qt::LeftButton && m_multiSelectStarted){
@ -340,7 +362,6 @@ void PageDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
m_selectionRect->setRect(selectionRect);
}
PageItemDesignIntf* page = pageItem() ? pageItem() : getCurrentPage();
if ((m_insertMode) && (page && page->rect().contains(page->mapFromScene(event->scenePos())))) {
if (!m_itemInsertRect->isVisible()) m_itemInsertRect->setVisible(true);
qreal posY = div(page->mapFromScene(event->scenePos()).y(), verticalGridStep()).quot * verticalGridStep();
@ -402,6 +423,11 @@ void PageDesignIntf::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
m_selectionRect = 0;
m_multiSelectStarted = false;
}
if(m_infoPosRect)
{
delete m_infoPosRect;
m_infoPosRect = 0;
}
QGraphicsScene::mouseReleaseEvent(event);
}

View File

@ -300,6 +300,7 @@ namespace LimeReport {
BaseDesignIntf::ItemMode m_itemMode;
QGraphicsRectItem* m_cutterBorder;
QGraphicsRectItem* m_pageRect;
QGraphicsTextItem* m_infoPosRect;
QVector<CommandIf::Ptr> m_commandsList;
QVector<ReportItemPos> m_positionStamp;
QVector<ReportItemSize> m_geometryStamp;

View File

@ -509,109 +509,6 @@ p, li { white-space: pre-wrap; }
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LimeReport::BorderEditor</name>
<message>
<source>Edit border</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Presets</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outline</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Border</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Style</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No style</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Solid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash dot dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>0.25</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>0.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>4</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>6</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LimeReport::BorderFrameEditor</name>
<message>

View File

@ -638,109 +638,7 @@ p, li { white-space: pre-wrap; }
</message>
</context>
<context>
<name>LimeReport::BorderEditor</name>
<message>
<source>Edit border</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Presets</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outline</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Border</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Style</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No style</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Solid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash dot dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>0.25</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>0.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>4</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>6</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LimeReport::BorderFrameEditor</name>
<message>
<source>BorderFrameEditor</source>

View File

@ -610,138 +610,6 @@ p, li { white-space: pre-wrap; }
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LimeReport::BorderEditor</name>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="14"/>
<source>Edit border</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="22"/>
<source>Presets</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="31"/>
<source>No lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="51"/>
<source>Outline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="68"/>
<source>Border</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="81"/>
<location filename="../limereport/items/lrbordereditor.ui" line="108"/>
<location filename="../limereport/items/lrbordereditor.ui" line="129"/>
<location filename="../limereport/items/lrbordereditor.ui" line="156"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="191"/>
<source>Style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="219"/>
<source>No style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="224"/>
<source>Solid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="229"/>
<source>Dash</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="234"/>
<source>Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="239"/>
<source>Dash dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="244"/>
<source>Dash dot dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="252"/>
<source>Width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="262"/>
<location filename="../limereport/items/lrbordereditor.ui" line="279"/>
<source>1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="269"/>
<source>0.25</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="274"/>
<source>0.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="284"/>
<source>1.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="289"/>
<source>2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="294"/>
<source>3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="299"/>
<source>4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="304"/>
<source>5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="309"/>
<source>6</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="317"/>
<source>Color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="345"/>
<source>Select</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LimeReport::BorderFrameEditor</name>
<message>
@ -4459,14 +4327,12 @@ Cet aperçu n&apos;est plus valide.</translation>
<translation></translation>
</message>
<message>
<location filename="../limereport/lrpagedesignintf.cpp" line="1675"/>
<location filename="../limereport/lrpagedesignintf.cpp" line="1717"/>
<source>Attention!</source>
<translation></translation>
</message>
<message>
<location filename="../limereport/lrpagedesignintf.cpp" line="1675"/>
<location filename="../limereport/lrpagedesignintf.cpp" line="1717"/>
<source>Selected elements have different parent containers</source>
<translation>Les éléments sélectionnés ont un parent différent</translation>
</message>

View File

@ -623,138 +623,7 @@ p, li { white-space: pre-wrap; }
</message>
</context>
<context>
<name>LimeReport::BorderEditor</name>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="14"/>
<source>Edit border</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="22"/>
<source>Presets</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="31"/>
<source>No lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="51"/>
<source>Outline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="68"/>
<source>Border</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="81"/>
<location filename="../limereport/items/lrbordereditor.ui" line="108"/>
<location filename="../limereport/items/lrbordereditor.ui" line="129"/>
<location filename="../limereport/items/lrbordereditor.ui" line="156"/>
<source>...</source>
<translation type="unfinished">...</translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="191"/>
<source>Style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="219"/>
<source>No style</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="224"/>
<source>Solid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="229"/>
<source>Dash</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="234"/>
<source>Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="239"/>
<source>Dash dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="244"/>
<source>Dash dot dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="252"/>
<source>Width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="262"/>
<location filename="../limereport/items/lrbordereditor.ui" line="279"/>
<source>1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="269"/>
<source>0.25</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="274"/>
<source>0.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="284"/>
<source>1.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="289"/>
<source>2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="294"/>
<source>3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="299"/>
<source>4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="304"/>
<source>5</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="309"/>
<source>6</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="317"/>
<source>Color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../limereport/items/lrbordereditor.ui" line="345"/>
<source>Select</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LimeReport::BorderFrameEditor</name>
<message>
<location filename="../limereport/items/lrborderframeeditor.ui" line="20"/>
@ -4471,14 +4340,12 @@ Ten podgląd nie jest już prawidłowy.</translation>
<translation>Ciąg znaków</translation>
</message>
<message>
<location filename="../limereport/lrpagedesignintf.cpp" line="1675"/>
<location filename="../limereport/lrpagedesignintf.cpp" line="1717"/>
<source>Attention!</source>
<translation>Uwaga!</translation>
</message>
<message>
<location filename="../limereport/lrpagedesignintf.cpp" line="1675"/>
<location filename="../limereport/lrpagedesignintf.cpp" line="1717"/>
<source>Selected elements have different parent containers</source>
<translation>Wybrane elementy mają różne pojemniki nadrzędne</translation>
</message>

View File

@ -515,109 +515,7 @@ p, li { white-space: pre-wrap; }
</message>
</context>
<context>
<name>LimeReport::BorderEditor</name>
<message>
<source>Edit border</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Presets</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outline</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Border</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>...</source>
<translation type="unfinished">...</translation>
</message>
<message>
<source>Style</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No style</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Solid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash dot dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>0.25</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>0.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>4</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>6</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LimeReport::BorderFrameEditor</name>
<message>
<source>BorderFrameEditor</source>

View File

@ -522,109 +522,7 @@ p, li { white-space: pre-wrap; }
</message>
</context>
<context>
<name>LimeReport::BorderEditor</name>
<message>
<source>Edit border</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Presets</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No lines</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outline</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Border</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>...</source>
<translation type="unfinished">...</translation>
</message>
<message>
<source>Style</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No style</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Solid</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Dash dot dot</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Width:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>0.25</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>0.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>1.5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>4</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>5</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>6</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LimeReport::BorderFrameEditor</name>
<message>
<source>BorderFrameEditor</source>