diff --git a/doc/doc.pri b/doc/doc.pri index 67428a0389286b8e537161decd222ce3632df0b2..98c6652a4b98a51ffc9aedd30c097aaf6cc4e957 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -23,9 +23,7 @@ qch_docs.files = $$QCH_FILE unix:!macx { system("mkdir -p `dirname $$QCH_FILE` && touch $$QCH_FILE") -} -unix:!macx { qch_docs.path = /share/doc/qtcreator INSTALLS += qch_docs } diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index 5f75cc8997e7ba5380f677e7830794fedda0ea2b..1bf767002b0bcaef5135bdfa468f7cdf31199c73 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -851,6 +851,102 @@ static void qDumpInnerValueOrPointer(QDumper &d, ////////////////////////////////////////////////////////////////////////////// +struct ModelIndex { int r; int c; void *p; void *m; }; + +static void qDumpQAbstractItem(QDumper &d) +{ + ModelIndex mm; + mm.r = mm.c = 0; + mm.p = mm.m = 0; + sscanf(d.templateParameters[0], "%d,%d,%p,%p", &mm.r, &mm.c, &mm.p, &mm.m); + const QModelIndex &mi(*reinterpret_cast<QModelIndex *>(&mm)); + const QAbstractItemModel *m = mi.model(); + const int rowCount = m->rowCount(mi); + if (rowCount < 0) + return; + const int columnCount = m->columnCount(mi); + if (columnCount < 0) + return; + P(d, "type", NS"QAbstractItem"); + P(d, "addr", "$" << mm.r << "," << mm.c << "," << mm.p << "," << mm.m); + //P(d, "value", "(" << rowCount << "," << columnCount << ")"); + P(d, "value", m->data(mi, Qt::DisplayRole).toString()); + P(d, "valueencoded", "2"); + P(d, "numchild", "1"); + if (d.dumpChildren) { + d << ",children=["; + for (int row = 0; row < rowCount; ++row) { + for (int column = 0; column < columnCount; ++column) { + QModelIndex child = m->index(row, column, mi); + d.beginHash(); + P(d, "name", "[" << row << "," << column << "]"); + //P(d, "numchild", (m->hasChildren(child) ? "1" : "0")); + P(d, "numchild", "1"); + P(d, "addr", "$" << child.row() << "," << child.column() << "," + << child.internalPointer() << "," << child.model()); + P(d, "type", NS"QAbstractItem"); + P(d, "value", m->data(mi, Qt::DisplayRole).toString()); + P(d, "valueencoded", "2"); + d.endHash(); + } + } + d.beginHash(); + P(d, "name", "DisplayRole"); + P(d, "numchild", 0); + P(d, "value", m->data(mi, Qt::DisplayRole).toString()); + P(d, "valueencoded", 2); + P(d, "type", NS"QString"); + d.endHash(); + d << "]"; + } + d.disarm(); +} + +static void qDumpQAbstractItemModel(QDumper &d) +{ + const QAbstractItemModel &m = *reinterpret_cast<const QAbstractItemModel *>(d.data); + + const int rowCount = m.rowCount(); + if (rowCount < 0) + return; + const int columnCount = m.columnCount(); + if (columnCount < 0) + return; + + P(d, "type", NS"QAbstractItemModel"); + P(d, "value", "(" << rowCount << "," << columnCount << ")"); + P(d, "numchild", "1"); + if (d.dumpChildren) { + d << ",children=["; + d.beginHash(); + P(d, "numchild", "1"); + P(d, "name", NS"QObject"); + P(d, "addr", d.data); + P(d, "value", m.objectName()); + P(d, "valueencoded", "2"); + P(d, "type", NS"QObject"); + P(d, "displayedtype", m.metaObject()->className()); + d.endHash(); + for (int row = 0; row < rowCount; ++row) { + for (int column = 0; column < columnCount; ++column) { + QModelIndex mi = m.index(row, column); + d.beginHash(); + P(d, "name", "[" << row << "," << column << "]"); + P(d, "value", m.data(mi, Qt::DisplayRole).toString()); + P(d, "valueencoded", "2"); + //P(d, "numchild", (m.hasChildren(mi) ? "1" : "0")); + P(d, "numchild", "1"); + P(d, "addr", "$" << mi.row() << "," << mi.column() << "," + << mi.internalPointer() << "," << mi.model()); + P(d, "type", NS"QAbstractItem"); + d.endHash(); + } + } + d << "]"; + } + d.disarm(); +} + static void qDumpQByteArray(QDumper &d) { const QByteArray &ba = *reinterpret_cast<const QByteArray *>(d.data); @@ -1210,7 +1306,7 @@ static void qDumpQImage(QDumper &d) if (d.dumpChildren) { d << ",children=["; d.beginHash(); - P(d, "name", "key"); + P(d, "name", "data"); P(d, "type", NS "QImageData"); P(d, "addr", d.data); d.endHash(); @@ -2533,7 +2629,8 @@ static void handleProtocolVersion2and3(QDumper & d) d.setupTemplateParameters(); P(d, "iname", d.iname); - P(d, "addr", d.data); + if (d.data) + P(d, "addr", d.data); #ifdef QT_NO_QDATASTREAM if (d.protocolVersion == 3) { @@ -2555,6 +2652,12 @@ static void handleProtocolVersion2and3(QDumper & d) if (isEqual(type, "map")) qDumpStdMap(d); break; + case 'A': + if (isEqual(type, "QAbstractItemModel")) + qDumpQAbstractItemModel(d); + else if (isEqual(type, "QAbstractItem")) + qDumpQAbstractItem(d); + break; case 'B': if (isEqual(type, "QByteArray")) qDumpQByteArray(d); @@ -2715,6 +2818,8 @@ void *qDumpObjectData440( // They are mentioned here nevertheless. For types that are not listed // here, dumpers won't be used. d << "dumpers=[" + "\""NS"QAbstractItem\"," + "\""NS"QAbstractItemModel\"," "\""NS"QByteArray\"," "\""NS"QDateTime\"," "\""NS"QDir\"," @@ -2810,7 +2915,6 @@ void *qDumpObjectData440( d.iname = inbuffer; while (*inbuffer) ++inbuffer; ++inbuffer; d.exp = inbuffer; while (*inbuffer) ++inbuffer; ++inbuffer; d.innertype = inbuffer; while (*inbuffer) ++inbuffer; ++inbuffer; - d.iname = inbuffer; while (*inbuffer) ++inbuffer; ++inbuffer; handleProtocolVersion2and3(d); } diff --git a/src/app/app.pro b/src/app/app.pro index 3bb47607f0edf9d307a0ab06e1327a895b6ecbff..4f29e1f263c89c8f6d7b411843cf3fbb6f53a648 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -5,29 +5,22 @@ TEMPLATE = app TARGET = $$IDE_APP_TARGET DESTDIR = $$IDE_APP_PATH - SOURCES += main.cpp include(../rpath.pri) win32 { - RC_FILE = qtcreator.rc -} - -macx { - ICON = qtcreator.icns - QMAKE_INFO_PLIST = Info.plist -} + CONFIG(debug, debug|release):LIBS *= -lExtensionSystemd -lAggregationd + else:LIBS *= -lExtensionSystem -lAggregation -macx { + RC_FILE = qtcreator.rc +} else:macx { CONFIG(debug, debug|release):LIBS *= -lExtensionSystem_debug -lAggregation_debug else:LIBS *= -lExtensionSystem -lAggregation -} -win32 { - CONFIG(debug, debug|release):LIBS *= -lExtensionSystemd -lAggregationd - else:LIBS *= -lExtensionSystem -lAggregation -} -unix:!macx { + + ICON = qtcreator.icns + QMAKE_INFO_PLIST = Info.plist +} else { LIBS *= -lExtensionSystem -lAggregation target.path = /bin diff --git a/src/app/main.cpp b/src/app/main.cpp index e1800de1f11d822f1a02ff392ea40e858d4573f7..5199c7c7e64e8f2f6185ba0525137a85d6fadebe 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -46,7 +46,7 @@ #include <QtGui/QApplication> #include <QtGui/QMainWindow> -#ifdef Q_OS_DARWIN +#ifdef Q_OS_MAC # include <sys/resource.h> #endif @@ -71,7 +71,7 @@ static const char *CLIENT_OPTION = "-client"; typedef QList<ExtensionSystem::PluginSpec *> PluginSpecSet; // Helpers for displaying messages. Note that there is no console on Windows. -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN // Format as <pre> HTML static inline void toHtml(QString &t) { @@ -204,7 +204,7 @@ static inline QStringList getPluginPaths() int main(int argc, char **argv) { -#ifdef Q_OS_DARWIN +#ifdef Q_OS_MAC // increase the number of file that can be opened in Qt Creator. struct rlimit rl; getrlimit(RLIMIT_NOFILE, &rl); diff --git a/src/libs/utils/abstractprocess.h b/src/libs/utils/abstractprocess.h index b7edcd889ec9cfe20a0184e776306c02b8994928..db24b0ca4e5147de3dc1dd10fd00368d63dc6109 100644 --- a/src/libs/utils/abstractprocess.h +++ b/src/libs/utils/abstractprocess.h @@ -59,7 +59,7 @@ public: //signals: virtual void processError(const QString &error) = 0; -#ifdef Q_WS_WIN +#ifdef Q_OS_WIN // Add PATH and SystemRoot environment variables in case they are missing static QStringList fixWinEnvironment(const QStringList &env); // Quote a Windows command line correctly for the "CreateProcess" API diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index efc49881c98b10d901721a873678af1413425ae9..be494fb5aff8a6fcd7012335e2d20a5d02a640ff 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -44,11 +44,10 @@ #include <QtGui/QToolButton> #include <QtGui/QPushButton> -#ifdef Q_OS_MAC /*static*/ const char * const Core::Utils::PathChooser::browseButtonLabel = +#ifdef Q_WS_MAC QT_TRANSLATE_NOOP("Core::Utils::PathChooser", "Choose..."); #else -/*static*/ const char * const Core::Utils::PathChooser::browseButtonLabel = QT_TRANSLATE_NOOP("Core::Utils::PathChooser", "Browse..."); #endif @@ -128,7 +127,7 @@ PathChooser::~PathChooser() void PathChooser::addButton(const QString &text, QObject *receiver, const char *slotFunc) { -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC QPushButton *button = new QPushButton; #else QToolButton *button = new QToolButton; diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index 3d5cdf2bda874fbf36e663b621c3fd5744854b49..ab1d5239c2c2bf0860c7d34793a8c4c2940932a3 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -86,7 +86,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *) m_toggleAction = new QAction(tr("Toggle Bookmark"), this); Core::Command *cmd = am->registerAction(m_toggleAction, BOOKMARKS_TOGGLE_ACTION, textcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+M"))); #else cmd->setDefaultKeySequence(QKeySequence(tr("Meta+M"))); @@ -116,7 +116,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *) //Previous m_prevAction = new QAction(tr("Previous Bookmark"), this); cmd = am->registerAction(m_prevAction, BOOKMARKS_PREV_ACTION, globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+,"))); #else cmd->setDefaultKeySequence(QKeySequence(tr("Meta+,"))); @@ -126,7 +126,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *) //Next m_nextAction = new QAction(tr("Next Bookmark"), this); cmd = am->registerAction(m_nextAction, BOOKMARKS_NEXT_ACTION, globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+."))); #else cmd->setDefaultKeySequence(QKeySequence(tr("Meta+."))); diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index 608956623e1379d0f14e7250174be0046721299b..304f7cf12f2a57fc4e1ccd6b32e2c0f1c7cda43a 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -361,7 +361,7 @@ Command *ActionManagerPrivate::registerOverridableAction(QAction *action, const baseAction->setEnabled(false); baseAction->setObjectName(id); baseAction->setParent(m_mainWnd); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC baseAction->setIconVisibleInMenu(false); #endif a->setAction(baseAction); diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index f36875126c088795b280bb0188813b799c3cc136..0b9d77bf23b02a3b66c2ac596fd6bce012adef84 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -170,9 +170,11 @@ FORMS += dialogs/newdialog.ui \ welcomemode.ui RESOURCES += core.qrc \ fancyactionbar.qrc -linux-* { + +unix:!macx { images.files = images/qtcreator_logo_*.png images.path = /share/pixmaps INSTALLS += images } + OTHER_FILES += Core.pluginspec diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index e4edc05d2beb59c958c48c22c4a565619496b39a..364098b63bb16d03dbe7ad33e754fc888145d840 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -344,7 +344,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : m_d->m_splitAction = new QAction(tr("Split"), this); cmd = am->registerAction(m_d->m_splitAction, Constants::SPLIT, editManagerContext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,2"))); #endif mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); @@ -352,7 +352,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : m_d->m_splitSideBySideAction = new QAction(tr("Split Side by Side"), this); cmd = am->registerAction(m_d->m_splitSideBySideAction, Constants::SPLIT_SIDE_BY_SIDE, editManagerContext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,3"))); #endif mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); @@ -360,7 +360,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : m_d->m_removeCurrentSplitAction = new QAction(tr("Remove Current Split"), this); cmd = am->registerAction(m_d->m_removeCurrentSplitAction, Constants::REMOVE_CURRENT_SPLIT, editManagerContext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,0"))); #endif mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); @@ -368,7 +368,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : m_d->m_removeAllSplitsAction = new QAction(tr("Remove All Splits"), this); cmd = am->registerAction(m_d->m_removeAllSplitsAction, Constants::REMOVE_ALL_SPLITS, editManagerContext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,1"))); #endif mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); @@ -376,7 +376,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : m_d->m_gotoOtherSplitAction = new QAction(tr("Goto Other Split"), this); cmd = am->registerAction(m_d->m_gotoOtherSplitAction, Constants::GOTO_OTHER_SPLIT, editManagerContext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,o"))); #endif mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT); diff --git a/src/plugins/coreplugin/fancyactionbar.cpp b/src/plugins/coreplugin/fancyactionbar.cpp index b14491ae726b01660d791afaabfe76b1e83a1f4e..318cf82ff3a5dcca269bde703db25db522c51593 100644 --- a/src/plugins/coreplugin/fancyactionbar.cpp +++ b/src/plugins/coreplugin/fancyactionbar.cpp @@ -85,7 +85,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event) QPainter p(this); p.drawPicture(0, 0, m_buttonElements.value(svgIdButtonBase)); p.drawPicture(0, 0, m_buttonElements.value(isDown() ? svgIdButtonPressedBase : svgIdButtonNormalBase)); -#ifndef Q_WS_MAC // Mac UI's dont usually do hover +#ifndef Q_WS_MAC // Mac UIs usually don't hover if (underMouse() && isEnabled()) p.drawPicture(0, 0, m_buttonElements.value(svgIdButtonHoverOverlay)); #endif diff --git a/src/plugins/coreplugin/fileiconprovider.cpp b/src/plugins/coreplugin/fileiconprovider.cpp index b5926a951ebb0fbb3bc63239c8872f488440ebed..34a58d574400930e66f131f92ea5ccfaec4e5813 100644 --- a/src/plugins/coreplugin/fileiconprovider.cpp +++ b/src/plugins/coreplugin/fileiconprovider.cpp @@ -70,7 +70,7 @@ QIcon FileIconProvider::icon(const QFileInfo &fileInfo) // Disabled since for now we'll make sure that all icons fit with our // own custom icons by returning an empty one if we don't know it. -#ifdef Q_OS_WIN +#ifdef Q_WS_WIN // This is incorrect if the OS does not always return the same icon for the // same suffix (Mac OS X), but should speed up the retrieval a lot ... icon = m_systemIconProvider.icon(fileInfo); @@ -123,7 +123,7 @@ void FileIconProvider::registerIconOverlayForSuffix(const QIcon &icon, const QSt QIcon FileIconProvider::iconForSuffix(const QString &suffix) const { QIcon icon; -#ifndef Q_OS_WIN // On windows we use the file system icons +#ifndef Q_WS_WIN // On windows we use the file system icons if (suffix.isEmpty()) return icon; diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 07ff1132942d1e89c3d634dfe263438db15c69c2..3520bd0cd88a6db252820867aef01927f18b63c1 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -144,7 +144,7 @@ MainWindow::MainWindow() : m_optionsAction(0), m_toggleSideBarAction(0), m_toggleFullScreenAction(0), -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC m_minimizeAction(0), m_zoomAction(0), #endif @@ -153,7 +153,7 @@ MainWindow::MainWindow() : OutputPaneManager::create(); setWindowTitle(tr("Qt Creator")); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC qApp->setWindowIcon(QIcon(":/core/images/qtcreator_logo_128.png")); #endif QCoreApplication::setApplicationName(QLatin1String("QtCreator")); @@ -597,7 +597,7 @@ void MainWindow::registerDefaultActions() // Save As Action tmpaction = new QAction(tr("Save &As..."), this); cmd = am->registerAction(tmpaction, Constants::SAVEAS, m_globalContext); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S"))); #endif cmd->setAttribute(Command::CA_UpdateText); @@ -607,7 +607,7 @@ void MainWindow::registerDefaultActions() // SaveAll Action m_saveAllAction = new QAction(tr("Save A&ll"), this); cmd = am->registerAction(m_saveAllAction, Constants::SAVEALL, m_globalContext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S"))); #endif mfile->addAction(cmd, Constants::G_FILE_SAVE); @@ -681,13 +681,13 @@ void MainWindow::registerDefaultActions() // Options Action m_optionsAction = new QAction(tr("&Options..."), this); cmd = am->registerAction(m_optionsAction, Constants::OPTIONS, m_globalContext); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence("Ctrl+,")); #endif mtools->addAction(cmd, Constants::G_DEFAULT_THREE); connect(m_optionsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog())); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC // Minimize Action m_minimizeAction = new QAction(tr("Minimize"), this); cmd = am->registerAction(m_minimizeAction, Constants::MINIMIZE_WINDOW, m_globalContext); @@ -711,7 +711,7 @@ void MainWindow::registerDefaultActions() tr("Show Sidebar"), this); m_toggleSideBarAction->setCheckable(true); cmd = am->registerAction(m_toggleSideBarAction, Constants::TOGGLE_SIDEBAR, m_globalContext); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence("Ctrl+0")); #else cmd->setDefaultKeySequence(QKeySequence("Alt+0")); @@ -721,7 +721,7 @@ void MainWindow::registerDefaultActions() mwindow->addAction(cmd, Constants::G_WINDOW_PANES); m_toggleSideBarAction->setEnabled(false); -#if !defined(Q_OS_MAC) +#ifndef Q_WS_MAC // Full Screen Action m_toggleFullScreenAction = new QAction(tr("Full Screen"), this); m_toggleFullScreenAction->setCheckable(true); @@ -732,7 +732,7 @@ void MainWindow::registerDefaultActions() #endif // About IDE Action -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC tmpaction = new QAction(tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu #else tmpaction = new QAction(tr("About &Qt Creator..."), this); @@ -746,7 +746,7 @@ void MainWindow::registerDefaultActions() cmd = am->registerAction(tmpaction, Constants::ABOUT_PLUGINS, m_globalContext); mhelp->addAction(cmd, Constants::G_HELP_ABOUT); tmpaction->setEnabled(true); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); #endif connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins())); @@ -1022,7 +1022,7 @@ void MainWindow::changeEvent(QEvent *e) emit windowActivated(); } } else if (e->type() == QEvent::WindowStateChange) { -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC bool minimized = isMinimized(); if (debugMainWindow) qDebug() << "main window state changed to minimized=" << minimized; diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 7886d7795d1c311ab285ef6124f834e671faa835..997a0c26d9e97bc77eaf7d2e12cf7b33632759b6 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -208,7 +208,7 @@ private: QAction *m_optionsAction; QAction *m_toggleSideBarAction; QAction *m_toggleFullScreenAction; -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC QAction *m_minimizeAction; QAction *m_zoomAction; #endif diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index f54a9378a6b3455ce01c56424bad84c202a59d20..d514aa0022de33a40f43ae85b11e888d1916661f 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -147,7 +147,7 @@ void ModeManager::objectAdded(QObject *obj) m_modeShortcuts.insert(index, cmd); connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip())); for (int i = 0; i < m_modeShortcuts.size(); ++i) { -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC m_modeShortcuts.at(i)->setDefaultKeySequence(QKeySequence(QString("Meta+%1").arg(i+1))); #else m_modeShortcuts.at(i)->setDefaultKeySequence(QKeySequence(QString("Ctrl+%1").arg(i+1))); diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index 091d19c2510a272003b36721a274cc0b1c3846b6..d93abca335e46fc2a752425710fccfd9f94ec517 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -363,7 +363,7 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget) m_navigationComboBox = new NavComboBox(this); m_navigationWidget = 0; -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC // this is to avoid ugly tool bar behavior m_navigationComboBox->setMaximumWidth(130); #endif diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index 685327c55927f0849072e90d45f89d15d19d1a1c..ba27f6771afdb1fa9aa76eb83cf32b2a5beb6481 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -207,7 +207,7 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) : m_buttonsWidget = new QWidget; m_buttonsWidget->setLayout(new QHBoxLayout); m_buttonsWidget->layout()->setContentsMargins(5,0,0,0); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC m_buttonsWidget->layout()->setSpacing(16); #else m_buttonsWidget->layout()->setSpacing(4); @@ -299,7 +299,7 @@ void OutputPaneManager::init() Command *cmd = am->registerAction(action, actionId, QList<int>() << Constants::C_GLOBAL_ID); if (outPane->priorityInStatusBar() != -1) { -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC cmd->setDefaultKeySequence(QKeySequence(paneShortCut(Qt::CTRL, shortcutNumber))); #else cmd->setDefaultKeySequence(QKeySequence(paneShortCut(Qt::ALT, shortcutNumber))); @@ -567,7 +567,7 @@ OutputPaneToggleButton::OutputPaneToggleButton(int number, const QString &text, "QPushButton { border-image: url(:/core/images/panel_button.png) 2 2 2 19;" " border-width: 2px 2px 2px 19px; padding-left: -17; padding-right: 4 } " "QPushButton:checked { border-image: url(:/core/images/panel_button_checked.png) 2 2 2 19 } " -#ifndef Q_WS_MAC // Mac UI's dont usually do hover +#ifndef Q_WS_MAC // Mac UIs usually don't hover "QPushButton:checked:hover { border-image: url(:/core/images/panel_button_checked_hover.png) 2 2 2 19 } " "QPushButton:pressed:hover { border-image: url(:/core/images/panel_button_pressed.png) 2 2 2 19 } " "QPushButton:hover { border-image: url(:/core/images/panel_button_hover.png) 2 2 2 19 } " diff --git a/src/plugins/coreplugin/stylehelper.cpp b/src/plugins/coreplugin/stylehelper.cpp index b46f751e009da3662996a643b055711597532c38..42ca012cf31f78f98e46c5615dd45a3068437e34 100644 --- a/src/plugins/coreplugin/stylehelper.cpp +++ b/src/plugins/coreplugin/stylehelper.cpp @@ -50,7 +50,7 @@ static int range(float x, int min, int max) qreal StyleHelper::sidebarFontSize() { -#if defined(Q_OS_MAC) +#if defined(Q_WS_MAC) return 9; #else return 7.5; diff --git a/src/plugins/coreplugin/welcomemode.cpp b/src/plugins/coreplugin/welcomemode.cpp index 4234b600d38b01867de213ea5e7950064e035114..74a8def7b07163626116ef77d00838400f7b9c0a 100644 --- a/src/plugins/coreplugin/welcomemode.cpp +++ b/src/plugins/coreplugin/welcomemode.cpp @@ -136,6 +136,8 @@ WelcomeMode::WelcomeMode() : m_d->ui.sitesTreeWidget->viewport()->setAutoFillBackground(false); m_d->ui.tutorialTreeWidget->viewport()->setAutoFillBackground(false); m_d->ui.didYouKnowTextBrowser->viewport()->setAutoFillBackground(false); + m_d->ui.helpUsLabel->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_d->ui.feedbackButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); l->addWidget(m_d->m_welcomePage); updateWelcomePage(WelcomePageData()); @@ -206,6 +208,7 @@ WelcomeMode::~WelcomeMode() { QSettings *settings = ICore::instance()->settings(); settings->setValue("General/WelcomeTab", m_d->btnGrp->checkedId()); + delete m_d->m_widget; delete m_d; } diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 6af357ca8057c24a39b3f384969fe4e3728a9ae0..f407e1b100028c49b2602ae30bb36d03b545a75f 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -100,7 +100,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m m_postAction = new QAction(tr("Paste Snippet..."), this); command = actionManager->registerAction(m_postAction, "CodePaster.Post", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+P"))); #endif connect(m_postAction, SIGNAL(triggered()), this, SLOT(post())); @@ -108,7 +108,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m m_fetchAction = new QAction(tr("Fetch Snippet..."), this); command = actionManager->registerAction(m_fetchAction, "CodePaster.Fetch", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+F"))); #endif connect(m_fetchAction, SIGNAL(triggered()), this, SLOT(fetch())); diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 384058685b5588ecc7518d75cfa83dcb7269fde1..d69d683f819a6fb39b0416d0ed6a2e6974f98988 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -405,7 +405,7 @@ void FunctionArgumentWidget::updateHintText() m_popupFrame->setFixedWidth(m_popupFrame->minimumSizeHint().width()); const QDesktopWidget *desktop = QApplication::desktop(); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC const QRect screen = desktop->availableGeometry(desktop->screenNumber(m_editor->widget())); #else const QRect screen = desktop->screenGeometry(desktop->screenNumber(m_editor->widget())); diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index b65981957bfeacfb9fd8a5fa098f5a7ee946fdff..c6a11a26d62d0a87bf4ab7e6e31cada654ceb6e1 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -43,11 +43,10 @@ namespace Internal { class DebuggerSettings : public QObject { Q_OBJECT - public: DebuggerSettings(QObject *parent = 0); ~DebuggerSettings(); - + void insertItem(int code, Core::Utils::SavedAction *item); Core::Utils::SavedAction *item(int code) const; diff --git a/src/plugins/debugger/debuggeroutputwindow.cpp b/src/plugins/debugger/debuggeroutputwindow.cpp index d50536e7ca5bff496c338c8da6564b1045245af3..9c51a5300c78785dd3117ac4c8e89b01736428bc 100644 --- a/src/plugins/debugger/debuggeroutputwindow.cpp +++ b/src/plugins/debugger/debuggeroutputwindow.cpp @@ -252,8 +252,8 @@ void DebuggerOutputWindow::showOutput(const QString &prefix, const QString &outp foreach (QString line, output.split("\n")) { // FIXME: QTextEdit asserts on really long lines... const int n = 3000; - //if (line.size() > n) - // line = line.left(n) + " [...] <cut off>"; + if (line.size() > n) + line = line.left(n) + " [...] <cut off>"; m_combinedText->appendPlainText(prefix + line); } QTextCursor cursor = m_combinedText->textCursor(); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 4c09fe9d1d0442061e3dc14308653d3cd735cb9e..60db690d214b31fe662f6ff77f0f520f8a426af2 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -112,7 +112,7 @@ const char * const BREAK_BY_FUNCTION = "Debugger.BreakByFunction"; const char * const BREAK_AT_MAIN = "Debugger.BreakAtMain"; const char * const ADD_TO_WATCH = "Debugger.AddToWatch"; -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC const char * const INTERRUPT_KEY = "Shift+F5"; const char * const RESET_KEY = "Ctrl+Shift+F5"; const char * const STEP_KEY = "F7"; @@ -418,6 +418,7 @@ void DebuggerPlugin::shutdown() m_manager->shutdown(); writeSettings(); + delete DebuggerSettings::instance(); //qDebug() << "DebuggerPlugin::~DebuggerPlugin"; removeObject(m_debugMode); @@ -1135,7 +1136,7 @@ void DebuggerPlugin::readSettings() DebuggerSettings::instance()->readSettings(s); QString defaultCommand("gdb"); -#if defined(Q_OS_WIN32) +#ifdef Q_OS_WIN defaultCommand.append(".exe"); #endif //QString defaultScript = ICore::instance()->resourcePath() + diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 5d587788485f2efcfeb63e68fed5e9bf90919679..9b0ae33cf80741490a13e3c191db4ab8ca60c7bb 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -72,7 +72,7 @@ # include "shared/sharedlibraryinjector.h" #endif -#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) +#ifdef Q_OS_UNIX #include <unistd.h> #include <dlfcn.h> #endif @@ -826,12 +826,10 @@ void GdbEngine::handleInfoThreads(const GdbResultRecord &record, const QVariant void GdbEngine::handleInfoProc(const GdbResultRecord &record, const QVariant &) { if (record.resultClass == GdbResultDone) { - #if defined(Q_OS_MAC) + #ifdef Q_OS_MAC //^done,process-id="85075" maybeHandleInferiorPidChanged(_(record.data.findChild("process-id").data())); - #endif - - #if defined(Q_OS_LINUX) || defined(Q_OS_WIN) + #else // FIXME: use something more robust QRegExp re(__("process (\\d+)")); QString data = __(record.data.findChild("consolestreamoutput").data()); @@ -919,14 +917,12 @@ static bool isStoppedReason(const QByteArray &reason) void GdbEngine::handleAqcuiredInferior() { - #if defined(Q_OS_WIN) + #ifdef Q_OS_WIN postCommand(_("info thread"), CB(handleInfoThreads)); - #endif - #if defined(Q_OS_LINUX) - postCommand(_("info proc"), CB(handleInfoProc)); - #endif - #if defined(Q_OS_MAC) + #elif defined(Q_OS_MAC) postCommand(_("info pid"), NeedsStop, CB(handleInfoProc)); + #else + postCommand(_("info proc"), CB(handleInfoProc)); #endif if (theDebuggerBoolSetting(ListSourceFiles)) reloadSourceFiles(); @@ -1883,22 +1879,20 @@ void GdbEngine::sendInsertBreakpoint(int index) // set up fallback in case of pending breakpoints which aren't handled // by the MI interface -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) - QString cmd = _("-break-insert -f "); +#if defined(Q_OS_WIN) + QString cmd = _("-break-insert "); //if (!data->condition.isEmpty()) - // cmd += _("-c ") + data->condition + ' '; + // cmd += "-c " + data->condition + " "; cmd += where; -#endif -#if defined(Q_OS_MAC) +#elif defined(Q_OS_MAC) QString cmd = _("-break-insert -l -1 "); //if (!data->condition.isEmpty()) // cmd += "-c " + data->condition + " "; cmd += where; -#endif -#if defined(Q_OS_WIN) - QString cmd = _("-break-insert "); +#else + QString cmd = _("-break-insert -f "); //if (!data->condition.isEmpty()) - // cmd += "-c " + data->condition + " "; + // cmd += _("-c ") + data->condition + ' '; cmd += where; #endif debugMessage(_("Current state: %1").arg(q->status())); @@ -2039,24 +2033,22 @@ void GdbEngine::handleBreakInsert(const GdbResultRecord &record, const QVariant const BreakpointData *data = handler->at(index); // Note that it is perfectly correct that the file name is put // in quotes but not escaped. GDB simply is like that. -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) - //QString where = "\"\\\"" + data->fileName + "\\\":" - // + data->lineNumber + "\""; - QString where = _c('"') + data->fileName + _("\":") - + data->lineNumber; - // Should not happen with -break-insert -f. gdb older than 6.8? - QTC_ASSERT(false, /**/); -#endif -#if defined(Q_OS_MAC) +#if defined(Q_OS_WIN) QFileInfo fi(data->fileName); QString where = _c('"') + fi.fileName() + _("\":") + data->lineNumber; -#endif -#if defined(Q_OS_WIN) + //QString where = m_data->fileName + _c(':') + data->lineNumber; +#elif defined(Q_OS_MAC) QFileInfo fi(data->fileName); QString where = _c('"') + fi.fileName() + _("\":") + data->lineNumber; - //QString where = m_data->fileName + _c(':') + data->lineNumber; +#else + //QString where = "\"\\\"" + data->fileName + "\\\":" + // + data->lineNumber + "\""; + QString where = _c('"') + data->fileName + _("\":") + + data->lineNumber; + // Should not happen with -break-insert -f. gdb older than 6.8? + QTC_ASSERT(false, /**/); #endif postCommand(_("break ") + where, CB(handleBreakInsert1), index); } @@ -2779,7 +2771,6 @@ static void setWatchDataEditValue(WatchData &data, const GdbMi &mi) static void setWatchDataValueToolTip(WatchData &data, const GdbMi &mi, int encoding = 0) { - qDebug() << "TOOLTIP: " << mi.data().size() << "ENC:" << encoding; if (mi.isValid()) data.setValueToolTip(decodeData(mi.data(), encoding)); } @@ -2814,7 +2805,7 @@ static void setWatchDataAddress(WatchData &data, const GdbMi &mi) { if (mi.isValid()) { data.addr = _(mi.data()); - if (data.exp.isEmpty()) + if (data.exp.isEmpty() && !data.addr.startsWith(_("$"))) data.exp = _("(*(") + gdbQuoteTypes(data.type) + _("*)") + data.addr + _c(')'); } } @@ -2886,7 +2877,6 @@ void GdbEngine::runDebuggingHelper(const WatchData &data0, bool dumpChildren) return; } WatchData data = data0; - QTC_ASSERT(!data.exp.isEmpty(), return); QByteArray params; QStringList extraArgs; @@ -2901,6 +2891,8 @@ void GdbEngine::runDebuggingHelper(const WatchData &data0, bool dumpChildren) QString addr; if (data.addr.startsWith(__("0x"))) addr = _("(void*)") + data.addr; + else if (data.exp.isEmpty()) // happens e.g. for QAbstractItem + addr = _("0"); else addr = _("&(") + data.exp + _c(')'); @@ -3208,6 +3200,9 @@ void GdbEngine::sendWatchParameters(const QByteArray ¶ms0) } encoded[encoded.size() - 1] = '}'; + params.replace('\0','!'); + emit gdbInputAvailable(QString(), QString::fromUtf8(params)); + postCommand(_(encoded)); } diff --git a/src/plugins/debugger/stackwindow.cpp b/src/plugins/debugger/stackwindow.cpp index e51c27ac6d311fd66ab6287fcfc7e8004e7bcbc7..9354dda80680582f622e5fffb3cf1ba42992b203 100644 --- a/src/plugins/debugger/stackwindow.cpp +++ b/src/plugins/debugger/stackwindow.cpp @@ -133,7 +133,7 @@ void StackWindow::copyContentsToClipboard() str += '\n'; } QClipboard *clipboard = QApplication::clipboard(); - #ifdef Q_OS_LINUX + #ifdef Q_WS_X11 clipboard->setText(str, QClipboard::Selection); #endif clipboard->setText(str, QClipboard::Clipboard); diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp index f074ee2ddc1a121cb62495944cc562042ce71666..887d0c7fa894c98cc870a3521a78fe0ef31373c5 100644 --- a/src/plugins/debugger/watchutils.cpp +++ b/src/plugins/debugger/watchutils.cpp @@ -658,6 +658,7 @@ QtDumperHelper::Type QtDumperHelper::specialType(QString s) if (s.startsWith(QLatin1String("std::"))) return stdType(s.mid(5)); // Strip namespace + // FIXME: that's not a good idea as it makes all namespaces equal. const int namespaceIndex = s.lastIndexOf(QLatin1String("::")); if (namespaceIndex == -1) { // None ... check for std.. @@ -665,7 +666,7 @@ QtDumperHelper::Type QtDumperHelper::specialType(QString s) if (sType != UnknownType) return sType; } else { - s.remove(namespaceIndex + 2); + s = s.mid(namespaceIndex + 2); } if (s == QLatin1String("QObject")) return QObjectType; @@ -677,6 +678,8 @@ QtDumperHelper::Type QtDumperHelper::specialType(QString s) return QObjectSignalType; if (s == QLatin1String("QVector")) return QVectorType; + if (s == QLatin1String("QAbstractItem")) + return QAbstractItemType; if (s == QLatin1String("QMap")) return QMapType; if (s == QLatin1String("QMultiMap")) @@ -689,6 +692,7 @@ QtDumperHelper::Type QtDumperHelper::specialType(QString s) bool QtDumperHelper::needsExpressionSyntax(Type t) { switch (t) { + case QAbstractItemType: case QObjectSlotType: case QObjectSignalType: case QMapType: @@ -1058,6 +1062,7 @@ void QtDumperHelper::addSize(const QString &name, int size) break; } if (name == QLatin1String("std::wstring")) { + // FIXME: check space between > > below? m_sizeCache.insert(QLatin1String("std::basic_string<unsigned short,std::char_traits<unsignedshort>,std::allocator<unsignedshort> >"), size); break; } @@ -1078,7 +1083,7 @@ QtDumperHelper::TypeData QtDumperHelper::typeData(const QString &typeName) const const Type st = simpleType(typeName); if (st != UnknownType) { td.isTemplate = false; - td.type =st; + td.type = st; return td; } // Try template @@ -1129,6 +1134,8 @@ void QtDumperHelper::evaluationParameters(const WatchData &data, if (outertype == m_qtNamespace + QLatin1String("QWidget")) outertype = m_qtNamespace + QLatin1String("QObject"); + QString inner = td.inner; + extraArgs.clear(); if (!inners.empty()) { @@ -1147,6 +1154,9 @@ void QtDumperHelper::evaluationParameters(const WatchData &data, // in rare cases we need more or less: switch (td.type) { + case QAbstractItemType: + inner = data.addr.mid(1); + break; case QObjectType: case QWidgetType: if (debugger == GdbDebugger) { @@ -1258,9 +1268,7 @@ void QtDumperHelper::evaluationParameters(const WatchData &data, inBuffer->append('\0'); inBuffer->append(data.exp.toUtf8()); inBuffer->append('\0'); - inBuffer->append(td.inner.toUtf8()); - inBuffer->append('\0'); - inBuffer->append(data.iname.toUtf8()); + inBuffer->append(inner.toUtf8()); inBuffer->append('\0'); if (debug) diff --git a/src/plugins/debugger/watchutils.h b/src/plugins/debugger/watchutils.h index e87b3cd8221bc0391f88b1f26f083c6f63363fe8..2b8ef865baf2e7d1d5f5de1abe33d9884bb4fecf 100644 --- a/src/plugins/debugger/watchutils.h +++ b/src/plugins/debugger/watchutils.h @@ -145,6 +145,7 @@ public: UnknownType, SupportedType, // A type that requires no special handling by the dumper // Below types require special handling + QAbstractItemType, QObjectType, QWidgetType, QObjectSlotType, QObjectSignalType, QVectorType, QMapType, QMultiMapType, QMapNodeType, StdVectorType, StdDequeType, StdSetType, StdMapType, StdStackType, diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h index 45b3f9fb059240ac208e2fa4b5c9a4a734658f75..43ec20ed7a07f4b868907c5273059294bd7c9712 100644 --- a/src/plugins/fakevim/fakevimactions.h +++ b/src/plugins/fakevim/fakevimactions.h @@ -66,7 +66,6 @@ class FakeVimSettings : public QObject public: FakeVimSettings(); ~FakeVimSettings(); - void insertItem(int code, Core::Utils::SavedAction *item, const QString &longname = QString(), const QString &shortname = QString()); @@ -77,7 +76,7 @@ public: void readSettings(QSettings *settings); void writeSettings(QSettings *settings); -public: +private: QHash<int, Core::Utils::SavedAction *> m_items; QHash<QString, int> m_nameToCode; QHash<int, QString> m_codeToName; diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index fb3c3b15c4932fe3aec3194d847a08b2909c55e3..7f28665f491cb2f84df5e3ad2d437aa4972b05f2 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -86,7 +86,7 @@ //#define DEBUG_UNDO 1 #if DEBUG_UNDO -# define UNDO_DEBUG(s) qDebug() << s +# define UNDO_DEBUG(s) qDebug() << << m_tc.document()->revision() << s #else # define UNDO_DEBUG(s) #endif @@ -172,26 +172,6 @@ enum MoveType MoveLineWise, }; -struct EditOperation -{ - EditOperation() : position(-1), itemCount(0) {} - int position; - int itemCount; // used to combine several operations - QString from; - QString to; -}; - -QDebug &operator<<(QDebug &ts, const EditOperation &op) -{ - if (op.itemCount > 0) { - ts << "\n EDIT BLOCK WITH " << op.itemCount << " ITEMS"; - } else { - ts << "\n EDIT AT " << op.position - << " FROM " << op.from << " TO " << op.to; - } - return ts; -} - QDebug &operator<<(QDebug &ts, const QList<QTextEdit::ExtraSelection> &sels) { foreach (QTextEdit::ExtraSelection sel, sels) @@ -212,8 +192,6 @@ enum EventResult EventPassedToCore }; -class UndoBreaker; - class FakeVimHandler::Private { public: @@ -229,7 +207,6 @@ public: void restoreWidget(); friend class FakeVimHandler; - friend class UndoBreaker; static int shift(int key) { return key + 32; } static int control(int key) { return key + 256; } @@ -310,6 +287,9 @@ public: QWidget *editor() const; QChar characterAtCursor() const { return m_tc.document()->characterAt(m_tc.position()); } + void beginEditBlock() { UNDO_DEBUG("BEGIN EDIT BLOCK"); m_tc.beginEditBlock(); } + void endEditBlock() { UNDO_DEBUG("END EDIT BLOCK"); m_tc.endEditBlock(); } + void joinPreviousEditBlock() { UNDO_DEBUG("JOIN EDIT BLOCK"); m_tc.joinPreviousEditBlock(); } public: QTextEdit *m_textedit; @@ -354,7 +334,6 @@ public: void undo(); void redo(); QMap<int, int> m_undoCursorPosition; // revision -> position - bool m_needMoreUndo; // extra data for '.' void replay(const QString &text, int count); @@ -519,12 +498,12 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev) } m_undoCursorPosition[m_tc.document()->revision()] = m_tc.position(); - if (m_mode == InsertMode) - m_tc.joinPreviousEditBlock(); - else - m_tc.beginEditBlock(); + //if (m_mode == InsertMode) + // joinPreviousEditBlock(); + //else + // beginEditBlock(); EventResult result = handleKey(key, um, ev->text()); - m_tc.endEditBlock(); + //endEditBlock(); // We fake vi-style end-of-line behaviour m_fakeEnd = (atEndOfLine() && m_mode == CommandMode); @@ -957,19 +936,20 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, .arg(QChar(m_semicolonType)) .arg(QChar(m_semicolonKey))); } else if (m_submode == ReplaceSubMode) { - if (count() < rightDist() && text.size() == 1 + if (count() <= (rightDist() + atEndOfLine()) && text.size() == 1 && (text.at(0).isPrint() || text.at(0).isSpace())) { + if (atEndOfLine()) + moveLeft(); setAnchor(); moveRight(count()); - removeSelectedText(); + QString rem = removeSelectedText(); m_tc.insertText(QString(count(), text.at(0))); m_moveType = MoveExclusive; - m_submode = NoSubMode; setDotCommand("%1r" + text, count()); - finishMovement(); - } else { - m_submode = NoSubMode; } + setTargetColumn(); + m_submode = NoSubMode; + finishMovement(); } else if (m_subsubmode == MarkSubSubMode) { m_marks[key] = m_tc.position(); m_subsubmode = NoSubSubMode; @@ -1911,7 +1891,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) if (flags.contains('i')) pattern.setCaseSensitivity(Qt::CaseInsensitive); const bool global = flags.contains('g'); - m_tc.beginEditBlock(); + beginEditBlock(); for (int line = beginLine; line <= endLine; ++line) { const int start = firstPositionInLine(line); const int end = lastPositionInLine(line); @@ -1937,7 +1917,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) break; } } - m_tc.endEditBlock(); + endEditBlock(); enterCommandMode(); } else if (reSet.indexIn(cmd) != -1) { // :set showBlackMessage(QString()); @@ -2410,12 +2390,9 @@ QWidget *FakeVimHandler::Private::editor() const void FakeVimHandler::Private::undo() { int current = m_tc.document()->revision(); - m_tc.endEditBlock(); - m_needMoreUndo = false; + //endEditBlock(); EDITOR(undo()); - if (m_needMoreUndo) - EDITOR(undo()); - m_tc.beginEditBlock(); + //beginEditBlock(); int rev = m_tc.document()->revision(); if (current == rev) showBlackMessage(tr("Already at oldest change")); @@ -2428,12 +2405,9 @@ void FakeVimHandler::Private::undo() void FakeVimHandler::Private::redo() { int current = m_tc.document()->revision(); - m_tc.endEditBlock(); - m_needMoreUndo = false; + //endEditBlock(); EDITOR(redo()); - if (m_needMoreUndo) - EDITOR(redo()); - m_tc.beginEditBlock(); + //beginEditBlock(); int rev = m_tc.document()->revision(); if (rev == current) showBlackMessage(tr("Already at newest change")); @@ -2486,21 +2460,11 @@ void FakeVimHandler::Private::recordJump() UNDO_DEBUG("jumps: " << m_jumpListUndo); } -class UndoBreaker : public QAbstractUndoItem -{ -public: - UndoBreaker(FakeVimHandler::Private *doc) : m_doc(doc) {} - void undo() { m_doc->m_needMoreUndo = true; } - void redo() { m_doc->m_needMoreUndo = true; } -private: - FakeVimHandler::Private *m_doc; -}; - void FakeVimHandler::Private::recordNewUndo() { - m_tc.endEditBlock(); - m_tc.document()->appendUndoItem(new UndoBreaker(this)); - m_tc.beginEditBlock(); + //endEditBlock(); + UNDO_DEBUG("---- BREAK ----"); + //beginEditBlock(); } void FakeVimHandler::Private::insertAutomaticIndentation(bool goingDown) diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 50bdb9dd9d8d3928fb34b6797d66ce5b055624fb..1910b4905b918509446f32522509140824680430 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -280,6 +280,7 @@ void FakeVimPluginPrivate::shutdown() delete m_fakeVimOptionsPage; m_fakeVimOptionsPage = 0; theFakeVimSettings()->writeSettings(Core::ICore::instance()->settings()); + delete theFakeVimSettings(); } bool FakeVimPluginPrivate::initialize() diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp index 313d229ceb869d7f4bf30df3c825c1f60a0472eb..2dff2fdc37896b4fcefdee9fc6b2f89bae3b0b9b 100644 --- a/src/plugins/find/findtoolbar.cpp +++ b/src/plugins/find/findtoolbar.cpp @@ -240,7 +240,7 @@ bool FindToolBar::eventFilter(QObject *obj, QEvent *event) if ((obj == m_ui.findEdit || obj == m_findCompleter->popup()) && event->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent *>(event); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC if (ke->key() == Qt::Key_Space && (ke->modifiers() & Qt::MetaModifier)) { #else if (ke->key() == Qt::Key_Space && (ke->modifiers() & Qt::ControlModifier)) { @@ -261,7 +261,7 @@ bool FindToolBar::eventFilter(QObject *obj, QEvent *event) event->accept(); return true; } -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC } else if (ke->key() == Qt::Key_Space && (ke->modifiers() & Qt::MetaModifier)) { #else } else if (ke->key() == Qt::Key_Space && (ke->modifiers() & Qt::ControlModifier)) { diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 4f240a21fe8111e15af6a90bb651bf03de184d31..ac3cfb2d2d8ad91b9923ddfde6b38935ee7e623a 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -279,7 +279,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_diffAction = new Core::Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this); command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext); command->setAttribute(Core::Command::CA_UpdateText); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D"))); #endif connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); @@ -287,7 +287,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_statusAction = new Core::Utils::ParameterAction(tr("File Status"), tr("Status Related to \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this); command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S"))); #endif command->setAttribute(Core::Command::CA_UpdateText); @@ -296,7 +296,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_logAction = new Core::Utils::ParameterAction(tr("Log File"), tr("Log of \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this); command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L"))); #endif command->setAttribute(Core::Command::CA_UpdateText); @@ -305,7 +305,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_blameAction = new Core::Utils::ParameterAction(tr("Blame"), tr("Blame for \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this); command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B"))); #endif command->setAttribute(Core::Command::CA_UpdateText); @@ -314,7 +314,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_undoFileAction = new Core::Utils::ParameterAction(tr("Undo Changes"), tr("Undo Changes for \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this); command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U"))); #endif command->setAttribute(Core::Command::CA_UpdateText); @@ -323,7 +323,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_stageAction = new Core::Utils::ParameterAction(tr("Stage File for Commit"), tr("Stage \"%1\" for Commit"), Core::Utils::ParameterAction::AlwaysEnabled, this); command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A"))); #endif command->setAttribute(Core::Command::CA_UpdateText); @@ -346,7 +346,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_diffProjectAction = new Core::Utils::ParameterAction(tr("Diff Current Project"), tr("Diff Project \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this); command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D")); #endif command->setAttribute(Core::Command::CA_UpdateText); @@ -361,7 +361,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_logProjectAction = new Core::Utils::ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this); command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K"))); #endif command->setAttribute(Core::Command::CA_UpdateText); @@ -398,7 +398,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_commitAction = new QAction(tr("Commit..."), this); command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C"))); #endif command->setAttribute(Core::Command::CA_UpdateText); diff --git a/src/plugins/help/centralwidget.cpp b/src/plugins/help/centralwidget.cpp index a53a67564ac27adc867763f9b23a7d9fc1fe5ada..72574102f91d8719099b146de13bdd92814cc724 100644 --- a/src/plugins/help/centralwidget.cpp +++ b/src/plugins/help/centralwidget.cpp @@ -85,10 +85,10 @@ CentralWidget::CentralWidget(QHelpEngine *engine, QWidget *parent) globalActionList.clear(); collectionFile = helpEngine->collectionFile(); - QString system = QLatin1String("win"); - #ifdef Q_OS_MAC - system = QLatin1String("mac"); +# define SYSTEM "mac" +#else +# define SYSTEM "win" #endif tabWidget = new QTabWidget; @@ -100,7 +100,7 @@ CentralWidget::CentralWidget(QHelpEngine *engine, QWidget *parent) QToolButton *newTabButton = new QToolButton(this); newTabButton->setAutoRaise(true); newTabButton->setToolTip(tr("Add new page")); - newTabButton->setIcon(QIcon(QString::fromUtf8(":/trolltech/assistant/images/%1/addtab.png").arg(system))); + newTabButton->setIcon(QIcon(QString::fromLatin1(":/trolltech/assistant/images/" SYSTEM "/addtab.png"))); tabWidget->setCornerWidget(newTabButton, Qt::TopLeftCorner); connect(newTabButton, SIGNAL(clicked()), this, SLOT(newTab())); diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 661723464cb84600b3c5857842a65296866a745d..f5287afbd6f2cbad6244f1ad40244895732185c1 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -241,7 +241,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) am->actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_HELP); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC QAction *sep = new QAction(this); sep->setSeparator(true); cmd = am->registerAction(sep, QLatin1String("Help.Separator"), globalcontext); @@ -344,7 +344,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error) actionList << previousAction << nextAction << homeAction -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC << sep #endif << copyAction; diff --git a/src/plugins/projectexplorer/debugginghelper.cpp b/src/plugins/projectexplorer/debugginghelper.cpp index da5fefc5125bc9e210e8145645b517015699dc42..b403872f5b200cf6866c52f7de0012c8911b7341 100644 --- a/src/plugins/projectexplorer/debugginghelper.cpp +++ b/src/plugins/projectexplorer/debugginghelper.cpp @@ -215,10 +215,11 @@ QStringList DebuggingHelperLibrary::possibleQMakeCommands() // On windows noone has renamed qmake, right? #ifdef Q_OS_WIN return QStringList() << "qmake.exe"; -#endif +#else // On unix some distributions renamed qmake to avoid clashes QStringList result; result << "qmake-qt4" << "qmake4" << "qmake"; return result; +#endif } diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 32b6ca9edfb3cc11834c2aa2eb175dcc715394ee..8054fa0f8d69f4c5ed6f62a64e025d73aa24acd9 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -90,7 +90,7 @@ protected: QTreeView::focusOutEvent(event); } -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC void keyPressEvent(QKeyEvent *event) { if ((event->key() == Qt::Key_Return diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 79ba761d1cb2c9846bc55e07c2e6689ebc2c53a9..c4a11d07e75ec4b368e050967ac5e633267b2b5e 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -112,7 +112,7 @@ private: } // namespace ProjectExplorer using namespace ProjectExplorer; -using Internal::SessionFile; +using namespace ProjectExplorer::Internal; void SessionFile::sessionLoadingProgress() @@ -215,7 +215,6 @@ bool SessionFile::load(const QString &fileName) qWarning() << "Could not find startup project" << startupProjectPath; } - const QVariant &editorsettings = reader.restoreValue(QLatin1String("EditorSettings")); if (editorsettings.isValid()) { connect(m_core->editorManager(), SIGNAL(editorOpened(Core::IEditor *)), @@ -272,6 +271,7 @@ bool SessionFile::save(const QString &fileName) } writer.saveValue(QLatin1String("ProjectDependencies"), QVariant(depMap)); + writer.saveValue(QLatin1String("OpenEditors"), m_core->editorManager()->openedEditors().count()); writer.saveValue(QLatin1String("EditorSettings"), @@ -694,28 +694,16 @@ bool SessionManager::clear() if (debug) qDebug() << "SessionManager - clearing session ..."; - bool cancelled; - QList<Project *> notClosed = requestCloseOfAllFiles(&cancelled); - - bool success = !cancelled; + bool success = m_core->editorManager()->closeAllEditors(); if (success) { if (debug) qDebug() << "SessionManager - Removing projects ..."; - QList<Project *> toClose; - foreach (Project *pro, projects()) { - if (!notClosed.contains(pro)) - toClose << pro; - } - setStartupProject(0); - removeProjects(toClose); + removeProjects(projects()); } - if (!notClosed.isEmpty()) - success = false; - if (debug) qDebug() << "SessionManager - clearing session result is " << success; @@ -883,29 +871,6 @@ void SessionManager::setEditorCodec(Core::IEditor *editor, const QString &fileNa textEditor->setTextCodec(project->editorConfiguration()->defaultTextCodec()); } -QList<Project *> SessionManager::requestCloseOfAllFiles(bool *cancelled) -{ - *cancelled = false; - QList<Core::IFile*> filesToClose; - foreach (Project *pro, projects()) - filesToClose << pro->file(); - foreach (Core::IEditor *editor, m_core->editorManager()->openedEditors()) - filesToClose << editor->file(); - QList<Core::IFile*> notClosed; - if (!filesToClose.isEmpty()) - notClosed = m_core->fileManager()->saveModifiedFiles(filesToClose, cancelled); - // close editors here by hand - if (!*cancelled) { - QList<Core::IEditor*> editorsToClose; - foreach (Core::IEditor *editor, m_core->editorManager()->openedEditors()) - if (!notClosed.contains(editor->file())) - editorsToClose << editor; - m_core->editorManager()->closeEditors(editorsToClose, false); - // project files are closed/removed later (in this::clear) - } - return Core::Utils::qwConvertList<Project*>(notClosed); -} - Core::IFile *SessionManager::file() const { return m_file; diff --git a/src/plugins/projectexplorer/session.h b/src/plugins/projectexplorer/session.h index b2131595219b9f2d4064f04f702b339936d648cd..c0099b591f9f31d6be1a6385208b10627dbb0fd0 100644 --- a/src/plugins/projectexplorer/session.h +++ b/src/plugins/projectexplorer/session.h @@ -180,8 +180,6 @@ private: QStringList dependenciesOrder() const; Project *defaultStartupProject() const; - QList<Project *> requestCloseOfAllFiles(bool *cancelled); - void updateName(const QString &session); Core::ICore *m_core; diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 3b0049ec4030dc2a77770e2b55c99c75c24dd009..071d30a5ce38c6d4cff10b50fa607b6dcae96815 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -103,7 +103,7 @@ bool QMakeStep::init(const QString &name) if (!qtVersion->isValid()) { -#if defined(Q_OS_MAC) +#if defined(Q_WS_MAC) emit addToOutputWindow(tr("\n<font color=\"#ff0000\"><b>No valid Qt version set. Set one in Preferences </b></font>\n")); #else emit addToOutputWindow(tr("\n<font color=\"#ff0000\"><b>No valid Qt version set. Set one in Tools/Options </b></font>\n")); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 761e70612fa38030fcfdff64d1dbf92f1c0139b0..ea64f2da180909c8d0393df574b3d888de2e4ea0 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -937,8 +937,7 @@ static inline QStringList possibleGuiBinaries(const QString &name) { #ifdef Q_OS_WIN return QStringList(name + QLatin1String(".exe")); -#endif -#ifdef Q_OS_MAC // 'Foo.app/Contents/MacOS/Foo' +#elif defined(Q_OS_MAC) // 'Foo.app/Contents/MacOS/Foo' QString upCaseName = name; upCaseName[0] = upCaseName.at(0).toUpper(); QString macBinary = upCaseName; diff --git a/src/plugins/quickopen/quickopenplugin.cpp b/src/plugins/quickopen/quickopenplugin.cpp index ae64e8dfe5132640f30b703565dc107fd2bb703f..9402d6ad127e39486b6e44522d587bd20204fbc3 100644 --- a/src/plugins/quickopen/quickopenplugin.cpp +++ b/src/plugins/quickopen/quickopenplugin.cpp @@ -162,7 +162,8 @@ static void loadSettingsHelper(QuickOpenPlugin *p, S *settings) } settings->beginGroup("CustomFilters"); QList<IQuickOpenFilter *> customFilters; - foreach (const QString &key, settings->childKeys()) { + const QStringList keys = settings->childKeys(); + foreach (const QString &key, keys) { IQuickOpenFilter *filter = new DirectoryFilter; filter->restoreState(settings->value(key).toByteArray()); p->m_filters.append(filter); diff --git a/src/plugins/quickopen/quickopentoolwindow.cpp b/src/plugins/quickopen/quickopentoolwindow.cpp index 139559bee34dd9fdd40ab2631b6fc828710a30f3..9d7ada56be4a5bc5ddeaccaf89503358474e1418 100644 --- a/src/plugins/quickopen/quickopentoolwindow.cpp +++ b/src/plugins/quickopen/quickopentoolwindow.cpp @@ -296,7 +296,7 @@ QuickOpenToolWindow::QuickOpenToolWindow(QuickOpenPlugin *qop) : connect(m_refreshAction, SIGNAL(triggered()), m_quickOpenPlugin, SLOT(refresh())); connect(m_configureAction, SIGNAL(triggered()), this, SLOT(showConfigureDialog())); connect(m_fileLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(textEdited(const QString&))); + this, SLOT(showPopup())); connect(m_completionList, SIGNAL(activated(QModelIndex)), this, SLOT(acceptCurrentEntry())); } @@ -345,8 +345,9 @@ bool QuickOpenToolWindow::eventFilter(QObject *obj, QEvent *event) } else if (obj == m_fileLineEdit && event->type() == QEvent::FocusOut) { m_completionList->hide(); } else if (obj == m_fileLineEdit && event->type() == QEvent::FocusIn) { - updateCompletionList(m_fileLineEdit->typedText()); - showCompletionList(); + if (static_cast<QFocusEvent*>(event)->reason() != Qt::MouseFocusReason) + m_fileLineEdit->selectAll(); + showPopup(); } else if (obj == this && event->type() == QEvent::ShortcutOverride) { QKeyEvent *ke = static_cast<QKeyEvent *>(event); if (ke->key() == Qt::Key_Escape && !ke->modifiers()) { @@ -367,9 +368,9 @@ void QuickOpenToolWindow::showCompletionList() m_completionList->show(); } -void QuickOpenToolWindow::textEdited(const QString &text) +void QuickOpenToolWindow::showPopup() { - updateCompletionList(text); + updateCompletionList(m_fileLineEdit->typedText()); showCompletionList(); } @@ -438,7 +439,11 @@ void QuickOpenToolWindow::show(const QString &text, int selectionStart, int sele { m_fileLineEdit->hideHintText(); m_fileLineEdit->setText(text); - setFocus(); + if (!m_fileLineEdit->hasFocus()) + m_fileLineEdit->setFocus(); + else + showPopup(); + if (selectionStart >= 0) m_fileLineEdit->setSelection(selectionStart, selectionLength); else @@ -470,15 +475,6 @@ void QuickOpenToolWindow::filterSelected() m_fileLineEdit->setFocus(); } -void QuickOpenToolWindow::focusInEvent(QFocusEvent *e) -{ - m_fileLineEdit->setFocus(e->reason()); - if (e->reason() != Qt::MouseFocusReason) { - m_fileLineEdit->selectAll(); - } - QWidget::focusInEvent(e); -} - void QuickOpenToolWindow::showEvent(QShowEvent *event) { QWidget::showEvent(event); diff --git a/src/plugins/quickopen/quickopentoolwindow.h b/src/plugins/quickopen/quickopentoolwindow.h index aa898fd5eea1dea4feb08db4816d2fa5e75d99c1..2a8dc03a9ed53d123ddb9a86e04e9ace59c8cb06 100644 --- a/src/plugins/quickopen/quickopentoolwindow.h +++ b/src/plugins/quickopen/quickopentoolwindow.h @@ -67,7 +67,7 @@ public: void show(const QString &text, int selectionStart = -1, int selectionLength = 0); private slots: - void textEdited(const QString &text); + void showPopup(); void acceptCurrentEntry(); void filterSelected(); void showConfigureDialog(); @@ -76,7 +76,6 @@ private: bool eventFilter(QObject *obj, QEvent *event); void showEvent(QShowEvent *e); - void focusInEvent(QFocusEvent *e); bool isShowingTypeHereMessage() const; void showCompletionList(); diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 532beecdf45f6ac7abd661c67ad9c434e9c4de22..af0e674c1bc070d8eec939ccebd3e79f94db241b 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -336,7 +336,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe command = ami->registerAction(m_addAction, SubversionPlugin::ADD, globalcontext); command->setAttribute(Core::Command::CA_UpdateText); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+A"))); #endif connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); @@ -368,7 +368,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe command = ami->registerAction(m_diffCurrentAction, SubversionPlugin::DIFF_CURRENT, globalcontext); command->setAttribute(Core::Command::CA_UpdateText); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+D"))); #endif connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); @@ -386,7 +386,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe command = ami->registerAction(m_commitCurrentAction, SubversionPlugin::COMMIT_CURRENT, globalcontext); command->setAttribute(Core::Command::CA_UpdateText); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+C"))); #endif connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile())); diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index b6b7408f16cd5476843e62d138178722c98793dd..5448be6d4a388e91f4765878c1f80b73b506ab90 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -956,7 +956,7 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e) case Qt::Key_End: case Qt::Key_Right: case Qt::Key_Left: -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC if ((e->modifiers() & (Qt::AltModifier | Qt::ShiftModifier)) == (Qt::AltModifier | Qt::ShiftModifier)) { d->m_lastEventWasBlockSelectionEvent = true; @@ -2257,13 +2257,17 @@ static void drawRectBox(QPainter *painter, const QRect &rect, bool start, bool e { painter->save(); painter->setRenderHint(QPainter::Antialiasing, false); - QColor c = pal.highlight().color(); - c.setAlpha(40); + + QRgb b = pal.base().color().rgb(); + QRgb h = pal.highlight().color().rgb(); + QColor c = QColor((qRed(b)*2+qRed(h))/3, + (qGreen(b)*2+qGreen(h))/3, + (qBlue(b)*2+qBlue(h))/3); + QLinearGradient grad(rect.topLeft(), rect.topRight()); - grad.setColorAt(0, c.darker(130)); + grad.setColorAt(0, c.lighter(110)); grad.setColorAt(1, c.lighter(160)); - QColor outline = c.darker(110); - outline.setAlpha(100); + QColor outline = c; QRect r = rect; painter->fillRect(rect, grad); diff --git a/src/plugins/texteditor/completionwidget.cpp b/src/plugins/texteditor/completionwidget.cpp index 8806fd3d6d5945e783d6aa9096d10ee78636b709..a7d0c2312979b8f1020fa2f38fb9688449224497 100644 --- a/src/plugins/texteditor/completionwidget.cpp +++ b/src/plugins/texteditor/completionwidget.cpp @@ -255,7 +255,7 @@ void CompletionWidget::updatePositionAndSize(int startPos) // Determine the position, keeping the popup on the screen const QRect cursorRect = m_editor->cursorRect(startPos); const QDesktopWidget *desktop = QApplication::desktop(); -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC const QRect screen = desktop->availableGeometry(desktop->screenNumber(m_editorWidget)); #else const QRect screen = desktop->screenGeometry(desktop->screenNumber(m_editorWidget)); diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index 37907a345e5c4625d5e31af50091f100f172704e..441a7a67113598be734816acf91699c9e4126046 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -48,7 +48,7 @@ static const bool DEFAULT_ANTIALIAS = true; enum { DEFAULT_FONT_SIZE = 12 }; static const char *DEFAULT_FONT_FAMILY = "Monaco"; #else -#ifdef Q_OS_UNIX +#ifdef Q_WS_X11 enum { DEFAULT_FONT_SIZE = 9 }; static const char *DEFAULT_FONT_FAMILY = "Monospace"; #else diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 44220bfdb9991004554402000437db773f73ef0c..d8bd9e098e494d1cc57e76da54d185a883377031 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -146,7 +146,7 @@ void TextEditorActionHandler::createActions() m_visualizeWhitespaceAction->setCheckable(true); command = am->registerAction(m_visualizeWhitespaceAction, TextEditor::Constants::VISUALIZE_WHITESPACE, m_contextId); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Ctrl+E, Ctrl+V"))); #endif advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); @@ -162,7 +162,7 @@ void TextEditorActionHandler::createActions() m_textWrappingAction = new QAction(tr("Enable Text &Wrapping"), this); m_textWrappingAction->setCheckable(true); command = am->registerAction(m_textWrappingAction, TextEditor::Constants::TEXT_WRAPPING, m_contextId); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Ctrl+E, Ctrl+W"))); #endif advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT); diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 049d3a3978061fa52ea78c7aeb173b0384e075a7..b6bf55025bfae1ebba9ee39327b6425ee7a9bcd8 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -124,7 +124,7 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe // Make sure the shortcut still works when the completion widget is active completionShortcut->setContext(Qt::ApplicationShortcut); Core::Command *command = am->registerShortcut(completionShortcut, Constants::COMPLETE_THIS, context); -#ifndef Q_OS_MAC +#ifndef Q_WS_MAC command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Space"))); #else command->setDefaultKeySequence(QKeySequence(tr("Meta+Space"))); diff --git a/src/qtcreatorlibrary.pri b/src/qtcreatorlibrary.pri index fb92b5202a865f60eaf356f19a049f92869e6ce9..ecfee84d112895ef37ac1f6a8d0c8fcbf40ce275 100644 --- a/src/qtcreatorlibrary.pri +++ b/src/qtcreatorlibrary.pri @@ -12,7 +12,7 @@ TARGET = $$qtLibraryTarget($$TARGET) contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols -linux-* { +unix:!macx { target.path = /$$IDE_LIBRARY_BASENAME/qtcreator INSTALLS += target } diff --git a/src/qtcreatorplugin.pri b/src/qtcreatorplugin.pri index cb3e57f4e89ce44ce909d293246ba9fcede935ab..dcb4649e99ee72efec3ac8d9ff883cc18d2c4a7f 100644 --- a/src/qtcreatorplugin.pri +++ b/src/qtcreatorplugin.pri @@ -42,7 +42,7 @@ contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols CONFIG += plugin plugin_with_soname -linux-* { +unix:!macx { target.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER pluginspec.files += $${TARGET}.pluginspec pluginspec.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp index 7052495fcef9f6979accf102bc671a7699cf342e..96c8643765732bbb9de25b1bbbe1a0738315ce7b 100644 --- a/src/shared/help/bookmarkmanager.cpp +++ b/src/shared/help/bookmarkmanager.cpp @@ -436,9 +436,10 @@ void BookmarkWidget::setup(bool showButtons) treeView = new TreeView(this); vlayout->addWidget(treeView); - QString system = QLatin1String("win"); #ifdef Q_OS_MAC - system = QLatin1String("mac"); +# define SYSTEM "mac" +#else +# define SYSTEM "win" #endif if (showButtons) { @@ -449,8 +450,8 @@ void BookmarkWidget::setup(bool showButtons) addButton = new QToolButton(this); addButton->setText(tr("Add")); - addButton->setIcon(QIcon(QString::fromUtf8( - ":/trolltech/assistant/images/%1/addtab.png").arg(system))); + addButton->setIcon(QIcon(QString::fromLatin1( + ":/trolltech/assistant/images/" SYSTEM "/addtab.png"))); addButton->setAutoRaise(true); addButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); hlayout->addWidget(addButton); @@ -458,8 +459,8 @@ void BookmarkWidget::setup(bool showButtons) removeButton = new QToolButton(this); removeButton->setText(tr("Remove")); - removeButton->setIcon(QIcon(QString::fromUtf8( - ":/trolltech/assistant/images/%1/closetab.png").arg(system))); + removeButton->setIcon(QIcon(QString::fromLatin1( + ":/trolltech/assistant/images/" SYSTEM "/closetab.png"))); removeButton->setAutoRaise(true); removeButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); hlayout->addWidget(removeButton); diff --git a/src/shared/help/indexwindow.cpp b/src/shared/help/indexwindow.cpp index 1b79ed00ae8aba6f78596baf543f551b9fdf48ae..8ae9f4e0a9346caf100e3af2059cbc6186c81cf1 100644 --- a/src/shared/help/indexwindow.cpp +++ b/src/shared/help/indexwindow.cpp @@ -140,7 +140,7 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e) } } } -#ifdef Q_OS_MAC +#ifdef Q_WS_MAC else if (obj == m_indexWidget && e->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent*>(e); if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter) diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp index d756b6430bd0a2718f0e4fc429c0f02eff40dfb2..47c9b93b33612f42e2be3c27c5c101f3eb569cc0 100644 --- a/src/shared/proparser/profileevaluator.cpp +++ b/src/shared/proparser/profileevaluator.cpp @@ -48,7 +48,7 @@ #ifdef Q_OS_UNIX #include <unistd.h> #include <sys/utsname.h> -#elif defined(Q_OS_WIN32) +#else #include <Windows.h> #endif #include <stdio.h> @@ -248,8 +248,10 @@ public: bool m_parsePreAndPostFiles; }; +#if !defined(__GNUC__) || __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) Q_DECLARE_TYPEINFO(ProFileEvaluator::Private::State, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(ProFileEvaluator::Private::ProLoop, Q_MOVABLE_TYPE); +#endif ProFileEvaluator::Private::Private(ProFileEvaluator *q_) : q(q_) @@ -893,7 +895,7 @@ void ProFileEvaluator::Private::visitProValue(ProValue *value) { // DEFINES ~= s/a/b/?[gqi] - // FIXME: qmake variable-expands val first. + doVariableReplace(&val); if (val.length() < 4 || val[0] != QLatin1Char('s')) { q->logMessage(format("the ~= operator can handle only the s/// function.")); break; @@ -1306,7 +1308,7 @@ QStringList ProFileEvaluator::Private::evaluateFunction( if (m_valuemapStack.count() >= 100) { q->errorMessage(format("ran into infinite recursion (depth > 100).")); - ok = false; + oki = false; } else { State sts = m_sts; m_valuemapStack.push(m_valuemap); diff --git a/src/shared/proparser/profileevaluator.h b/src/shared/proparser/profileevaluator.h index de4b07f41d0fac509b9d2f4244e1db5e357c97b1..cb3a488033149615a1b9f9193e4b371a5cd738c7 100644 --- a/src/shared/proparser/profileevaluator.h +++ b/src/shared/proparser/profileevaluator.h @@ -88,6 +88,7 @@ private: class Private; Private *d; + // This doesn't help gcc 3.3 ... template<typename T> friend class QTypeInfo; }; diff --git a/src/shared/qtlockedfile/qtlockedfile.h b/src/shared/qtlockedfile/qtlockedfile.h index b4a5cbd06376a8c7d0526ebdf321a98b7ee001a1..49e26735dc67921a8014735e15775b4e4dbb3b7b 100644 --- a/src/shared/qtlockedfile/qtlockedfile.h +++ b/src/shared/qtlockedfile/qtlockedfile.h @@ -32,7 +32,7 @@ #include <QtCore/QFile> -#if defined(Q_WS_WIN) +#if defined(Q_OS_WIN) # if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT) # define QT_QTLOCKEDFILE_EXPORT # elif defined(QT_QTLOCKEDFILE_IMPORT) diff --git a/src/tools/qpatch/files-to-patch-linux b/src/tools/qpatch/files-to-patch-linux index da166075843ea60c10c916dd63d7c66aa41e3459..4c7b5fd6349c1b89a83a0621fe0920b9de4d6c0f 100644 --- a/src/tools/qpatch/files-to-patch-linux +++ b/src/tools/qpatch/files-to-patch-linux @@ -235,26 +235,26 @@ examples/xml/xmlstreamlint/xmlstreamlint examples/xmlpatterns/filetree/filetree examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel examples/xmlpatterns/recipes/recipes -lib/libQt3Support.so.4.5.1 -lib/libQtAssistantClient.so.4.5.1 -lib/libQtCLucene.so.4.5.1 -lib/libQtCore.so.4.5.1 -lib/libQtDBus.so.4.5.1 -lib/libQtDesigner.so.4.5.1 -lib/libQtDesignerComponents.so.4.5.1 -lib/libQtGui.so.4.5.1 -lib/libQtHelp.so.4.5.1 -lib/libQtNetwork.so.4.5.1 -lib/libQtOpenGL.so.4.5.1 -lib/libQtScript.so.4.5.1 -lib/libQtScriptTools.so.4.5.1 -lib/libQtSql.so.4.5.1 -lib/libQtSvg.so.4.5.1 -lib/libQtTest.so.4.5.1 +lib/libQt3Support.so.4.5.2 +lib/libQtAssistantClient.so.4.5.2 +lib/libQtCLucene.so.4.5.2 +lib/libQtCore.so.4.5.2 +lib/libQtDBus.so.4.5.2 +lib/libQtDesigner.so.4.5.2 +lib/libQtDesignerComponents.so.4.5.2 +lib/libQtGui.so.4.5.2 +lib/libQtHelp.so.4.5.2 +lib/libQtNetwork.so.4.5.2 +lib/libQtOpenGL.so.4.5.2 +lib/libQtScript.so.4.5.2 +lib/libQtScriptTools.so.4.5.2 +lib/libQtSql.so.4.5.2 +lib/libQtSvg.so.4.5.2 +lib/libQtTest.so.4.5.2 lib/libQtUiTools.a -lib/libQtWebKit.so.4.5.1 -lib/libQtXml.so.4.5.1 -lib/libQtXmlPatterns.so.4.5.1 +lib/libQtWebKit.so.4.5.2 +lib/libQtXml.so.4.5.2 +lib/libQtXmlPatterns.so.4.5.2 plugins/accessible/libqtaccessiblecompatwidgets.so plugins/accessible/libqtaccessiblewidgets.so plugins/codecs/libqcncodecs.so diff --git a/tests/auto/fakevim/main.cpp b/tests/auto/fakevim/main.cpp index 9e931526f92acfaa31d1cd33277d84d8dcc05a75..ddc91e3a6a02f19aa0ed31c298b736788168ff26 100644 --- a/tests/auto/fakevim/main.cpp +++ b/tests/auto/fakevim/main.cpp @@ -63,6 +63,7 @@ private slots: void command_e(); void command_i(); void command_left(); + void command_r(); void command_right(); void command_up(); void command_w(); @@ -325,16 +326,21 @@ void tst_FakeVim::command_i() check("ixxx" + escape, "xx@x" + lines); check("u", "@" + lines); -return; - // combine insertions + check("i1" + escape, "@1" + lines); + check("i2" + escape, "@21" + lines); + check("i3" + escape, "@321" + lines); + check("u", "@21" + lines); + check("u", "@1" + lines); + check("u", "@" + lines); check("ia" + escape, "@a" + lines); check("ibx" + escape, "b@xa" + lines); check("icyy" + escape, "bcy@yxa" + lines); check("u", "b@xa" + lines); - check("u", "@a" + lines); // undo broken - checkEx("redo", "b@xa" + lines); - check("u", "@a" + lines); + check("u", "@a" + lines); +// FIXME undo broken +// checkEx("redo", "b@xa" + lines); +// check("u", "@a" + lines); check("u", "@" + lines); } @@ -344,11 +350,26 @@ void tst_FakeVim::command_left() move("4j", "@int main"); move("h", "@int main"); // no move over left border move("$", "argv[])@"); - move("h", "argv[]@)"); + //move("h", "argv[]@)"); + check("h", lmid(0, 4) + "\nint main(int argc, char *argv[]@)\n" + lmid(5)); move("3h", "arg@v[])"); move("50h", "@int main"); } +void tst_FakeVim::command_r() +{ + setup(); + move("4j", "@int main"); + move("$", "int main(int argc, char *argv[])@"); + check("rx", lmid(0, 4) + "\nint main(int argc, char *argv[]x@\n" + lmid(5)); + check("2h", lmid(0, 4) + "\nint main(int argc, char *argv[@]x\n" + lmid(5)); + check("4ra", lmid(0, 4) + "\nint main(int argc, char *argv[@]x\n" + lmid(5)); +return; // FIXME + check("3rb", lmid(0, 4) + "\nint main(int argc, char *argv[bb@b\n" + lmid(5)); + check("2rc", lmid(0, 4) + "\nint main(int argc, char *argv[bb@b\n" + lmid(5)); + check("h2rc",lmid(0, 4) + "\nint main(int argc, char *argv[bc@c\n" + lmid(5)); +} + void tst_FakeVim::command_right() { setup(); diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index de12a5474c71976bb5a4245934095eacf5f51372..349055c3b2ada198326b3e2d7e9b8d4f5f6de9b3 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -48,6 +48,7 @@ #include <QtGui/QLabel> #include <QtGui/QPainter> #include <QtGui/QPainterPath> +#include <QtGui/QStandardItemModel> #include <QtNetwork/QHostAddress> @@ -787,6 +788,21 @@ void testStdVector() vec.push_back(false); } +void testQStandardItemModel() +{ + QStandardItemModel m; + QStandardItem *i1, *i2, *i11; + m.appendRow(QList<QStandardItem *>() + << (i1 = new QStandardItem("1")) << (new QStandardItem("a"))); + m.appendRow(QList<QStandardItem *>() + << (i2 = new QStandardItem("2")) << (new QStandardItem("b"))); + i1->appendRow(QList<QStandardItem *>() + << (i11 = new QStandardItem("11")) << (new QStandardItem("aa"))); + int i = 1; + ++i; + ++i; +} + void testQString() { QString str = "Hello "; @@ -1090,6 +1106,7 @@ int main(int argc, char *argv[]) QStringList list; list << "aaa" << "bbb" << "cc"; + testQStandardItemModel(); testQImage(); testNoArgumentName(1, 2, 3); testIO();