mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 08:40:53 +01:00
Fix crash: In Xref link widget, If there is an element being added (element pose mode), and this one is compatible with the type of Xref sought by the widget, then the widget show this element.
When user finish the element pose mode, the element under the cursor is deleted, but continue to be show by the widget. So, click on this element in the widget cause a crash. This case come when user add element and go to another diagram without finish the pose mode, and open Xref link widget from an element in this other diagram. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4993 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -377,8 +377,6 @@ void Diagram::keyReleaseEvent(QKeyEvent *e)
|
||||
* Diagram become the ownership of event_interface
|
||||
* If there is a previous interface, they will be delete before
|
||||
* and call init() to the new interface.
|
||||
* The derivated class of DiagramEventInterface need to emit the signal "finish" when the job is done,
|
||||
* diagram use this signal to delete the interface. If the signal isn't send, the interface will never be deleted.
|
||||
* @param event_interface
|
||||
*/
|
||||
void Diagram::setEventInterface(DiagramEventInterface *event_interface)
|
||||
@@ -391,6 +389,19 @@ void Diagram::setEventInterface(DiagramEventInterface *event_interface)
|
||||
m_event_interface = event_interface;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Diagram::clearEventInterface
|
||||
* Clear the current event interface.
|
||||
*/
|
||||
void Diagram::clearEventInterface()
|
||||
{
|
||||
if(m_event_interface)
|
||||
{
|
||||
delete m_event_interface;
|
||||
m_event_interface = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Diagram::conductorsAutonumName
|
||||
* @return the name of autonum to use.
|
||||
|
||||
Reference in New Issue
Block a user