Commit c3594213 authored by con's avatar con
Browse files

Merge remote branch 'origin/2.0'

Conflicts:
	doc/qtcreator.qdoc
parents d24d01f4 b2cb2f6e
......@@ -92,19 +92,12 @@
\o \l{Using the Maemo Emulator}
\o \l{Debugging}
\list
\o \l {Debugging Qt Applications}
\list
\o \l{Debugging the Example Application}
\o \l{Interacting with the Debugger}
\o \l{Setting Up Debugger}
\o \l{Using Debugging Helpers}
\endlist
\o \l{Debugging Qt Quick Applications}
\list
\o \l{Using the QML Inspector}
\endlist
\endlist
\o \l{Using the Maemo Emulator}
\o \l{Using Version Control Systems}
......@@ -3970,13 +3963,10 @@
\contentspage index.html
\previouspage creator-build-dependencies.html
\page creator-debugging.html
\nextpage creator-debugging-cpp.html
\nextpage creator-debugging-example.html
\title Debugging
You can use the Qt Creator \gui Debug mode to inspect the state of your
Qt and Qt Quick projects while debugging.
Qt Creator does not include a debugger. It provides a debugger plugin that acts
as an interface between the Qt Creator core and external native debuggers
such as the GNU Symbolic Debugger (gdb), the Microsoft Console Debugger (CDB),
......@@ -4198,8 +4188,12 @@
\previouspage creator-debugging.html
\page creator-debugging-cpp.html
\nextpage creator-debugging-example.html
=======
You can use the Qt Creator \gui Debug mode to inspect the state of your
Qt projects while debugging.
>>>>>>> origin/2.0
\title Debugging Qt Applications
\image qtcreator-debugger-views.png "Native debugger views"
In the \gui Debug mode you can interact with the debugger in several ways, including
the following:
......@@ -4628,6 +4622,14 @@
It is also possible to continue executing the program until the current
function completes or jump to an arbitrary position in the current function.
\section2 Stepping into Frameworks in Mac OS
In Mac OS X, external libraries are usually built into so-called Frameworks,
which may contain both release and debug versions of the library. When you run
applications on the Mac OS desktop, the release version of Frameworks is used
by default. To step into Frameworks, select the \gui {Use debug versions of
Frameworks} option in the project run settings for \gui Desktop and
\gui {Qt Simulator} targets.
\section1 Setting Breakpoints
......@@ -4799,7 +4801,7 @@
/*!
\contentspage index.html
\previouspage creator-debugging-cpp.html
\previouspage creator-debugging.html
\page creator-debugging-example.html
\nextpage creator-debug-mode.html
......@@ -4884,7 +4886,7 @@
\contentspage index.html
\previouspage creator-debugger-engines.html
\page creator-debugging-helpers.html
\nextpage creator-debugging-qml.html
\nextpage creator-maemo-emulator.html
\title Using Debugging Helpers
......@@ -5426,7 +5428,7 @@
\contentspage index.html
\previouspage creator-visual-editor.html
\page quick-projects.html
\nextpage quick-ui.html
\nextpage quick-components.html
\title Creating Qt Quick Projects
......@@ -5464,9 +5466,9 @@
/*!
\contentspage index.html
\previouspage quick-ui.html
\previouspage quick-projects.html
\page quick-components.html
\nextpage quick-buttons.html
\nextpage quick-screens.html
\title Creating Components
......@@ -5505,9 +5507,9 @@
/*!
\contentspage index.html
\previouspage quick-scalable-image.html
\previouspage quick-components.html
\page quick-screens.html
\nextpage quick-list-views.html
\nextpage quick-animations.html
\title Creating Screens
......@@ -5539,7 +5541,7 @@
/*!
\contentspage index.html
\previouspage quick-list-views.html
\previouspage quick-screens.html
\page quick-animations.html
\nextpage quick-user-interaction.html
......@@ -6066,7 +6068,7 @@
/*!
\contentspage index.html
\previouspage creator-qml-inspector.html
\previouspage creator-debugging-helpers.html
\page creator-maemo-emulator.html
\nextpage creator-version-control.html
......
......@@ -219,3 +219,5 @@ Cpp.ignoredirectives = Q_DECLARE_HANDLE \
K_DECLARE_PRIVATE \
PHONON_OBJECT \
PHONON_HEIR
creator = true
......@@ -273,17 +273,6 @@ static bool startsWith(const char *s, const char *t)
return true;
}
static bool couldBePointer(const void *p)
{
// we assume valid pointer to be 4-aligned at least.
// So use this check only when this is guaranteed.
// FIXME: this breaks e.g. in the QString dumper...
const quintptr d = quintptr(p);
//qDebug() << "CHECKING : " << p << ((d & 3) == 0 && (d > 1000 || d == 0));
//return (d & 3) == 0 && (d > 1000 || d == 0);
return d > 1000 || d == 0;
}
// Check memory for read access and provoke segfault if nothing else helps.
// On Windows, try to be less crash-prone by checking memory using WinAPI
......@@ -314,6 +303,17 @@ static bool couldBePointer(const void *p)
qProvokeSegFaultHelper = *(char*)d; \
} while (0)
static bool couldBePointer(const void *p)
{
// we assume valid pointer to be 4-aligned at least.
// So use this check only when this is guaranteed.
// FIXME: this breaks e.g. in the QString dumper...
const quintptr d = quintptr(p);
//qDebug() << "CHECKING : " << p << ((d & 3) == 0 && (d > 1000 || d == 0));
//return (d & 3) == 0 && (d > 1000 || d == 0);
return d > 1000 || d == 0;
}
#endif
#ifdef QT_NAMESPACE
......
......@@ -207,6 +207,8 @@ void AttachCoreDialog::setCoreFile(const QString &fileName)
//
///////////////////////////////////////////////////////////////////////
#ifndef Q_OS_WIN
static bool isUnixProcessId(const QString &procname)
{
for (int i = 0; i != procname.size(); ++i)
......@@ -288,6 +290,7 @@ static QList<ProcData> unixProcessList()
}
return rc;
}
#endif // Q_OS_WIN
static QList<ProcData> processList()
{
......
......@@ -50,7 +50,7 @@ template <class SymbolType>
inline bool resolveSymbol(const char *libraryName, HMODULE libraryHandle, const char *symbolName, SymbolType *s, QString *errorMessage)
{
*s = 0;
FARPROC WINAPI vs = ::GetProcAddress(libraryHandle, symbolName);
FARPROC vs = ::GetProcAddress(libraryHandle, symbolName);
if (vs == 0) {
*errorMessage = QString::fromLatin1("Unable to resolve '%2' in '%1'.").arg(QString::fromAscii(symbolName), QString::fromAscii(libraryName));
return false;
......
......@@ -32,6 +32,7 @@
#include <utils/filterlineedit.h>
#include "itemlibrarywidgets.h"
#include "itemlibrarymodel.h"
#include "itemlibraryimageprovider.h"
#include "customdraganddrop.h"
#include <QFileInfo>
......@@ -164,6 +165,9 @@ ItemLibrary::ItemLibrary(QWidget *parent) :
m_d->m_resourcesView->setModel(m_d->m_resourcesDirModel);
m_d->m_resourcesView->setIconSize(m_d->m_resIconSize);
/* create image provider for loading item icons */
m_d->m_itemsView->engine()->addImageProvider(QLatin1String("qmldesigner_itemlibrary"), new Internal::ItemLibraryImageProvider);
/* other widgets */
QTabBar *tabBar = new QTabBar(this);
tabBar->addTab(tr("Items", "Title of library items view"));
......
......@@ -6,8 +6,8 @@ VPATH += $$PWD
INCLUDEPATH += $$PWD
# Input
HEADERS += itemlibrary.h customdraganddrop.h itemlibrarymodel.h itemlibrarywidgets.h
SOURCES += itemlibrary.cpp customdraganddrop.cpp itemlibrarymodel.cpp itemlibrarywidgets.cpp
HEADERS += itemlibrary.h customdraganddrop.h itemlibrarymodel.h itemlibrarywidgets.h itemlibraryimageprovider.h
SOURCES += itemlibrary.cpp customdraganddrop.cpp itemlibrarymodel.cpp itemlibrarywidgets.cpp itemlibraryimageprovider.cpp
RESOURCES += itemlibrary.qrc
OTHER_FILES += \
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file 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 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "itemlibraryimageprovider.h"
namespace QmlDesigner {
namespace Internal {
ItemLibraryImageProvider::ItemLibraryImageProvider() :
QDeclarativeImageProvider(QDeclarativeImageProvider::Pixmap)
{
}
QPixmap ItemLibraryImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
{
QPixmap pixmap(id);
if (size) {
size->setWidth(pixmap.width());
size->setHeight(pixmap.height());
}
if (requestedSize.isValid())
return pixmap.scaled(requestedSize);
return pixmap;
}
}
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file 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 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef ITEMLIBRARYIMAGEPROVIDER_H
#define ITEMLIBRARYIMAGEPROVIDER_H
#include <QDeclarativeImageProvider>
namespace QmlDesigner {
namespace Internal {
class ItemLibraryImageProvider : public QDeclarativeImageProvider
{
public:
ItemLibraryImageProvider();
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize);
};
}
}
#endif // ITEMLIBRARYIMAGEPROVIDER_H
......@@ -176,7 +176,6 @@ ItemLibraryItemModel::ItemLibraryItemModel(QScriptEngine *scriptEngine, int item
m_scriptEngine(scriptEngine),
m_libId(itemLibId),
m_name(itemName),
m_icon(),
m_iconSize(64, 64)
{
QScriptValue pixmapScriptValue(m_scriptEngine->newVariant(QPixmap()));
......@@ -204,21 +203,19 @@ QString ItemLibraryItemModel::itemName() const
return m_name;
}
void ItemLibraryItemModel::setItemIcon(const QIcon &itemIcon)
void ItemLibraryItemModel::setItemIconPath(const QString &iconPath)
{
m_icon = itemIcon;
m_iconPath = iconPath;
QScriptValue pixmapScriptValue(m_scriptEngine->newVariant(m_icon.pixmap(m_iconSize)));
setProperty(QLatin1String("itemPixmap"), pixmapScriptValue);
setProperty(QLatin1String("itemLibraryIconPath"),
QString(QLatin1String("image://qmldesigner_itemlibrary/") + iconPath));
}
void ItemLibraryItemModel::setItemIconSize(const QSize &itemIconSize)
{
m_iconSize = itemIconSize;
// qDebug() << "set icon size" << itemIconSize;
setItemIcon(m_icon);
setItemIconPath(m_iconPath);
}
......@@ -414,12 +411,12 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo)
itemModel = new ItemLibraryItemModel(m_scriptEngine.data(), itemId, entry.name());
// delayed creation of (default) icons
if (entry.icon().isNull())
entry.setIcon(QIcon(QLatin1String(":/ItemLibrary/images/item-default-icon.png")));
if (entry.iconPath().isEmpty())
entry.setIconPath(QLatin1String(":/ItemLibrary/images/item-default-icon.png"));
if (entry.dragIcon().isNull())
entry.setDragIcon(createDragPixmap(getWidth(entry), getHeight(entry)));
itemModel->setItemIcon(entry.icon());
itemModel->setItemIconPath(entry.iconPath());
itemModel->setItemIconSize(m_itemIconSize);
sectionModel->addSectionEntry(itemModel);
m_sections.insert(itemId, sectionId);
......
......@@ -84,7 +84,7 @@ public:
int itemLibId() const;
QString itemName() const;
void setItemIcon(const QIcon &itemIcon);
void setItemIconPath(const QString &iconPath);
void setItemIconSize(const QSize &itemIconSize);
bool operator<(const ItemLibraryItemModel &other) const;
......@@ -93,7 +93,7 @@ private:
QWeakPointer<QScriptEngine> m_scriptEngine;
int m_libId;
QString m_name;
QIcon m_icon;
QString m_iconPath;
QSize m_iconSize;
};
......
......@@ -96,7 +96,7 @@ Item {
width: itemLibraryIconWidth // to be set in Qml context
height: itemLibraryIconHeight // to be set in Qml context
pixmap: itemPixmap // to be set by model
source: itemLibraryIconPath // to be set by model
}
Text {
......
......@@ -2,10 +2,12 @@ VPATH += $$PWD
INCLUDEPATH += $$PWD
SOURCES += stateseditorwidget.cpp \
stateseditormodel.cpp \
stateseditorview.cpp
stateseditorview.cpp \
stateseditorimageprovider.cpp
HEADERS += stateseditorwidget.h \
stateseditormodel.h \
stateseditorview.h
stateseditorview.h \
stateseditorimageprovider.cpp
RESOURCES += $$PWD/stateseditor.qrc
OTHER_FILES +=$$PWD/stateslist.qml \
$$PWD/HorizontalScrollBar.qml
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file 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 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "stateseditorimageprovider.h"
#include "stateseditorview.h"
namespace QmlDesigner {
namespace Internal {
StatesEditorImageProvider::StatesEditorImageProvider(StatesEditorView *view) :
QDeclarativeImageProvider(QDeclarativeImageProvider::Pixmap),
m_view(view)
{
}
QPixmap StatesEditorImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
{
if (!m_view.isNull()) {
// discard the count number (see StatesEditorModel m_updateCounter)
QString s = id.mid(0, id.lastIndexOf(QLatin1Char('-')));
bool ok = false;
int state = s.toInt(&ok);
if (ok) {
QPixmap pm = m_view->renderState(state);
if (size)
*size = pm.size();
if (requestedSize.isValid())
return pm.scaled(requestedSize);
return pm;
}
}
return QPixmap();
}
}
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file 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 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef STATESEDITORIMAGEPROVIDER_H
#define STATESEDITORIMAGEPROVIDER_H
#include <QDeclarativeImageProvider>
#include <QWeakPointer>
namespace QmlDesigner {
namespace Internal {
class StatesEditorView;
class StatesEditorImageProvider : public QDeclarativeImageProvider
{
public:
StatesEditorImageProvider(StatesEditorView *view);
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize);
private:
QWeakPointer<StatesEditorView> m_view;
};
}
}
#endif // STATESEDITORIMAGEPROVIDER_H
......@@ -42,12 +42,12 @@ namespace QmlDesigner {
namespace Internal {
StatesEditorModel::StatesEditorModel(QObject *parent) :
QAbstractListModel(parent)
QAbstractListModel(parent),
m_updateCounter(0)
{
QHash<int, QByteArray> roleNames;
roleNames.insert(StateNameRole, "stateName");
roleNames.insert(StatesPixmapRole, "statePixmap");
roleNames.insert(StateImageSourceRole, "stateImageSource");
setRoleNames(roleNames);
}
......@@ -78,11 +78,9 @@ QVariant StatesEditorModel::data(const QModelIndex &index, int role) const
result = m_stateNames.at(index.row());
break;
}
case StatesPixmapRole: {
// TODO: Maybe cache this?
if (!m_statesView.isNull()) {
result = m_statesView->renderState(index.row());
}
case StateImageSourceRole: {
if (!m_statesView.isNull())
return QString("image://qmldesigner_stateseditor/%1-%2").arg(index.row()).arg(m_updateCounter);
break;
}
}
......@@ -134,6 +132,14 @@ void StatesEditorModel::updateState(int i)
{
Q_ASSERT(i >= 0 && i < m_stateNames.count());