109,7 → 109,7 |
(*it)->setSelected(false); |
} |
m_SelList = other.m_SelList; |
if (m_isGUISelection) |
if (m_isGUISelection && !m_SelList.isEmpty()) |
m_sigSelectionChanged = true; |
if (emptyOther) |
other.clear(); |
145,26 → 145,28 |
|
bool Selection::connectItemToGUI() |
{ |
bool ret = false; |
if (!m_isGUISelection || m_SelList.isEmpty()) |
return false; |
|
return ret; |
if (m_SelList.count() == 1) |
{ |
QPointer<PageItem> pi = m_SelList.first(); |
//Quick check to see if the pointer is nullptr, if its nullptr, we should remove it from the list now |
while (pi.isNull()) |
if (pi.isNull()) |
{ |
m_SelList.removeAll(pi); |
if (m_SelList.isEmpty()) |
break; |
pi = m_SelList.first(); |
return ret; |
} |
|
if (pi.isNull()) |
return false; |
|
bool ret = pi->connectToGUI(); |
ret = pi->connectToGUI(); |
pi->emitAllToGUI(); |
m_sigSelectionChanged = true; |
|
} |
else |
{ |
ret = m_SelList.first()->connectToGUI(); |
m_SelList.first()->emitAllToGUI(); |
m_sigSelectionChanged = true; |
} |
sendSignals(false); |
return ret; |
} |
228,17 → 230,16 |
return true; |
} |
|
bool Selection::prependItem(PageItem *item) |
bool Selection::prependItem(PageItem *item, bool /*doEmit*/) |
{ |
if (item == nullptr) |
return false; |
if (m_SelList.contains(item)) |
return false; |
|
if (!m_SelList.contains(item)) |
{ |
if (m_isGUISelection && !m_SelList.isEmpty()) |
m_SelList[0]->disconnectFromGUI(); |
m_SelList.prepend(item); |
if (m_isGUISelection) |
if (m_isGUISelection /*&& doEmit*/) |
{ |
item->setSelected(true); |
m_sigSelectionChanged = true; |
246,6 → 247,8 |
sendSignals(); |
return true; |
} |
return false; |
} |
|
PageItem *Selection::itemAt_(int index) |
{ |