Commit d24d01f4 authored by con's avatar con
Browse files

Merge commit '52b9fcca' (origin/2.0)

Conflicts:
	src/plugins/debugger/debuggeragents.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.h
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationwidget.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemosshthread.h
parents f823c481 52b9fcca
......@@ -72,7 +72,7 @@ doc/pluginhowto/html/*
# Binaries
# --------
bin/*.dll
bin/qtcreator.bin
bin/qtcreator
bin/qtcreator_process_stub*
bin/qtcreator.exe
share/doc/qtcreator/qtcreator.qch
......
......@@ -5,11 +5,14 @@ int main(int argc, char *argv[])
{
QApplication a(argc, argv);
BatteryIndicator w;
//! [0]
#if defined(Q_WS_S60)
w.showMaximized();
#else
w.show();
#endif
//! [0]
return a.exec();
}
doc/images/qtcreator-overview.png

101 KB | W: | H:

doc/images/qtcreator-overview.png

60.6 KB | W: | H:

doc/images/qtcreator-overview.png
doc/images/qtcreator-overview.png
doc/images/qtcreator-overview.png
doc/images/qtcreator-overview.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -551,6 +551,11 @@
an open output pane, click the \gui {Maximize Output Pane} button
or press \key {Alt+9}.
To search within the \gui{Application Output} and \gui{Compile Output}
panes, press \key {Ctrl+F} when the pane is active. Enter search
criteria in the \gui Find field and click the left and right arrows to
search down and up in the pane.
To open the \gui{General Messages} and \gui{Version Control}
panes, select \gui {Window > Output Panes}.
......@@ -824,20 +829,20 @@
\image qtcreator-editortoolbar-symbols.png
Use the toolbar to navigate between open files and symbols in use:
\list
\o To browse forward or backward through your location history, click
Use the toolbar to navigate between open files and symbols in use.
To browse forward or backward through your location history, click
\inlineimage qtcreator-back.png
and \inlineimage qtcreator-forward.png
.
\o To go to any open file, select it from the \gui{Open files}
drop-down menu.
\o To jump to any symbol used in the current file, select it from the
\gui Symbols drop-down menu.
\endlist
When you create or edit forms in a \c{.ui} file, the toolbar contains
Qt Designer specific tools.
To go to any open file, select it from the \gui{Open files} drop-down menu.
Right-click the menu title and select \gui {Copy Full Path to Clipboard} to
copy the path and name of the current file to the clipboard.
To jump to any symbol used in the current file, select it from the
\gui Symbols drop-down menu. By default, the symbols are displayed in the
order in which they appear in the file. Right-click the menu title and select
\gui {Sort Alphabetically} to arrange the symbols in alphabetic order.
\section1 Splitting the Editor View
......@@ -1438,7 +1443,7 @@
\section1 Renaming Symbols
The functions used to rename symbols depends on whether you are
The functions available for renaming symbols depend on whether you are
writing C++ or QML code. For QML, you can only rename IDs.
To rename a specific symbol in a Qt project:
......@@ -1601,6 +1606,8 @@
The wizards prompt you to enter the settings needed
for that particular type of project and create the necessary files for you.
To display other types of files in the \gui Projects pane, specify them in
the project file.
\image qtcreator-new-project.png
......@@ -1637,6 +1644,25 @@
\image qtcreator-new-project-summary.png
\endlist
\section1 Displaying Additional File Types in Projects Pane
Qt Creator determines whether to display files from the project folder
in the \gui Projects pane depending on the file type (.pro, .pri, .cpp,
.h, .ui, .qrc, and so on). To display other types of files, edit the the
project file. Add filenames as values of the \c {OTHER_FILES} variable.
You can also use wildcards.
For example, the following code specifies that text files are displayed
in the \gui Projects pane:
\code
OTHER_FILES += *.txt
\endcode
This also makes the files available in the \gui Locator.
\section1 Adding New Project Wizards
If you have a team working on a large application or several applications,
......@@ -2818,6 +2844,17 @@
\o In the \gui Properties pane, change the \gui objectName to
\bold batteryLevelBar.
\o Right-click the \gui BatteryIndicator object and select
\gui {Lay Out > Lay Out Horizontally} to ensure that the battery
indicator widget size is adjusted correctly on Maemo devices.
To adjust widget size correctly on Qt Simulator, remove the condition
from the main.cpp file (displayed in the following code snippet) and just
leave the \c {w.showMaximized();} line:
\snippet examples/batteryindicator/main.cpp 0
\endlist
\section1 Completing the Header File
......@@ -3222,6 +3259,12 @@
\image qtcreator-textfinder-ui-widgets.png "Adding widgets to Text Finder UI"
\note To easily locate the widgets, use the search box at the top of the
\gui Sidebar. For example, to find the \gui Label widget, start typing
the word \bold label.
\image qtcreator-texfinder-filter.png "Filter field"
\o Double-click the \gui{Label} widget and enter the text \bold{Keyword}.
\o Double-click the \gui{Push Button} widget and enter the text \bold{Find}.
......@@ -3755,7 +3798,7 @@
\section1 Using the Locator Filters
The \gui Locator allows you to browse not only files, but any items
The locator allows you to browse not only files, but any items
defined by \bold{locator filters}. By default, the locator contains
filters which locate:
\list
......@@ -6478,7 +6521,7 @@
\title Tips and Tricks
\section1 Switching between modes
\section1 Switching Between Modes
Qt Creator uses different modes for different purposes. You can quickly
switch between these modes with the following keyboard shortcuts:
......@@ -6501,6 +6544,12 @@
To quickly move between currently open files, press
\key Ctrl+Tab.
To move forward in the location history, press \key {Alt+Right}
(\key {Cmd+Opt+Right} on Mac OS). To move backward, press \key {Alt+Left}
(\key {Cmd+Opt+Right} on Mac OS). For example, if you use the \gui Locator
to jump to a symbol in the same file, you can jump back to your original
location in that file by pressing \key {Alt+Left}.
\section1 Moving To the Edit Mode
......@@ -6518,10 +6567,34 @@
To find specific settings you require in \gui{Tools} > \gui{Options...}
use the filter located at the top left of the \gui Options dialog box.
\section1 Opening Output Panes
The output panes provide a list of errors and warnings encountered during
a build, detailed output from the compiler, status of a program when it is
executed and debug output, as well as search results.
To open output panes, use the following shortcuts:
\list
\o \gui{Build Issues} pane Alt+1 (Cmd+1 on Mac OS X)
\o \gui{Search Results} pane Alt+2 (Cmd+2 on Mac OS X)
\o \gui{Application Output} pane Alt+3 (Cmd+3 on Mac OS X)
\o \gui{Compile Output} pane Alt+4 (Cmd+4 on Mac OS X)
\endlist
For more information about output panes, see \l{Viewing Output}.
\section1 Using Keyboard Shortcuts
Qt Creator provides \l{Keyboard Shortcuts}{many useful keyboard shortcuts}.
You can see the keyboard shortcut for a menu command in the menu
or the tooltip for a button.
To customize, import or export keyboard shortcuts, select \gui Tools >
\gui Options... > \gui Environment > \gui Keyboard.
......@@ -6556,11 +6629,19 @@
\section1 Moving To Symbols
To move straight to a symbol used in a project, select the symbol in the
\gui Editor toolbar drop-down menu.
For more information on the editor toolbar,
\gui Editor toolbar drop-down menu. For more information on the editor toolbar,
see \l {Using the Editor Toolbar}.
To jump to a symbol in the current file, press \key {Ctrl+K} to open the
\gui Locator, enter a period (.), and start typing the symbol name. Then
select the symbol in the list. For more information on using the locator,
see \l{Searching With the Locator}.
Press \key Ctrl (\key Cmd on Mac OS) and click a symbol to move directly to
the definition or the declaration of the symbol. You can also move the cursor
on the symbol and press \key {F2}. For more information, see
\l{Moving to Symbol Definition or Declaration}.
\section1 Displaying Signals and Slots
......@@ -6574,6 +6655,9 @@
the slot in the \e slots subitem. The objects connected to this slot are
shown as children of the slot. This method works with signals too.
For more information about the \gui{Locals and Watchers} view, see
\l{Locals and Watchers}.
\section1 Displaying Low Level Data
......@@ -6588,6 +6672,19 @@
\o Uncheck the \gui{Use debugging helper} checkbox.
\endlist
\section1 Locating Files
The \gui Locator provides one of the easiest ways in Qt Creator to browse
through projects, files, classes, methods, documentation and file systems.
To quickly access files not directly mentioned in your project, you can
create your own locator filters. That way you can locate files in a
directory structure you have defined.
To create locator filters, select \gui {Tools > Options... > Locator > Add}.
For more information, see \l{Creating Locator Filters}.
*/
......
......@@ -55,7 +55,8 @@ qhp.QtCreator.extraFiles = \
images/page_bg.png \
images/page.png \
images/qt-logo.png \
images/sprites-combined.png
images/sprites-combined.png \
images/bullet_up.png
qhp.QtCreator.subprojects = manual
qhp.QtCreator.subprojects.manual.title = Qt Creator Manual
......
......@@ -604,7 +604,11 @@ def isNull(p):
# for invalid char *, as their "contents" is being examined
#s = str(p)
#return s == "0x0" or s.startswith("0x0 ")
return p.cast(lookupType("void").pointer()) == 0
try:
# Can fail with: "RuntimeError: Cannot access memory at address 0x5"
return p.cast(lookupType("void").pointer()) == 0
except:
return False
movableTypes = set([
"QBrush", "QBitArray", "QByteArray",
......@@ -1045,11 +1049,14 @@ class Dumper:
# Special handling for char** argv.
n = 0
p = item.value
# p is 0 for "optimized out" cases.
if not isNull(p):
while not isNull(p.dereference()) and n <= 100:
p += 1
n += 1
# p is 0 for "optimized out" cases. Or contains rubbish.
try:
if not isNull(p):
while not isNull(p.dereference()) and n <= 100:
p += 1
n += 1
except:
pass
with SubItem(self):
self.put('iname="%s",' % item.iname)
......
......@@ -1042,7 +1042,7 @@ bool BinEditor::event(QEvent *e) {
selEnd = selStart + 1;
byteCount = 1;
}
if (byteCount <= 8) {
if (m_hexCursor && byteCount <= 8) {
const QPoint &startPoint = offsetToPos(selStart);
const QPoint &endPoint = offsetToPos(selEnd);
const QPoint expandedEndPoint
......@@ -1138,14 +1138,25 @@ void BinEditor::keyPressEvent(QKeyEvent *e)
} break;
case Qt::Key_Home:
setCursorPosition((e->modifiers() & Qt::ControlModifier) ?
0 : (m_cursorPosition/16 * 16), moveMode);
if (e->modifiers() & Qt::ControlModifier) {
if (m_inLazyMode)
emit startOfFileRequested(editorInterface());
else
setCursorPosition(0);
} else {
setCursorPosition(m_cursorPosition/16 * 16, moveMode);
}
break;
case Qt::Key_End:
setCursorPosition((e->modifiers() & Qt::ControlModifier) ?
(m_size-1) : (m_cursorPosition/16 * 16 + 15), moveMode);
if (e->modifiers() & Qt::ControlModifier) {
if (m_inLazyMode)
emit endOfFileRequested(editorInterface());
else
setCursorPosition(m_size - 1);
} else {
setCursorPosition(m_cursorPosition/16 * 16 + 15, moveMode);
}
break;
default:
if (m_readOnly)
break;
......@@ -1380,7 +1391,7 @@ void BinEditor::jumpToAddress(quint64 address)
{
if (address >= m_baseAddr && address < m_baseAddr + m_data.size())
setCursorPosition(address - m_baseAddr);
else
else if (m_inLazyMode)
emit newRangeRequested(editorInterface(), address);
}
......@@ -1392,7 +1403,7 @@ void BinEditor::setNewWindowRequestAllowed()
QPoint BinEditor::offsetToPos(int offset)
{
const int x = m_labelWidth + (offset % 16) * m_columnWidth;
const int y = (offset / 16) * m_lineHeight;
const int y = (offset / 16 - verticalScrollBar()->value()) * m_lineHeight;
return QPoint(x, y);
}
......
......@@ -84,7 +84,7 @@ public:
};
int cursorPosition() const;
void setCursorPosition(int pos, MoveMode moveMode = MoveAnchor);
Q_INVOKABLE void setCursorPosition(int pos, MoveMode moveMode = MoveAnchor);
void jumpToAddress(quint64 address);
void setModified(bool);
......@@ -133,6 +133,8 @@ Q_SIGNALS:
void lazyDataRequested(Core::IEditor *editor, quint64 block, bool synchronous);
void newWindowRequested(quint64 address);
void newRangeRequested(Core::IEditor *, quint64 address);
void startOfFileRequested(Core::IEditor *);
void endOfFileRequested(Core::IEditor *);
protected:
void scrollContentsBy(int dx, int dy);
......
......@@ -180,6 +180,10 @@ public:
this, SLOT(provideData(Core::IEditor *, quint64)));
connect(m_editor, SIGNAL(newRangeRequested(Core::IEditor*,quint64)),
this, SLOT(provideNewRange(Core::IEditor*,quint64)));
connect(m_editor, SIGNAL(startOfFileRequested(Core::IEditor*)), this,
SLOT(handleStartOfFileRequested(Core::IEditor*)));
connect(m_editor, SIGNAL(endOfFileRequested(Core::IEditor*)), this,
SLOT(handleEndOfFileRequested(Core::IEditor*)));
}
~BinEditorFile() {}
......@@ -209,7 +213,7 @@ public:
&& file.open(QIODevice::ReadOnly)) {
m_fileName = fileName;
qint64 maxRange = 64 * 1024 * 1024;
if (file.isSequential() && file.size() <= maxRange) {
if (file.size() <= maxRange) {
m_editor->setData(file.readAll());
} else {
m_editor->setLazyData(offset, maxRange);
......@@ -241,6 +245,14 @@ private slots:
open(m_fileName, offset);
}
void handleStartOfFileRequested(Core::IEditor *) {
open(m_fileName, 0);
}
void handleEndOfFileRequested(Core::IEditor *) {
open(m_fileName, QFileInfo(m_fileName).size() - 1);
}
public:
void setFilename(const QString &filename) {
......
......@@ -274,7 +274,7 @@ void EditorToolBar::listContextMenu(QPoint pos)
if (fileName.isEmpty())
return;
QMenu menu;
menu.addAction(tr("Copy full path to clipboard"));
menu.addAction(tr("Copy Full Path to Clipboard"));
if (menu.exec(m_editorList->mapToGlobal(pos))) {
QApplication::clipboard()->setText(QDir::toNativeSeparators(fileName));
}
......
......@@ -689,7 +689,7 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable)
m_methodCombo->setModel(m_proxyModel);
m_methodCombo->setContextMenuPolicy(Qt::ActionsContextMenu);
m_sortAction = new QAction(tr("Sort alphabetically"), m_methodCombo);
m_sortAction = new QAction(tr("Sort Alphabetically"), m_methodCombo);
m_sortAction->setCheckable(true);
m_sortAction->setChecked(sortedMethodOverview());
connect(m_sortAction, SIGNAL(toggled(bool)), CppPlugin::instance(), SLOT(setSortedMethodOverview(bool)));
......
......@@ -50,6 +50,7 @@
#include <utils/qtcassert.h>
#include <QtCore/QDebug>
#include <QtCore/QMetaObject>
#include <QtGui/QMessageBox>
#include <QtGui/QPlainTextEdit>
......@@ -74,6 +75,8 @@ namespace Internal {
it handles communication between the engine and the bineditor.
*/
namespace { const int DataRange = 1024 * 1024; }
MemoryViewAgent::MemoryViewAgent(DebuggerEngine *engine, quint64 addr)
: QObject(engine), m_engine(engine)
{
......@@ -113,11 +116,15 @@ void MemoryViewAgent::createBinEditor(quint64 addr)
connect(editor->widget(),
SIGNAL(newRangeRequested(Core::IEditor *, quint64)), this,
SLOT(provideNewRange(Core::IEditor*,quint64)));
connect(editor->widget(), SIGNAL(startOfFileRequested(Core::IEditor *)),
this, SLOT(handleStartOfFileRequested(Core::IEditor*)));
connect(editor->widget(), SIGNAL(endOfFileRequested(Core::IEditor *)),
this, SLOT(handleEndOfFileRequested(Core::IEditor*)));
m_editors << editor;
editorManager->activateEditor(editor);
QMetaObject::invokeMethod(editor->widget(), "setNewWindowRequestAllowed");
QMetaObject::invokeMethod(editor->widget(), "setLazyData",
Q_ARG(quint64, addr), Q_ARG(int, 1024 * 1024), Q_ARG(int, BinBlockSize));
Q_ARG(quint64, addr), Q_ARG(int, DataRange), Q_ARG(int, BinBlockSize));
} else {
DebuggerPlugin::instance()->showMessageBox(QMessageBox::Warning,
tr("No memory viewer available"),
......@@ -147,10 +154,26 @@ void MemoryViewAgent::addLazyData(QObject *editorToken, quint64 addr,
void MemoryViewAgent::provideNewRange(Core::IEditor *editor, quint64 address)
{
QMetaObject::invokeMethod(editor->widget(), "setLazyData",
Q_ARG(quint64, address), Q_ARG(int, 1024 * 1024),
Q_ARG(quint64, address), Q_ARG(int, DataRange),
Q_ARG(int, BinBlockSize));
}
// Since we are not dealing with files, we take these signals to mean
// "move to start/end of range". This seems to make more sense than
// jumping to the start or end of the address space, respectively.
void MemoryViewAgent::handleStartOfFileRequested(Core::IEditor *editor)
{
QMetaObject::invokeMethod(editor->widget(),
"setCursorPosition", Q_ARG(int, 0));
}
void MemoryViewAgent::handleEndOfFileRequested(Core::IEditor *editor)
{
QMetaObject::invokeMethod(editor->widget(),
"setCursorPosition", Q_ARG(int, DataRange - 1));
}
///////////////////////////////////////////////////////////////////////
//
......
......@@ -63,6 +63,8 @@ private:
Q_SLOT void createBinEditor(quint64 startAddr);
Q_SLOT void fetchLazyData(Core::IEditor *, quint64 block, bool sync);
Q_SLOT void provideNewRange(Core::IEditor *editor, quint64 address);
Q_SLOT void handleStartOfFileRequested(Core::IEditor *editor);
Q_SLOT void handleEndOfFileRequested(Core::IEditor *editor);
QList<QPointer<Core::IEditor> > m_editors;
QPointer<DebuggerEngine> m_engine;
......
......@@ -693,8 +693,8 @@ QString decodeData(const QByteArray &ba, int encoding)
decodedBa[i + 1] = c;
}
//qDebug() << quoteUnprintableLatin1(decodedBa) << "\n\n";
return doubleQuote + QString::fromUcs4(reinterpret_cast<const uint *>
(decodedBa.data()), decodedBa.size() / 4) + doubleQuote;
return doubleQuote + QString::fromUtf16(reinterpret_cast<const ushort *>
(decodedBa.data()), decodedBa.size() / 2) + doubleQuote;
}
}
qDebug() << "ENCODING ERROR: " << encoding;
......
......@@ -232,6 +232,11 @@ struct Column
int logical; // Column on screen.
};
QDebug operator<<(QDebug ts, const Column &col)
{
return ts << "(p: " << col.physical << ", l: " << col.logical << ")";
}
struct CursorPosition
{
// for jump history
......@@ -2035,22 +2040,25 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
m_opcount = m_mvcount;
m_mvcount.clear();
m_submode = DeleteSubMode;
} else if ((input.is('d') || input.is('x')) && isVisualCharMode()) {
leaveVisualMode();
m_submode = DeleteSubMode;
finishMovement();
} else if ((input.is('d') || input.is('x')) && isVisualLineMode()) {
leaveVisualMode();
m_rangemode = RangeLineMode;
yankText(currentRange(), m_register);
removeText(currentRange());
handleStartOfLine();
} else if ((input.is('d') || input.is('x')) && isVisualBlockMode()) {
leaveVisualMode();
m_rangemode = RangeBlockMode;
yankText(currentRange(), m_register);
removeText(currentRange());
setPosition(qMin(position(), anchor()));
} else if ((input.is('d') || input.is('x') || input.isKey(Key_Delete))
&& isVisualMode()) {
if (isVisualCharMode()) {
leaveVisualMode();
m_submode = DeleteSubMode;
finishMovement();
} else if (isVisualLineMode()) {
leaveVisualMode();
m_rangemode = RangeLineMode;
yankText(currentRange(), m_register);
removeText(currentRange());
handleStartOfLine();
} else if (isVisualBlockMode()) {
leaveVisualMode();
m_rangemode = RangeBlockMode;
yankText(currentRange(), m_register);
removeText(currentRange());
setPosition(qMin(position(), anchor()));
}
} else if (input.is('D') && isNoVisualMode()) {
if (atEndOfLine())
moveLeft();
......@@ -2486,6 +2494,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input)
setAnchor();
moveRight(qMin(1, rightDist()));
removeText(currentRange());
if (atEndOfLine())
moveLeft();
} else if (input.isKey(Key_BracketLeft) || input.isKey(Key_BracketRight)) {
} else if (input.isControl(Key_BracketRight)) {
......@@ -2624,11 +2634,11 @@ EventResult FakeVimHandler::Private::handleInsertMode(const Input &input)
if (col.logical <= ind.logical && col.logical
&& startsWithWhitespace(data, col.physical)) {
const int ts = config(ConfigTabStop).toInt();
const int newcol = col.logical - 1 - (col.logical - 1) % ts;
data.remove(0, col.physical);
setLineContents(line, tabExpand(newcol).append(data));
const int newl = col.logical - 1 - (col.logical - 1) % ts;
const QString prefix = tabExpand(newl);
setLineContents(line, prefix + data.mid(col.physical));
moveToStartOfLine();
moveRight(newcol);