summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Fischer <[email protected]>2014-11-24 01:40:15 +0100
committerAndi Fischer <[email protected]>2014-11-24 01:40:15 +0100
commitd121d8c6d32182529d65136ad86ea6b18ad276ef (patch)
tree12d342b5082f7cf31adb34e295f9f2cda220553f
parent53a2deb3b0d6fd18d699d9935ca7bb72b6a1f33e (diff)
Fix for diagram tabs moving and context popup menu.
-rw-r--r--umbrello/uml.cpp23
-rw-r--r--umbrello/uml.h2
-rw-r--r--umbrello/umldoc.cpp2
3 files changed, 19 insertions, 8 deletions
diff --git a/umbrello/uml.cpp b/umbrello/uml.cpp
index 2d686ae..b2af9ea 100644
--- a/umbrello/uml.cpp
+++ b/umbrello/uml.cpp
@@ -802,7 +802,7 @@ void UMLApp::initView()
connect(m_tabWidget, SIGNAL(currentChanged(int)), SLOT(slotTabChanged(int)));
m_tabWidget->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(m_tabWidget, SIGNAL(customContextMenuRequested(QPoint)), m_doc, SLOT(slotDiagramPopupMenu(QWidget*,QPoint))); //FIXME KF5
+ connect(m_tabWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotDiagramPopupMenu(QPoint)));
m_tabWidget->setCornerWidget(m_newSessionButton, Qt::TopLeftCorner);
m_newSessionButton->installEventFilter(this);
@@ -3017,6 +3017,19 @@ QString UMLApp::imageMimeType() const
}
/**
+ * Called when right clicking on tab widget.
+ * @param point the point where the right mouse button was clicked
+ */
+void UMLApp::slotDiagramPopupMenu(const QPoint& point)
+{
+ QTabBar* tabBar = m_tabWidget->tabBar();
+ int index = tabBar->tabAt(point);
+ UMLView* view = (UMLView*)m_tabWidget->widget(index);
+ QPoint globalPoint = m_tabWidget->mapToGlobal(point);
+ m_doc->slotDiagramPopupMenu(view, globalPoint);
+}
+
+/**
* Called when the tab has changed.
* @param index the index of the changed tab widget
*/
@@ -3114,9 +3127,7 @@ void UMLApp::slotMoveTabLeft()
else {
to = m_tabWidget->count() - 1;
}
-#if 0 //FIXME KF5
- m_tabWidget->moveTab(from, to);
-#endif
+ m_tabWidget->tabBar()->moveTab(from, to);
}
/**
@@ -3134,9 +3145,7 @@ void UMLApp::slotMoveTabRight()
else {
to = 0;
}
-#if 0 //FIXME KF5
- m_tabWidget->moveTab(from, to);
-#endif
+ m_tabWidget->tabBar()->moveTab(from, to);
}
/**
diff --git a/umbrello/uml.h b/umbrello/uml.h
index 9813593..0004e5a 100644
--- a/umbrello/uml.h
+++ b/umbrello/uml.h
@@ -307,6 +307,8 @@ private slots:
void setLang_vala();
void setLang_xmlschema();
+ void slotDiagramPopupMenu(const QPoint& point);
+
private:
static UMLApp* s_instance; ///< The last created instance of this class.
UMLAppPrivate *m_d;
diff --git a/umbrello/umldoc.cpp b/umbrello/umldoc.cpp
index 0f015f1..b7005cc 100644
--- a/umbrello/umldoc.cpp
+++ b/umbrello/umldoc.cpp
@@ -3024,7 +3024,7 @@ void UMLDoc::createDatatype(const QString &name)
*/
void UMLDoc::slotDiagramPopupMenu(QWidget* umlview, const QPoint& point)
{
-//FIXME KF5
+//FIXME KF5 move to uml.cpp::slotDiagramPopupMenu ?!
UMLView* view = (UMLView*) umlview;
UMLListViewItem::ListViewType type = UMLListViewItem::lvt_Unknown;