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:
xavier
2012-07-15 13:01:04 +00:00
parent 61ec5986a8
commit b20e982cf9
3 changed files with 17 additions and 2 deletions

View File

@@ -66,6 +66,20 @@ bool QETTabWidget::isMovable() const {
#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 {
return(tab_bar_);
}