Merge remote-tracking branch 'origin/4.8'

Conflicts:
	tests/unit/unittest/unittest.pro

Change-Id: I4f0ab05f96ee60900a3a35fad4c7331238367593
This commit is contained in:
Eike Ziller
2018-11-09 13:30:40 +01:00
153 changed files with 3881 additions and 2057 deletions

View File

@@ -221,13 +221,11 @@ ThreadsHandler::ThreadsHandler(DebuggerEngine *engine)
tr("Address"), tr("Function"), tr("File"), tr("Line"), tr("State"),
tr("Name"), tr("Target ID"), tr("Details"), tr("Core"),
});
}
m_comboBox = new QComboBox;
m_comboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
m_comboBox->setModel(this);
connect(m_comboBox, QOverload<int>::of(&QComboBox::activated), this, [this](int row) {
setData(index(row, 0), {}, BaseTreeView::ItemActivatedRole);
});
ThreadsHandler::~ThreadsHandler()
{
delete m_comboBox;
}
QVariant ThreadsHandler::data(const QModelIndex &index, int role) const
@@ -249,7 +247,7 @@ bool ThreadsHandler::setData(const QModelIndex &idx, const QVariant &data, int r
const Thread thread = itemForIndexAtLevel<1>(idx);
if (thread != m_currentThread) {
m_currentThread = thread;
m_comboBox->setCurrentIndex(idx.row());
threadSwitcher()->setCurrentIndex(idx.row());
m_engine->selectThread(thread);
}
return true;
@@ -364,6 +362,19 @@ void ThreadsHandler::notifyStopped(const QString &id)
thread->notifyStopped();
}
QPointer<QComboBox> ThreadsHandler::threadSwitcher()
{
if (!m_comboBox) {
m_comboBox = new QComboBox;
m_comboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
m_comboBox->setModel(this);
connect(m_comboBox, QOverload<int>::of(&QComboBox::activated), this, [this](int row) {
setData(index(row, 0), {}, BaseTreeView::ItemActivatedRole);
});
}
return m_comboBox;
}
void ThreadsHandler::setThreads(const GdbMi &data)
{
rootItem()->removeChildren();