Files
qt-creator/src/libs/utils/debuggerlanguagechooser.cpp
Lasse Holmstedt 8c39471081 Debugger languages are now runconfiguration dependent
There's a UI in qml/customexec/cmake/qmake run configs for choosing the
debugger languages (C++ and QML). The default for all except .qmlproject
is only C++, so default debugging behavior is the same. However, if the
user wants to do simultaneous debugging with two languages, or only
debug QML, they can select the languages from Run Settings and it will
be remembered.

Reviewed-by: hunger
2010-09-01 11:35:36 +02:00

50 lines
1.3 KiB
C++

#include "debuggerlanguagechooser.h"
#include <QHBoxLayout>
#include <QCheckBox>
namespace Utils {
DebuggerLanguageChooser::DebuggerLanguageChooser(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
setLayout(layout);
m_useCppDebugger = new QCheckBox(tr("C++"), this);
m_useQmlDebugger = new QCheckBox(tr("QML"), this);
layout->setMargin(0);
layout->addWidget(m_useCppDebugger);
layout->addWidget(m_useQmlDebugger);
connect(m_useCppDebugger, SIGNAL(toggled(bool)),
this, SLOT(useCppDebuggerToggled(bool)));
connect(m_useQmlDebugger, SIGNAL(toggled(bool)),
this, SLOT(useQmlDebuggerToggled(bool)));
}
void DebuggerLanguageChooser::setCppChecked(bool value)
{
m_useCppDebugger->setChecked(value);
}
void DebuggerLanguageChooser::setQmlChecked(bool value)
{
m_useQmlDebugger->setChecked(value);
}
void DebuggerLanguageChooser::useCppDebuggerToggled(bool toggled)
{
emit cppLanguageToggled(toggled);
if (!toggled && !m_useQmlDebugger->isChecked())
m_useQmlDebugger->setChecked(true);
}
void DebuggerLanguageChooser::useQmlDebuggerToggled(bool toggled)
{
emit qmlLanguageToggled(toggled);
if (!toggled && !m_useCppDebugger->isChecked())
m_useCppDebugger->setChecked(true);
}
} // namespace Utils