mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 06:20:53 +01:00
Circumvented a display bug occuring when moving the current diagram from the elements panel.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1912 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -476,7 +476,7 @@ void ProjectView::moveDiagramUp(DiagramView *diagram_view) {
|
|||||||
// le schema est le premier du projet
|
// le schema est le premier du projet
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tabs_ -> tabBar() -> moveTab(diagram_view_position, diagram_view_position - 1);
|
tabs_ -> moveTab(diagram_view_position, diagram_view_position - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -497,7 +497,7 @@ void ProjectView::moveDiagramDown(DiagramView *diagram_view) {
|
|||||||
// le schema est le dernier du projet
|
// le schema est le dernier du projet
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tabs_ -> tabBar() -> moveTab(diagram_view_position, diagram_view_position + 1);
|
tabs_ -> moveTab(diagram_view_position, diagram_view_position + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -66,6 +66,20 @@ bool QETTabWidget::isMovable() const {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Move the tab from index \a from to index \a to.
|
||||||
|
*/
|
||||||
|
void QETTabWidget::moveTab(int from, int to) {
|
||||||
|
tab_bar_ -> moveTab(from, to);
|
||||||
|
// workaround to a weird bug when moving the current tab
|
||||||
|
if (count() > 1) {
|
||||||
|
int current_index = tab_bar_ -> currentIndex();
|
||||||
|
// switch to any other index then back to the current one
|
||||||
|
tab_bar_ -> setCurrentIndex(current_index ? 0 : 1);
|
||||||
|
tab_bar_ -> setCurrentIndex(current_index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QETTabBar *QETTabWidget::tabBar() const {
|
QETTabBar *QETTabWidget::tabBar() const {
|
||||||
return(tab_bar_);
|
return(tab_bar_);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class QETTabWidget : public QTabWidget {
|
|||||||
public:
|
public:
|
||||||
void setMovable(bool);
|
void setMovable(bool);
|
||||||
bool isMovable() const;
|
bool isMovable() const;
|
||||||
|
void moveTab(int, int);
|
||||||
QETTabBar *tabBar() const;
|
QETTabBar *tabBar() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user