diff options
Diffstat (limited to 'tools')
73 files changed, 1270 insertions, 412 deletions
diff --git a/tools/assistant/lib/qhelpgenerator.cpp b/tools/assistant/lib/qhelpgenerator.cpp index 85bdd75..f94031b 100644 --- a/tools/assistant/lib/qhelpgenerator.cpp +++ b/tools/assistant/lib/qhelpgenerator.cpp @@ -712,14 +712,15 @@ bool QHelpGenerator::insertKeywords(const QList<QHelpDataIndexItem> &keywords, d->query->exec(QLatin1String("BEGIN")); QSet<QString> indices; foreach (const QHelpDataIndexItem &itm, keywords) { - - /* - * Identical ids make no sense and just confuse the Assistant user, - * so we ignore all repetitions. - */ + // Identical ids make no sense and just confuse the Assistant user, + // so we ignore all repetitions. if (indices.contains(itm.identifier)) continue; - indices.insert(itm.identifier); + + // Still empty ids should be ignored, as otherwise we will include only + // the first keyword with an empty id. + if (!itm.identifier.isEmpty()) + indices.insert(itm.identifier); pos = itm.reference.indexOf(QLatin1Char('#')); fileName = itm.reference.left(pos); diff --git a/tools/assistant/tools/assistant/doc/assistant.qdoc b/tools/assistant/tools/assistant/doc/assistant.qdoc index 129e60d..eda2063 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdoc +++ b/tools/assistant/tools/assistant/doc/assistant.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/assistant/tools/assistant/openpagesmanager.cpp b/tools/assistant/tools/assistant/openpagesmanager.cpp index 3b69b50..75b8653 100644 --- a/tools/assistant/tools/assistant/openpagesmanager.cpp +++ b/tools/assistant/tools/assistant/openpagesmanager.cpp @@ -167,7 +167,8 @@ void OpenPagesManager::setupInitialPages(bool defaultCollection, m_model->addPage(helpEngine.homePage()); for (int i = 0; i < m_model->rowCount(); ++i) CentralWidget::instance()->addPage(m_model->pageAt(i)); - setCurrentPage(initialPage); + setCurrentPage((initialPage >= m_model->rowCount()) + ? m_model->rowCount() - 1 : initialPage); m_openPagesSwitcher->selectCurrentPage(); } diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 31c115a..3ca57b4 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -590,8 +590,6 @@ void Configure::parseCmdLine() // Image formats -------------------------------------------- else if (configCmdLine.at(i) == "-no-gif") dictionary[ "GIF" ] = "no"; - else if (configCmdLine.at(i) == "-qt-gif") - dictionary[ "GIF" ] = "plugin"; else if (configCmdLine.at(i) == "-no-libtiff") { dictionary[ "TIFF"] = "no"; @@ -1642,7 +1640,7 @@ bool Configure::displayHelp() "[-no-qmake] [-qmake] [-dont-process] [-process]\n" "[-no-style-<style>] [-qt-style-<style>] [-redo]\n" "[-saveconfig <config>] [-loadconfig <config>]\n" - "[-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libpng]\n" + "[-qt-zlib] [-system-zlib] [-no-gif] [-no-libpng]\n" "[-qt-libpng] [-system-libpng] [-no-libtiff] [-qt-libtiff]\n" "[-system-libtiff] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg]\n" "[-no-libmng] [-qt-libmng] [-system-libmng] [-no-qt3support] [-mmx]\n" @@ -1770,7 +1768,6 @@ bool Configure::displayHelp() desc("ZLIB", "system", "-system-zlib", "Use zlib from the operating system.\nSee http://www.gzip.org/zlib\n"); desc("GIF", "no", "-no-gif", "Do not compile GIF reading support."); - desc("GIF", "auto", "-qt-gif", "Compile GIF reading support.\nSee also src/gui/image/qgifhandler_p.h\n"); desc("LIBPNG", "no", "-no-libpng", "Do not compile PNG support."); desc("LIBPNG", "qt", "-qt-libpng", "Use the libpng bundled with Qt."); diff --git a/tools/designer/data/ui4.xsd b/tools/designer/data/ui4.xsd index fc9c120..53bae62 100644 --- a/tools/designer/data/ui4.xsd +++ b/tools/designer/data/ui4.xsd @@ -207,6 +207,7 @@ <xs:attribute name="column" type="xs:integer" /> <xs:attribute name="rowspan" type="xs:integer" /> <xs:attribute name="colspan" type="xs:integer" /> + <xs:attribute name="alignment" type="xs:string" /> </xs:complexType> <!-- item view begin --> diff --git a/tools/designer/src/components/formeditor/formwindow.cpp b/tools/designer/src/components/formeditor/formwindow.cpp index ebf00f9..88b86d8 100644 --- a/tools/designer/src/components/formeditor/formwindow.cpp +++ b/tools/designer/src/components/formeditor/formwindow.cpp @@ -1683,10 +1683,13 @@ void FormWindow::cut() // for cases like QMainWindow (central widget is an inner container) or QStackedWidget (page is an inner container) QWidget *FormWindow::innerContainer(QWidget *outerContainer) const { - bool isContainer = m_core->widgetDataBase()->isContainer(outerContainer); - if (isContainer) - if (QDesignerContainerExtension *container = qt_extension<QDesignerContainerExtension*>(m_core->extensionManager(), outerContainer)) - return container->widget(container->currentIndex()); + if (m_core->widgetDataBase()->isContainer(outerContainer)) + if (const QDesignerContainerExtension *container = qt_extension<QDesignerContainerExtension*>(m_core->extensionManager(), outerContainer)) { + const int currentIndex = container->currentIndex(); + return currentIndex >= 0 ? + container->widget(currentIndex) : + static_cast<QWidget *>(0); + } return outerContainer; } @@ -1706,8 +1709,10 @@ QWidget *FormWindow::containerForPaste() const QWidget *containerOfW = findContainer(selection.first(), /* exclude layouts */ true); if (!containerOfW || containerOfW == mainContainer()) break; - // No layouts, must be container + // No layouts, must be container. No empty page-based containers. containerOfW = innerContainer(containerOfW); + if (!containerOfW) + break; if (LayoutInfo::layoutType(m_core, containerOfW) != LayoutInfo::NoLayout || !m_core->widgetDataBase()->isContainer(containerOfW)) break; w = containerOfW; @@ -1716,6 +1721,8 @@ QWidget *FormWindow::containerForPaste() const // and the like as the central widget has the layout). w = innerContainer(w); + if (!w) + return 0; if (LayoutInfo::layoutType(m_core, w) != LayoutInfo::NoLayout) return 0; // Go up via container extension (also includes step from QMainWindow to its central widget) diff --git a/tools/designer/src/lib/sdk/abstractdnditem.qdoc b/tools/designer/src/lib/sdk/abstractdnditem.qdoc index bdae59c..0d63954 100644 --- a/tools/designer/src/lib/sdk/abstractdnditem.qdoc +++ b/tools/designer/src/lib/sdk/abstractdnditem.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/designer/src/lib/sdk/abstracticoncache.qdoc b/tools/designer/src/lib/sdk/abstracticoncache.qdoc index 6eb6b13..467eca2 100644 --- a/tools/designer/src/lib/sdk/abstracticoncache.qdoc +++ b/tools/designer/src/lib/sdk/abstracticoncache.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/designer/src/lib/sdk/dynamicpropertysheet.qdoc b/tools/designer/src/lib/sdk/dynamicpropertysheet.qdoc index b813c16..93690cd 100644 --- a/tools/designer/src/lib/sdk/dynamicpropertysheet.qdoc +++ b/tools/designer/src/lib/sdk/dynamicpropertysheet.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/designer/src/lib/sdk/layoutdecoration.qdoc b/tools/designer/src/lib/sdk/layoutdecoration.qdoc index 1b38975..1dacbb2 100644 --- a/tools/designer/src/lib/sdk/layoutdecoration.qdoc +++ b/tools/designer/src/lib/sdk/layoutdecoration.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/designer/src/lib/sdk/membersheet.qdoc b/tools/designer/src/lib/sdk/membersheet.qdoc index 7185579..f9d76cf 100644 --- a/tools/designer/src/lib/sdk/membersheet.qdoc +++ b/tools/designer/src/lib/sdk/membersheet.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/designer/src/lib/sdk/propertysheet.qdoc b/tools/designer/src/lib/sdk/propertysheet.qdoc index 8c49087..ab2477b 100644 --- a/tools/designer/src/lib/sdk/propertysheet.qdoc +++ b/tools/designer/src/lib/sdk/propertysheet.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/designer/src/lib/sdk/taskmenu.qdoc b/tools/designer/src/lib/sdk/taskmenu.qdoc index 23ea1b2..68854b3 100644 --- a/tools/designer/src/lib/sdk/taskmenu.qdoc +++ b/tools/designer/src/lib/sdk/taskmenu.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/designer/src/lib/shared/morphmenu.cpp b/tools/designer/src/lib/shared/morphmenu.cpp index 80eac0c..eb5bc87 100644 --- a/tools/designer/src/lib/shared/morphmenu.cpp +++ b/tools/designer/src/lib/shared/morphmenu.cpp @@ -193,7 +193,7 @@ static QStringList classesOfCategory(MorphCategory cat) << QLatin1String("QSpinBox") << QLatin1String("QDoubleSpinBox"); break; case MorphTextEdit: - l << QLatin1String("QTextEdit") << QLatin1String("QPlainTextEdit"); + l << QLatin1String("QTextEdit") << QLatin1String("QPlainTextEdit") << QLatin1String("QTextBrowser"); break; } } diff --git a/tools/designer/src/lib/shared/qdesigner_command2.cpp b/tools/designer/src/lib/shared/qdesigner_command2.cpp index c16bf40..ce2128a 100644 --- a/tools/designer/src/lib/shared/qdesigner_command2.cpp +++ b/tools/designer/src/lib/shared/qdesigner_command2.cpp @@ -154,6 +154,68 @@ QString MorphLayoutCommand::formatDescription(QDesignerFormEditorInterface * /* return QApplication::translate("Command", "Change layout of '%1' from %2 to %3").arg(widgetName, oldName, newName); } +LayoutAlignmentCommand::LayoutAlignmentCommand(QDesignerFormWindowInterface *formWindow) : + QDesignerFormWindowCommand(QApplication::translate("Command", "Change layout alignment"), formWindow), + m_newAlignment(0), m_oldAlignment(0), m_widget(0) +{ +} + +bool LayoutAlignmentCommand::init(QWidget *w, Qt::Alignment alignment) +{ + bool enabled; + m_newAlignment = alignment; + m_oldAlignment = LayoutAlignmentCommand::alignmentOf(core(), w, &enabled); + m_widget = w; + return enabled; +} + +void LayoutAlignmentCommand::redo() +{ + LayoutAlignmentCommand::applyAlignment(core(), m_widget, m_newAlignment); +} + +void LayoutAlignmentCommand::undo() +{ + LayoutAlignmentCommand::applyAlignment(core(), m_widget, m_oldAlignment); +} + +// Find out alignment and return whether command is enabled. +Qt::Alignment LayoutAlignmentCommand::alignmentOf(const QDesignerFormEditorInterface *core, QWidget *w, bool *enabledIn) +{ + bool managed; + QLayout *layout; + + if (enabledIn) + *enabledIn = false; + // Can only work on a managed layout + const LayoutInfo::Type type = LayoutInfo::laidoutWidgetType(core, w, &managed, &layout); + const bool enabled = layout && managed && + (type == LayoutInfo::HBox || type == LayoutInfo::VBox + || type == LayoutInfo::Grid); + if (!enabled) + return Qt::Alignment(0); + // Get alignment + const int index = layout->indexOf(w); + Q_ASSERT(index >= 0); + if (enabledIn) + *enabledIn = true; + return layout->itemAt(index)->alignment(); +} + +void LayoutAlignmentCommand::applyAlignment(const QDesignerFormEditorInterface *core, QWidget *w, Qt::Alignment a) +{ + // Find layout and apply to item + QLayout *layout; + LayoutInfo::laidoutWidgetType(core, w, 0, &layout); + if (layout) { + const int index = layout->indexOf(w); + if (index >= 0) { + layout->itemAt(index)->setAlignment(a); + layout->update(); + } + } +} + } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/tools/designer/src/lib/shared/qdesigner_command2_p.h b/tools/designer/src/lib/shared/qdesigner_command2_p.h index 5c7b9d6..4e9c95a 100644 --- a/tools/designer/src/lib/shared/qdesigner_command2_p.h +++ b/tools/designer/src/lib/shared/qdesigner_command2_p.h @@ -94,6 +94,28 @@ private: QWidget *m_layoutBase; }; +// Change the alignment of a widget in a managed grid/box layout cell. +class LayoutAlignmentCommand : public QDesignerFormWindowCommand { + Q_DISABLE_COPY(LayoutAlignmentCommand) +public: + explicit LayoutAlignmentCommand(QDesignerFormWindowInterface *formWindow); + + bool init(QWidget *w, Qt::Alignment alignment); + + virtual void redo(); + virtual void undo(); + + // Find out alignment and return whether command is enabled. + static Qt::Alignment alignmentOf(const QDesignerFormEditorInterface *core, QWidget *w, bool *enabled = 0); + +private: + static void applyAlignment(const QDesignerFormEditorInterface *core, QWidget *w, Qt::Alignment a); + + Qt::Alignment m_newAlignment; + Qt::Alignment m_oldAlignment; + QWidget *m_widget; +}; + } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/tools/designer/src/lib/shared/qdesigner_taskmenu.cpp b/tools/designer/src/lib/shared/qdesigner_taskmenu.cpp index a607f35..cdb7d15 100644 --- a/tools/designer/src/lib/shared/qdesigner_taskmenu.cpp +++ b/tools/designer/src/lib/shared/qdesigner_taskmenu.cpp @@ -41,6 +41,7 @@ #include "qdesigner_taskmenu_p.h" #include "qdesigner_command_p.h" +#include "qdesigner_command2_p.h" #include "richtexteditor_p.h" #include "plaintexteditor_p.h" #include "stylesheeteditor_p.h" @@ -180,10 +181,128 @@ QString ObjectNameDialog::newObjectName() const { return m_editor->text(); } +} // namespace +namespace qdesigner_internal { + +// Sub menu displaying the alignment options of a widget in a managed +// grid/box layout cell. +class LayoutAlignmentMenu { +public: + explicit LayoutAlignmentMenu(QObject *parent); + + QAction *subMenuAction() const { return m_subMenuAction; } + + void connect(QObject *receiver, const char *aSlot); + + // Set up enabled state and checked actions according to widget (managed box/grid) + bool setAlignment(const QDesignerFormEditorInterface *core, QWidget *w); + + // Return the currently checked alignment + Qt::Alignment alignment() const; + +private: + enum Actions { HorizNone, Left, HorizCenter, Right, VerticalNone, Top, VerticalCenter, Bottom }; + static QAction *createAction(const QString &text, int data, QMenu *menu, QActionGroup *ag); + + QAction *m_subMenuAction; + QActionGroup *m_horizGroup; + QActionGroup *m_verticalGroup; + QAction *m_actions[Bottom + 1]; +}; + +QAction *LayoutAlignmentMenu::createAction(const QString &text, int data, QMenu *menu, QActionGroup *ag) +{ + QAction * a = new QAction(text, 0); + a->setCheckable(true); + a->setData(QVariant(data)); + menu->addAction(a); + ag->addAction(a); + return a; +} + +LayoutAlignmentMenu::LayoutAlignmentMenu(QObject *parent) : + m_subMenuAction(new QAction(QDesignerTaskMenu::tr("Layout Alignment"), parent)), + m_horizGroup(new QActionGroup(parent)), + m_verticalGroup(new QActionGroup(parent)) +{ + m_horizGroup->setExclusive(true); + m_verticalGroup->setExclusive(true); + + QMenu *menu = new QMenu; + m_subMenuAction->setMenu(menu); + + m_actions[HorizNone] = createAction(QDesignerTaskMenu::tr("No Horizontal Alignment"), 0, menu, m_horizGroup); + m_actions[Left] = createAction(QDesignerTaskMenu::tr("Left"), Qt::AlignLeft, menu, m_horizGroup); + m_actions[HorizCenter] = createAction(QDesignerTaskMenu::tr("Center Horizontally"), Qt::AlignHCenter, menu, m_horizGroup); + m_actions[Right] = createAction(QDesignerTaskMenu::tr("Right"), Qt::AlignRight, menu, m_horizGroup); + menu->addSeparator(); + m_actions[VerticalNone] = createAction(QDesignerTaskMenu::tr("No Vertical Alignment"), 0, menu, m_verticalGroup); + m_actions[Top] = createAction(QDesignerTaskMenu::tr("Top"), Qt::AlignTop, menu, m_verticalGroup); + m_actions[VerticalCenter] = createAction(QDesignerTaskMenu::tr("Center Vertically"), Qt::AlignVCenter, menu, m_verticalGroup); + m_actions[Bottom] = createAction(QDesignerTaskMenu::tr("Bottom"), Qt::AlignBottom, menu, m_verticalGroup); +} + +void LayoutAlignmentMenu::connect(QObject *receiver, const char *aSlot) +{ + QObject::connect(m_horizGroup, SIGNAL(triggered(QAction*)), receiver, aSlot); + QObject::connect(m_verticalGroup, SIGNAL(triggered(QAction*)), receiver, aSlot); +} + +bool LayoutAlignmentMenu::setAlignment(const QDesignerFormEditorInterface *core, QWidget *w) +{ + bool enabled; + const Qt::Alignment alignment = LayoutAlignmentCommand::alignmentOf(core, w, &enabled); + if (!enabled) { + m_subMenuAction->setEnabled(false); + m_actions[HorizNone]->setChecked(true); + m_actions[VerticalNone]->setChecked(true); + return false; + } + // Get alignment + switch (alignment & Qt::AlignHorizontal_Mask) { + case Qt::AlignLeft: + m_actions[Left]->setChecked(true); + break; + case Qt::AlignHCenter: + m_actions[HorizCenter]->setChecked(true); + break; + case Qt::AlignRight: + m_actions[Right]->setChecked(true); + break; + default: + m_actions[HorizNone]->setChecked(true); + break; + } + switch (alignment & Qt::AlignVertical_Mask) { + case Qt::AlignTop: + m_actions[Top]->setChecked(true); + break; + case Qt::AlignVCenter: + m_actions[VerticalCenter]->setChecked(true); + break; + case Qt::AlignBottom: + m_actions[Bottom]->setChecked(true); + break; + default: + m_actions[VerticalNone]->setChecked(true); + break; + } + return true; +} + +Qt::Alignment LayoutAlignmentMenu::alignment() const +{ + Qt::Alignment alignment = 0; + if (const QAction *horizAction = m_horizGroup->checkedAction()) + if (const int horizAlign = horizAction->data().toInt()) + alignment |= static_cast<Qt::Alignment>(horizAlign); + if (const QAction *vertAction = m_verticalGroup->checkedAction()) + if (const int vertAlign = vertAction->data().toInt()) + alignment |= static_cast<Qt::Alignment>(vertAlign); + return alignment; } -namespace qdesigner_internal { // -------------- QDesignerTaskMenuPrivate class QDesignerTaskMenuPrivate { public: @@ -214,6 +333,7 @@ public: QAction *m_navigateToSlot; PromotionTaskMenu* m_promotionTaskMenu; QActionGroup *m_sizeActionGroup; + LayoutAlignmentMenu m_layoutAlignmentMenu; QAction *m_sizeActionsSubMenu; }; @@ -242,6 +362,7 @@ QDesignerTaskMenuPrivate::QDesignerTaskMenuPrivate(QWidget *widget, QObject *par m_navigateToSlot(new QAction(QDesignerTaskMenu::tr("Go to slot..."), parent)), m_promotionTaskMenu(new PromotionTaskMenu(widget, PromotionTaskMenu::ModeManagedMultiSelection, parent)), m_sizeActionGroup(new QActionGroup(parent)), + m_layoutAlignmentMenu(parent), m_sizeActionsSubMenu(new QAction(QDesignerTaskMenu::tr("Size Constraints"), parent)) { QMenu *sizeMenu = new QMenu; @@ -293,6 +414,7 @@ QDesignerTaskMenu::QDesignerTaskMenu(QWidget *widget, QObject *parent) : connect(d->m_containerFakeMethods, SIGNAL(triggered()), this, SLOT(containerFakeMethods())); connect(d->m_navigateToSlot, SIGNAL(triggered()), this, SLOT(slotNavigateToSlot())); connect(d->m_sizeActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(applySize(QAction*))); + d->m_layoutAlignmentMenu.connect(this, SLOT(slotLayoutAlignment())); } QDesignerTaskMenu::~QDesignerTaskMenu() @@ -410,6 +532,9 @@ QList<QAction*> QDesignerTaskMenu::taskActions() const actions.append(d->m_changeStyleSheet); actions.append(d->m_separator6); actions.append(d->m_sizeActionsSubMenu); + if (d->m_layoutAlignmentMenu.setAlignment(formWindow->core(), d->m_widget)) + actions.append(d->m_layoutAlignmentMenu.subMenuAction()); + d->m_promotionTaskMenu->setMode(formWindow->isManaged(d->m_widget) ? PromotionTaskMenu::ModeManagedMultiSelection : PromotionTaskMenu::ModeUnmanagedMultiSelection); d->m_promotionTaskMenu->addActions(formWindow, PromotionTaskMenu::LeadingSeparator, actions); @@ -771,7 +896,17 @@ void QDesignerTaskMenu::setProperty(QDesignerFormWindowInterface *fw, PropertyM } } - +void QDesignerTaskMenu::slotLayoutAlignment() +{ + QDesignerFormWindowInterface *fw = formWindow(); + const Qt::Alignment newAlignment = d->m_layoutAlignmentMenu.alignment(); + LayoutAlignmentCommand *cmd = new LayoutAlignmentCommand(fw); + if (cmd->init(d->m_widget, newAlignment)) { + fw->commandHistory()->push(cmd); + } else { + delete cmd; + } +} } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/tools/designer/src/lib/shared/qdesigner_taskmenu_p.h b/tools/designer/src/lib/shared/qdesigner_taskmenu_p.h index da7f572..23586f7 100644 --- a/tools/designer/src/lib/shared/qdesigner_taskmenu_p.h +++ b/tools/designer/src/lib/shared/qdesigner_taskmenu_p.h @@ -118,6 +118,7 @@ private slots: void containerFakeMethods(); void slotNavigateToSlot(); void applySize(QAction *a); + void slotLayoutAlignment(); private: QDesignerTaskMenuPrivate *d; diff --git a/tools/designer/src/lib/shared/qlayout_widget.cpp b/tools/designer/src/lib/shared/qlayout_widget.cpp index acec815..012f605 100644 --- a/tools/designer/src/lib/shared/qlayout_widget.cpp +++ b/tools/designer/src/lib/shared/qlayout_widget.cpp @@ -601,7 +601,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const } } - // Grid Layout state. Datatypically store the state of a GridLayout as a map of + // Grid Layout state. Datatype storing the state of a GridLayout as a map of // widgets to QRect(columns, rows) and size. Used to store the state for undo operations // that do not change the widgets within the layout; also provides some manipulation // functions and ability to apply the state to a layout provided its widgets haven't changed. @@ -634,7 +634,11 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const static CellStates cellStates(const QList<QRect> &rects, int numRows, int numColumns); typedef QMap<QWidget *, QRect> WidgetItemMap; + typedef QMap<QWidget *, Qt::Alignment> WidgetAlignmentMap; + WidgetItemMap widgetItemMap; + WidgetAlignmentMap widgetAlignmentMap; + int rowCount; int colCount; }; @@ -706,8 +710,11 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const const int count = l->count(); for (int i = 0; i < count; i++) { QLayoutItem *item = l->itemAt(i); - if (!LayoutInfo::isEmptyItem(item)) + if (!LayoutInfo::isEmptyItem(item)) { widgetItemMap.insert(item->widget(), gridItemInfo(l, i)); + if (item->alignment()) + widgetAlignmentMap.insert(item->widget(), item->alignment()); + } } } @@ -743,7 +750,8 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const const LayoutItemRectMap::const_iterator icend = itemMap.constEnd(); for (LayoutItemRectMap::const_iterator it = itemMap.constBegin(); it != icend; ++it) { const QRect info = it.value(); - grid->addItem(it.key(), info.y(), info.x(), info.height(), info.width()); + const Qt::Alignment alignment = widgetAlignmentMap.value(it.key()->widget(), Qt::Alignment(0)); + grid->addItem(it.key(), info.y(), info.x(), info.height(), info.width(), alignment); } // create spacers const CellStates cs = cellStates(itemMap.values(), rowCount, colCount); diff --git a/tools/designer/src/lib/shared/qtresourcemodel.cpp b/tools/designer/src/lib/shared/qtresourcemodel.cpp index 709f389..e3fc805 100644 --- a/tools/designer/src/lib/shared/qtresourcemodel.cpp +++ b/tools/designer/src/lib/shared/qtresourcemodel.cpp @@ -428,10 +428,10 @@ void QtResourceModelPrivate::removeOldPaths(QtResourceSet *resourceSet, const QS void QtResourceModelPrivate::setWatcherEnabled(const QString &path, bool enable) { - m_fileWatcher->removePath(path); - - if (!enable) + if (!enable) { + m_fileWatcher->removePath(path); return; + } QFileInfo fi(path); if (fi.exists()) diff --git a/tools/designer/src/lib/uilib/abstractformbuilder.cpp b/tools/designer/src/lib/uilib/abstractformbuilder.cpp index 3f40d81..ae6fac9 100644 --- a/tools/designer/src/lib/uilib/abstractformbuilder.cpp +++ b/tools/designer/src/lib/uilib/abstractformbuilder.cpp @@ -794,6 +794,69 @@ static inline QFormLayout::ItemRole formLayoutRole(int column, int colspan) } #endif +static inline QString alignmentValue(Qt::Alignment a) +{ + QString h,v; + switch (a & Qt::AlignHorizontal_Mask) { + case Qt::AlignLeft: + h = QLatin1String("Qt::AlignLeft"); + break; + case Qt::AlignRight: + h = QLatin1String("Qt::AlignRight"); + break; + case Qt::AlignHCenter: + h = QLatin1String("Qt::AlignHCenter"); + break; + case Qt::AlignJustify: + h = QLatin1String("Qt::AlignJustify"); + break; + } + switch (a & Qt::AlignVertical_Mask) { + case Qt::AlignTop: + v = QLatin1String("Qt::AlignTop"); + break; + case Qt::AlignBottom: + v = QLatin1String("Qt::AlignBottom"); + break; + case Qt::AlignVCenter: + v = QLatin1String("Qt::AlignVCenter"); + break; + } + if (h.isEmpty() && v.isEmpty()) + return QString(); + if (!v.isEmpty()) { + if (!h.isEmpty()) + h += QLatin1Char('|'); + h += v; + } + return h; +} + +static inline Qt::Alignment alignmentFromDom(const QString &in) +{ + Qt::Alignment rc = 0; + if (!in.isEmpty()) { + foreach (const QString &f, in.split(QLatin1Char('|'))) { + if (f == QLatin1String("Qt::AlignLeft")) { + rc |= Qt::AlignLeft; + } else if (f == QLatin1String("Qt::AlignRight")) { + rc |= Qt::AlignRight; + } else if (f == QLatin1String("Qt::AlignHCenter")) { + rc |= Qt::AlignHCenter; + } else if (f == QLatin1String("Qt::AlignJustify")) { + rc |= Qt::AlignJustify; + } else if (f == QLatin1String("Qt::AlignTop")) { + rc |= Qt::AlignTop; + } else if (f == QLatin1String("Qt::AlignBottom")) { + rc |= Qt::AlignBottom; + } else if (f == QLatin1String("Qt::AlignVCenter")) { + rc |= Qt::AlignVCenter; + } + } + } + return rc; +} + /*! \internal */ @@ -838,12 +901,15 @@ QLayoutItem *QAbstractFormBuilder::create(DomLayoutItem *ui_layoutItem, QLayout { switch (ui_layoutItem->kind()) { case DomLayoutItem::Widget: { - if (QWidget *w = create(ui_layoutItem->elementWidget(), parentWidget)) + if (QWidget *w = create(ui_layoutItem->elementWidget(), parentWidget)) { #ifdef QFORMINTERNAL_NAMESPACE // uilib - return new QWidgetItemV2(w); + QWidgetItem *item = new QWidgetItemV2(w); #else // Within Designer: Use factory method that returns special items that refuse to shrink to 0,0 - return QLayoutPrivate::createWidgetItem(layout, w); + QWidgetItem *item = QLayoutPrivate::createWidgetItem(layout, w); #endif + item->setAlignment(alignmentFromDom(ui_layoutItem->attributeAlignment())); + return item; + } qWarning() << QCoreApplication::translate("QAbstractFormBuilder", "Empty widget item in %1 '%2'.").arg(QString::fromUtf8(layout->metaObject()->className()), layout->objectName()); return 0; } @@ -1384,13 +1450,14 @@ DomActionRef *QAbstractFormBuilder::createActionRefDom(QAction *action) // Struct to store layout item parameters for saving layout items struct FormBuilderSaveLayoutEntry { explicit FormBuilderSaveLayoutEntry(QLayoutItem *li = 0) : - item(li), row(-1), column(-1), rowSpan(0), columnSpan(0) {} + item(li), row(-1), column(-1), rowSpan(0), columnSpan(0), alignment(0) {} QLayoutItem *item; int row; int column; int rowSpan; int columnSpan; + Qt::Alignment alignment; }; // Create list from standard box layout @@ -1401,7 +1468,9 @@ static QList<FormBuilderSaveLayoutEntry> saveLayoutEntries(const QLayout *layout rc.reserve(count); for (int idx = 0; idx < count; ++idx) { QLayoutItem *item = layout->itemAt(idx); - rc.append(FormBuilderSaveLayoutEntry(item)); + FormBuilderSaveLayoutEntry entry(item); + entry.alignment = item->alignment(); + rc.append(entry); } } return rc; @@ -1417,6 +1486,7 @@ static QList<FormBuilderSaveLayoutEntry> saveGridLayoutEntries(QGridLayout *grid QLayoutItem *item = gridLayout->itemAt(idx); FormBuilderSaveLayoutEntry entry(item); gridLayout->getItemPosition(idx, &entry.row, &entry.column, &entry.rowSpan,&entry.columnSpan); + entry.alignment = item->alignment(); rc.append(entry); } } @@ -1490,6 +1560,8 @@ DomLayout *QAbstractFormBuilder::createDom(QLayout *layout, DomLayout *ui_layout ui_item->setAttributeRowSpan(item.rowSpan); if (item.columnSpan > 1) ui_item->setAttributeColSpan(item.columnSpan); + if (item.alignment) + ui_item->setAttributeAlignment(alignmentValue(item.alignment)); ui_items.append(ui_item); } } diff --git a/tools/designer/src/lib/uilib/container.qdoc b/tools/designer/src/lib/uilib/container.qdoc index a3bbcc6..cea5a45 100644 --- a/tools/designer/src/lib/uilib/container.qdoc +++ b/tools/designer/src/lib/uilib/container.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/designer/src/lib/uilib/customwidget.qdoc b/tools/designer/src/lib/uilib/customwidget.qdoc index cdbdfa2..88c169a 100644 --- a/tools/designer/src/lib/uilib/customwidget.qdoc +++ b/tools/designer/src/lib/uilib/customwidget.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/designer/src/lib/uilib/ui4.cpp b/tools/designer/src/lib/uilib/ui4.cpp index 98974e6..2b5fe8b 100644 --- a/tools/designer/src/lib/uilib/ui4.cpp +++ b/tools/designer/src/lib/uilib/ui4.cpp @@ -3673,6 +3673,7 @@ void DomLayoutItem::clear(bool clear_all) m_attr_rowSpan = 0; m_has_attr_colSpan = false; m_attr_colSpan = 0; + m_has_attr_alignment = false; } m_kind = Unknown; @@ -3694,6 +3695,7 @@ DomLayoutItem::DomLayoutItem() m_attr_rowSpan = 0; m_has_attr_colSpan = false; m_attr_colSpan = 0; + m_has_attr_alignment = false; m_widget = 0; m_layout = 0; m_spacer = 0; @@ -3727,6 +3729,10 @@ void DomLayoutItem::read(QXmlStreamReader &reader) setAttributeColSpan(attribute.value().toString().toInt()); continue; } + if (name == QLatin1String("alignment")) { + setAttributeAlignment(attribute.value().toString()); + continue; + } reader.raiseError(QLatin1String("Unexpected attribute ") + name.toString()); } @@ -3779,6 +3785,8 @@ void DomLayoutItem::read(const QDomElement &node) setAttributeRowSpan(node.attribute(QLatin1String("rowspan")).toInt()); if (node.hasAttribute(QLatin1String("colspan"))) setAttributeColSpan(node.attribute(QLatin1String("colspan")).toInt()); + if (node.hasAttribute(QLatin1String("alignment"))) + setAttributeAlignment(node.attribute(QLatin1String("alignment"))); for (QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { if (!n.isElement()) @@ -3828,6 +3836,9 @@ void DomLayoutItem::write(QXmlStreamWriter &writer, const QString &tagName) cons if (hasAttributeColSpan()) writer.writeAttribute(QLatin1String("colspan"), QString::number(attributeColSpan())); + if (hasAttributeAlignment()) + writer.writeAttribute(QLatin1String("alignment"), attributeAlignment()); + switch (kind()) { case Widget: { DomWidget* v = elementWidget(); diff --git a/tools/designer/src/lib/uilib/ui4_p.h b/tools/designer/src/lib/uilib/ui4_p.h index a464a89..836175e 100644 --- a/tools/designer/src/lib/uilib/ui4_p.h +++ b/tools/designer/src/lib/uilib/ui4_p.h @@ -1427,6 +1427,11 @@ public: inline void setAttributeColSpan(int a) { m_attr_colSpan = a; m_has_attr_colSpan = true; } inline void clearAttributeColSpan() { m_has_attr_colSpan = false; } + inline bool hasAttributeAlignment() const { return m_has_attr_alignment; } + inline QString attributeAlignment() const { return m_attr_alignment; } + inline void setAttributeAlignment(const QString& a) { m_attr_alignment = a; m_has_attr_alignment = true; } + inline void clearAttributeAlignment() { m_has_attr_alignment = false; } + // child element accessors enum Kind { Unknown = 0, Widget, Layout, Spacer }; inline Kind kind() const { return m_kind; } @@ -1460,6 +1465,9 @@ private: int m_attr_colSpan; bool m_has_attr_colSpan; + QString m_attr_alignment; + bool m_has_attr_alignment; + // child element data Kind m_kind; DomWidget* m_widget; diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp index 8520cf7..4896272 100644 --- a/tools/linguist/linguist/mainwindow.cpp +++ b/tools/linguist/linguist/mainwindow.cpp @@ -2498,8 +2498,8 @@ void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose) } if (m_ui.actionPlaceMarkerMatches->isChecked()) { - // Stores the occurence count of the place markers in the map placeMarkerIndexes. - // i.e. the occurence count of %1 is stored at placeMarkerIndexes[1], + // Stores the occurrence count of the place markers in the map placeMarkerIndexes. + // i.e. the occurrence count of %1 is stored at placeMarkerIndexes[1], // count of %2 is stored at placeMarkerIndexes[2] etc. // In the first pass, it counts all place markers in the sourcetext. // In the second pass it (de)counts all place markers in the translation. diff --git a/tools/linguist/linguist/printout.cpp b/tools/linguist/linguist/printout.cpp index 581dc00..7ec6875 100644 --- a/tools/linguist/linguist/printout.cpp +++ b/tools/linguist/linguist/printout.cpp @@ -130,7 +130,7 @@ void PrintOut::addBox(int percent, const QString &text, Style style, Qt::Alignme cp.rect.setSize(QSize(cp.rect.width() + wd, qMax(cp.rect.height(), ht))); } -// use init if inital vsize should be calculated (first breakPage call) +// use init if initial vsize should be calculated (first breakPage call) void PrintOut::breakPage(bool init) { static const int LeftAlign = Qt::AlignLeft | Qt::AlignTop; diff --git a/tools/linguist/shared/ts.dtd b/tools/linguist/shared/ts.dtd index 4d2cdeb..12d3562 100644 --- a/tools/linguist/shared/ts.dtd +++ b/tools/linguist/shared/ts.dtd @@ -4,8 +4,6 @@ ! ! The location element is set as optional since it was introduced first in Qt 4.2. ! The userdata element is set as optional since it was introduced first in Qt 4.4. - ! The source and translation elements are optional starting with version 3.0 - ! (Qt 4.6) to support S60 blank messages. ! --> <!-- @@ -36,13 +34,10 @@ language CDATA #IMPLIED> <!-- The encoding to use in the QM file by default. Default is ISO-8859-1. --> <!ELEMENT defaultcodec (#PCDATA) > -<!ELEMENT context (name?, comment?, (context|message)+) > +<!ELEMENT context (name, comment?, (context|message)+) > <!ATTLIST context encoding CDATA #IMPLIED> <!ELEMENT name %evilstring; > -<!-- If "no", then the context nesting is for informational puposes only --> -<!ATTLIST name - nest (yes|no) "yes"> <!-- This is "disambiguation" in the (new) API, or "msgctxt" in gettext speak --> <!ELEMENT comment %evilstring; > <!-- Previous content of comment (result of merge) --> @@ -53,12 +48,13 @@ <!ELEMENT translatorcomment %evilstring; > <!ELEMENT message (location*, source?, oldsource?, comment?, oldcomment?, extracomment?, translatorcomment?, translation?, userdata?, extra-**) > <!-- - ! If utf8 is true, the defaultcodec is overridden and the message is encoded - ! in UTF-8 in the QM file. + ! If utf8 is "true", the defaultcodec is overridden and the message is encoded + ! in UTF-8 in the QM file. If it is "both", both source encodings are stored + ! in the QM file. --> <!ATTLIST message id CDATA #IMPLIED - utf8 (true|false) "false" + utf8 (true|false|both) "false" numerus (yes|no) "no"> <!ELEMENT location EMPTY> <!-- @@ -100,14 +96,5 @@ --> <!ELEMENT numerusform (#PCDATA|byte|lengthvariant)* > <!ATTLIST numerusform - plurality (nullar|singular|dual|trial|paucal|greaterpaucal|plural|greaterplural) #IMPLIED> variants (yes|no) "no"> <!ELEMENT lengthvariant %evilstring; > -<!-- - ! The translation variants have a priority between 1 ("highest") and 9 ("lowest") - ! Typically longer translations get a higher priority. - ! If omitted, the order of appearance of the variants in the TS files is used. - --> -<!ATTLIST lengthvariant - priority (1|2|3|4|5|6|7|8|9) #IMPLIED> - diff --git a/tools/macdeployqt/shared/shared.cpp b/tools/macdeployqt/shared/shared.cpp index 52cf04b..c7d23c0 100644 --- a/tools/macdeployqt/shared/shared.cpp +++ b/tools/macdeployqt/shared/shared.cpp @@ -388,7 +388,7 @@ DeploymentInfo deployQtFrameworks(QList<FrameworkInfo> frameworks, foreach (FrameworkInfo dependency, dependencies) { changeInstallName(dependency.installName, dependency.deployedInstallName, deployedBinaryPath); - // Deploy framework if neccesary. + // Deploy framework if necessary. if (copiedFrameworks.contains(dependency.frameworkName) == false && frameworks.contains(dependency) == false) { frameworks.append(dependency); } diff --git a/tools/porting/src/preprocessorcontrol.cpp b/tools/porting/src/preprocessorcontrol.cpp index 673ed08..31adc32 100644 --- a/tools/porting/src/preprocessorcontrol.cpp +++ b/tools/porting/src/preprocessorcontrol.cpp @@ -154,7 +154,7 @@ QByteArray PreprocessorCache::readFile(const QString &filename) const // read the file for us. if (receivers(SIGNAL(readFile(QByteArray&,QString))) > 0) { QByteArray array; - // Workaround for "not beeing able to emit from const function" + // Workaround for "not being able to emit from const function" PreprocessorCache *cache = const_cast<PreprocessorCache *>(this); emit cache->readFile(array, filename); return array; diff --git a/tools/porting/src/textreplacement.h b/tools/porting/src/textreplacement.h index f90fb82..f351552 100644 --- a/tools/porting/src/textreplacement.h +++ b/tools/porting/src/textreplacement.h @@ -53,7 +53,7 @@ class TextReplacement public: QByteArray newText; int insertPosition; - int currentLenght; //lenght of the text that is going to be replaced. + int currentLenght; //length of the text that is going to be replaced. bool operator<(const TextReplacement &other) const { return (insertPosition < other.insertPosition); @@ -70,7 +70,7 @@ public: insert maintains the TextReplacement list in sorted order. - Returns true if the insert was successfull, false otherwise; + Returns true if the insert was successful, false otherwise; */ bool insert(QByteArray newText, int insertPosition, int currentLenght); void clear(); diff --git a/tools/qconfig/qconfig.pro b/tools/qconfig/qconfig.pro index efbfcf2..171924f 100644 --- a/tools/qconfig/qconfig.pro +++ b/tools/qconfig/qconfig.pro @@ -6,5 +6,4 @@ build_all:!build_pass { } HEADERS = feature.h featuretreemodel.h graphics.h SOURCES = main.cpp feature.cpp featuretreemodel.cpp -INTERFACES = TARGET = qconfig diff --git a/tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp b/tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp index 31667dc..4122fab 100644 --- a/tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/tools/qdbus/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -1130,11 +1130,11 @@ int main(int argc, char **argv) static code representing those interfaces, which can then be used to make calls to remote objects or implement said interfaces. - \c qdbusxml2dcpp has two modes of operation, that correspond to the two possible outputs it can + \c qdbusxml2cpp has two modes of operation, that correspond to the two possible outputs it can produce: the interface (proxy) class or the adaptor class. The latter consists of both a C++ header and a source file, which are meant to be edited and adapted to your needs. - The \c qdbusxml2dcpp tool is not meant to be run every time you compile your + The \c qdbusxml2cpp tool is not meant to be run every time you compile your application. Instead, it's meant to be used when developing the code or when the interface changes. diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index a83a321..d43ad96 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2015,7 +2015,7 @@ void DitaXmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *mark } /*! - Generates a table of contents begining at \a node. + Generates a table of contents beginning at \a node. */ void DitaXmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker, @@ -2101,7 +2101,7 @@ void DitaXmlGenerator::generateTableOfContents(const Node *node, /*! Revised for the new doc format. - Generates a table of contents begining at \a node. + Generates a table of contents beginning at \a node. */ void DitaXmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker, diff --git a/tools/qdoc3/doc/qdoc-manual.qdoc b/tools/qdoc3/doc/qdoc-manual.qdoc index c3ab731..b557ad9 100644 --- a/tools/qdoc3/doc/qdoc-manual.qdoc +++ b/tools/qdoc3/doc/qdoc-manual.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free diff --git a/tools/qdoc3/doc/qdoc-manual.qdocconf b/tools/qdoc3/doc/qdoc-manual.qdocconf index 5a725b9..9514d63 100644 --- a/tools/qdoc3/doc/qdoc-manual.qdocconf +++ b/tools/qdoc3/doc/qdoc-manual.qdocconf @@ -1,7 +1,7 @@ project = QDoc description = QDoc3 Manual -indexes = $QTDIR/doc/html/qt.index +indexes = ../../../doc/html/qt.index outputdir = html @@ -9,41 +9,226 @@ sources = qdoc-manual.qdoc sourcedirs = $PWD exampledirs += $PWD \ - $QTDIR/examples + ../../../examples imagedirs += images extraimages.HTML = qt-logo -HTML.stylesheets = classic.css - -HTML.style = "h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }\n" \ - "a:link { color: #004faf; text-decoration: none }\n" \ - "a:visited { color: #672967; text-decoration: none }\n" \ - "td.postheader { font-family: sans-serif }\n" \ - "tr.address { font-family: sans-serif }\n" \ - "body { background: #ffffff; color: black; }" - -HTML.postheader = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"5\" width=\"100%\">\n" \ - "<tr>\n" \ - "<td align=\"left\" valign=\"top\" width=\"32\">" \ - "<a href=\"http://qt.nokia.com/\"><img src=\"images/qt-logo.png\" align=\"left\" border=\"0\" /></a>" \ - "</td>\n" \ - "<td class=\"postheader\" valign=\"center\">" \ - "<a href=\"01-qdoc-manual.html\">" \ - "<font color=\"#004faf\">Home: QDoc Manual</font></a> ·" \ - "<a href=\"http://qt.nokia.com/doc/4.8\">" \ - "<font color=\"#004faf\"> Qt Reference Documentation</font></a>" \ - "</td>\n" \ - "</tr></table>" - -HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ - "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ - "<td width=\"40%\" align=\"left\">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ - "<td width=\"20%\" align=\"center\"><a href=\"trademarks.html\">Trademarks</a></td>\n" \ - "<td width=\"40%\" align=\"right\"><div align=\"right\">Qt \\version</div></td>\n" \ - "</tr></table></div></address>" - -spurious += "Missing '\\}'" -spurious += "Cannot use .*" -spurious += "Unexpected .*" +HTML.stylesheets = style/style.css \ + style/OfflineStyle.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style_ie6.css + +HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ + " <div class=\"content\"> \n" \ + " <div id=\"nav-logo\">\n" \ + " <a href=\"index.html\">Home</a></div>\n" \ + " <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \ + " <div id=\"narrowsearch\"></div>\n" \ + " <div id=\"nav-topright\">\n" \ + " <ul>\n" \ + " <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \ + " <li class=\"nav-topright-dev\"><a href=\"http://developer.qt.nokia.com/\">DEV</a></li>\n" \ + " <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \ + " <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \ + " DOC</a></li>\n" \ + " <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div id=\"shortCut\">\n" \ + " <ul>\n" \ + " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.8</a></span></li>\n" \ + " <li class=\"shortCut-topleft-active\"><a href=\"http://doc.qt.nokia.com\">ALL VERSIONS" \ + " </a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <ul class=\"sf-menu\" id=\"narrowmenu\"> \n" \ + " <li><a href=\"#\">API Lookup</a> \n" \ + " <ul> \n" \ + " <li><a href=\"classes.html\">Class index</a></li> \n" \ + " <li><a href=\"functions.html\">Function index</a></li> \n" \ + " <li><a href=\"modules.html\">Modules</a></li> \n" \ + " <li><a href=\"namespaces.html\">Namespaces</a></li> \n" \ + " <li><a href=\"qtglobal.html\">Global Declarations</a></li> \n" \ + " <li><a href=\"qdeclarativeelements.html\">QML elements</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " <li><a href=\"#\">Qt Topics</a> \n" \ + " <ul> \n" \ + " <li><a href=\"qt-basic-concepts.html\">Programming with Qt</a></li> \n" \ + " <li><a href=\"qtquick.html\">Device UIs & Qt Quick</a></li> \n" \ + " <li><a href=\"qt-gui-concepts.html\">UI Design with Qt</a></li> \n" \ + " <li><a href=\"developing-with-qt.html\">Cross-platform and Platform-specific</a></li> \n" \ + " <li><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \ + " <li><a href=\"technology-apis.html\">Qt and Key Technologies</a></li> \n" \ + " <li><a href=\"best-practices.html\">How-To's and Best Practices</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " <li><a href=\"#\">Examples</a> \n" \ + " <ul> \n" \ + " <li><a href=\"all-examples.html\">Examples</a></li> \n" \ + " <li><a href=\"tutorials.html\">Tutorials</a></li> \n" \ + " <li><a href=\"demos.html\">Demos</a></li> \n" \ + " <li><a href=\"qdeclarativeexamples.html\">QML Examples</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " </ul> \n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"wrapper\">\n" \ + " <div class=\"hd\">\n" \ + " <span></span>\n" \ + " </div>\n" \ + " <div class=\"bd group\">\n" \ + " <div class=\"sidebar\">\n" \ + " <div class=\"searchlabel\">\n" \ + " Search index:</div>\n" \ + " <div class=\"search\" id=\"sidebarsearch\">\n" \ + " <form id=\"qtdocsearch\" action=\"\" onsubmit=\"return false;\">\n" \ + " <fieldset>\n" \ + " <input type=\"text\" name=\"searchstring\" id=\"pageType\" value=\"\" />\n" \ + " <div id=\"resultdialog\"> \n" \ + " <a href=\"#\" id=\"resultclose\">Close</a> \n" \ + " <p id=\"resultlinks\" class=\"all\"><a href=\"#\" id=\"showallresults\">All</a> | <a href=\"#\" id=\"showapiresults\">API</a> | <a href=\"#\" id=\"showarticleresults\">Articles</a> | <a href=\"#\" id=\"showexampleresults\">Examples</a></p> \n" \ + " <p id=\"searchcount\" class=\"all\"><span id=\"resultcount\"></span><span id=\"apicount\"></span><span id=\"articlecount\"></span><span id=\"examplecount\"></span> results:</p> \n" \ + " <ul id=\"resultlist\" class=\"all\"> \n" \ + " </ul> \n" \ + " </div> \n" \ + " </fieldset>\n" \ + " </form>\n" \ + " </div>\n" \ + " <div class=\"box first bottombar\" id=\"lookup\">\n" \ + " <h2 title=\"API Lookup\"><span></span>\n" \ + " API Lookup</h2>\n" \ + " <div id=\"list001\" class=\"list\">\n" \ + " <ul id=\"ul001\" >\n" \ + " <li class=\"defaultLink\"><a href=\"classes.html\">Class index</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"functions.html\">Function index</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"modules.html\">Modules</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"namespaces.html\">Namespaces</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"qtglobal.html\">Global Declarations</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"qdeclarativeelements.html\">QML elements</a></li>\n" \ + " </ul> \n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"box bottombar\" id=\"topics\">\n" \ + " <h2 title=\"Qt Topics\"><span></span>\n" \ + " Qt Topics</h2>\n" \ + " <div id=\"list002\" class=\"list\">\n" \ + " <ul id=\"ul002\" >\n" \ + " <li class=\"defaultLink\"><a href=\"qt-basic-concepts.html\">Programming with Qt</a></li> \n" \ + " <li class=\"defaultLink\"><a href=\"qtquick.html\">Device UIs & Qt Quick</a></li> \n" \ + " <li class=\"defaultLink\"><a href=\"qt-gui-concepts.html\">UI Design with Qt</a></li> \n" \ + " <li class=\"defaultLink\"><a href=\"developing-with-qt.html\">Cross-platform and Platform-specific</a></li> \n" \ + " <li class=\"defaultLink\"><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \ + " <li class=\"defaultLink\"><a href=\"technology-apis.html\">Qt and Key Technologies</a></li> \n" \ + " <li class=\"defaultLink\"><a href=\"best-practices.html\">How-To's and Best Practices</a></li> \n" \ + " </ul> \n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"box\" id=\"examples\">\n" \ + " <h2 title=\"Examples\"><span></span>\n" \ + " Examples</h2>\n" \ + " <div id=\"list003\" class=\"list\">\n" \ + " <ul id=\"ul003\">\n" \ + " <li class=\"defaultLink\"><a href=\"all-examples.html\">Examples</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"tutorials.html\">Tutorials</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"demos.html\">Demos</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html\">QML Examples</a></li>\n" \ + " </ul> \n" \ + " </div>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"wrap\">\n" \ + " <div class=\"toolbar\">\n" \ + " <div class=\"breadcrumb toolblock\">\n" \ + " <ul>\n" \ + " <li class=\"first\"><a href=\"index.html\">Home</a></li>\n" \ + " <!-- Bread crumbs goes here -->\n" + +HTML.postpostheader = " </ul>\n" \ + " </div>\n" \ + " <div class=\"toolbuttons toolblock\">\n" \ + " <ul>\n" \ + " <li id=\"smallA\" class=\"t_button\">A</li>\n" \ + " <li id=\"medA\" class=\"t_button active\">A</li>\n" \ + " <li id=\"bigA\" class=\"t_button\">A</li>\n" \ + " <li id=\"print\" class=\"t_button\"><a href=\"javascript:this.print();\">\n" \ + " <span>Print</span></a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"content mainContent\">\n" + +HTML.footer = "" \ + " <div class=\"feedback t_button\">\n" \ + " [+] Documentation Feedback</div>\n" \ + " </div>\n" \ + " </div>\n" \ + " </div> \n" \ + " <div class=\"ft\">\n" \ + " <span></span>\n" \ + " </div>\n" \ + " </div> \n" \ + " <div class=\"footer\">\n" \ + " <p>\n" \ + " <acronym title=\"Copyright\">©</acronym> 2008-2010 Nokia Corporation and/or its\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide.</p>\n" \ + " <p>\n" \ + " All other trademarks are property of their respective owners. <a title=\"Privacy Policy\"\n" \ + " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \ + " <br />\n" \ + " <p>\n" \ + " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \ + " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \ + " with the terms contained in a written agreement between you and Nokia.</p>\n" \ + " <p>\n" \ + " Alternatively, this document may be used under the terms of the <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU\n" \ + " Free Documentation License version 1.3</a>\n" \ + " as published by the Free Software Foundation.</p>\n" \ + " </div>\n" \ + " <div id=\"feedbackBox\">\n" \ + " <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \ + " <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \ + " <p id=\"noteHead\">Thank you for giving your feedback.</p> <p class=\"note\">Make sure it is related to this specific page. For more general bugs and \n" \ + " requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a>.</p>\n" \ + " <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\"></textarea></p>\n" \ + " <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \ + " </form>\n" \ + " </div>\n" \ + " <div id=\"blurpage\">\n" \ + " </div>\n" + +# This stuff is used by the Qt 4.7 doc format. +scriptdirs = ../../../doc/src/template/scripts +styledirs = ../../../doc/src/template/style + +scripts.HTML = functions.js \ + narrow.js \ + superfish.js \ + jquery.js + +styles.HTML = style.css \ + narrow.css \ + superfish.css \ + superfish_skin.css \ + style_ie6.css \ + style_ie7.css \ + style_ie8.css + +# Files not referenced in any qdoc file (last four are needed by qtdemo) +# See also extraimages.HTML +qhp.Qt.extraFiles = scripts/functions.js \ + scripts/jquery.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/narrow.css \ + style/superfish.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css + diff --git a/tools/qdoc3/helpprojectwriter.cpp b/tools/qdoc3/helpprojectwriter.cpp index 98246c4..63e8df7 100644 --- a/tools/qdoc3/helpprojectwriter.cpp +++ b/tools/qdoc3/helpprojectwriter.cpp @@ -49,6 +49,7 @@ #include "config.h" #include "node.h" #include "tree.h" +#include <qdebug.h> QT_BEGIN_NAMESPACE @@ -250,8 +251,9 @@ bool HelpProjectWriter::generateSection(HelpProject &project, foreach (const QString &name, project.subprojects.keys()) { SubProject subproject = project.subprojects[name]; // No selectors: accept all nodes. - if (subproject.selectors.isEmpty()) + if (subproject.selectors.isEmpty()) { project.subprojects[name].nodes[objName] = node; + } else if (subproject.selectors.contains(node->type())) { // Accept only the node types in the selectors hash. if (node->type() != Node::Fake) @@ -262,9 +264,10 @@ bool HelpProjectWriter::generateSection(HelpProject &project, const FakeNode *fakeNode = static_cast<const FakeNode *>(node); if (subproject.selectors[node->type()].contains(fakeNode->subType()) && fakeNode->subType() != Node::ExternalPage && - !fakeNode->fullTitle().isEmpty()) + !fakeNode->fullTitle().isEmpty()) { project.subprojects[name].nodes[objName] = node; + } } } } @@ -527,13 +530,11 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer writer.writeStartElement("section"); writer.writeAttribute("ref", href); writer.writeAttribute("title", fakeNode->fullTitle()); - // qDebug() << "Title:" << fakeNode->fullTitle(); - if (fakeNode->subType() == Node::HeaderFile) { - + if ((fakeNode->subType() == Node::HeaderFile) || (fakeNode->subType() == Node::QmlClass)) { // Write subsections for all members, obsolete members and Qt 3 // members. - if (!project.memberStatus[node].isEmpty()) { + if (!project.memberStatus[node].isEmpty() || (fakeNode->subType() == Node::QmlClass)) { QString membersPath = href.left(href.size()-5) + "-members.html"; writer.writeStartElement("section"); writer.writeAttribute("ref", membersPath); @@ -690,8 +691,9 @@ void HelpProjectWriter::generateProject(HelpProject &project) if (subproject.sortPages) { QStringList titles = subproject.nodes.keys(); titles.sort(); - foreach (const QString &title, titles) + foreach (const QString &title, titles) { writeNode(project, writer, subproject.nodes[title]); + } } else { // Find a contents node and navigate from there, using the NextLink values. foreach (const Node *node, subproject.nodes) { diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 77e306a..76ee4e8 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -451,7 +451,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, { int skipAhead = 0; static bool in_para = false; - + switch (atom->type()) { case Atom::AbstractLeft: break; @@ -527,18 +527,18 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE]; break; case Atom::Code: - out() << "<pre class=\"highlightedCode brush: cpp\">" + out() << "<pre class=\"highlightedCode brush: cpp\">" << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), marker,relative)) << "</pre>\n"; - break; + break; #ifdef QDOC_QML case Atom::Qml: - out() << "<pre class=\"highlightedCode brush: cpp\">" + out() << "<pre class=\"highlightedCode brush: cpp\">" << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), marker,relative)) << "</pre>\n"; - break; + break; #endif case Atom::CodeNew: out() << "<p>you can rewrite it as</p>\n" @@ -554,7 +554,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "<pre class=\"highlightedCode brush: cpp\">" << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string())))) << "</pre>\n"; - break; + break; case Atom::FootnoteLeft: // ### For now if (in_para) { @@ -927,13 +927,12 @@ int HtmlGenerator::generateAtom(const Atom *atom, threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom); if (threeColumnEnumValueTable) { out() << "<table class=\"valuelist\">"; - // << "<tr>" - if (++numTableRows % 2 == 1) - out() << "<tr class=\"odd\">"; - else - out() << "<tr class=\"even\">"; + if (++numTableRows % 2 == 1) + out() << "<tr class=\"odd\">"; + else + out() << "<tr class=\"even\">"; - out() << "<tr><th class=\"tblConst\">Constant</th>" + out() << "<th class=\"tblConst\">Constant</th>" << "<th class=\"tblval\">Value</th>" << "<th class=\"tbldscr\">Description</th></tr>\n"; } @@ -1811,44 +1810,44 @@ void HtmlGenerator::generateHeader(const QString& title, out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n"; out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; - - // Adding syntax highlighter // future release - + + // Adding syntax highlighter // future release + // Setting some additional style sheet related details depending on configuration (e.g. Online/Creator) switch (application) { case Online: // Adding style and js for small windows - out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n"; - out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />"; - out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n"; - out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />\n"; + out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />"; + out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />\n"; // Browser spec styles - out() << " <!--[if IE]>\n"; - out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n"; - out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n"; - out() << "<![endif]-->\n"; - out() << "<!--[if lt IE 7]>\n"; - out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n"; - out() << "<![endif]-->\n"; - out() << "<!--[if IE 7]>\n"; - out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n"; - out() << "<![endif]-->\n"; - out() << "<!--[if IE 8]>\n"; - out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n"; - out() << "<![endif]-->\n"; - - out() << "</head>\n"; - // CheckEmptyAndLoadList activating search - out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; + out() << " <!--[if IE]>\n"; + out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n"; + out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n"; + out() << "<![endif]-->\n"; + out() << "<!--[if lt IE 7]>\n"; + out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n"; + out() << "<![endif]-->\n"; + out() << "<!--[if IE 7]>\n"; + out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n"; + out() << "<![endif]-->\n"; + out() << "<!--[if IE 8]>\n"; + out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n"; + out() << "<![endif]-->\n"; + + out() << "</head>\n"; + // CheckEmptyAndLoadList activating search + out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; break; case Creator: - out() << "</head>\n"; - out() << "<body class=\"offline narrow creator\">\n"; // offline narrow + out() << "</head>\n"; + out() << "<body class=\"offline narrow creator\">\n"; // offline narrow break; default: - out() << "</head>\n"; - out() << "<body>\n"; + out() << "</head>\n"; + out() << "<body>\n"; break; } @@ -1866,7 +1865,7 @@ void HtmlGenerator::generateHeader(const QString& title, case Creator: out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); generateBreadCrumbs(title,node,marker); - out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); break; default: // default -- not used except if one forgets to set any of the above settings to true out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); @@ -1930,10 +1929,8 @@ void HtmlGenerator::generateHeader(const QString& title, } } -#if 0 // Removed for new doc format. MWS if (node && !node->links().empty()) - out() << "<p>\n" << navigationLinks << "</p>\n"; -#endif + out() << "<p class=\"naviNextPrevious headerNavi\">\n" << navigationLinks << "</p><p/>\n"; } void HtmlGenerator::generateTitle(const QString& title, @@ -1945,8 +1942,8 @@ void HtmlGenerator::generateTitle(const QString& title, if (!title.isEmpty()) out() << "<h1 class=\"title\">" << protectEnc(title) << "</h1>\n"; if (!subTitle.isEmpty()) { - out() << "<span"; - if (subTitleSize == SmallSubTitle) + out() << "<span"; + if (subTitleSize == SmallSubTitle) out() << " class=\"small-subtitle\">"; else out() << " class=\"subtitle\">"; @@ -1958,7 +1955,7 @@ void HtmlGenerator::generateTitle(const QString& title, void HtmlGenerator::generateFooter(const Node *node) { if (node && !node->links().empty()) - out() << "<p>\n" << navigationLinks << "</p>\n"; + out() << "<p class=\"naviNextPrevious footerNavi\">\n" << navigationLinks << "</p>\n"; out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version()) << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()); @@ -1979,10 +1976,10 @@ void HtmlGenerator::generateFooter(const Node *node) out() << " })();\n"; out() << " </script>\n"; out() << "</body>\n"; - break; + break; case Creator: out() << "</body>\n"; - break; + break; default: out() << "</body>\n"; } @@ -2238,20 +2235,19 @@ void HtmlGenerator::generateNavigationBar(const NavigationBar& bar, out() << "</a>]\n"; #endif } - if (fake->name() != QString("index.html")) - { - if (bar.current.begin() != 0) { - out() << "[<a href=\"" << "home" - << ".html\">Home</a>]\n"; - } - if (bar.next.begin() != 0) { - out() << "[<a href=\"" << fileBase(node, bar.next) - << ".html\">Next: "; - generateText(Text::sectionHeading(bar.next.begin()), node, marker); - out() << "</a>]\n"; + if (fake->name() != QString("index.html")) { + if (bar.current.begin() != 0) { + out() << "[<a href=\"" << "home" + << ".html\">Home</a>]\n"; + } + if (bar.next.begin() != 0) { + out() << "[<a href=\"" << fileBase(node, bar.next) + << ".html\">Next: "; + generateText(Text::sectionHeading(bar.next.begin()), node, marker); + out() << "</a>]\n"; + } + out() << "</p>\n"; } - out() << "</p>\n"; - } } } #endif @@ -3283,7 +3279,7 @@ void HtmlGenerator::generateLink(const Atom* atom, inLink = false; out() << protectEnc(atom->string().mid(k)); } else if (marker->recognizeLanguage("Java")) { - // hack for Java: remove () and use <tt> when appropriate + // hack for Java: remove () and use <tt> when appropriate bool func = atom->string().endsWith("()"); bool tt = (func || atom->string().contains(camelCase)); if (tt) @@ -3417,7 +3413,7 @@ QString HtmlGenerator::protect(const QString &string, const QString &outputEncod #undef APPEND } -QString HtmlGenerator::fileBase(const Node *node) +QString HtmlGenerator::fileBase(const Node *node) const { QString result; @@ -3548,8 +3544,11 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) return QString(); fn = fileName(node); -/* if (!node->url().isEmpty()) - return fn;*/ +#if 0 + if (!node->url().isEmpty()) + return fn; +#endif + #if 0 // ### reintroduce this test, without breaking .dcf files if (fn != outFileName()) @@ -3723,7 +3722,11 @@ void HtmlGenerator::findAllClasses(const InnerNode *node) (*c)->subType() == Node::QmlClass && !(*c)->doc().isEmpty()) { QString qmlClassName = (*c)->name(); - qmlClasses.insert(qmlClassName,*c); + // Remove the "QML:" prefix if present. + if (qmlClassName.startsWith(QLatin1String("QML:"))) + qmlClasses.insert(qmlClassName.mid(4),*c); + else + qmlClasses.insert(qmlClassName,*c); } else if ((*c)->isInnerNode()) { findAllClasses(static_cast<InnerNode *>(*c)); @@ -4065,7 +4068,7 @@ void HtmlGenerator::generateStatus(const Node *node, CodeMarker *marker) switch (node->status()) { case Node::Obsolete: if (node->isInnerNode()) - Generator::generateStatus(node, marker); + Generator::generateStatus(node, marker); break; case Node::Compat: if (node->isInnerNode()) { @@ -4225,7 +4228,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << "<tr class=\"odd\">"; else out() << "<tr class=\"even\">"; - + out() << "<td class=\"tblQmlPropNode\"><p>"; out() << "<a name=\"" + refForNode(qpn) + "\"></a>"; @@ -4236,7 +4239,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, if (qpgn->isDefault()) out() << "<span class=\"qmldefault\">default</span>"; generateQmlItem(qpn, relative, marker, false); - out() << "</td></tr>"; + out() << "</p></td></tr>"; } ++p; } @@ -4265,10 +4268,10 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << "<div class=\"qmlproto\">"; out() << "<table class=\"qmlname\">"; //out() << "<tr>"; - if (++numTableRows % 2 == 1) - out() << "<tr class=\"odd\">"; - else - out() << "<tr class=\"even\">"; + if (++numTableRows % 2 == 1) + out() << "<tr class=\"odd\">"; + else + out() << "<tr class=\"even\">"; out() << "<td class=\"tblQmlFuncNode\"><p>"; out() << "<a name=\"" + refForNode(qmn) + "\"></a>"; generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index d885ada..b96d737 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -241,7 +241,7 @@ class HtmlGenerator : public PageGenerator void generateStatus(const Node *node, CodeMarker *marker); QString registerRef(const QString& ref); - QString fileBase(const Node *node); + virtual QString fileBase(const Node *node) const; #if 0 QString fileBase(const Node *node, const SectionIterator& section); #endif diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index a187c2e..37dc191 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -310,10 +310,10 @@ PageGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) const FakeNode *fakeNode = static_cast<const FakeNode *>(node); if (fakeNode->subType() == Node::ExternalPage) return; -#ifdef QDOC_QML + if (fakeNode->subType() == Node::Image) + return; if (fakeNode->subType() == Node::QmlPropertyGroup) return; -#endif if (fakeNode->subType() == Node::Page) { if (node->count() > 0) qDebug("PAGE %s HAS CHILDREN", qPrintable(fakeNode->title())); diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index ae0bf25..d47e066 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -120,9 +120,9 @@ SOURCES += apigenerator.cpp \ qtPrepareTool(QDOC, qdoc3) -docs.commands = $$QDOC qdoc-manual.qdocconf +html-docs.commands = cd \"$$PWD/doc\" && $$QDOC qdoc-manual.qdocconf -QMAKE_EXTRA_TARGETS += docs +QMAKE_EXTRA_TARGETS += html-docs target.path = $$[QT_INSTALL_BINS] INSTALLS += target diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 6a06a8c..e642559 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -62,11 +62,15 @@ qhp.Qt.extraFiles = index.html \ qhp.Qt.filterAttributes = qt 4.8.0 qtrefdoc qhp.Qt.customFilters.Qt.name = Qt 4.8.0 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.8.0 -qhp.Qt.subprojects = classes overviews examples +qhp.Qt.subprojects = classes qmlelements overviews examples qhp.Qt.subprojects.classes.title = Classes -qhp.Qt.subprojects.classes.indexTitle = Qt's Classes +qhp.Qt.subprojects.classes.indexTitle = All Classes qhp.Qt.subprojects.classes.selectors = class fake:headerfile qhp.Qt.subprojects.classes.sortPages = true +qhp.Qt.subprojects.qmlelements.title = QML Elements +qhp.Qt.subprojects.qmlelements.indexTitle = QML Elements +qhp.Qt.subprojects.qmlelements.selectors = fake:qmlclass +qhp.Qt.subprojects.qmlelements.sortPages = true qhp.Qt.subprojects.overviews.title = Overviews qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs qhp.Qt.subprojects.overviews.selectors = fake:page,group,module diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf index b78b512..5d52a47 100644 --- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf +++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf @@ -71,8 +71,9 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \ QT_END_INCLUDE_NAMESPACE \ PHONON_EXPORT \ Q_DECLARATIVE_EXPORT \ - Q_GADGET \ - QWEBKIT_EXPORT + Q_GADGET \ + QWEBKIT_EXPORT \ + Q_INVOKABLE Cpp.ignoredirectives = Q_DECLARE_HANDLE \ Q_DECLARE_INTERFACE \ Q_DECLARE_METATYPE \ diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 58cee4f..4ae032f 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -9,6 +9,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <div id=\"nav-logo\">\n" \ " <a href=\"index.html\">Home</a></div>\n" \ " <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \ + " <div id=\"narrowsearch\"></div>\n" \ " <div id=\"nav-topright\">\n" \ " <ul>\n" \ " <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \ @@ -26,6 +27,37 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " </a></li>\n" \ " </ul>\n" \ " </div>\n" \ + " <ul class=\"sf-menu\" id=\"narrowmenu\"> \n" \ + " <li><a href=\"#\">API Lookup</a> \n" \ + " <ul> \n" \ + " <li><a href=\"classes.html\">Class index</a></li> \n" \ + " <li><a href=\"functions.html\">Function index</a></li> \n" \ + " <li><a href=\"modules.html\">Modules</a></li> \n" \ + " <li><a href=\"namespaces.html\">Namespaces</a></li> \n" \ + " <li><a href=\"qtglobal.html\">Global Declarations</a></li> \n" \ + " <li><a href=\"qdeclarativeelements.html\">QML elements</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " <li><a href=\"#\">Qt Topics</a> \n" \ + " <ul> \n" \ + " <li><a href=\"qt-basic-concepts.html\">Programming with Qt</a></li> \n" \ + " <li><a href=\"qtquick.html\">Device UIs & Qt Quick</a></li> \n" \ + " <li><a href=\"qt-gui-concepts.html\">UI Design with Qt</a></li> \n" \ + " <li><a href=\"developing-with-qt.html\">Cross-platform and Platform-specific</a></li> \n" \ + " <li><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \ + " <li><a href=\"technology-apis.html\">Qt and Key Technologies</a></li> \n" \ + " <li><a href=\"best-practices.html\">How-To's and Best Practices</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " <li><a href=\"#\">Examples</a> \n" \ + " <ul> \n" \ + " <li><a href=\"all-examples.html\">Examples</a></li> \n" \ + " <li><a href=\"tutorials.html\">Tutorials</a></li> \n" \ + " <li><a href=\"demos.html\">Demos</a></li> \n" \ + " <li><a href=\"qdeclarativeexamples.html\">QML Examples</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " </ul> \n" \ " </div>\n" \ " </div>\n" \ " <div class=\"wrapper\">\n" \ @@ -36,7 +68,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <div class=\"sidebar\">\n" \ " <div class=\"searchlabel\">\n" \ " Search index:</div>\n" \ - " <div class=\"search\">\n" \ + " <div class=\"search\" id=\"sidebarsearch\">\n" \ " <form id=\"qtdocsearch\" action=\"\" onsubmit=\"return false;\">\n" \ " <fieldset>\n" \ " <input type=\"text\" name=\"searchstring\" id=\"pageType\" value=\"\" />\n" \ diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index f50cb69..dedf806 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -63,10 +63,15 @@ qhp.Qt.filterAttributes = qt 4.8.0 qtrefdoc qhp.Qt.customFilters.Qt.name = Qt 4.8.0 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.8.0 qhp.Qt.subprojects = classes overviews examples +qhp.Qt.subprojects = classes qmlelements overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes qhp.Qt.subprojects.classes.selectors = class fake:headerfile qhp.Qt.subprojects.classes.sortPages = true +qhp.Qt.subprojects.qmlelements.title = QML Elements +qhp.Qt.subprojects.qmlelements.indexTitle = QML Elements +qhp.Qt.subprojects.qmlelements.selectors = fake:qmlclass +qhp.Qt.subprojects.qmlelements.sortPages = true qhp.Qt.subprojects.overviews.title = Overviews qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs qhp.Qt.subprojects.overviews.selectors = fake:page,group,module diff --git a/tools/qdoc3/tokenizer.h b/tools/qdoc3/tokenizer.h index bd35965..1b33f6f 100644 --- a/tools/qdoc3/tokenizer.h +++ b/tools/qdoc3/tokenizer.h @@ -145,7 +145,7 @@ class Tokenizer int ch = getch(); if (ch == EOF) return EOF; - // cast explicitely to make sure the value of ch + // cast explicitly to make sure the value of ch // is in range [0..255] to avoid assert messages // when using debug CRT that checks its input. return int(uint(uchar(ch))); diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 540ffa9..d1e2c60 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -1543,8 +1543,72 @@ bool Tree::generateIndexSection(QXmlStreamWriter &writer, return true; } + /*! - */ + Returns true if the node \a n1 is less than node \a n2. + The comparison is performed by comparing properties of the nodes in order + of increasing complexity. +*/ +bool compareNodes(const Node *n1, const Node *n2) +{ + // Private nodes can occur in any order since they won't normally be + // written to the index. + if (n1->access() == Node::Private && n2->access() == Node::Private) + return true; + + if (n1->location().filePath() < n2->location().filePath()) + return true; + else if (n1->location().filePath() > n2->location().filePath()) + return false; + + if (n1->type() < n2->type()) + return true; + else if (n1->type() > n2->type()) + return false; + + if (n1->name() < n2->name()) + return true; + else if (n1->name() > n2->name()) + return false; + + if (n1->access() < n2->access()) + return true; + else if (n1->access() > n2->access()) + return false; + + if (n1->type() == Node::Function && n2->type() == Node::Function) { + const FunctionNode *f1 = static_cast<const FunctionNode *>(n1); + const FunctionNode *f2 = static_cast<const FunctionNode *>(n2); + + if (f1->isConst() < f2->isConst()) + return true; + else if (f1->isConst() > f2->isConst()) + return false; + + if (f1->signature() < f2->signature()) + return true; + else if (f1->signature() > f2->signature()) + return false; + } + + if (n1->type() == Node::Fake && n2->type() == Node::Fake) { + const FakeNode *f1 = static_cast<const FakeNode *>(n1); + const FakeNode *f2 = static_cast<const FakeNode *>(n2); + if (f1->fullTitle() < f2->fullTitle()) + return true; + else if (f1->fullTitle() > f2->fullTitle()) + return false; + } + + return false; +} + +/*! + Generate index sections for the child nodes of the given \a node + using the \a writer specified. If \a generateInternalNodes is true, + nodes marked as internal will be included in the index; otherwise, + they will be omitted. +*/ void Tree::generateIndexSections(QXmlStreamWriter &writer, const Node *node, bool generateInternalNodes) const @@ -1554,7 +1618,10 @@ void Tree::generateIndexSections(QXmlStreamWriter &writer, if (node->isInnerNode()) { const InnerNode *inner = static_cast<const InnerNode *>(node); - foreach (const Node *child, inner->childNodes()) { + NodeList cnodes = inner->childNodes(); + qSort(cnodes.begin(), cnodes.end(), compareNodes); + + foreach (const Node *child, cnodes) { /* Don't generate anything for a QML property group node. It is just a place holder for a collection of QML property diff --git a/tools/qmeegographicssystemhelper/qmeegofencesync.cpp b/tools/qmeegographicssystemhelper/qmeegofencesync.cpp new file mode 100644 index 0000000..499e102 --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegofencesync.cpp @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmeegofencesync.h" +#include "qmeegofencesync_p.h" +#include "qmeegoruntime.h" + +/* QMeeGoFenceSyncPrivate */ + +QMeeGoFenceSyncPrivate::QMeeGoFenceSyncPrivate() : syncObject(NULL) +{ +} + +QMeeGoFenceSyncPrivate::~QMeeGoFenceSyncPrivate() +{ + if (syncObject) { + QMeeGoRuntime::destroyFenceSync(syncObject); + syncObject = NULL; + } +} + +/* QMeeGoFenceSync */ + +QMeeGoFenceSync::QMeeGoFenceSync(QWidget *parent) : QObject(parent), d_ptr(new QMeeGoFenceSyncPrivate()) +{ + Q_D(QMeeGoFenceSync); + d->q_ptr = this; +} + +QMeeGoFenceSync::~QMeeGoFenceSync() +{ +} + +void QMeeGoFenceSync::setSyncPoint() +{ + Q_D(QMeeGoFenceSync); + if (d->syncObject) + QMeeGoRuntime::destroyFenceSync(d->syncObject); + + d->syncObject = QMeeGoRuntime::createFenceSync(); +} diff --git a/tools/qmeegographicssystemhelper/qmeegofencesync.h b/tools/qmeegographicssystemhelper/qmeegofencesync.h new file mode 100644 index 0000000..2d3f5c5 --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegofencesync.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMEEGOFENCESYNC_H +#define QMEEGOFENCESYNC_H + +#include <QWidget> + +class QMeeGoFenceSyncPrivate; + +//! A synchronization helper for GL pipeline. +/*! + Fence syncs provide a mechanism for synchronizing access to certain GL primitives + and make it possible for the application developer to be sure that a certain point + in the GL processing pipeline has been already executed before continuing operation. + + Currently fence syncs are only useful in conjunction with QMeeGoLivePixmaps. + \code + ... + // In your paint/expose event: + QImage *image = livePixmap->lock(&someGlobalFenceSync); + // Modify the image... + livePixmap->release(image); + + painter->drawPixmap(0, 0, *livePixmap); + someGlobalFenceSync.setSyncPoint(); + ... + \endcode + + Assuming the paint/expose events come repeatedly, the lock operation + will block till the previous event completed painting the livePixmap. +*/ + +class Q_DECL_EXPORT QMeeGoFenceSync : public QObject +{ +public: + //! Constructs a new fence sync. + /*! + The fence sync is created without a sync point. You need to set the sync point manually. + */ + QMeeGoFenceSync(QWidget *parent = 0); + + //! Destructor for the fence sync. + virtual ~QMeeGoFenceSync(); + + //! Sets the fence sync. + /*! + The fence sync synchronization point should be set after all drawing has been scheduled. + Setting a synchronization point always overrides the previous point -- whetver is was + used (waited upon) or not. + */ + void setSyncPoint(); + +private: + Q_DISABLE_COPY(QMeeGoFenceSync) + Q_DECLARE_PRIVATE(QMeeGoFenceSync) + +protected: + QScopedPointer<QMeeGoFenceSyncPrivate> d_ptr; //! Private bits. + friend class QMeeGoLivePixmap; +}; + +#endif diff --git a/tools/qmeegographicssystemhelper/qmeegofencesync_p.h b/tools/qmeegographicssystemhelper/qmeegofencesync_p.h new file mode 100644 index 0000000..8a5d26e --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegofencesync_p.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmeegofencesync.h" + +#ifndef QMEEGOFENCESYNC_P_H +#define QMEEGOFENCESYNC_P_H + +class QMeeGoFenceSyncPrivate +{ +public: + Q_DECLARE_PUBLIC(QMeeGoFenceSync); + QMeeGoFenceSyncPrivate(); + + virtual ~QMeeGoFenceSyncPrivate(); + + void* syncObject; + + QMeeGoFenceSync *q_ptr; +}; + +#endif diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h index 2bb75eb..2baacbb 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h @@ -147,7 +147,7 @@ public: //! Destroys an EGL shared image. /*! Destroys an EGLSharedImage previously created with an ::imageToEGLSharedImage call. - Returns true if the image was found and the destruction was successfull. Notice that + Returns true if the image was found and the destruction was successful. Notice that this destroys the image for all processes using it. */ static bool destroyEGLSharedImage(Qt::HANDLE handle); diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro index 4d69fac..161a31b 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro @@ -6,5 +6,5 @@ include(../../src/qbase.pri) QT += gui INCLUDEPATH += '../../src/plugins/graphicssystems/meego' -HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h -SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp +HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h +SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegofencesync.cpp diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp index b9dbb2b..9700581f 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp @@ -40,15 +40,13 @@ ****************************************************************************/ #include "qmeegolivepixmap.h" -#include <private/qimage_p.h> -#include <private/qpixmap_raster_p.h> #include "qmeegolivepixmap_p.h" +#include "qmeegofencesync_p.h" #include "qmeegoruntime.h" -#include <QSharedMemory> /* QMeeGoLivePixmapPrivate */ -QMeeGoLivePixmapPrivate::QMeeGoLivePixmapPrivate(Qt::HANDLE h) : handle(h) +QMeeGoLivePixmapPrivate::QMeeGoLivePixmapPrivate() { } @@ -60,7 +58,7 @@ QMeeGoLivePixmapPrivate::~QMeeGoLivePixmapPrivate() QMeeGoLivePixmap* QMeeGoLivePixmap::livePixmapWithSize(int w, int h, Format format) { - QImage::Format qtFormat; + QImage::Format qtFormat; if (format == Format_RGB16) qtFormat = QImage::Format_RGB16; else if (format == Format_ARGB32_Premultiplied) @@ -69,17 +67,17 @@ QMeeGoLivePixmap* QMeeGoLivePixmap::livePixmapWithSize(int w, int h, Format form qWarning("Unsupported live pixmap format!"); return 0; } - - Qt::HANDLE liveTextureHandle = QMeeGoRuntime::createLiveTexture(w, h, qtFormat); - if (! liveTextureHandle) { + + QPixmapData *pmd = QMeeGoRuntime::pixmapDataWithNewLiveTexture(w, h, qtFormat); + if (! pmd) { qWarning("Failed to create a live texture with given size!"); return NULL; } - return QMeeGoLivePixmap::fromHandle(liveTextureHandle); + return new QMeeGoLivePixmap(pmd); } -QMeeGoLivePixmap::QMeeGoLivePixmap(QPixmapData *p, Qt::HANDLE h) : QPixmap(p), d_ptr(new QMeeGoLivePixmapPrivate(h)) +QMeeGoLivePixmap::QMeeGoLivePixmap(QPixmapData *p) : QPixmap(p), d_ptr(new QMeeGoLivePixmapPrivate()) { Q_D(QMeeGoLivePixmap); d->q_ptr = this; @@ -87,57 +85,33 @@ QMeeGoLivePixmap::QMeeGoLivePixmap(QPixmapData *p, Qt::HANDLE h) : QPixmap(p), d QMeeGoLivePixmap* QMeeGoLivePixmap::fromHandle(Qt::HANDLE liveTextureHandle) { - Qt::HANDLE eglImage = QMeeGoRuntime::liveTextureToEGLImage(liveTextureHandle); - if (! eglImage) { - qWarning("Failed to bind the live texture as an egl image!"); - return NULL; - } - - QPixmapData *pmd = QMeeGoRuntime::pixmapDataFromEGLImage(eglImage); + QPixmapData *pmd = QMeeGoRuntime::pixmapDataFromLiveTextureHandle(liveTextureHandle); if (! pmd) { - qWarning("Failed to allocate a pixmap data from a given live texture egl image!"); + qWarning("Failed to create a live texture from given handle!"); return NULL; } - - return new QMeeGoLivePixmap(pmd, liveTextureHandle); + + return new QMeeGoLivePixmap(pmd); } Qt::HANDLE QMeeGoLivePixmap::handle() { - Q_D(QMeeGoLivePixmap); - return d->handle; + return QMeeGoRuntime::getLiveTextureHandle(this); } QMeeGoLivePixmap::~QMeeGoLivePixmap() { } -QImage* QMeeGoLivePixmap::lock() +QImage* QMeeGoLivePixmap::lock(QMeeGoFenceSync *fenceSync) { - Q_D(QMeeGoLivePixmap); - - void *data = NULL; - int pitch = 0; - - if (! QMeeGoRuntime::lockLiveTexture(d->handle)) { - qWarning("Failed to lock a live texture!"); - return new QImage(); - } - - QMeeGoRuntime::queryLiveTexture(d->handle, &data, &pitch); - if (data == NULL || pitch == 0) { - qWarning("Failed to query the live texture!"); - return new QImage(); - } - - // FIXME Bug here! FIX FIX FIX FIX FIX FIX - return new QImage((uchar *) data, width(), height(), QImage::Format_RGB16); + if (fenceSync) + return QMeeGoRuntime::lockLiveTexture(this, fenceSync->d_func()->syncObject); + else + return QMeeGoRuntime::lockLiveTexture(this, NULL); } - + void QMeeGoLivePixmap::release(QImage *img) { - Q_D(QMeeGoLivePixmap); - // FIXME Make sure we're locked! - QMeeGoRuntime::unlockLiveTexture(d->handle); - delete img; + QMeeGoRuntime::releaseLiveTexture(this, img); } diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h index 12fe994..51b5976 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h @@ -43,6 +43,7 @@ #define QMEEGOLIVEPIXMAP_H #include <QPixmap> +#include "qmeegofencesync.h" class QMeeGoLivePixmapPrivate; class QSharedMemory; @@ -52,7 +53,7 @@ class QImage; /*! */ -class QMeeGoLivePixmap : public QPixmap +class Q_DECL_EXPORT QMeeGoLivePixmap : public QPixmap { public: enum Format { @@ -82,8 +83,12 @@ public: //! Locks the access to the pixmap. /*! The returned image can be used for direct access. + You can optionally specify a fence sync to wait upon before unlocking. When + you specify a fence sync, you can be sure that this function will return only + when the previsouly set QMeeGoFenceSync synchronization point has been executed/passed + by the GL processing pipeline. */ - QImage* lock(); + QImage* lock(QMeeGoFenceSync *fenceSync = NULL); //! Unlocks the access to the pixmap. /*! @@ -96,7 +101,7 @@ public: virtual ~QMeeGoLivePixmap(); private: - QMeeGoLivePixmap(QPixmapData *p, Qt::HANDLE h); + QMeeGoLivePixmap(QPixmapData *p); Q_DISABLE_COPY(QMeeGoLivePixmap) Q_DECLARE_PRIVATE(QMeeGoLivePixmap) diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h b/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h index 22347d6..78d9553 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h @@ -48,11 +48,9 @@ class QMeeGoLivePixmapPrivate { public: Q_DECLARE_PUBLIC(QMeeGoLivePixmap); - QMeeGoLivePixmapPrivate(Qt::HANDLE handle); + QMeeGoLivePixmapPrivate(); virtual ~QMeeGoLivePixmapPrivate(); - - Qt::HANDLE handle; - + QMeeGoLivePixmap *q_ptr; }; diff --git a/tools/qmeegographicssystemhelper/qmeegooverlaywidget.cpp b/tools/qmeegographicssystemhelper/qmeegooverlaywidget.cpp index f9f14ae..b42a7ea 100644 --- a/tools/qmeegographicssystemhelper/qmeegooverlaywidget.cpp +++ b/tools/qmeegographicssystemhelper/qmeegooverlaywidget.cpp @@ -42,7 +42,8 @@ #include <QDebug> #include <QEvent> #include <QMouseEvent> -#include <QCoreApplication> +#include <QApplication> +#include <QDesktopWidget> #include "qmeegooverlaywidget.h" #include "qmeegographicssystemhelper.h" #include "qmeegoruntime.h" @@ -54,10 +55,12 @@ QMeeGoOverlayWidget::QMeeGoOverlayWidget(int surfaceWidth, int surfaceHeight, QW if (! QMeeGoGraphicsSystemHelper::isRunningMeeGo()) qFatal("QMeeGoOverlayWidget can only be used when running with 'meego' graphics system!"); + const QRect desktop = QApplication::desktop()->screenGeometry(parent); + QMeeGoRuntime::setSurfaceFixedSize(surfaceWidth, surfaceHeight); - scaleW = sw / 864.0; - scaleH = sh / 480.0; + scaleW = sw / desktop.width(); + scaleH = sh / desktop.height(); installEventFilter(this); } diff --git a/tools/qmeegographicssystemhelper/qmeegooverlaywidget.h b/tools/qmeegographicssystemhelper/qmeegooverlaywidget.h index c2c08b4..e67f59b 100644 --- a/tools/qmeegographicssystemhelper/qmeegooverlaywidget.h +++ b/tools/qmeegographicssystemhelper/qmeegooverlaywidget.h @@ -48,7 +48,7 @@ /*! */ -class QMeeGoOverlayWidget : public QWidget +class Q_DECL_EXPORT QMeeGoOverlayWidget : public QWidget { public: //! Constructs a new scaling widget. diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp index 44f9f58..2d3ee3c 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp @@ -44,6 +44,7 @@ #include <private/qlibrary_p.h> #include <private/qfactoryloader_p.h> #include <private/qgraphicssystemplugin_p.h> +#include <stdio.h> #define ENSURE_INITIALIZED {if (!initialized) initialize();} @@ -51,36 +52,35 @@ bool QMeeGoRuntime::initialized = false; typedef int (*QMeeGoImageToEglSharedImageFunc) (const QImage&); typedef QPixmapData* (*QMeeGoPixmapDataFromEglSharedImageFunc) (Qt::HANDLE handle, const QImage&); -typedef QPixmapData* (*QMeeGoPixmapDataFromEglImageFunc) (Qt::HANDLE handle); typedef QPixmapData* (*QMeeGoPixmapDataWithGLTextureFunc) (int w, int h); typedef bool (*QMeeGoDestroyEGLSharedImageFunc) (Qt::HANDLE handle); typedef void (*QMeeGoUpdateEglSharedImagePixmapFunc) (QPixmap*); typedef void (*QMeeGoSetSurfaceFixedSizeFunc) (int w, int h); typedef void (*QMeeGoSetSurfaceScalingFunc) (int x, int y, int w, int h); typedef void (*QMeeGoSetTranslucentFunc) (bool translucent); -typedef Qt::HANDLE (*QMeeGoLiveTextureCreateFunc) (int w, int h, QImage::Format format); -typedef bool (*QMeeGoLiveTextureLockFunc) (Qt::HANDLE h); -typedef bool (*QMeeGoLiveTextureUnlockFunc) (Qt::HANDLE h); -typedef void (*QMeeGoLiveTextureDestroyFunc) (Qt::HANDLE h); -typedef void (*QMeeGoLiveTextureQueryFunc) (Qt::HANDLE h, void **data, int *pitch); -typedef Qt::HANDLE (*QMeeGoLiveTextureToEglImageFunc) (Qt::HANDLE h); +typedef QPixmapData* (*QMeeGoPixmapDataWithNewLiveTextureFunc) (int w, int h, QImage::Format format); +typedef QPixmapData* (*QMeeGoPixmapDataFromLiveTextureHandleFunc) (Qt::HANDLE h); +typedef QImage* (*QMeeGoLiveTextureLockFunc) (QPixmap*, void* fenceSync); +typedef bool (*QMeeGoLiveTextureReleaseFunc) (QPixmap*, QImage *i); +typedef Qt::HANDLE (*QMeeGoLiveTextureGetHandleFunc) (QPixmap*); +typedef void* (*QMeeGoCreateFenceSyncFunc) (void); +typedef void (*QMeeGoDestroyFenceSyncFunc) (void *fs); static QMeeGoImageToEglSharedImageFunc qt_meego_image_to_egl_shared_image = NULL; static QMeeGoPixmapDataFromEglSharedImageFunc qt_meego_pixmapdata_from_egl_shared_image = NULL; -static QMeeGoPixmapDataFromEglImageFunc qt_meego_pixmapdata_from_egl_image = NULL; static QMeeGoPixmapDataWithGLTextureFunc qt_meego_pixmapdata_with_gl_texture = NULL; static QMeeGoDestroyEGLSharedImageFunc qt_meego_destroy_egl_shared_image = NULL; static QMeeGoUpdateEglSharedImagePixmapFunc qt_meego_update_egl_shared_image_pixmap = NULL; static QMeeGoSetSurfaceFixedSizeFunc qt_meego_set_surface_fixed_size = NULL; static QMeeGoSetSurfaceScalingFunc qt_meego_set_surface_scaling = NULL; static QMeeGoSetTranslucentFunc qt_meego_set_translucent = NULL; -static QMeeGoLiveTextureCreateFunc qt_meego_live_texture_create = NULL; +static QMeeGoPixmapDataWithNewLiveTextureFunc qt_meego_pixmapdata_with_new_live_texture = NULL; +static QMeeGoPixmapDataFromLiveTextureHandleFunc qt_meego_pixmapdata_from_live_texture_handle = NULL; static QMeeGoLiveTextureLockFunc qt_meego_live_texture_lock = NULL; -static QMeeGoLiveTextureUnlockFunc qt_meego_live_texture_unlock = NULL; -static QMeeGoLiveTextureDestroyFunc qt_meego_live_texture_destroy = NULL; -static QMeeGoLiveTextureQueryFunc qt_meego_live_texture_query = NULL; -static QMeeGoLiveTextureToEglImageFunc qt_meego_live_texture_to_egl_image = NULL; - +static QMeeGoLiveTextureReleaseFunc qt_meego_live_texture_release = NULL; +static QMeeGoLiveTextureGetHandleFunc qt_meego_live_texture_get_handle = NULL; +static QMeeGoCreateFenceSyncFunc qt_meego_create_fence_sync = NULL; +static QMeeGoDestroyFenceSyncFunc qt_meego_destroy_fence_sync = NULL; void QMeeGoRuntime::initialize() { @@ -96,27 +96,30 @@ void QMeeGoRuntime::initialize() if (success) { qt_meego_image_to_egl_shared_image = (QMeeGoImageToEglSharedImageFunc) library.resolve("qt_meego_image_to_egl_shared_image"); qt_meego_pixmapdata_from_egl_shared_image = (QMeeGoPixmapDataFromEglSharedImageFunc) library.resolve("qt_meego_pixmapdata_from_egl_shared_image"); - qt_meego_pixmapdata_from_egl_image = (QMeeGoPixmapDataFromEglImageFunc) library.resolve("qt_meego_pixmapdata_from_egl_image"); qt_meego_pixmapdata_with_gl_texture = (QMeeGoPixmapDataWithGLTextureFunc) library.resolve("qt_meego_pixmapdata_with_gl_texture"); qt_meego_destroy_egl_shared_image = (QMeeGoDestroyEGLSharedImageFunc) library.resolve("qt_meego_destroy_egl_shared_image"); qt_meego_update_egl_shared_image_pixmap = (QMeeGoUpdateEglSharedImagePixmapFunc) library.resolve("qt_meego_update_egl_shared_image_pixmap"); qt_meego_set_surface_fixed_size = (QMeeGoSetSurfaceFixedSizeFunc) library.resolve("qt_meego_set_surface_fixed_size"); qt_meego_set_surface_scaling = (QMeeGoSetSurfaceScalingFunc) library.resolve("qt_meego_set_surface_scaling"); qt_meego_set_translucent = (QMeeGoSetTranslucentFunc) library.resolve("qt_meego_set_translucent"); - qt_meego_live_texture_create = (QMeeGoLiveTextureCreateFunc) library.resolve("qt_meego_live_texture_create"); + qt_meego_pixmapdata_with_new_live_texture = (QMeeGoPixmapDataWithNewLiveTextureFunc) library.resolve("qt_meego_pixmapdata_with_new_live_texture"); + qt_meego_pixmapdata_from_live_texture_handle = (QMeeGoPixmapDataFromLiveTextureHandleFunc) library.resolve("qt_meego_pixmapdata_from_live_texture_handle"); qt_meego_live_texture_lock = (QMeeGoLiveTextureLockFunc) library.resolve("qt_meego_live_texture_lock"); - qt_meego_live_texture_unlock = (QMeeGoLiveTextureUnlockFunc) library.resolve("qt_meego_live_texture_unlock"); - qt_meego_live_texture_destroy = (QMeeGoLiveTextureDestroyFunc) library.resolve("qt_meego_live_texture_destroy"); - qt_meego_live_texture_query = (QMeeGoLiveTextureQueryFunc) library.resolve("qt_meego_live_texture_query"); - qt_meego_live_texture_to_egl_image = (QMeeGoLiveTextureToEglImageFunc) library.resolve("qt_meego_live_texture_to_egl_image"); + qt_meego_live_texture_release = (QMeeGoLiveTextureReleaseFunc) library.resolve("qt_meego_live_texture_release"); + qt_meego_live_texture_get_handle = (QMeeGoLiveTextureGetHandleFunc) library.resolve("qt_meego_live_texture_get_handle"); + qt_meego_create_fence_sync = (QMeeGoCreateFenceSyncFunc) library.resolve("qt_meego_create_fence_sync"); + qt_meego_destroy_fence_sync = (QMeeGoDestroyFenceSyncFunc) library.resolve("qt_meego_destroy_fence_sync"); - if (qt_meego_image_to_egl_shared_image && qt_meego_pixmapdata_from_egl_shared_image && qt_meego_pixmapdata_from_egl_image && + if (qt_meego_image_to_egl_shared_image && qt_meego_pixmapdata_from_egl_shared_image && qt_meego_pixmapdata_with_gl_texture && qt_meego_destroy_egl_shared_image && qt_meego_update_egl_shared_image_pixmap && qt_meego_set_surface_fixed_size && qt_meego_set_surface_scaling && qt_meego_set_translucent && - qt_meego_live_texture_create && qt_meego_live_texture_lock && qt_meego_live_texture_unlock && - qt_meego_live_texture_destroy && qt_meego_live_texture_query && qt_meego_live_texture_to_egl_image) + qt_meego_pixmapdata_with_new_live_texture && qt_meego_pixmapdata_from_live_texture_handle && + qt_meego_live_texture_lock && qt_meego_live_texture_release && qt_meego_live_texture_get_handle && + qt_meego_create_fence_sync && qt_meego_destroy_fence_sync) { qDebug("Successfully resolved MeeGo graphics system: %s %s\n", qPrintable(libraryPrivate->fileName), qPrintable(libraryPrivate->fullVersion)); + } else { + Q_ASSERT(false); } } else { Q_ASSERT(false); @@ -139,13 +142,6 @@ QPixmapData* QMeeGoRuntime::pixmapDataFromEGLSharedImage(Qt::HANDLE handle, cons return qt_meego_pixmapdata_from_egl_shared_image(handle, softImage); } -QPixmapData* QMeeGoRuntime::pixmapDataFromEGLImage(Qt::HANDLE handle) -{ - ENSURE_INITIALIZED; - Q_ASSERT(qt_meego_pixmapdata_from_egl_image); - return qt_meego_pixmapdata_from_egl_image(handle); -} - QPixmapData* QMeeGoRuntime::pixmapDataWithGLTexture(int w, int h) { ENSURE_INITIALIZED; @@ -188,45 +184,51 @@ void QMeeGoRuntime::setTranslucent(bool translucent) qt_meego_set_translucent(translucent); } -Qt::HANDLE QMeeGoRuntime::createLiveTexture(int w, int h, QImage::Format format) +QPixmapData* QMeeGoRuntime::pixmapDataWithNewLiveTexture(int w, int h, QImage::Format format) { ENSURE_INITIALIZED; - Q_ASSERT(qt_meego_live_texture_create); - return qt_meego_live_texture_create(w, h, format); + Q_ASSERT(qt_meego_pixmapdata_with_new_live_texture); + return qt_meego_pixmapdata_with_new_live_texture(w, h, format); } -bool QMeeGoRuntime::lockLiveTexture(Qt::HANDLE h) +QPixmapData* QMeeGoRuntime::pixmapDataFromLiveTextureHandle(Qt::HANDLE h) { ENSURE_INITIALIZED; - Q_ASSERT(qt_meego_live_texture_lock); - return qt_meego_live_texture_lock(h); + Q_ASSERT(qt_meego_pixmapdata_from_live_texture_handle); + return qt_meego_pixmapdata_from_live_texture_handle(h); } -bool QMeeGoRuntime::unlockLiveTexture(Qt::HANDLE h) +QImage* QMeeGoRuntime::lockLiveTexture(QPixmap *p, void* fenceSync) { ENSURE_INITIALIZED; - Q_ASSERT(qt_meego_live_texture_unlock); - return qt_meego_live_texture_unlock(h); + Q_ASSERT(qt_meego_live_texture_lock); + return qt_meego_live_texture_lock(p, fenceSync); } -void QMeeGoRuntime::destroyLiveTexture(Qt::HANDLE h) +bool QMeeGoRuntime::releaseLiveTexture(QPixmap *p, QImage *i) { ENSURE_INITIALIZED; - Q_ASSERT(qt_meego_live_texture_destroy); - qt_meego_live_texture_destroy(h); + Q_ASSERT(qt_meego_live_texture_release); + return qt_meego_live_texture_release(p, i); } -void QMeeGoRuntime::queryLiveTexture(Qt::HANDLE h, void **data, int *pitch) +Qt::HANDLE QMeeGoRuntime::getLiveTextureHandle(QPixmap *pixmap) { ENSURE_INITIALIZED; - Q_ASSERT(qt_meego_live_texture_query); - qt_meego_live_texture_query(h, data, pitch); + Q_ASSERT(qt_meego_live_texture_get_handle); + return qt_meego_live_texture_get_handle(pixmap); } -Qt::HANDLE QMeeGoRuntime::liveTextureToEGLImage(Qt::HANDLE handle) +void* QMeeGoRuntime::createFenceSync() { ENSURE_INITIALIZED; - Q_ASSERT(qt_meego_live_texture_to_egl_image); - return qt_meego_live_texture_to_egl_image(handle); + Q_ASSERT(qt_meego_create_fence_sync); + return qt_meego_create_fence_sync(); } +void QMeeGoRuntime::destroyFenceSync(void *fs) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_destroy_fence_sync); + qt_meego_destroy_fence_sync(fs); +} diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.h b/tools/qmeegographicssystemhelper/qmeegoruntime.h index 048b9be..be6ff6b 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.h +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.h @@ -49,19 +49,19 @@ public: static Qt::HANDLE imageToEGLSharedImage(const QImage &image); static QPixmapData* pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage); - static QPixmapData* pixmapDataFromEGLImage(Qt::HANDLE handle); static QPixmapData* pixmapDataWithGLTexture(int w, int h); static bool destroyEGLSharedImage(Qt::HANDLE handle); static void updateEGLSharedImagePixmap(QPixmap *p); static void setSurfaceFixedSize(int w, int h); static void setSurfaceScaling(int x, int y, int w, int h); static void setTranslucent(bool translucent); - static Qt::HANDLE createLiveTexture(int w, int h, QImage::Format format); - static bool lockLiveTexture(Qt::HANDLE h); - static bool unlockLiveTexture(Qt::HANDLE h); - static void destroyLiveTexture(Qt::HANDLE h); - static void queryLiveTexture(Qt::HANDLE h, void **data, int *pitch); - static Qt::HANDLE liveTextureToEGLImage(Qt::HANDLE); + static QPixmapData* pixmapDataWithNewLiveTexture(int w, int h, QImage::Format format); + static QPixmapData* pixmapDataFromLiveTextureHandle(Qt::HANDLE h); + static QImage* lockLiveTexture(QPixmap *pixmap, void *fenceSync); + static bool releaseLiveTexture(QPixmap *pixmap, QImage *image); + static Qt::HANDLE getLiveTextureHandle(QPixmap *pixmap); + static void* createFenceSync(); + static void destroyFenceSync(void *fs); private: static bool initialized; diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 00d43c1..579f1ab 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -172,6 +172,7 @@ void scriptOptsUsage() qWarning(" play ..................................... playback an existing script"); qWarning(" testimages ............................... record images or compare images on playback"); qWarning(" testerror ................................ test 'error' property of root item on playback"); + qWarning(" testskip ................................ test 'skip' property of root item on playback"); qWarning(" snapshot ................................. file being recorded is static,"); qWarning(" only one frame will be recorded or tested"); qWarning(" exitoncomplete ........................... cleanly exit the viewer on script completion"); @@ -305,6 +306,8 @@ static void parseScriptOptions() scriptOptions |= QDeclarativeViewer::TestImages; } else if (option == QLatin1String("testerror")) { scriptOptions |= QDeclarativeViewer::TestErrorProperty; + } else if (option == QLatin1String("testskip")) { + scriptOptions |= QDeclarativeViewer::TestSkipProperty; } else if (option == QLatin1String("exitoncomplete")) { scriptOptions |= QDeclarativeViewer::ExitOnComplete; } else if (option == QLatin1String("exitonfailure")) { diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp index 9864df6..a516fd7 100644 --- a/tools/qml/qdeclarativetester.cpp +++ b/tools/qml/qdeclarativetester.cpp @@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE +extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled; QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer::ScriptOptions opts, QDeclarativeView *parent) @@ -61,6 +62,12 @@ QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer parent->viewport()->installEventFilter(this); parent->installEventFilter(this); QUnifiedTimer::instance()->setConsistentTiming(true); + + //Font antialiasing makes tests system-specific, so disable it + QFont noAA = QApplication::font(); + noAA.setStyleStrategy(QFont::NoAntialias); + QApplication::setFont(noAA); + if (options & QDeclarativeViewer::Play) this->run(); start(); @@ -136,8 +143,25 @@ void QDeclarativeTester::imagefailure() { hasFailed = true; - if (options & QDeclarativeViewer::ExitOnFailure) - exit(-1); + if (options & QDeclarativeViewer::ExitOnFailure){ + testSkip(); + exit(hasFailed?-1:0); + } +} + +void QDeclarativeTester::testSkip() +{ + if (options & QDeclarativeViewer::TestSkipProperty){ + QString e = m_view->rootObject()->property("skip").toString(); + if (!e.isEmpty()) { + if(hasFailed){ + qWarning() << "Test failed, but skipping it: " << e; + }else{ + qWarning() << "Test skipped: " << e; + } + hasFailed = 0; + } + } } void QDeclarativeTester::complete() @@ -149,7 +173,10 @@ void QDeclarativeTester::complete() hasFailed = true; } } - if (options & QDeclarativeViewer::ExitOnComplete) + + + testSkip(); + if (options & QDeclarativeViewer::ExitOnComplete) QApplication::exit(hasFailed?-1:0); if (hasCompleted) @@ -258,7 +285,7 @@ void QDeclarativeTester::updateCurrentTime(int msec) fe.msec = msec; if (msec == 0 || !(options & QDeclarativeViewer::TestImages)) { // Skip first frame, skip if not doing images - } else if (0 == (m_savedFrameEvents.count() % 60) || snapshot) { + } else if (0 == ((m_savedFrameEvents.count()-1) % 60) || snapshot) { fe.image = img; } else { QCryptographicHash hash(QCryptographicHash::Md5); @@ -309,14 +336,14 @@ void QDeclarativeTester::updateCurrentTime(int msec) if (QDeclarativeVisualTestFrame *frame = qobject_cast<QDeclarativeVisualTestFrame *>(event)) { if (frame->msec() < msec) { if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) { - qWarning() << "QDeclarativeTester: Extra frame. Seen:" + qWarning() << "QDeclarativeTester(" << m_script << "): Extra frame. Seen:" << msec << "Expected:" << frame->msec(); imagefailure(); } } else if (frame->msec() == msec) { if (!frame->hash().isEmpty() && frame->hash().toUtf8() != fe.hash.toHex()) { if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) { - qWarning() << "QDeclarativeTester: Mismatched frame hash at" << msec + qWarning() << "QDeclarativeTester(" << m_script << "): Mismatched frame hash at" << msec << ". Seen:" << fe.hash.toHex() << "Expected:" << frame->hash().toUtf8(); imagefailure(); @@ -328,9 +355,14 @@ void QDeclarativeTester::updateCurrentTime(int msec) if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record) && !frame->image().isEmpty()) { QImage goodImage(frame->image().toLocalFile()); + if (frame->msec() == 16 && goodImage.size() != img.size()){ + //Also an image mismatch, but this warning is more informative. Only checked at start though. + qWarning() << "QDeclarativeTester(" << m_script << "): Size mismatch. This test must be run at " << goodImage.size(); + imagefailure(); + } if (goodImage != img) { QString reject(frame->image().toLocalFile() + ".reject.png"); - qWarning() << "QDeclarativeTester: Image mismatch. Reject saved to:" + qWarning() << "QDeclarativeTester(" << m_script << "): Image mismatch. Reject saved to:" << reject; img.save(reject); bool doDiff = (goodImage.size() == img.size()); diff --git a/tools/qml/qdeclarativetester.h b/tools/qml/qdeclarativetester.h index 021869d..0cf508a 100644 --- a/tools/qml/qdeclarativetester.h +++ b/tools/qml/qdeclarativetester.h @@ -228,6 +228,7 @@ private: void imagefailure(); void complete(); + void testSkip(); enum Destination { View, ViewPort }; void addKeyEvent(Destination, QKeyEvent *); diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 5e169d8..78bc409 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -1383,6 +1383,8 @@ void QDeclarativeViewer::appAboutToQuit() // avoid crashes if messages are received after app has closed delete loggerWindow; loggerWindow = 0; + delete tester; + tester = 0; } void QDeclarativeViewer::autoStartRecording() @@ -1518,6 +1520,7 @@ void QDeclarativeViewer::updateSizeHints(bool initial) //qWarning() << "USH: R2V: setting free size "; layout()->setSizeConstraint(QLayout::SetNoConstraint); layout()->activate(); + setMinimumSize(QSize(1,1)); setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); canvas->setMinimumSize(QSize(0,0)); canvas->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index d1ec26d..b43aa54 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -83,7 +83,8 @@ public: SaveOnExit = 0x00000010, ExitOnComplete = 0x00000020, ExitOnFailure = 0x00000040, - Snapshot = 0x00000080 + Snapshot = 0x00000080, + TestSkipProperty = 0x00000100 }; Q_DECLARE_FLAGS(ScriptOptions, ScriptOption) void setScript(const QString &s) { m_script = s; } diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 0d6b4da..f2e26d7 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE // external use ignore them // extern bool Q_CORE_EXPORT qt_resolve_symlinks; -static const char *appearance_text = +static const char *appearance_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Appearance</font></b></p>" "<hr>" "<p>Use this tab to customize the appearance of your Qt applications.</p>" @@ -96,9 +96,9 @@ static const char *appearance_text = "To customize colors further, press the Tune Palette button to open " "the advanced palette editor." "<p>The Preview Window shows what the selected Style and colors look " -"like."; +"like."); -static const char *font_text = +static const char *font_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Fonts</font></b></p>" "<hr>" "<p>Use this tab to select the default font for your Qt applications. " @@ -115,9 +115,9 @@ static const char *font_text = "Korean characters that are not found in the Lucida font will be taken " "from the Mincho font. Because the font substitutions are " "lists, you can also select multiple families, such as Song Ti (for " -"use with Chinese text)."; +"use with Chinese text)."); -static const char *interface_text = +static const char *interface_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Interface</font></b></p>" "<hr>" "<p>Use this tab to customize the feel of your Qt applications.</p>" @@ -132,10 +132,10 @@ static const char *interface_text = "at 0 will disable the Global Strut feature</p>" "<p>XIM (Extended Input Methods) are used for entering characters in " "languages that have large character sets, for example, Chinese and " -"Japanese."; +"Japanese."); // ### What does the 'Enhanced support for languages written R2L do? -static const char *printer_text = +static const char *printer_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Printer</font></b></p>" "<hr>" "<p>Use this tab to configure the way Qt generates output for the printer." @@ -146,14 +146,14 @@ static const char *printer_text = "size will be bigger." "<p>When using font embedding you can select additional directories where " "Qt should search for embeddable font files. By default, the X " -"server font path is used."; +"server font path is used."); -static const char *phonon_text = +static const char *phonon_text = QT_TRANSLATE_NOOP("MainWindow", "<p><b><font size+=2>Phonon</font></b></p>" "<hr>" "<p>Use this tab to configure the Phonon GStreamer multimedia backend. " "<p>It is reccommended to leave all settings on \"Auto\" to let " -"Phonon determine your settings automatically."; +"Phonon determine your settings automatically."); static QColorGroup::ColorRole centralFromItem( int item ) { diff --git a/tools/qtestlib/wince/cetest/activesyncconnection.cpp b/tools/qtestlib/wince/cetest/activesyncconnection.cpp index 98062ed..812ed47 100644 --- a/tools/qtestlib/wince/cetest/activesyncconnection.cpp +++ b/tools/qtestlib/wince/cetest/activesyncconnection.cpp @@ -247,7 +247,7 @@ bool ActiveSyncConnection::copyFileFromDevice(const QString &deviceSource, const wprintf(L"\n"); if (!readUntilEnd) { - debugOutput(QString::fromLatin1(" an error occured during copy"), 2); + debugOutput(QString::fromLatin1(" an error occurred during copy"), 2); return false; } diff --git a/tools/qtestlib/wince/cetest/deployment.cpp b/tools/qtestlib/wince/cetest/deployment.cpp index 95768f9..e74c72b 100644 --- a/tools/qtestlib/wince/cetest/deployment.cpp +++ b/tools/qtestlib/wince/cetest/deployment.cpp @@ -227,9 +227,9 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList return; for (int it = 0; it < list.size(); ++it) { - QString argSource = list.at(it) + QString(".sources"); + QString argSource = list.at(it); QString argPath = list.at(it) + QString(".path"); - if ((project->values(argSource).isEmpty() || project->values(argPath).isEmpty()) && list.at(it) != "deploy") { + if (((project->values(argSource + QString(".files")).isEmpty() && project->values(argSource + QString(".sources")).isEmpty()) || project->values(argPath).isEmpty()) && list.at(it) != "deploy") { debugOutput(QString::fromLatin1("cannot deploy \"%1\" because of missing data.").arg(list.at(it)), 0); continue; } @@ -240,7 +240,7 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList if (!addPath.startsWith("/") && !addPath.startsWith(QLatin1String("\\"))) addPath = targetPath + "/" + addPath; - QStringList addSources = project->values(argSource); + QStringList addSources = project->values(argSource + QString(".files")) + project->values(argSource + QString(".sources")); addSources.replaceInStrings(QLatin1String("/"), QLatin1String("\\")); for(int index=0; index < addSources.size(); ++index) { QString dirstr = qmake_getpwd(); @@ -264,7 +264,7 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList continue; } QString appendedQmakeDeploy = QString::fromLatin1("_q_make_additional_deploy_%1").arg(addQMakeDeployCounter++); - project->parse(appendedQmakeDeploy + QLatin1String(".sources = \"") + wildInfo.absoluteFilePath()); + project->parse(appendedQmakeDeploy + QLatin1String(".files = \"") + wildInfo.absoluteFilePath()); project->parse(appendedQmakeDeploy + QLatin1String(".path = \"") + addPath); list.append(appendedQmakeDeploy); } @@ -276,7 +276,7 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList QStringList additionalEntries = additionalDir.entryList(QDir::NoDotAndDotDot | QDir::AllEntries | QDir::NoSymLinks); foreach(QString item, additionalEntries) { QString appendedDeploy = QString::fromLatin1("_q_make_additional_deploy_%1").arg(addQMakeDeployCounter++); - project->parse(appendedDeploy + QLatin1String(".sources = \"") + Option::fixPathToLocalOS(additionalDir.absoluteFilePath(item)) + QLatin1String("\"")); + project->parse(appendedDeploy + QLatin1String(".files = \"") + Option::fixPathToLocalOS(additionalDir.absoluteFilePath(item)) + QLatin1String("\"")); QString appendTargetPath = project->values(argPath).join(QLatin1String(" ")); if (appendTargetPath == QLatin1String(".")) appendTargetPath = filestr; diff --git a/tools/qtestlib/wince/cetest/main.cpp b/tools/qtestlib/wince/cetest/main.cpp index 4272a83..ec62af1 100644 --- a/tools/qtestlib/wince/cetest/main.cpp +++ b/tools/qtestlib/wince/cetest/main.cpp @@ -283,7 +283,7 @@ int main(int argc, char **argv) cout << "Error: Can only test executables!" << endl; return -1; } - // Check wether the project is still in debug/release mode after reading + // Check whether the project is still in debug/release mode after reading // If .pro specifies to be one mode only, we need to accept this if (project.isActiveConfig("debug") && !project.isActiveConfig("release")) { TestConfiguration::testDebug = true; diff --git a/tools/qvfb/qvfb.cpp b/tools/qvfb/qvfb.cpp index b4ccebc..a3b1964 100644 --- a/tools/qvfb/qvfb.cpp +++ b/tools/qvfb/qvfb.cpp @@ -1038,7 +1038,7 @@ void AnimationSaveWidget::convertToMpeg(QString filename) // ### can't use QProcess, not in Qt 2.3 // ### but it's certainly in Qt 4! use it? - // Execute the ppmtompeg command as a seperate process to do the encoding + // Execute the ppmtompeg command as a separate process to do the encoding pid_t pid = ::fork(); if ( !pid ) { // Child process diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp index db6375e..f5b2521 100644 --- a/tools/runonphone/serenum_unix.cpp +++ b/tools/runonphone/serenum_unix.cpp @@ -100,7 +100,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) // data transmission. // the extra info stores that as a index for the interface if (buf[0] >= 5 && buf[1] == 36 && buf[2] == 6) { // CDC Union - for (int i = 4; i < buf[0]; i++) + for (int i = 3; i < buf[0]; i++) usableInterfaces.append((int) buf[i]); } size -= buf[0]; @@ -146,32 +146,17 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) // second loop to find the actual data interface. foreach (int i, usableInterfaces) { - for (int m = 0; m < usbConfig.bNumInterfaces; ++m) { - for (int o = 0; o < usbConfig.interface[m].num_altsetting; ++o) { - struct usb_interface_descriptor &descriptor = usbConfig.interface[m].altsetting[o]; - if (descriptor.bInterfaceNumber != i) - continue; - if (descriptor.bInterfaceClass == 10) { // "CDC Data" - if (loglevel > 1) { - qDebug() << " found the data port" - << "bus:" << bus->dirname - << "device" << device->filename - << "interface" << descriptor.bInterfaceNumber; - } - // ### manufacturer and product strings are only readable as root :( - if (!manufacturerString.isEmpty() && !productString.isEmpty()) { - eligibleInterfaces << QString("usb-%1_%2-if%3") - .arg(manufacturerString.replace(QChar(' '), QChar('_'))) - .arg(productString.replace(QChar(' '), QChar('_'))) - .arg(i, 2, 16, QChar('0')); - } else { - eligibleInterfaces << QString("if%1").arg(i, 2, 16, QChar('0')); // fix! - } - eligibleInterfacesInfo << InterfaceInfo(manufacturerString, productString, device->descriptor.idVendor, device->descriptor.idProduct); - } - } + // ### manufacturer and product strings are only readable as root :( + if (!manufacturerString.isEmpty() && !productString.isEmpty()) { + eligibleInterfaces << QString("usb-%1_%2-if%3") + .arg(manufacturerString.replace(QChar(' '), QChar('_'))) + .arg(productString.replace(QChar(' '), QChar('_'))) + .arg(i, 2, 16, QChar('0')); + } else { + eligibleInterfaces << QString("if%1").arg(i, 2, 16, QChar('0')); // fix! } } + eligibleInterfacesInfo << InterfaceInfo(manufacturerString, productString, device->descriptor.idVendor, device->descriptor.idProduct); } } } diff --git a/tools/runonphone/symbianutils/tcftrkdevice.h b/tools/runonphone/symbianutils/tcftrkdevice.h index 67955e5..f56a86e 100644 --- a/tools/runonphone/symbianutils/tcftrkdevice.h +++ b/tools/runonphone/symbianutils/tcftrkdevice.h @@ -65,7 +65,7 @@ struct Breakpoint; /* Command error handling in TCF: * 1) 'Severe' errors (JSON format, parameter format): Trk emits a - * nonstandard message (\3\2 error paramaters) and closes the connection. + * nonstandard message (\3\2 error parameters) and closes the connection. * 2) Protocol errors: 'N' without error message is returned. * 3) Errors in command execution: 'R' with a TCF error hash is returned * (see TcfTrkCommandError). */ diff --git a/tools/runonphone/symbianutils/tcftrkmessage.h b/tools/runonphone/symbianutils/tcftrkmessage.h index 510b485..929a9e6 100644 --- a/tools/runonphone/symbianutils/tcftrkmessage.h +++ b/tools/runonphone/symbianutils/tcftrkmessage.h @@ -123,7 +123,7 @@ struct SYMBIANUTILS_EXPORT RunControlContext { QByteArray parentId; // Parent process id of a thread. }; -// Module load information occuring with 'RunControl contextSuspended' events +// Module load information occurring with 'RunControl contextSuspended' events struct SYMBIANUTILS_EXPORT ModuleLoadEventInfo { ModuleLoadEventInfo(); void clear(); diff --git a/tools/tools.pro b/tools/tools.pro index 8f23fe4..e82bcaa 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -20,7 +20,7 @@ TEMPLATE = subdirs SUBDIRS += designer } } - unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig + unix:!mac:!embedded:!qpa:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig win32:!wince*:SUBDIRS += activeqt } contains(QT_CONFIG, declarative):SUBDIRS += qml |