mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
TerminalStripBridge color can be edited.
This commit is contained in:
@@ -23,6 +23,30 @@ TerminalStripBridge::TerminalStripBridge(TerminalStrip *parent_strip) :
|
||||
m_strip(parent_strip)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief TerminalStripBridge::sharedRef
|
||||
* @return a QSharedPointer of this
|
||||
*/
|
||||
QSharedPointer<TerminalStripBridge> TerminalStripBridge::sharedRef()
|
||||
{
|
||||
QSharedPointer<TerminalStripBridge> this_shared(this->weakRef());
|
||||
if (this_shared.isNull())
|
||||
{
|
||||
this_shared = QSharedPointer<TerminalStripBridge>(this);
|
||||
m_this_weak = this_shared.toWeakRef();
|
||||
}
|
||||
|
||||
return this_shared;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalStripBridge::weakRef
|
||||
* @return a QWeakPointer of this, weak pointer can be null
|
||||
*/
|
||||
QWeakPointer<TerminalStripBridge> TerminalStripBridge::weakRef() {
|
||||
return m_this_weak;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalStripBridge::color
|
||||
* @return The color of this bridge
|
||||
@@ -31,6 +55,13 @@ QColor TerminalStripBridge::color() const {
|
||||
return m_color;
|
||||
}
|
||||
|
||||
void TerminalStripBridge::setColor(const QColor &color) {
|
||||
m_color = color;
|
||||
if (m_strip) {
|
||||
m_strip->bridgeColorChanged(sharedRef());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalStripBridge::realTerminals
|
||||
* @return the real terminals who are bridged by this bridge
|
||||
|
||||
Reference in New Issue
Block a user