diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-12-17 23:46:27 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-12-17 23:46:27 (GMT) |
commit | a60c9a1ff41e5ca1482121ff3f89a112b359b6d4 (patch) | |
tree | ebe4f5e941eb3bda28593c2b170101867cb0afe3 /tools | |
parent | 412920402f488c2cf6eb81e7582f9b5aa7b06680 (diff) | |
parent | b8a4b365b1105a742369bbaa5dc00e43914089e0 (diff) | |
download | Qt-a60c9a1ff41e5ca1482121ff3f89a112b359b6d4.zip Qt-a60c9a1ff41e5ca1482121ff3f89a112b359b6d4.tar.gz Qt-a60c9a1ff41e5ca1482121ff3f89a112b359b6d4.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts:
.gitignore
tests/benchmarks/benchmarks.pro
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/lib/qhelpindexwidget.cpp | 4 | ||||
-rw-r--r-- | tools/assistant/lib/qhelpsearchengine.h | 2 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/bookmarkmanager.cpp | 116 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 11 | ||||
-rw-r--r-- | tools/designer/src/components/formeditor/itemview_propertysheet.cpp | 183 | ||||
-rw-r--r-- | tools/designer/src/components/formeditor/itemview_propertysheet.h | 10 | ||||
-rw-r--r-- | tools/designer/src/lib/shared/actionrepository.cpp | 2 | ||||
-rw-r--r-- | tools/linguist/linguist/messageeditor.h | 2 | ||||
-rw-r--r-- | tools/linguist/lrelease/main.cpp | 2 | ||||
-rw-r--r-- | tools/qdoc3/generator.cpp | 45 | ||||
-rw-r--r-- | tools/qdoc3/generator.h | 2 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 4 |
12 files changed, 219 insertions, 164 deletions
diff --git a/tools/assistant/lib/qhelpindexwidget.cpp b/tools/assistant/lib/qhelpindexwidget.cpp index 475a1fe..6cf1a72 100644 --- a/tools/assistant/lib/qhelpindexwidget.cpp +++ b/tools/assistant/lib/qhelpindexwidget.cpp @@ -130,6 +130,7 @@ void QHelpIndexProvider::stopCollecting() m_abort = true; m_mutex.unlock(); wait(); + m_abort = false; } QStringList QHelpIndexProvider::indices() const @@ -164,7 +165,6 @@ void QHelpIndexProvider::run() foreach (QString dbFileName, m_helpEngine->fileNameReaderMap.keys()) { m_mutex.lock(); if (m_abort) { - m_abort = false; m_mutex.unlock(); return; } @@ -181,7 +181,6 @@ void QHelpIndexProvider::run() foreach (QString s, lst) indicesSet.insert(s); if (m_abort) { - m_abort = false; m_mutex.unlock(); return; } @@ -194,7 +193,6 @@ void QHelpIndexProvider::run() m_mutex.lock(); m_indices = indicesSet.values(); qSort(m_indices.begin(), m_indices.end(), caseInsensitiveLessThan); - m_abort = false; m_mutex.unlock(); } diff --git a/tools/assistant/lib/qhelpsearchengine.h b/tools/assistant/lib/qhelpsearchengine.h index 21f04c5..632ac0b 100644 --- a/tools/assistant/lib/qhelpsearchengine.h +++ b/tools/assistant/lib/qhelpsearchengine.h @@ -86,7 +86,9 @@ public: QHelpSearchQueryWidget* queryWidget(); QHelpSearchResultWidget* resultWidget(); +#ifdef QT_DEPRECATED QT_DEPRECATED int hitsCount() const; +#endif int hitCount() const; typedef QPair<QString, QString> SearchHit; diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 70f3157..523525e 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -69,9 +69,12 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, , m_title(title) , bookmarkManager(manager) { + ui.setupUi(this); + installEventFilter(this); + ui.treeView->installEventFilter(this); + ui.treeView->viewport()->installEventFilter(this); - ui.setupUi(this); ui.bookmarkEdit->setText(title); ui.newFolderButton->setVisible(false); ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); @@ -264,12 +267,14 @@ void BookmarkDialog::currentChanged(const QModelIndex ¤t) bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) { - if (object == this && e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); + if (object != ui.treeView && object != ui.treeView->viewport()) + return QWidget::eventFilter(object, e); - QModelIndex index = ui.treeView->currentIndex(); + if (e->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast<QKeyEvent*>(e); switch (ke->key()) { case Qt::Key_F2: { + const QModelIndex &index = ui.treeView->currentIndex(); const QModelIndex &source = proxyModel->mapToSource(index); QStandardItem *item = bookmarkManager->treeBookmarkModel()->itemFromIndex(source); @@ -281,13 +286,13 @@ bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) } break; case Qt::Key_Delete: { + const QModelIndex &index = ui.treeView->currentIndex(); bookmarkManager->removeBookmarkItem(ui.treeView, proxyModel->mapToSource(index)); ui.bookmarkFolders->clear(); ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); QString name = tr("Bookmarks"); - index = ui.treeView->currentIndex(); if (index.isValid()) name = index.data().toString(); ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); @@ -297,6 +302,7 @@ bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) break; } } + return QObject::eventFilter(object, e); } @@ -312,7 +318,10 @@ BookmarkWidget::BookmarkWidget(BookmarkManager *manager, QWidget *parent, , bookmarkManager(manager) { setup(showButtons); + installEventFilter(this); + treeView->installEventFilter(this); + treeView->viewport()->installEventFilter(this); } BookmarkWidget::~BookmarkWidget() @@ -484,7 +493,6 @@ void BookmarkWidget::setup(bool showButtons) treeView->setAutoExpandDelay(1000); treeView->setDropIndicatorShown(true); treeView->header()->setVisible(false); - treeView->viewport()->installEventFilter(this); treeView->setContextMenuPolicy(Qt::CustomContextMenu); connect(treeView, SIGNAL(expanded(QModelIndex)), this, @@ -530,59 +538,71 @@ void BookmarkWidget::focusInEvent(QFocusEvent *e) bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) { - if ((object == this) || (object == treeView->viewport())) { - QModelIndex index = treeView->currentIndex(); - if (e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); - if (index.isValid() && searchField->text().isEmpty()) { + if (object != this && object != treeView + && object != treeView->viewport()) { + return QWidget::eventFilter(object, e); + } + + if (e->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast<QKeyEvent*>(e); + const bool tree = object == treeView || object == treeView->viewport(); + switch (ke->key()) { + case Qt::Key_F2: { + const QModelIndex &index = treeView->currentIndex(); const QModelIndex &src = filterBookmarkModel->mapToSource(index); - if (ke->key() == Qt::Key_F2) { - QStandardItem *item = - bookmarkManager->treeBookmarkModel()->itemFromIndex(src); - if (item) { + if (tree && searchField->text().isEmpty()) { + if (QStandardItem *item = bookmarkManager->treeBookmarkModel() + ->itemFromIndex(src)) { item->setEditable(true); treeView->edit(index); item->setEditable(false); } - } else if (ke->key() == Qt::Key_Delete) { - bookmarkManager->removeBookmarkItem(treeView, src); } - } + } break; + + case Qt::Key_Enter: { + case Qt::Key_Return: + if (tree) { + const QString &data = treeView->selectionModel()->currentIndex() + .data(Qt::UserRole + 10).toString(); + if (!data.isEmpty() && data != QLatin1String("Folder")) + emit requestShowLink(data); + } + } break; - switch (ke->key()) { - default: break; - case Qt::Key_Up: { - case Qt::Key_Down: + case Qt::Key_Delete: { + const QModelIndex &index = treeView->currentIndex(); + const QModelIndex &src = filterBookmarkModel->mapToSource(index); + if (tree && searchField->text().isEmpty()) + bookmarkManager->removeBookmarkItem(treeView, src); + } break; + + case Qt::Key_Up: { + case Qt::Key_Down: + if (!tree) treeView->subclassKeyPressEvent(ke); - } break; - - case Qt::Key_Enter: { - case Qt::Key_Return: - index = treeView->selectionModel()->currentIndex(); - if (index.isValid()) { - QString data = index.data(Qt::UserRole + 10).toString(); - if (!data.isEmpty() && data != QLatin1String("Folder")) - emit requestShowLink(data); - } - } break; + } break; - case Qt::Key_Escape: { - emit escapePressed(); - } break; - } - } else if (e->type() == QEvent::MouseButtonRelease) { - if (index.isValid()) { - QMouseEvent *me = static_cast<QMouseEvent*>(e); - bool controlPressed = me->modifiers() & Qt::ControlModifier; - if(((me->button() == Qt::LeftButton) && controlPressed) - || (me->button() == Qt::MidButton)) { - QString data = index.data(Qt::UserRole + 10).toString(); - if (!data.isEmpty() && data != QLatin1String("Folder")) - CentralWidget::instance()->setSourceInNewTab(data); - } - } + case Qt::Key_Escape: { + emit escapePressed(); + } break; + + default: break; } } + + if (e->type() == QEvent::MouseButtonRelease) { + QMouseEvent *me = static_cast<QMouseEvent*>(e); + bool controlPressed = me->modifiers() & Qt::ControlModifier; + if(((me->button() == Qt::LeftButton) && controlPressed) + || (me->button() == Qt::MidButton)) { + const QModelIndex &index = treeView->currentIndex(); + const QString &data = index.data(Qt::UserRole + 10).toString(); + if (!data.isEmpty() && data != QLatin1String("Folder")) + CentralWidget::instance()->setSourceInNewTab(data); + } + } + return QWidget::eventFilter(object, e); } diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index cd3feec..0ddb1df 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -247,6 +247,7 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "PHONON" ] = "auto"; dictionary[ "PHONON_BACKEND" ] = "yes"; dictionary[ "MULTIMEDIA" ] = "yes"; + dictionary[ "AUDIO_BACKEND" ] = "yes"; dictionary[ "DIRECTSHOW" ] = "no"; dictionary[ "WEBKIT" ] = "auto"; dictionary[ "DECLARATIVE" ] = "auto"; @@ -897,6 +898,10 @@ void Configure::parseCmdLine() dictionary[ "MULTIMEDIA" ] = "no"; } else if( configCmdLine.at(i) == "-multimedia" ) { dictionary[ "MULTIMEDIA" ] = "yes"; + } else if( configCmdLine.at(i) == "-audio-backend" ) { + dictionary[ "AUDIO_BACKEND" ] = "yes"; + } else if( configCmdLine.at(i) == "-no-audio-backend" ) { + dictionary[ "AUDIO_BACKEND" ] = "no"; } else if( configCmdLine.at(i) == "-no-phonon" ) { dictionary[ "PHONON" ] = "no"; } else if( configCmdLine.at(i) == "-phonon" ) { @@ -1567,9 +1572,9 @@ bool Configure::displayHelp() "[-no-openssl] [-no-dbus] [-dbus] [-dbus-linked] [-platform <spec>]\n" "[-qtnamespace <namespace>] [-qtlibinfix <infix>] [-no-phonon]\n" "[-phonon] [-no-phonon-backend] [-phonon-backend]\n" - "[-no-multimedia] [-multimedia] [-no-webkit] [-webkit]\n" + "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n" "[-no-script] [-script] [-no-scripttools] [-scripttools]\n" - "[-graphicssystem raster|opengl|openvg]\n\n", 0, 7); + "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7); desc("Installation options:\n\n"); @@ -1749,6 +1754,8 @@ bool Configure::displayHelp() desc("PHONON_BACKEND","yes","-phonon-backend", "Compile in the platform-specific Phonon backend-plugin"); desc("MULTIMEDIA", "no", "-no-multimedia", "Do not compile the multimedia module"); desc("MULTIMEDIA", "yes","-multimedia", "Compile in multimedia module"); + desc("AUDIO_BACKEND", "no","-no-audio-backend", "Do not compile in the platform audio backend into QtMultimedia"); + desc("AUDIO_BACKEND", "yes","-audio-backend", "Compile in the platform audio backend into QtMultimedia"); desc("WEBKIT", "no", "-no-webkit", "Do not compile in the WebKit module"); desc("WEBKIT", "yes", "-webkit", "Compile in the WebKit module (WebKit is built if a decent C++ compiler is used.)"); desc("SCRIPT", "no", "-no-script", "Do not build the QtScript module."); diff --git a/tools/designer/src/components/formeditor/itemview_propertysheet.cpp b/tools/designer/src/components/formeditor/itemview_propertysheet.cpp index 38f73e7..96d159a 100644 --- a/tools/designer/src/components/formeditor/itemview_propertysheet.cpp +++ b/tools/designer/src/components/formeditor/itemview_propertysheet.cpp @@ -45,6 +45,7 @@ #include <QtGui/QAbstractItemView> #include <QtGui/QHeaderView> +#include <QtCore/QDebug> QT_BEGIN_NAMESPACE @@ -54,41 +55,27 @@ struct Property { Property() : m_sheet(0),m_id(-1) {} Property(QDesignerPropertySheetExtension *sheet, int id) : m_sheet(sheet), m_id(id) {} - bool operator==(const Property &p) { return m_sheet == p.m_sheet && m_id == p.m_id; } - uint qHash() { - return ((int)(m_sheet-(QDesignerPropertySheetExtension*)(0))) & m_id; - } QDesignerPropertySheetExtension *m_sheet; int m_id; }; -class ItemViewPropertySheetPrivate { +typedef QMap<int, Property> FakePropertyMap; -public: - ItemViewPropertySheetPrivate(QHeaderView *horizontalHeader, - QHeaderView *verticalHeader, - QObject *parent); +struct ItemViewPropertySheetPrivate { + ItemViewPropertySheetPrivate(QDesignerFormEditorInterface *core, + QHeaderView *horizontalHeader, + QHeaderView *verticalHeader); - inline void createMapping(int fakeId, QHeaderView *header, const QString &headerName); inline QStringList realPropertyNames(); inline QString fakePropertyName(const QString &prefix, const QString &realName); - QDesignerFormEditorInterface *m_core; - - // Maps index of fake property - // to index of real property in respective sheet - QHash<int, Property> m_propertyIdMap; + // Maps index of fake property to index of real property in respective sheet + FakePropertyMap m_propertyIdMap; - // Maps name of fake property - // to name of real property + // Maps name of fake property to name of real property QHash<QString, QString> m_propertyNameMap; -private: - static QDesignerFormEditorInterface *formEditorForObject(QObject *o); - - QHeaderView *m_hHeader; - QHeaderView *m_vHeader; QHash<QHeaderView *, QDesignerPropertySheetExtension *> m_propertySheet; QStringList m_realPropertyNames; }; @@ -111,43 +98,18 @@ using namespace qdesigner_internal; /***************** ItemViewPropertySheetPrivate *********************/ -ItemViewPropertySheetPrivate::ItemViewPropertySheetPrivate(QHeaderView *horizontalHeader, - QHeaderView *verticalHeader, - QObject *parent) - : m_core(formEditorForObject(parent)), - m_hHeader(horizontalHeader), - m_vHeader(verticalHeader) +ItemViewPropertySheetPrivate::ItemViewPropertySheetPrivate(QDesignerFormEditorInterface *core, + QHeaderView *horizontalHeader, + QHeaderView *verticalHeader) { if (horizontalHeader) m_propertySheet.insert(horizontalHeader, qt_extension<QDesignerPropertySheetExtension*> - (m_core->extensionManager(), horizontalHeader)); + (core->extensionManager(), horizontalHeader)); if (verticalHeader) m_propertySheet.insert(verticalHeader, qt_extension<QDesignerPropertySheetExtension*> - (m_core->extensionManager(), verticalHeader)); -} - -// Find the form editor in the hierarchy. -// We know that the parent of the sheet is the extension manager -// whose parent is the core. -QDesignerFormEditorInterface *ItemViewPropertySheetPrivate::formEditorForObject(QObject *o) -{ - do { - if (QDesignerFormEditorInterface* core = qobject_cast<QDesignerFormEditorInterface*>(o)) - return core; - o = o->parent(); - } while(o); - Q_ASSERT(o); - return 0; -} - -void ItemViewPropertySheetPrivate::createMapping(int fakeId, QHeaderView *header, - const QString &headerName) -{ - const int realPropertyId = m_propertySheet.value(header)->indexOf(headerName); - QDesignerPropertySheetExtension *propertySheet = m_propertySheet.value(header); - m_propertyIdMap.insert(fakeId, Property(propertySheet, realPropertyId)); + (core->extensionManager(), verticalHeader)); } QStringList ItemViewPropertySheetPrivate::realPropertyNames() @@ -194,46 +156,19 @@ QString ItemViewPropertySheetPrivate::fakePropertyName(const QString &prefix, ItemViewPropertySheet::ItemViewPropertySheet(QTreeView *treeViewObject, QObject *parent) : QDesignerPropertySheet(treeViewObject, parent), - d(new ItemViewPropertySheetPrivate(treeViewObject->header(), 0, parent)) + d(new ItemViewPropertySheetPrivate(core(), treeViewObject->header(), 0)) { - QHeaderView *hHeader = treeViewObject->header(); - - foreach (const QString &realPropertyName, d->realPropertyNames()) { - const QString fakePropertyName - = d->fakePropertyName(QLatin1String("header"), realPropertyName); - d->createMapping(createFakeProperty(fakePropertyName, 0), hHeader, realPropertyName); - } - - foreach (int id, d->m_propertyIdMap.keys()) { - setAttribute(id, true); - setPropertyGroup(id, QLatin1String(headerGroup)); - } + initHeaderProperties(treeViewObject->header(), QLatin1String("header")); } - ItemViewPropertySheet::ItemViewPropertySheet(QTableView *tableViewObject, QObject *parent) : QDesignerPropertySheet(tableViewObject, parent), - d(new ItemViewPropertySheetPrivate(tableViewObject->horizontalHeader(), - tableViewObject->verticalHeader(), parent)) + d(new ItemViewPropertySheetPrivate(core(), + tableViewObject->horizontalHeader(), + tableViewObject->verticalHeader())) { - QHeaderView *hHeader = tableViewObject->horizontalHeader(); - QHeaderView *vHeader = tableViewObject->verticalHeader(); - - foreach (const QString &realPropertyName, d->realPropertyNames()) { - const QString fakePropertyName - = d->fakePropertyName(QLatin1String("horizontalHeader"), realPropertyName); - d->createMapping(createFakeProperty(fakePropertyName, 0), hHeader, realPropertyName); - } - foreach (const QString &realPropertyName, d->realPropertyNames()) { - const QString fakePropertyName - = d->fakePropertyName(QLatin1String("verticalHeader"), realPropertyName); - d->createMapping(createFakeProperty(fakePropertyName, 0), vHeader, realPropertyName); - } - - foreach (int id, d->m_propertyIdMap.keys()) { - setAttribute(id, true); - setPropertyGroup(id, QLatin1String(headerGroup)); - } + initHeaderProperties(tableViewObject->horizontalHeader(), QLatin1String("horizontalHeader")); + initHeaderProperties(tableViewObject->verticalHeader(), QLatin1String("verticalHeader")); } ItemViewPropertySheet::~ItemViewPropertySheet() @@ -241,6 +176,24 @@ ItemViewPropertySheet::~ItemViewPropertySheet() delete d; } +void ItemViewPropertySheet::initHeaderProperties(QHeaderView *hv, const QString &prefix) +{ + QDesignerPropertySheetExtension *headerSheet = d->m_propertySheet.value(hv); + Q_ASSERT(headerSheet); + const QString headerGroupS = QLatin1String(headerGroup); + foreach (const QString &realPropertyName, d->realPropertyNames()) { + const int headerIndex = headerSheet->indexOf(realPropertyName); + Q_ASSERT(headerIndex != -1); + const QVariant defaultValue = realPropertyName == QLatin1String(visibleProperty) ? + QVariant(true) : headerSheet->property(headerIndex); + const QString fakePropertyName = d->fakePropertyName(prefix, realPropertyName); + const int fakeIndex = createFakeProperty(fakePropertyName, defaultValue); + d->m_propertyIdMap.insert(fakeIndex, Property(headerSheet, headerIndex)); + setAttribute(fakeIndex, true); + setPropertyGroup(fakeIndex, headerGroupS); + } +} + /*! Returns the mapping of fake property names to real property names */ @@ -251,19 +204,17 @@ QHash<QString,QString> ItemViewPropertySheet::propertyNameMap() const QVariant ItemViewPropertySheet::property(int index) const { - if (d->m_propertyIdMap.contains(index)) { - Property realProperty = d->m_propertyIdMap.value(index); - return realProperty.m_sheet->property(realProperty.m_id); - } else { - return QDesignerPropertySheet::property(index); - } + const FakePropertyMap::const_iterator it = d->m_propertyIdMap.constFind(index); + if (it != d->m_propertyIdMap.constEnd()) + return it.value().m_sheet->property(it.value().m_id); + return QDesignerPropertySheet::property(index); } void ItemViewPropertySheet::setProperty(int index, const QVariant &value) { - if (d->m_propertyIdMap.contains(index)) { - Property realProperty = d->m_propertyIdMap.value(index); - realProperty.m_sheet->setProperty(realProperty.m_id, value); + const FakePropertyMap::iterator it = d->m_propertyIdMap.find(index); + if (it != d->m_propertyIdMap.end()) { + it.value().m_sheet->setProperty(it.value().m_id, value); } else { QDesignerPropertySheet::setProperty(index, value); } @@ -271,18 +222,46 @@ void ItemViewPropertySheet::setProperty(int index, const QVariant &value) void ItemViewPropertySheet::setChanged(int index, bool changed) { - if (d->m_propertyIdMap.contains(index)) { - Property realProperty = d->m_propertyIdMap.value(index); - realProperty.m_sheet->setChanged(realProperty.m_id, changed); + const FakePropertyMap::iterator it = d->m_propertyIdMap.find(index); + if (it != d->m_propertyIdMap.end()) { + it.value().m_sheet->setChanged(it.value().m_id, changed); + } else { + QDesignerPropertySheet::setChanged(index, changed); } - QDesignerPropertySheet::setChanged(index, changed); +} + +bool ItemViewPropertySheet::isChanged(int index) const +{ + const FakePropertyMap::const_iterator it = d->m_propertyIdMap.constFind(index); + if (it != d->m_propertyIdMap.constEnd()) + return it.value().m_sheet->isChanged(it.value().m_id); + return QDesignerPropertySheet::isChanged(index); +} + +bool ItemViewPropertySheet::hasReset(int index) const +{ + const FakePropertyMap::const_iterator it = d->m_propertyIdMap.constFind(index); + if (it != d->m_propertyIdMap.constEnd()) + return it.value().m_sheet->hasReset(it.value().m_id); + return QDesignerPropertySheet::hasReset(index); } bool ItemViewPropertySheet::reset(int index) { - if (d->m_propertyIdMap.contains(index)) { - Property realProperty = d->m_propertyIdMap.value(index); - return realProperty.m_sheet->reset(realProperty.m_id); + const FakePropertyMap::iterator it = d->m_propertyIdMap.find(index); + if (it != d->m_propertyIdMap.end()) { + QDesignerPropertySheetExtension *headerSheet = it.value().m_sheet; + const int headerIndex = it.value().m_id; + const bool resetRC = headerSheet->reset(headerIndex); + // Resetting for "visible" might fail and the stored default + // of the Widget database is "false" due to the widget not being + // visible at the time it was determined. Reset to "true" manually. + if (!resetRC && headerSheet->propertyName(headerIndex) == QLatin1String(visibleProperty)) { + headerSheet->setProperty(headerIndex, QVariant(true)); + headerSheet->setChanged(headerIndex, false); + return true; + } + return resetRC; } else { return QDesignerPropertySheet::reset(index); } diff --git a/tools/designer/src/components/formeditor/itemview_propertysheet.h b/tools/designer/src/components/formeditor/itemview_propertysheet.h index a926339..dbcd63d 100644 --- a/tools/designer/src/components/formeditor/itemview_propertysheet.h +++ b/tools/designer/src/components/formeditor/itemview_propertysheet.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE namespace qdesigner_internal { -class ItemViewPropertySheetPrivate; +struct ItemViewPropertySheetPrivate; class ItemViewPropertySheet: public QDesignerPropertySheet { @@ -69,11 +69,15 @@ public: QVariant property(int index) const; void setProperty(int index, const QVariant &value); - void setChanged(int index, bool changed); + virtual void setChanged(int index, bool changed); + virtual bool isChanged(int index) const; - bool reset(int index); + virtual bool hasReset(int index) const; + virtual bool reset(int index); private: + void initHeaderProperties(QHeaderView *hv, const QString &prefix); + ItemViewPropertySheetPrivate *d; }; diff --git a/tools/designer/src/lib/shared/actionrepository.cpp b/tools/designer/src/lib/shared/actionrepository.cpp index 1655d07..83e64e6 100644 --- a/tools/designer/src/lib/shared/actionrepository.cpp +++ b/tools/designer/src/lib/shared/actionrepository.cpp @@ -226,7 +226,7 @@ void ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action, item->setText(action->text()); item->setToolTip(action->text()); // shortcut - const QString shortcut = actionShortCut(core, action).value().toString(); + const QString shortcut = actionShortCut(core, action).value().toString(QKeySequence::NativeText); item = sl[ShortCutColumn]; item->setText(shortcut); item->setToolTip(shortcut); diff --git a/tools/linguist/linguist/messageeditor.h b/tools/linguist/linguist/messageeditor.h index b69af9c..d73c216 100644 --- a/tools/linguist/linguist/messageeditor.h +++ b/tools/linguist/linguist/messageeditor.h @@ -67,7 +67,7 @@ struct MessageEditorData { QList<FormMultiWidget *> transTexts; QString invariantForm; QString firstForm; - float fontSize; + qreal fontSize; bool pluralEditMode; }; diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp index c45459a..b8e8eb2 100644 --- a/tools/linguist/lrelease/main.cpp +++ b/tools/linguist/lrelease/main.cpp @@ -55,6 +55,8 @@ #include <QtCore/QStringList> #include <QtCore/QTextStream> +QT_USE_NAMESPACE + #ifdef QT_BOOTSTRAPPED static void initBinaryDir( #ifndef Q_OS_WIN diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 9389268..56fca06 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -65,6 +65,8 @@ QMap<QString, QStringList> Generator::imgFileExts; QSet<QString> Generator::outputFormats; QStringList Generator::imageFiles; QStringList Generator::imageDirs; +QStringList Generator::exampleDirs; +QStringList Generator::exampleImgExts; QString Generator::outDir; QString Generator::project; @@ -120,12 +122,19 @@ void Generator::initialize(const Config &config) if (!dirInfo.mkdir(outDir + "/images")) config.lastLocation().fatal(tr("Cannot create output directory '%1'") .arg(outDir + "/images")); + if (!dirInfo.mkdir(outDir + "/images/used-in-examples")) + config.lastLocation().fatal(tr("Cannot create output directory '%1'") + .arg(outDir + "/images/used-in-examples")); } imageFiles = config.getStringList(CONFIG_IMAGES); imageDirs = config.getStringList(CONFIG_IMAGEDIRS); + exampleDirs = config.getStringList(CONFIG_EXAMPLEDIRS); + exampleImgExts = config.getStringList(CONFIG_EXAMPLES + Config::dot + + CONFIG_IMAGEEXTENSIONS); - QString imagesDotFileExtensions = CONFIG_IMAGES + Config::dot + CONFIG_FILEEXTENSIONS; + QString imagesDotFileExtensions = + CONFIG_IMAGES + Config::dot + CONFIG_FILEEXTENSIONS; QSet<QString> formats = config.subVars(imagesDotFileExtensions); QSet<QString>::ConstIterator f = formats.begin(); while (f != formats.end()) { @@ -323,7 +332,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) const FakeNode *fake = static_cast<const FakeNode *>(node); if (fake->subType() == Node::Example) generateExampleFiles(fake, marker); - else if (fake->subType() == Node::File) + else if ((fake->subType() == Node::File) || (fake->subType() == Node::Image)) quiet = true; } @@ -530,6 +539,13 @@ void Generator::generateInheritedBy(const ClassNode *classe, } } +/*! + This function is called when the documentation for an + example is being formatted. It outputs the list of source + files comprising the example, and the list of images used + by the example. The images are copied into a subtree of + \c{...doc/html/images/used-in-examples/...} + */ void Generator::generateFileList(const FakeNode* fake, CodeMarker* marker, Node::SubType subtype, @@ -546,9 +562,30 @@ void Generator::generateFileList(const FakeNode* fake, if (child->subType() == subtype) { ++count; QString file = child->name(); + if (subtype == Node::Image) { + if (!file.isEmpty()) { + QDir dirInfo; + QString userFriendlyFilePath; + QString srcPath = Config::findFile(fake->location(), + QStringList(), + exampleDirs, + file, + exampleImgExts, + userFriendlyFilePath); + userFriendlyFilePath.truncate(userFriendlyFilePath.lastIndexOf('/')); + + QString imgOutDir = outDir + "/images/used-in-examples/" + userFriendlyFilePath; + if (!dirInfo.mkpath(imgOutDir)) + fake->location().fatal(tr("Cannot create output directory '%1'") + .arg(imgOutDir)); + + QString imgOutName = Config::copyFile(fake->location(), + srcPath, + file, + imgOutDir); + } - if (file == "network/qftp/images/dir.png") - qDebug() << "FILE:" << file; + } openedList.next(); text << Atom(Atom::ListItemNumber, openedList.numberString()) diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index 7667789..cc1ea25 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -183,6 +183,8 @@ class Generator static QSet<QString> outputFormats; static QStringList imageFiles; static QStringList imageDirs; + static QStringList exampleDirs; + static QStringList exampleImgExts; static QString outDir; static QString project; }; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 8711c6b..ae7bd81 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -3429,6 +3429,8 @@ QString HtmlGenerator::fileName(const Node *node) if (node->type() == Node::Fake) { if (static_cast<const FakeNode *>(node)->subType() == Node::ExternalPage) return node->name(); + if (static_cast<const FakeNode *>(node)->subType() == Node::Image) + return node->name(); } return PageGenerator::fileName(node); } @@ -4000,6 +4002,8 @@ QString HtmlGenerator::getLink(const Atom *atom, if (path.isEmpty()) { link = linkForNode(*node, relative); + if (*node && (*node)->subType() == Node::Image) + link = "images/used-in-examples/" + link; if (targetAtom) link += "#" + refForAtom(targetAtom, *node); } |