Clean up some code

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3834 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-03-18 18:07:18 +00:00
parent e29ed4372a
commit 72c68c0d8d
10 changed files with 86 additions and 122 deletions

View File

@@ -778,7 +778,7 @@ void DiagramView::adjustSceneRect() {
QRectF elements_bounding_rect = scene -> itemsBoundingRect();
// rectangle contenant le cadre = colonnes + cartouche
QRectF border_bounding_rect = scene -> border().adjusted(-Diagram::margin, -Diagram::margin, Diagram::margin, Diagram::margin);
QRectF border_bounding_rect = scene -> border_and_titleblock.borderAndTitleBlockRect().adjusted(-Diagram::margin, -Diagram::margin, Diagram::margin, Diagram::margin);
// ajuste la sceneRect
QRectF new_scene_rect = elements_bounding_rect.united(border_bounding_rect);
@@ -1180,26 +1180,10 @@ void DiagramView::mouseDoubleClickEvent(QMouseEvent *e) {
BorderTitleBlock &bi = scene -> border_and_titleblock;
// Get the rectangle of the header column
QRectF columns_rect(
Diagram::margin,
Diagram::margin,
bi.borderWidth(),
bi.columnsHeaderHeight()
);
// Get the rectangle of the header row
QRectF rows_rect(
Diagram::margin,
Diagram::margin,
bi.rowsHeaderWidth(),
bi.diagramHeight()
);
//Get the click pos on the diagram
QPointF click_pos = viewportTransform().inverted().map(e -> pos());
if (bi.titleBlockRect().contains(click_pos) || columns_rect.contains(click_pos) || rows_rect.contains(click_pos)) {
if (bi.titleBlockRect().contains(click_pos) || bi.columnsRect().contains(click_pos) || bi.rowsRect().contains(click_pos)) {
e->accept();
editDiagramProperties();
return;