summaryrefslogtreecommitdiffstats
path: root/src/Authoring
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2018-05-22 09:46:33 +0300
committerTomi Korpipää <tomi.korpipaa@qt.io>2018-05-22 06:55:12 +0000
commit80fd9766deb5f00ed9a3cb3ddd3bc39e4180dcea (patch)
tree74a376c9f6515b97ff817545f8252fd5ec3877ab /src/Authoring
parent58b7f3f8d569cb803fb9222dfe97e1de71909a7b (diff)
Remove obsolete WidgetControlControlListener
Task-number: QT3DS-361 Change-Id: Ia07296afbda8ea8c70ff6019b0da6dac1234edd7 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Diffstat (limited to 'src/Authoring')
-rw-r--r--src/Authoring/Studio/Controls/BreadCrumbControl.cpp1
-rw-r--r--src/Authoring/Studio/Controls/Control.cpp59
-rw-r--r--src/Authoring/Studio/Controls/Control.h6
-rw-r--r--src/Authoring/Studio/Controls/ControlData.cpp20
-rw-r--r--src/Authoring/Studio/Controls/ControlData.h6
-rw-r--r--src/Authoring/Studio/Controls/WidgetControl.cpp153
-rw-r--r--src/Authoring/Studio/Controls/WidgetControl.h25
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/AbstractTimelineRowUI.h2
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/Bindings/ITimelineItemBinding.h1
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp5
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.h1
11 files changed, 0 insertions, 279 deletions
diff --git a/src/Authoring/Studio/Controls/BreadCrumbControl.cpp b/src/Authoring/Studio/Controls/BreadCrumbControl.cpp
index 3f55a05b..5a873fd6 100644
--- a/src/Authoring/Studio/Controls/BreadCrumbControl.cpp
+++ b/src/Authoring/Studio/Controls/BreadCrumbControl.cpp
@@ -138,7 +138,6 @@ void CBreadCrumbControl::GenerateButtonText(const SBreadCrumb &inBreadCrumb, TBu
inButton->SetTextColorUp(CStudioPreferences::GetNormalColor());
inButton->SetTextColorDown(CStudioPreferences::GetNormalColor());
inButton->SetText(theDisplayName);
- inButton->SetTooltipText(theDisplayName);
inButton->SetName(theDisplayName);
}
diff --git a/src/Authoring/Studio/Controls/Control.cpp b/src/Authoring/Studio/Controls/Control.cpp
index 31ad60ec..171c9b3b 100644
--- a/src/Authoring/Studio/Controls/Control.cpp
+++ b/src/Authoring/Studio/Controls/Control.cpp
@@ -418,7 +418,6 @@ void CControl::OnMouseOut(CPt inPoint, Qt::KeyboardModifiers inFlags)
{
m_ControlData->m_IsMouseOver = false;
- GetWindowListener()->HideTooltips();
// Go through all the children looking for ones that think the mouse is over.
// If it is then notify it of a mouse out.
ControlGraph::SReverseIterator thePos = ControlGraph::GetRChildren(*this);
@@ -631,20 +630,6 @@ bool CControl::OnMouseHover(CPt inPoint, Qt::KeyboardModifiers inFlags)
}
}
- // If the mouseover was not handled
- if (!theRetVal) {
- // If the tooltip text is not empty
- QString theTooltipText = GetTooltipText();
- if (!theTooltipText.isEmpty()) {
- // Show the tooltip, and return true so that parents don't cover this tooltip with their
- // own
- // Note that we are offsetting the point so that it appears below the mouse cursor
- GetWindowListener()->ShowTooltips(GetGlobalPosition(CPt(inPoint.x, inPoint.y + 32)),
- GetTooltipText());
- theRetVal = true;
- }
- }
-
return theRetVal;
}
@@ -1043,30 +1028,6 @@ bool CControl::IsChildInvalidated() const
return m_ControlData->m_IsChildInvalidated || m_ControlData->m_IsInvalidated;
}
-void CControl::SetWindowListener(CControlWindowListener *inListener)
-{
- m_ControlData->m_WindowListener = inListener;
-}
-
-//=============================================================================
-/**
- * Retrieves the topmost window of this control. The window listener is the
- * bridge between the OS and the cross-platform custom control code below.
- * This function was added specifically to support drag-and-drop by providing
- * a way of setting the drag state on the outermost window.
- * @return pointer to the control window listener or std::shared_ptr<CControlData>() if there is
- * not one
- */
-CControlWindowListener *CControl::GetWindowListener()
-{
- CControlWindowListener *theWindowListener = nullptr;
- if (GetParent() != nullptr)
- theWindowListener = GetParent()->GetWindowListener();
- else
- theWindowListener = m_ControlData->m_WindowListener;
- return theWindowListener;
-}
-
//=============================================================================
/**
* Set this control as being visible or not.
@@ -1640,26 +1601,6 @@ void CControl::OnMouseClick(CPt, Qt::KeyboardModifiers)
{
}
-//===============================================================================
-/**
- * Sets the text of the tooltip for this control. If the string is empty, no
- * tooltip will be shown.
- * @param inText text of the tooltip
- */
-void CControl::SetTooltipText(const QString &inText)
-{
- m_ControlData->SetTooltipText(inText);
-}
-
-//===============================================================================
-/**
- * @return the current tooltip text for this control
- */
-QString CControl::GetTooltipText()
-{
- return m_ControlData->GetTooltipText();
-}
-
void CControl::GrabFocus(CControl *inControl)
{
if (GetParent())
diff --git a/src/Authoring/Studio/Controls/Control.h b/src/Authoring/Studio/Controls/Control.h
index 7ad22726..97c775a4 100644
--- a/src/Authoring/Studio/Controls/Control.h
+++ b/src/Authoring/Studio/Controls/Control.h
@@ -192,9 +192,6 @@ public:
bool GetEnabledFlag();
void SetEnabledFlag(bool inIsEnabled);
- void SetWindowListener(CControlWindowListener *inListener);
- CControlWindowListener *GetWindowListener();
-
virtual void OnChildSizeChanged(CControl *inChild);
virtual void ResetMinMaxPref(){}
@@ -224,9 +221,6 @@ public:
void RemoveFocusListener(CChildFocusListener *inListener);
void FireFocusEvent(bool inStatus);
- void SetTooltipText(const QString &inText);
- QString GetTooltipText();
-
virtual void EnsureVisible(CRct inRect);
void EnsureVisible();
diff --git a/src/Authoring/Studio/Controls/ControlData.cpp b/src/Authoring/Studio/Controls/ControlData.cpp
index 81bb3a9c..edd23473 100644
--- a/src/Authoring/Studio/Controls/ControlData.cpp
+++ b/src/Authoring/Studio/Controls/ControlData.cpp
@@ -576,16 +576,6 @@ void CControlData::SetEnabledFlag(bool inIsEnabled)
m_IsEnabled = inIsEnabled;
}
-void CControlData::SetWindowListener(CControlWindowListener *inListener)
-{
- m_WindowListener = inListener;
-}
-
-CControlWindowListener *CControlData::GetWindowListener()
-{
- return m_WindowListener;
-}
-
void CControlData::OnChildSizeChanged(CControl *inChild)
{
if (m_Control)
@@ -718,16 +708,6 @@ void CControlData::FireFocusEvent(bool inStatus)
m_Control->FireFocusEvent(inStatus);
}
-void CControlData::SetTooltipText(const QString &inText)
-{
- m_TooltipText = inText;
-}
-
-QString CControlData::GetTooltipText()
-{
- return m_TooltipText;
-}
-
void CControlData::EnsureVisible(CRct inRect)
{
if (m_Control)
diff --git a/src/Authoring/Studio/Controls/ControlData.h b/src/Authoring/Studio/Controls/ControlData.h
index cb149b30..d3d2694e 100644
--- a/src/Authoring/Studio/Controls/ControlData.h
+++ b/src/Authoring/Studio/Controls/ControlData.h
@@ -220,9 +220,6 @@ public:
bool GetEnabledFlag();
void SetEnabledFlag(bool inIsEnabled);
- void SetWindowListener(CControlWindowListener *inListener);
- CControlWindowListener *GetWindowListener();
-
void OnChildSizeChanged(CControl *inChild);
void ResetMinMaxPref();
@@ -251,9 +248,6 @@ public:
void RemoveFocusListener(CChildFocusListener *inListener);
void FireFocusEvent(bool inStatus);
- void SetTooltipText(const QString &inText);
- QString GetTooltipText();
-
void EnsureVisible(CRct inRect);
void EnsureVisible();
diff --git a/src/Authoring/Studio/Controls/WidgetControl.cpp b/src/Authoring/Studio/Controls/WidgetControl.cpp
index 5ffb27fb..68de4341 100644
--- a/src/Authoring/Studio/Controls/WidgetControl.cpp
+++ b/src/Authoring/Studio/Controls/WidgetControl.cpp
@@ -44,16 +44,13 @@
WidgetControl::WidgetControl(CControl *control, QWidget *parent)
: QWidget(parent)
, m_control(control)
- , m_controlListener(this)
{
Q_ASSERT(control);
- control->SetWindowListener(&m_controlListener);
setControlSize(sizeHint());
}
WidgetControl::~WidgetControl()
{
- m_control->SetWindowListener(nullptr);
}
bool WidgetControl::event(QEvent *event)
@@ -290,153 +287,3 @@ void WidgetControl::OnReflectMouse(CPt &inPoint, Qt::KeyboardModifiers inFlags)
if (m_control->IsChildInvalidated())
repaint();
}
-
-//=============================================================================
-/**
- * Creates the pass thru class for the wnd control.
- */
-WidgetControlControlListener::WidgetControlControlListener(WidgetControl *inParent)
-{
- m_Parent = inParent;
-}
-
-WidgetControlControlListener::~WidgetControlControlListener()
-{
-}
-
-//=============================================================================
-/**
- * Notification from the control that the window was invalidated.
- */
-void WidgetControlControlListener::OnControlInvalidated()
-{
- m_Parent->update();
-}
-
-//=============================================================================
-/**
- * Notification from the control to do a popup at the specified location.
- */
-long WidgetControlControlListener::DoPopup(QMenu *inMenu, CPt inPoint)
-{
- long selectedIndex = -1;
- if (inMenu) {
- m_Parent->setContextMenuShown(true);
- auto action = inMenu->exec(m_Parent->mapToGlobal(inPoint));
- m_Parent->setContextMenuShown(false);
- if (action)
- selectedIndex = inMenu->actions().indexOf(action);
- }
-
- return selectedIndex;
-}
-
-//=============================================================================
-/**
- * Get the location of the point in Screen coordinates.
- */
-CPt WidgetControlControlListener::ClientToScreen(CPt inPoint)
-{
- return m_Parent->mapToGlobal(inPoint);
-}
-
-//=============================================================================
-/**
- * Get the location of the point into client coordinates.
- */
-CPt WidgetControlControlListener::ScreenToClient(CPt inPoint)
-{
- return m_Parent->mapFromGlobal(inPoint);
-}
-
-//=============================================================================
-/**
- * Get the platform dependent view that this is embedding.
- * Used when platform dependent controls need to be embedded into the Controls.
- */
-TPlatformView WidgetControlControlListener::GetPlatformView()
-{
-#ifdef KDAB_TEMPORARILY_REMOVED
- return m_Parent->m_hWnd;
-#else
- return nullptr;
-#endif
-}
-
-//=============================================================================
-/**
- * Pass-thru to the CWndControl's SetIsDragging function.
- * @param inIsDragging true to specify that a drag is occurring or false to cancel a drag
- */
-void WidgetControlControlListener::SetIsDragging(bool inIsDragging)
-{
-#ifdef KDAB_TEMPORARILY_REMOVED
- m_Parent->SetIsDragging(inIsDragging);
-#endif
-}
-
-//=============================================================================
-/**
- * Pass-thru to the CWndControl's ShowTooltips function.
- * @param inLocation mid-point of the tooltip in global coordinates
- * @param inText text to display as a tooltip
- */
-void WidgetControlControlListener::ShowTooltips(CPt inLocation, const QString &inText)
-{
-#ifdef KDAB_TEMPORARILY_REMOVED
- m_Parent->ShowTooltips(inLocation, inText);
-#endif
-}
-
-//=============================================================================
-/**
- * Pass-thru to the CWndControl's HideTooltips function.
- */
-void WidgetControlControlListener::HideTooltips()
-{
-#ifdef KDAB_TEMPORARILY_REMOVED
- m_Parent->HideTooltips();
-#endif
-}
-
-//=============================================================================
-/**
- * Pass-thru to the CWndControl's ShowMoveableTooltips function.
- * @param inLocation mid-point of the tooltip in global coordinates
- * @param inText text to display as a tooltip
- */
-void WidgetControlControlListener::ShowMoveableWindow(CPt inLocation, const Q3DStudio::CString &inText,
- CRct inBoundingRct)
-{
-#ifdef KDAB_TEMPORARILY_REMOVED
- m_Parent->ShowMoveableWindow(inLocation, inText, inBoundingRct);
-#endif
-}
-
-//=============================================================================
-/**
- * Pass-thru to the CWndControl's HideMoveableTooltips function.
- */
-void WidgetControlControlListener::HideMoveableWindow()
-{
-#ifdef KDAB_TEMPORARILY_REMOVED
- m_Parent->HideMoveableWindow();
-#endif
-}
-
-void WidgetControlControlListener::DoStartDrag(IDragable *inDragable)
-{
- m_Parent->DoStartDrag(inDragable);
-}
-
-//===============================================================================
-/**
-* performs a drag operation on a file
-*/
-void WidgetControlControlListener::DoStartDrag(std::vector<Q3DStudio::CString> &inDragFileNameList)
-{
- m_Parent->DoStartDrag(inDragFileNameList);
-}
-
-
-
diff --git a/src/Authoring/Studio/Controls/WidgetControl.h b/src/Authoring/Studio/Controls/WidgetControl.h
index e65dcb31..55d33596 100644
--- a/src/Authoring/Studio/Controls/WidgetControl.h
+++ b/src/Authoring/Studio/Controls/WidgetControl.h
@@ -37,33 +37,9 @@
class CRenderer;
class WidgetControl;
-class WidgetControlControlListener : public CControlWindowListener
-{
-public:
- WidgetControlControlListener(WidgetControl *inParent);
- virtual ~WidgetControlControlListener();
-
- void OnControlInvalidated() override;
- long DoPopup(QMenu *inMenu, CPt inLocation) override;
- CPt ClientToScreen(CPt inPoint) override;
- CPt ScreenToClient(CPt inPoint) override;
- TPlatformView GetPlatformView() override;
- void SetIsDragging(bool inIsDragging) override;
- void ShowTooltips(CPt inLocation, const QString &inText) override;
- void HideTooltips() override;
- void DoStartDrag(IDragable *inDragable) override;
- void DoStartDrag(std::vector<Q3DStudio::CString> &inDragFileNameList) override;
- void ShowMoveableWindow(CPt inLocation, const Q3DStudio::CString &inText,
- CRct inBoundingRct) override;
- void HideMoveableWindow() override;
-
-protected:
- WidgetControl *m_Parent;
-};
class WidgetControl : public QWidget, public CWinDropContainer
{
Q_OBJECT
- friend class ::WidgetControlControlListener;
public:
explicit WidgetControl(CControl *control, QWidget *parent = nullptr);
virtual ~WidgetControl();
@@ -106,7 +82,6 @@ private:
bool m_isLeftMouseDown = false;
bool m_isDragging = false;
bool m_isContextMenuShown = false;
- WidgetControlControlListener m_controlListener;
};
#endif // WIDGETCONTROL_H
diff --git a/src/Authoring/Studio/Palettes/Timeline/AbstractTimelineRowUI.h b/src/Authoring/Studio/Palettes/Timeline/AbstractTimelineRowUI.h
index b16107ca..a3b86013 100644
--- a/src/Authoring/Studio/Palettes/Timeline/AbstractTimelineRowUI.h
+++ b/src/Authoring/Studio/Palettes/Timeline/AbstractTimelineRowUI.h
@@ -37,7 +37,6 @@ class ITimelineControl;
class ISnappingListProvider;
class CControl;
-class CControlWindowListener;
class CDropTarget;
class CRct;
class CSnapper;
@@ -76,7 +75,6 @@ public:
bool inGlobalCommitSelectionFlag) = 0;
virtual void PopulateSnappingList(CSnapper *inSnappingList) = 0;
- virtual void DoStartDrag(CControlWindowListener *inWndListener) = 0;
virtual void AcceptDropAfter(bool inAccept) = 0;
virtual void AcceptDropBefore(bool inAccept) = 0;
virtual void SetDropTarget(CDropTarget *inDropTarget) = 0;
diff --git a/src/Authoring/Studio/Palettes/Timeline/Bindings/ITimelineItemBinding.h b/src/Authoring/Studio/Palettes/Timeline/Bindings/ITimelineItemBinding.h
index 9a5f7e3e..5f1dfe40 100644
--- a/src/Authoring/Studio/Palettes/Timeline/Bindings/ITimelineItemBinding.h
+++ b/src/Authoring/Studio/Palettes/Timeline/Bindings/ITimelineItemBinding.h
@@ -93,7 +93,6 @@ public:
virtual void OnCollapsed() = 0;
virtual void ClearKeySelection() = 0;
virtual bool OpenAssociatedEditor() = 0;
- virtual void DoStartDrag(CControlWindowListener *inWndListener) = 0;
virtual void SetDropTarget(CDropTarget *inTarget) = 0;
// Hierarchy
diff --git a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp
index 9e600ad6..7b70458f 100644
--- a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp
+++ b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp
@@ -422,11 +422,6 @@ bool Qt3DSDMTimelineItemBinding::OpenAssociatedEditor()
return false; // nothing to do by default
}
-void Qt3DSDMTimelineItemBinding::DoStartDrag(CControlWindowListener *inWndListener)
-{
- inWndListener->DoStartDrag(this);
-}
-
inline qt3dsdm::Qt3DSDMInstanceHandle Qt3DSDMTimelineItemBinding::GetInstance() const
{
return m_DataHandle;
diff --git a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.h b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.h
index 2e253fbe..7852719f 100644
--- a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.h
+++ b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.h
@@ -130,7 +130,6 @@ public:
void OnCollapsed() override;
void ClearKeySelection() override;
bool OpenAssociatedEditor() override;
- void DoStartDrag(CControlWindowListener *inWndListener) override;
void SetDropTarget(CDropTarget *inTarget) override;
// Hierarchy
long GetChildrenCount() override;