Commit 9b81dc17 authored by Eike Ziller's avatar Eike Ziller
Browse files

Merge remote-tracking branch 'origin/2.4'

parents bf3bf658 d6fcc1d6
......@@ -147,6 +147,11 @@ def lookupType(typestring):
type = gdb.lookup_type(ts)
except RuntimeError, error:
#warn("LOOKING UP '%s': %s" % (ts, error))
if type is None:
pos = typestring.find("<unnamed>")
if pos != -1:
# See http://sourceware.org/bugzilla/show_bug.cgi?id=13269
return lookupType(typestring.replace("<unnamed>", "(anonymous namespace)"))
# See http://sourceware.org/bugzilla/show_bug.cgi?id=11912
exp = "(class '%s'*)0" % ts
try:
......
......@@ -288,7 +288,9 @@ bool CMakeProject::parseCMakeLists()
allIncludePaths.append(cbpparser.includeFiles());
QStringList allFrameworkPaths;
QList<ProjectExplorer::HeaderPath> allHeaderPaths = activeBC->toolChain()->systemHeaderPaths();
QList<ProjectExplorer::HeaderPath> allHeaderPaths;
if (activeBC->toolChain())
allHeaderPaths = activeBC->toolChain()->systemHeaderPaths();
foreach (const ProjectExplorer::HeaderPath &headerPath, allHeaderPaths) {
if (headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath)
allFrameworkPaths.append(headerPath.path());
......@@ -302,12 +304,12 @@ bool CMakeProject::parseCMakeLists()
CPlusPlus::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this);
if (pinfo.includePaths != allIncludePaths
|| pinfo.sourceFiles != m_files
|| pinfo.defines != activeBC->toolChain()->predefinedMacros()
|| pinfo.defines != (activeBC->toolChain() ? activeBC->toolChain()->predefinedMacros() : QByteArray())
|| pinfo.frameworkPaths != allFrameworkPaths) {
pinfo.includePaths = allIncludePaths;
// TODO we only want C++ files, not all other stuff that might be in the project
pinfo.sourceFiles = m_files;
pinfo.defines = activeBC->toolChain()->predefinedMacros(); // TODO this is to simplistic
pinfo.defines = (activeBC->toolChain() ? activeBC->toolChain()->predefinedMacros() : QByteArray()); // TODO this is to simplistic
pinfo.frameworkPaths = allFrameworkPaths;
modelmanager->updateProjectInfo(pinfo);
m_codeModelFuture.cancel();
......
......@@ -142,7 +142,10 @@ bool MakeStep::init()
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
pp->setWorkingDirectory(bc->buildDirectory());
pp->setCommand(bc->toolChain()->makeCommand());
if (bc->toolChain())
pp->setCommand(bc->toolChain()->makeCommand());
else
pp->setCommand(QLatin1String("make"));
pp->setArguments(arguments);
setOutputParser(new ProjectExplorer::GnuMakeParser());
......
......@@ -45,7 +45,6 @@ SUBDIRS = plugin_coreplugin \
plugin_qmlprofiler \
plugin_remotelinux \
plugin_madde \
plugin_qttest \
plugin_valgrind \
plugin_updateinfo
......@@ -191,14 +190,6 @@ plugin_qtestlib.subdir = qtestlib
plugin_qtestlib.depends = plugin_projectexplorer
plugin_qtestlib.depends += plugin_coreplugin
plugin_qttest.subdir = qttest
plugin_qttest.depends = plugin_projectexplorer
plugin_qttest.depends += plugin_coreplugin
plugin_qttest.depends += plugin_debugger
plugin_qttest.depends += plugin_qt4projectmanager
plugin_qttest.depends += plugin_qtsupport
plugin_qttest.depends += plugin_remotelinux
plugin_helloworld.subdir = helloworld
plugin_helloworld.depends = plugin_coreplugin
......
......@@ -659,10 +659,13 @@ static void buildContextProperties(
typeScope = scope; // incorrect but may be an ok fallback
ClassOrNamespace *binding = typeOf.context().lookupType(namedType->name(), typeScope);
if (binding && !binding->symbols().isEmpty()) {
Class *klass = binding->symbols().first()->asClass();
if (klass) {
FakeMetaObject::Ptr fmo = buildFakeMetaObject(klass, fakeMetaObjects, typeOf);
typeName = fmo->className();
// find the best 'Class' symbol
for (int i = binding->symbols().size() - 1; i >= 0; --i) {
if (Class *klass = binding->symbols().at(i)->asClass()) {
FakeMetaObject::Ptr fmo = buildFakeMetaObject(klass, fakeMetaObjects, typeOf);
typeName = fmo->className();
break;
}
}
}
}
......
<plugin name=\"QtTest\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\" experimental=\"true\">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2011 Nokia Corporation</copyright>
<license>
Commercial Usage
Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
GNU Lesser General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
</license>
<category>Automated Testing</category>
<description>Automated Testing Plugin</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name=\"ProjectExplorer\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"Debugger\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"Qt4ProjectManager\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"QtSupport\" version=\"$$QTCREATOR_VERSION\"/>
<dependency name=\"RemoteLinux\" version=\"$$QTCREATOR_VERSION\"/>
</dependencyList>
</plugin>
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#include "addmanualtestdlg.h"
#include "ui_addmanualtestdlg.h"
AddManualTestDlg::AddManualTestDlg(QWidget *parent) :
QDialog(parent),
ui(new Ui::AddManualTestDlg)
{
ui->setupUi(this);
}
AddManualTestDlg::~AddManualTestDlg()
{
delete ui;
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef ADDMANUALTESTDLG_H
#define ADDMANUALTESTDLG_H
#include <QDialog>
QT_BEGIN_NAMESPACE
namespace Ui {
class AddManualTestDlg;
}
QT_END_NAMESPACE
class AddManualTestDlg : public QDialog
{
Q_OBJECT
public:
explicit AddManualTestDlg(QWidget *parent = 0);
~AddManualTestDlg();
private:
Ui::AddManualTestDlg *ui;
};
#endif // ADDMANUALTESTDLG_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AddManualTestDlg</class>
<widget class="QDialog" name="AddManualTestDlg">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>625</width>
<height>605</height>
</rect>
</property>
<property name="windowTitle">
<string>Add Manual Test</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Test function name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Test goal:</string>
</property>
</widget>
</item>
<item>
<widget class="QPlainTextEdit" name="plainTextEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>75</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Prerequisites:</string>
</property>
</widget>
</item>
<item>
<widget class="QPlainTextEdit" name="plainTextEdit_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>75</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Test steps:</string>
</property>
</widget>
</item>
<item>
<widget class="QTableWidget" name="tableWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>lineEdit</tabstop>
<tabstop>plainTextEdit</tabstop>
<tabstop>plainTextEdit_2</tabstop>
<tabstop>tableWidget</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AddManualTestDlg</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AddManualTestDlg</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#include "dialogs.h"
#include "qsystem.h"
#include <QTimer>
#include <QAbstractItemView>
#include <QTableWidgetItem>
#include <QResizeEvent>
#include <QScrollBar>
#include <QPushButton>
SelectDlg::SelectDlg(const QString &title, const QString &helpText,
QAbstractItemView::SelectionMode mode, int width, int height,
const QStringList &columns, const QByteArray &colWidths, QWidget *parent) : QDialog(parent)
{
m_colWidths = colWidths;
setupUi(this);
setModal(true);
setWindowTitle(title);
instructLabel->setText(helpText);
groupsList->setSelectionMode(mode);
resize(width, height);
groupsList->setEditTriggers(QAbstractItemView::NoEditTriggers);
groupsList->setColumnCount(columns.count());
groupsList->setHorizontalHeaderLabels(columns);
groupsList->setSelectionBehavior(QAbstractItemView::SelectRows);
groupsList->setSortingEnabled(true);
groupsList->sortByColumn(0, Qt::AscendingOrder);
groupsList->setAlternatingRowColors(true);
groupsList->verticalHeader()->hide();
groupsList->horizontalHeader()->show();
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
groupsList->setWordWrap(true);
connect(groupsList, SIGNAL(itemSelectionChanged()),
this, SLOT(onItemSelectionChanged()), Qt::DirectConnection);
QTimer::singleShot(0, this, SLOT(resizeEvent()));
}
void SelectDlg::resizeEvent()
{
resizeEvent(0);
}
void SelectDlg::addSelectableItems(const QStringList &items)
{
foreach (const QString &item, items)
addSelectableItem(item);
}
void SelectDlg::addSelectableItem(const QString &item)
{
groupsList->setSortingEnabled(false);
if (groupsList->columnCount() > 1) {
int row = groupsList->rowCount();
groupsList->insertRow(row);
QStringList tmp = item.split(QLatin1Char('|'));
if (tmp.count() > groupsList->columnCount()) {
for (int i = 0; i < (groupsList->columnCount() - 1); ++i)
groupsList->setItem(row, i, new QTableWidgetItem(tmp[i]));
QString s;
for (int i = groupsList->columnCount(); i < tmp.count(); ++i) {
if (!s.isEmpty()) s+= QLatin1Char('|');
s += tmp[i];
}
groupsList->setItem(row, (groupsList->columnCount() - 1), new QTableWidgetItem(s));
} else if (tmp.count() < groupsList->columnCount()) {
for (int i = 0; i < tmp.count(); ++i)
groupsList->setItem(row, i, new QTableWidgetItem(tmp[i]));
for (int i = tmp.count(); i < groupsList->columnCount(); ++i)
groupsList->setItem(row, i, new QTableWidgetItem(QString()));
} else {
for (int i = 0; i < tmp.count(); ++i)
groupsList->setItem(row, i, new QTableWidgetItem(tmp[i]));
}
} else {
// In single column mode we accept no duplicates
if (groupsList->findItems(item, Qt::MatchCaseSensitive).count() <= 0) {
int row = groupsList->rowCount();
groupsList->insertRow(row);
groupsList->setItem(row, 0, new QTableWidgetItem(item));
}
}
groupsList->setSortingEnabled(true);
}
QStringList SelectDlg::selectedItems()
{
QStringList ret;
QTableWidgetItem *item;
for (int row = 0; row < groupsList->rowCount(); ++row) {
item = groupsList->item(row, 0);
if (item && item->isSelected()) {
QString S = item->text();
for (int col = 1; col < groupsList->columnCount(); ++col) {
S+= QLatin1Char('|');
item = groupsList->item(row, col);
if (item)
S += item->text();
}
ret.append(S);
}
}
return ret;
}
void SelectDlg::setColumnWidth(int col, int width)
{
groupsList->setColumnWidth(col, width);
}
void SelectDlg::resizeEvent(QResizeEvent *event)
{
Q_UNUSED(event);
int fixedSize = 4;
const int extraSize = 80;
int total = 0;
if (groupsList->verticalScrollBar()->isVisible())
fixedSize += groupsList->verticalScrollBar()->width();
for (int i = 0; i < groupsList->columnCount(); ++i) {
if (i < m_colWidths.count()) {
if (static_cast<int>(m_colWidths[i]) > 0) {
setColumnWidth(i, m_colWidths[i]);
total += m_colWidths[i];
}
} else if (i == 0) {
int extra = groupsList->columnCount() - 1;
int colWidth = (groupsList->width() - fixedSize) - (extraSize * extra);
setColumnWidth(0, colWidth);
} else {
setColumnWidth(i, extraSize);
}
}
if (m_colWidths.count() > 0) {
for (int i = 0; i < groupsList->columnCount(); ++i) {
if ((i < m_colWidths.count()) && (static_cast<int>(m_colWidths[i]) == 0)) {
int colWidth = (groupsList->width() - fixedSize) - total;
setColumnWidth(i, colWidth);
}
}
}
groupsList->resizeRowsToContents();
}
void SelectDlg::resizeContents()
{
groupsList->resizeRowsToContents();
}
void SelectDlg::onItemSelectionChanged()
{
QList<QTableWidgetItem *> items = groupsList->selectedItems();
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(items.count() > 0);
}
//***********************************
NewTestFunctionDlg::NewTestFunctionDlg(const QString &testCase, QWidget *parent) :
QDialog(parent)
{
setupUi(this);
setModal(true);
testcaseLabel->setText(testCase);
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
connect(testFunctionName,SIGNAL(textChanged(QString)),
this, SLOT(onChanged()), Qt::DirectConnection);
resizeEvent(0);
}
void NewTestFunctionDlg::onChanged()
{
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!testFunctionName->text().isEmpty());
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General