Commit 0374a978 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/3.2' into HEAD

Change-Id: I257bb9310bb3bde493aff4cd43091ec63fcb5203
parents 341ec7f9 01d07153
......@@ -60,6 +60,15 @@
\c {qtcreator .}
\note To run a self-built \QC from the command line on Windows, make sure
that the Qt installation directory is included in the PATH environment
variable. You can enter the following command on the command line to add Qt
to the path:
\code
set PATH=<Qt_installation_directory>\mingw\bin;c:<Qt_installation_directory>\bin;%PATH%
\endcode
The following table summarizes the available options:
\table
......
......@@ -124,11 +124,7 @@
For example, running \tt{qtcreator somesession}, launches \QC and
loads session somesession.
\note Make sure \QC is included in the PATH environment variable.
This can be done by typing the following in the command line:
\code
set PATH=c:\qtsdk\mingw\bin;c:\qtsdk\qt\bin;%PATH%
\endcode
For more information, see \l{Using Command Line Options}.
\section1 Showing and Hiding the Sidebar
......@@ -152,15 +148,16 @@
Press \key Ctrl (\key Cmd on OS X) and click a symbol to move directly to
the definition or the declaration of the symbol. You can also move the
on the symbol and press \key {F2}. For more information, see
cursor \l{Moving to Symbol Definition or Declaration}.
cursor on the symbol and press \key {F2}. For more information, see
\l{Moving to Symbol Definition or Declaration}.
\section1 Displaying Signals and Slots
If an instance of a class is derived from QObject, and you would like to
find all other objects connected to one of your object's slots using
Qt's signals and slots mechanism, select \gui Tools > \gui Options
> \gui{Debugger} > \gui{Debugging Helper} > \gui{Use Debugging Helper}.
> \gui{Debugger} > \gui{Locals and Expressions} >
\gui{Use Debugging Helper}.
In the \gui{Locals and Expressions} view, expand the object's entry and open
the slot in the \e slots subitem. The objects connected to this slot are
......@@ -179,7 +176,7 @@
\list 1
\li Select \gui Tools > \gui Options > \gui Debugger >
\gui{Debugging Helper}.
\gui{Locals and Expressions}.
\li Uncheck the \gui{Use Debugging Helper} checkbox.
......@@ -234,7 +231,7 @@
\li \c %MONTH%: Month
\li \c %DAY%: Day of the month
\li \c %DATE%: Date
\li \c %USER%: User name
\li \c %USER%: Username
\li \c %FILENAME%: File name
\li \c %CLASS%: Class name (if applicable)
\li \c %$VARIABLE%: Contents of environment variable \c{VARIABLE}.
......
......@@ -78,8 +78,8 @@
enter the host name or IP address of the device.
This value will be available in the variable \c %{CurrentDevice:HostAddress}.
\li In the \gui {The user name to log into the device} field,
enter the user name to log into the device and run the
\li In the \gui {The username to log into the device} field,
enter the username to log into the device and run the
application as.
This value will be available in the variable \c %{CurrentDevice:UserName}.
......
......@@ -145,9 +145,9 @@
\list
\li \QMLD uses external processes (QML Puppet) to render and preview
\li \QMLD uses a QML emulation layer (QML Puppet) to render and preview
images and to collect data. Executing C++ code might cause the QML
Puppet to crash. If it crashes, an error message is displayed and
emulation layer to crash. If it crashes, an error message is displayed and
you can continue editing the QML file in the code editor.
\endlist
......
......@@ -41,11 +41,8 @@
\row
\li Learn more about Qt
\li \l{http://qt.digia.com/product/learning/}{Learning}
from Digia
\l{http://qt-project.org/wiki/developer-guides}
{Qt Developer Guides} from Qt Project
\li \l{http://qt-project.org/wiki/developer-guides}
{Qt Developer Guides}
\row
\li Develop Qt applications for desktop and mobile devices
......
......@@ -192,7 +192,7 @@ def qdump__std__map(d, value):
for i in d.childRange():
with SubItem(d, i):
pair = (node + 1).cast(pairPointer).dereference()
d.putPair(pair)
d.putPair(pair, i)
if d.isNull(node["_M_right"]):
parent = node["_M_parent"]
while node == parent["_M_right"]:
......@@ -267,9 +267,18 @@ def qdump__std____debug__map(d, value):
def qdump__std____debug__set(d, value):
qdump__std__set(d, value)
def qdump__std__multiset(d, value):
qdump__std__set(d, value)
def qdump__std____cxx1998__map(d, value):
qdump__std__map(d, value)
def qform__std__multimap():
return mapForms()
def qdump__std__multimap(d, value):
return qdump__std__map(d, value)
def stdTreeIteratorHelper(d, value):
node = value["_M_node"].dereference()
d.putNumChild(1)
......
......@@ -112,7 +112,9 @@ QDataStream &operator<<(QDataStream &out, const ValuesChangedCommand &command)
QSharedMemory *sharedMemory = createSharedMemory(keyCounter, outDataStreamByteArray.size());
if (sharedMemory) {
sharedMemory->lock();
std::memcpy(sharedMemory->data(), outDataStreamByteArray.constData(), sharedMemory->size());
sharedMemory->unlock();
out << command.keyNumber();
return out;
}
......
......@@ -392,8 +392,15 @@ QImage QuickItemNodeInstance::renderPreviewImage(const QSize &previewImageSize)
{
QRectF previewItemBoundingRect = boundingRect();
if (previewItemBoundingRect.isValid() && quickItem())
return designerSupport()->renderImageForItem(quickItem(), previewItemBoundingRect, previewImageSize);
if (previewItemBoundingRect.isValid() && quickItem()) {
if (quickItem()->isVisible()) {
return designerSupport()->renderImageForItem(quickItem(), previewItemBoundingRect, previewImageSize);
} else {
QImage transparentImage(previewImageSize, QImage::Format_ARGB32_Premultiplied);
transparentImage.fill(Qt::transparent);
return transparentImage;
}
}
return QImage();
}
......
......@@ -3050,7 +3050,7 @@ bool Parser::parseExpressionStatement(StatementAST *&node)
return parsed;
}
bool Parser::parseStatement(StatementAST *&node)
bool Parser::parseStatement(StatementAST *&node, bool blockLabeledStatement)
{
DEBUG_THIS_RULE();
switch (LA()) {
......@@ -3077,6 +3077,8 @@ bool Parser::parseStatement(StatementAST *&node)
case T_CASE:
case T_DEFAULT:
if (blockLabeledStatement)
return false;
return parseLabeledStatement(node);
case T_BREAK:
......@@ -3145,8 +3147,11 @@ bool Parser::parseStatement(StatementAST *&node)
}
default:
if (LA() == T_IDENTIFIER && LA(2) == T_COLON)
if (LA() == T_IDENTIFIER && LA(2) == T_COLON) {
if (blockLabeledStatement)
return false;
return parseLabeledStatement(node);
}
return parseExpressionOrDeclarationStatement(node);
} // switch
......@@ -3617,7 +3622,7 @@ bool Parser::parseLabeledStatement(StatementAST *&node)
LabeledStatementAST *ast = new (_pool) LabeledStatementAST;
ast->label_token = consumeToken();
ast->colon_token = consumeToken();
parseStatement(ast->statement);
parseStatement(ast->statement, /*blockLabeledStatement =*/ true);
node = ast;
return true;
}
......@@ -3627,7 +3632,7 @@ bool Parser::parseLabeledStatement(StatementAST *&node)
LabeledStatementAST *ast = new (_pool) LabeledStatementAST;
ast->label_token = consumeToken();
match(T_COLON, &ast->colon_token);
parseStatement(ast->statement);
parseStatement(ast->statement, /*blockLabeledStatement =*/ true);
node = ast;
return true;
}
......@@ -3637,7 +3642,7 @@ bool Parser::parseLabeledStatement(StatementAST *&node)
ast->case_token = consumeToken();
parseConstantExpression(ast->expression);
match(T_COLON, &ast->colon_token);
parseStatement(ast->statement);
parseStatement(ast->statement, /*blockLabeledStatement =*/ true);
node = ast;
return true;
}
......
......@@ -142,7 +142,7 @@ public:
bool parsePtrOperator(PtrOperatorListAST *&node);
bool parseRelationalExpression(ExpressionAST *&node);
bool parseShiftExpression(ExpressionAST *&node);
bool parseStatement(StatementAST *&node);
bool parseStatement(StatementAST *&node, bool blockLabeledStatement = false);
bool parseThisExpression(ExpressionAST *&node);
bool parseBoolLiteral(ExpressionAST *&node);
bool parseNumericLiteral(ExpressionAST *&node);
......
......@@ -604,7 +604,7 @@ ModelManagerInterface::ProjectInfo ModelManagerInterface::projectInfoForPath(QSt
if (res.qtQmlPath.isEmpty())
res.qtQmlPath = pInfo.qtQmlPath;
foreach (const QString &path, pInfo.importPaths)
if (res.importPaths.contains(path))
if (!res.importPaths.contains(path))
res.importPaths.append(path);
}
return res;
......@@ -1105,28 +1105,24 @@ void ModelManagerInterface::updateImportPaths()
while (pInfoIter.hasNext()) {
pInfoIter.next();
QString pathAtt = pInfoIter.value().qtQmlPath;
if (!pathAtt.isEmpty() && allImportPaths.size() > 0
&& allImportPaths.value(allImportPaths.size()) != pathAtt)
if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
allImportPaths.append(pathAtt);
}
{
QString pathAtt = defaultProjectInfo().qtQmlPath;
if (!pathAtt.isEmpty() && allImportPaths.size() > 0
&& allImportPaths.value(allImportPaths.size()) != pathAtt)
if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
allImportPaths.append(pathAtt);
}
pInfoIter.toFront();
while (pInfoIter.hasNext()) {
pInfoIter.next();
QString pathAtt = pInfoIter.value().qtImportsPath;
if (!pathAtt.isEmpty() && allImportPaths.size() > 0
&& allImportPaths.value(allImportPaths.size()) != pathAtt)
if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
allImportPaths.append(pathAtt);
}
{
QString pathAtt = defaultProjectInfo().qtImportsPath;
if (!pathAtt.isEmpty() && allImportPaths.size() > 0
&& allImportPaths.value(allImportPaths.size()) != pathAtt)
if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
allImportPaths.append(pathAtt);
}
allImportPaths += m_defaultImportPaths;
......
......@@ -1973,9 +1973,10 @@ void EditorManager::updateMakeWritableWarning()
void EditorManager::setupSaveActions(IDocument *document, QAction *saveAction, QAction *saveAsAction, QAction *revertToSavedAction)
{
saveAction->setEnabled(document != 0 && document->isModified());
const bool hasFile = document != 0 && !document->filePath().isEmpty();
saveAction->setEnabled(hasFile && document->isModified());
saveAsAction->setEnabled(document != 0 && document->isSaveAsAllowed());
revertToSavedAction->setEnabled(document != 0 && !document->filePath().isEmpty());
revertToSavedAction->setEnabled(hasFile);
const QString documentName = document ? document->displayName() : QString();
QString quotedName;
......
......@@ -318,12 +318,14 @@ void EditorToolBar::listContextMenu(QPoint pos)
d->m_editorList->currentIndex());
QString fileName = entry ? entry->fileName() : QString();
QString shortFileName = entry ? QFileInfo(fileName).fileName() : QString();
if (fileName.isEmpty() || shortFileName.isEmpty())
return;
QMenu menu;
QAction *copyPath = menu.addAction(tr("Copy Full Path to Clipboard"));
QAction *copyFileName = menu.addAction(tr("Copy File Name to Clipboard"));
menu.addSeparator();
if (fileName.isEmpty() || shortFileName.isEmpty()) {
copyPath->setEnabled(false);
copyFileName->setEnabled(false);
}
EditorManager::addSaveAndCloseEditorActions(&menu, entry);
menu.addSeparator();
EditorManager::addNativeDirAndOpenWithActions(&menu, entry);
......
......@@ -241,6 +241,11 @@ bool MainWindow::isNewItemDialogRunning() const
MainWindow::~MainWindow()
{
// explicitly delete window support, because that calls methods from ICore that call methods
// from mainwindow, so mainwindow still needs to be alive
delete m_windowSupport;
m_windowSupport = 0;
ExtensionSystem::PluginManager::removeObject(m_shortcutSettings);
ExtensionSystem::PluginManager::removeObject(m_generalSettings);
ExtensionSystem::PluginManager::removeObject(m_toolSettings);
......@@ -371,11 +376,6 @@ void MainWindow::closeEvent(QCloseEvent *event)
m_navigationWidget->closeSubWidgets();
event->accept();
// explicitly delete window support, because that calls methods from ICore that call methods
// from mainwindow, so mainwindow still needs to be alive
delete m_windowSupport;
m_windowSupport = 0;
}
void MainWindow::openDroppedFiles(const QStringList &files)
......
......@@ -218,6 +218,36 @@ public:
PathChooser *overrideStartScriptFileName;
QDialogButtonBox *buttonBox;
struct State
{
bool isValid() const
{
return validKit && validLocalExecFilename && validCoreFilename;
}
bool validKit;
bool validLocalExecFilename;
bool validCoreFilename;
bool localCoreFile;
bool localKit;
};
State getDialogState(const AttachCoreDialog &p) const
{
State st;
st.localCoreFile = p.useLocalCoreFile();
st.validKit = (kitChooser->currentKit() != 0);
st.validLocalExecFilename = localExecFileName->isValid();
if (st.localCoreFile)
st.validCoreFilename = localCoreFileName->isValid();
else
st.validCoreFilename = !p.remoteCoreFile().isEmpty();
st.localKit = p.isLocalKit();
return st;
}
};
AttachCoreDialog::AttachCoreDialog(QWidget *parent)
......@@ -302,6 +332,18 @@ int AttachCoreDialog::exec()
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept()));
changed();
AttachCoreDialogPrivate::State st = d->getDialogState(*this);
if (!st.validKit) {
d->kitChooser->setFocus();
} else if (!st.validCoreFilename) {
if (st.localCoreFile)
d->localCoreFileName->setFocus();
else
d->remoteCoreFileName->setFocus();
} else if (!st.validLocalExecFilename) {
d->localExecFileName->setFocus();
}
return QDialog::exec();
}
......@@ -335,24 +377,21 @@ void AttachCoreDialog::coreFileChanged(const QString &core)
void AttachCoreDialog::changed()
{
bool isValid = d->kitChooser->currentKit() && d->localExecFileName->isValid();
bool isKitLocal = isLocalKit();
AttachCoreDialogPrivate::State st = d->getDialogState(*this);
d->forceLocalLabel->setVisible(!isKitLocal);
d->forceLocalCheckBox->setVisible(!isKitLocal);
if (useLocalCoreFile()) {
d->forceLocalLabel->setVisible(!st.localKit);
d->forceLocalCheckBox->setVisible(!st.localKit);
if (st.localCoreFile) {
d->localCoreFileName->setVisible(true);
d->remoteCoreFileName->setVisible(false);
d->selectRemoteCoreButton->setVisible(false);
isValid = isValid && d->localCoreFileName->isValid();
} else {
d->localCoreFileName->setVisible(false);
d->remoteCoreFileName->setVisible(true);
d->selectRemoteCoreButton->setVisible(true);
isValid = isValid && !remoteCoreFile().isEmpty();
}
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid);
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(st.isValid());
}
void AttachCoreDialog::selectRemoteCoreFile()
......
......@@ -252,12 +252,14 @@ void GenericProject::refresh(RefreshOptions options)
Kit *k = activeTarget() ? activeTarget()->kit() : KitManager::defaultKit();
if (ToolChain *tc = ToolChainKitInformation::toolChain(k)) {
QStringList cxxflags; // FIXME: Can we do better?
part->evaluateToolchain(tc, cxxflags, cxxflags,
QStringList cflags;
QStringList cxxflags;
cxxflags << QLatin1String("-std=c++11");
part->evaluateToolchain(tc, cxxflags, cflags,
SysRootKitInformation::sysRoot(k));
}
part->cxxVersion = CppTools::ProjectPart::CXX11; // assume C++11
part->projectConfigFile = configFileName();
// ### add _defines.
......
......@@ -2233,7 +2233,8 @@ GitClient::StashInfo &GitClient::stashInfo(const QString &workingDirectory)
void GitClient::endStashScope(const QString &workingDirectory)
{
const QString repoDirectory = VcsManager::findTopLevelForDirectory(workingDirectory);
QTC_ASSERT(m_stashInfo.contains(repoDirectory), return);
if (!m_stashInfo.contains(repoDirectory))
return;
m_stashInfo[repoDirectory].end();
}
......
......@@ -19,7 +19,7 @@
<item row="0" column="0">
<widget class="QLabel" name="usernameLabel">
<property name="text">
<string>User name:</string>
<string>Username:</string>
</property>
</widget>
</item>
......
......@@ -1090,7 +1090,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
[]() { return variableValue(Constants::VAR_CURRENTDEVICE_SSHPORT); });
VariableManager::registerVariable(Constants::VAR_CURRENTDEVICE_USERNAME,
tr("The user name with which to log into the device in the currently active kit."),
tr("The username with which to log into the device in the currently active kit."),
[]() { return variableValue(Constants::VAR_CURRENTDEVICE_USERNAME); });
VariableManager::registerVariable(Constants::VAR_CURRENTDEVICE_PRIVATEKEYFILE,
......
......@@ -161,7 +161,7 @@ QString Node::path() const
int Node::line() const
{
return -1;
return m_line;
}
QString Node::displayName() const
......
......@@ -332,11 +332,16 @@ void RunSettingsWidget::cloneRunConfiguration()
if (!factory)
return;
//: Title of a the cloned RunConfiguration window, text of the window
QString name = uniqueRCName(QInputDialog::getText(this, tr("Clone Configuration"), tr("New configuration name:")));
if (name.isEmpty())
return;
RunConfiguration *newRc = factory->clone(m_target, activeRunConfiguration);
if (!newRc)
return;
newRc->setDisplayName(activeRunConfiguration->displayName());
newRc->setDisplayName(name);
m_target->addRunConfiguration(newRc);
m_target->setActiveRunConfiguration(newRc);
}
......
......@@ -37,6 +37,8 @@
#include <qtsupport/qtkitinformation.h>
#include <utils/qtcassert.h>
#include <tools/hostosinfo.h>
#include <QFileInfo>
namespace QbsProjectManager {
......@@ -65,14 +67,33 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
if (tc) {
// FIXME/CLARIFY: How to pass the sysroot?
ProjectExplorer::Abi targetAbi = tc->targetAbi();
QString architecture = ProjectExplorer::Abi::toString(targetAbi.architecture());
if (targetAbi.wordWidth() == 64)
architecture.append(QLatin1String("_64"));
data.insert(QLatin1String(QBS_ARCHITECTURE), architecture);
if (targetAbi.architecture() != ProjectExplorer::Abi::UnknownArchitecture) {
QString architecture = ProjectExplorer::Abi::toString(targetAbi.architecture());
// We have to be conservative tacking on suffixes to arch names because an arch that is
// already 64-bit may get an incorrect name as a result (i.e. Itanium)
if (targetAbi.wordWidth() == 64) {
switch (targetAbi.architecture()) {
case ProjectExplorer::Abi::X86Architecture:
architecture.append(QLatin1String("_"));
// fall through
case ProjectExplorer::Abi::ArmArchitecture:
case ProjectExplorer::Abi::MipsArchitecture:
case ProjectExplorer::Abi::PowerPCArchitecture:
architecture.append(QString::number(targetAbi.wordWidth()));
break;
default:
break;
}
}
data.insert(QLatin1String(QBS_ARCHITECTURE),
qbs::Internal::HostOsInfo::canonicalArchitecture(architecture));
}
if (targetAbi.endianness() == ProjectExplorer::Abi::BigEndian)
data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("big"));
else
else if (targetAbi.endianness() == ProjectExplorer::Abi::LittleEndian)
data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("little"));
if (targetAbi.os() == ProjectExplorer::Abi::WindowsOS) {
......@@ -83,19 +104,21 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
: QStringList() << QLatin1String("msvc"));
} else if (targetAbi.os() == ProjectExplorer::Abi::MacOS) {
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants (include header?)
const char IOS_SIMULATOR_TYPE[] = "Ios.Simulator.Type";
const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitInformation::qtVersion(k);
QStringList targetOS;
targetOS << QLatin1String("darwin") << QLatin1String("bsd4")
<< QLatin1String("bsd") << QLatin1String("unix");
if (qt && qt->type() == QLatin1String(IOSQT)) {
QStringList targetOS;
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture)
targetOS << QLatin1String("ios-simulator");
targetOS << QLatin1String("ios") << QLatin1String("darwin")
<< QLatin1String("bsd4") << QLatin1String("bsd") << QLatin1String("unix");
data.insert(QLatin1String(QBS_TARGETOS), targetOS);
targetOS.insert(0, QLatin1String("ios"));
if (ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k) == IOS_SIMULATOR_TYPE)
targetOS.insert(0, QLatin1String("ios-simulator"));
} else {
data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("osx")
<< QLatin1String("darwin") << QLatin1String("bsd4")
<< QLatin1String("bsd") << QLatin1String("unix"));
targetOS.insert(0, QLatin1String("osx"));
}
data.insert(QLatin1String(QBS_TARGETOS), targetOS);
if (tc->type() != QLatin1String("clang")) {
data.insert(QLatin1String(QBS_TOOLCHAIN), QLatin1String("gcc"));
} else {
......
......@@ -35,7 +35,6 @@
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/idocument.h>
#include <coreplugin/messagemanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtsupportconstants.h>
......@@ -116,46 +115,6 @@ static qbs::GroupData findMainQbsGroup(const qbs::ProductData &productData)
return qbs::GroupData();
}
static bool addQbsFiles(QbsBaseProjectNode *node, const QStringList &filePaths, qbs::Project prj,
const qbs::ProductData &productData, const qbs::GroupData &groupData,
const QString &productPath, QStringList *notAdded)
{
QStringList allPaths = groupData.allFilePaths();
foreach (const QString &path, filePaths) {
qbs::ErrorInfo err = prj.addFiles(productData, groupData, QStringList() << path);
if (err.hasError()) {
Core::MessageManager::write(err.toString());
*notAdded += path;
} else {
allPaths += path;
}
}
if (notAdded->count() != filePaths.count())
QbsGroupNode::setupFiles(node, allPaths, productPath, true);
return notAdded->isEmpty();
}