diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-23 16:06:00 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-23 16:06:00 (GMT) |
commit | 2bfde77e07c1de1866a1d171fc5dc5c584618e8e (patch) | |
tree | a38ead931add61ba1b8dbb2eb0ad495a59aaf35f | |
parent | ec2d71f0e4af0e0c286f0027d0242f456fdb2bb6 (diff) | |
parent | 5423ba187c62ea861ccfcc013fb15fcc4a5ae28d (diff) | |
download | Qt-2bfde77e07c1de1866a1d171fc5dc5c584618e8e.zip Qt-2bfde77e07c1de1866a1d171fc5dc5c584618e8e.tar.gz Qt-2bfde77e07c1de1866a1d171fc5dc5c584618e8e.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into windows-7-multitouch
62 files changed, 2776 insertions, 1078 deletions
diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml index 03b59f3..96a3e80 100644 --- a/demos/qtdemo/xml/examples.xml +++ b/demos/qtdemo/xml/examples.xml @@ -118,6 +118,7 @@ <example filename="threadedfortuneserver" name="Threaded Fort. Server" /> <example filename="torrent" name="Torrent Client" /> <example filename="securesocketclient" name="Secure Socket Client" /> + <example filename="googlesuggest" name="Google Suggest" /> </category> <category dirname="opengl" name="OpenGL"> <example filename="2dpainting" name="2D Painting" /> @@ -213,6 +214,12 @@ <example filename="wiggly" name="Wiggly" /> <example filename="windowflags" name="Window Flags" /> </category> + <category dirname="webkit" name="WebKit"> + <example filename="formextractor" name="Form Extractor" /> + <example filename="previewer" name="HTML Previewer" /> + <example filename="fancybrowser" name="Fancy Browser" /> + <example filename="googlechat" name="Google Chat" /> + </category> <category dirname="xml" name="XML"> <example filename="saxbookmarks" name="SAX Bookmarks" /> <example filename="dombookmarks" name="DOM Bookmarks" /> diff --git a/doc/doc.pri b/doc/doc.pri index 46df3cb..a4c77fe 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -4,7 +4,7 @@ win32 { QT_WINCONFIG = release/ - CONFIG(debug, debug|release) { + !CONFIG(release, debug|release) { QT_WINCONFIG = debug/ } } diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc index e3c2291..29c6c0b 100644 --- a/doc/src/examples.qdoc +++ b/doc/src/examples.qdoc @@ -209,6 +209,7 @@ \o \l{network/loopback}{Loopback} \o \l{network/threadedfortuneserver}{Threaded Fortune Server}\raisedaster \o \l{network/torrent}{Torrent} + \o \l{network/googlesuggest}{Google Suggest} \endlist \section1 OpenGL @@ -348,6 +349,8 @@ \list \o \l{webkit/previewer}{Previewer}\raisedaster \o \l{webkit/formextractor}{Form Extractor} + \o \l{webkit/googlechat}{Google Chat} + \o \l{webkit/fancybrowser}{Fancy Browser} \endlist \section1 Widgets diff --git a/doc/src/examples/fancybrowser.qdoc b/doc/src/examples/fancybrowser.qdoc new file mode 100644 index 0000000..9001c20 --- /dev/null +++ b/doc/src/examples/fancybrowser.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example webkit/fancybrowser + \title Fancy Browser Example + + The Fancy Browser example shows how to use jQuery with QtWebKit to + make a web browser with some special effects and content manipulation. + + \image fancybrowser-example.png + +*/ diff --git a/doc/src/examples/googlechat.qdoc b/doc/src/examples/googlechat.qdoc new file mode 100644 index 0000000..f2d61cf --- /dev/null +++ b/doc/src/examples/googlechat.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example webkit/googlechat + \title Google Chat Example + + The Google Chat example shows how to use implement a simple Google Chat + client with QtWebKit. + + \image googlechat-example.png + +*/ diff --git a/doc/src/examples/googlesuggest.qdoc b/doc/src/examples/googlesuggest.qdoc new file mode 100644 index 0000000..a9b09f9 --- /dev/null +++ b/doc/src/examples/googlesuggest.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example network/googlesuggest + \title Google Suggest Example + + The Google Suggest example shows how to use the network access manager + to get the list of suggested search terms from Google. + + \image googlesuggest-example.png + +*/ diff --git a/doc/src/images/fancybrowser-example.png b/doc/src/images/fancybrowser-example.png Binary files differnew file mode 100644 index 0000000..717ac9d --- /dev/null +++ b/doc/src/images/fancybrowser-example.png diff --git a/doc/src/images/googlechat-example.png b/doc/src/images/googlechat-example.png Binary files differnew file mode 100644 index 0000000..0338445 --- /dev/null +++ b/doc/src/images/googlechat-example.png diff --git a/doc/src/images/googlesuggest-example.png b/doc/src/images/googlesuggest-example.png Binary files differnew file mode 100644 index 0000000..4ef072a --- /dev/null +++ b/doc/src/images/googlesuggest-example.png diff --git a/doc/src/licenses.qdoc b/doc/src/licenses.qdoc index b42b882..1c3f6d2 100644 --- a/doc/src/licenses.qdoc +++ b/doc/src/licenses.qdoc @@ -239,6 +239,24 @@ \o Parts of the internal QImageSmoothScaler::scale() function use code based on pnmscale.c by Jef Poskanzer. \endlist + + \hr + + jQuery JavaScript Library v1.3.2 + http://jquery.com/ + + Copyright (c) 2009 John Resig + Dual licensed under the MIT and GPL licenses. + http://docs.jquery.com/License + + Sizzle CSS Selector Engine - v0.9.3 + Copyright 2009, The Dojo Foundation + Released under the MIT, BSD, and GPL Licenses. + More information: http://sizzlejs.com/ + + \list + \o examples/webkit/fancybrowser/jquery.min.js + \endlist */ /*! diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp new file mode 100644 index 0000000..285a018 --- /dev/null +++ b/examples/network/googlesuggest/googlesuggest.cpp @@ -0,0 +1,223 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtCore> +#include <QtGui> +#include <QtNetwork> + +#include "googlesuggest.h" + +#define GSUGGEST_URL "http://google.com/complete/search?output=toolbar&q=%1" + +GSuggestCompletion::GSuggestCompletion(QLineEdit *parent): QObject(parent), editor(parent) +{ + popup = new QTreeWidget; + popup->setColumnCount(2); + popup->setUniformRowHeights(true); + popup->setRootIsDecorated(false); + popup->setEditTriggers(QTreeWidget::NoEditTriggers); + popup->setSelectionBehavior(QTreeWidget::SelectRows); + popup->setFrameStyle(QFrame::Box | QFrame::Plain); + popup->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + popup->header()->hide(); + popup->installEventFilter(this); + popup->setMouseTracking(true); + + connect(popup, SIGNAL(itemClicked(QTreeWidgetItem*, int)), + SLOT(doneCompletion())); + + popup->setWindowFlags(Qt::Popup); + popup->setFocusPolicy(Qt::NoFocus); + popup->setFocusProxy(parent); + + timer = new QTimer(this); + timer->setSingleShot(true); + timer->setInterval(500); + connect(timer, SIGNAL(timeout()), SLOT(autoSuggest())); + connect(editor, SIGNAL(textEdited(QString)), timer, SLOT(start())); + + connect(&networkManager, SIGNAL(finished(QNetworkReply*)), + this, SLOT(handleNetworkData(QNetworkReply*))); + +} + +GSuggestCompletion::~GSuggestCompletion() +{ + delete popup; +} + +bool GSuggestCompletion::eventFilter(QObject *obj, QEvent *ev) +{ + if (obj != popup) + return false; + + if (ev->type() == QEvent::MouseButtonPress) { + popup->hide(); + editor->setFocus(); + return true; + } + + if (ev->type() == QEvent::KeyPress) { + + bool consumed = false; + int key = static_cast<QKeyEvent*>(ev)->key(); + switch (key) { + case Qt::Key_Enter: + case Qt::Key_Return: + doneCompletion(); + consumed = true; + + case Qt::Key_Escape: + editor->setFocus(); + popup->hide(); + consumed = true; + + case Qt::Key_Up: + case Qt::Key_Down: + case Qt::Key_Home: + case Qt::Key_End: + case Qt::Key_PageUp: + case Qt::Key_PageDown: + break; + + default: + editor->setFocus(); + editor->event(ev); + popup->hide(); + break; + } + + return consumed; + } + + return false; +} + +void GSuggestCompletion::showCompletion(const QStringList &choices, const QStringList &hits) +{ + + if (choices.isEmpty() || choices.count() != hits.count()) + return; + + const QPalette &pal = editor->palette(); + QColor color = pal.color(QPalette::Disabled, QPalette::WindowText); + + popup->setUpdatesEnabled(false); + popup->clear(); + for (int i = 0; i < choices.count(); ++i) { + QTreeWidgetItem * item; + item = new QTreeWidgetItem(popup); + item->setText(0, choices[i]); + item->setText(1, hits[i]); + item->setTextAlignment(1, Qt::AlignRight); + item->setTextColor(1, color); + } + popup->setCurrentItem(popup->topLevelItem(0)); + popup->resizeColumnToContents(0); + popup->resizeColumnToContents(1); + popup->adjustSize(); + popup->setUpdatesEnabled(true); + + int h = popup->sizeHintForRow(0) * qMin(7, choices.count()) + 3; + popup->resize(popup->width(), h); + + popup->move(editor->mapToGlobal(QPoint(0, editor->height()))); + popup->setFocus(); + popup->show(); +} + +void GSuggestCompletion::doneCompletion() +{ + timer->stop(); + popup->hide(); + editor->setFocus(); + QTreeWidgetItem *item = popup->currentItem(); + if (item) { + editor->setText(item->text(0)); + QKeyEvent *e; + e = new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier); + QApplication::postEvent(editor, e); + e = new QKeyEvent(QEvent::KeyRelease, Qt::Key_Enter, Qt::NoModifier); + QApplication::postEvent(editor, e); + } +} + +void GSuggestCompletion::preventSuggest() +{ + timer->stop(); +} + +void GSuggestCompletion::autoSuggest() +{ + QString str = editor->text(); + QString url = QString(GSUGGEST_URL).arg(str); + networkManager.get(QNetworkRequest(QString(url))); +} + +void GSuggestCompletion::handleNetworkData(QNetworkReply *networkReply) +{ + QUrl url = networkReply->url(); + if (!networkReply->error()) { + QStringList choices; + QStringList hits; + + QString response(networkReply->readAll()); + QXmlStreamReader xml(response); + while (!xml.atEnd()) { + xml.readNext(); + if (xml.tokenType() == QXmlStreamReader::StartElement) + if (xml.name() == "suggestion") { + QStringRef str = xml.attributes().value("data"); + choices << str.toString(); + } + if (xml.tokenType() == QXmlStreamReader::StartElement) + if (xml.name() == "num_queries") { + QStringRef str = xml.attributes().value("int"); + hits << str.toString(); + } + } + + showCompletion(choices, hits); + } + + networkReply->deleteLater(); +} diff --git a/examples/network/googlesuggest/googlesuggest.h b/examples/network/googlesuggest/googlesuggest.h new file mode 100644 index 0000000..0267709 --- /dev/null +++ b/examples/network/googlesuggest/googlesuggest.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GOOGLESUGGEST_H +#define GOOGLESUGGEST_H + +#include <QObject> +#include <QNetworkAccessManager> + +QT_BEGIN_NAMESPACE +class QLineEdit; +class QNetworkReply; +class QTimer; +class QTreeWidget; +QT_END_NAMESPACE + +class GSuggestCompletion : public QObject +{ + Q_OBJECT + +public: + GSuggestCompletion(QLineEdit *parent = 0); + ~GSuggestCompletion(); + bool eventFilter(QObject *obj, QEvent *ev); + void showCompletion(const QStringList &choices, const QStringList &hits); + +public slots: + + void doneCompletion(); + void preventSuggest(); + void autoSuggest(); + void handleNetworkData(QNetworkReply *networkReply); + +private: + QLineEdit *editor; + QTreeWidget *popup; + QTimer *timer; + QNetworkAccessManager networkManager; +}; + +#endif // GOOGLESUGGEST_H + diff --git a/examples/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro new file mode 100644 index 0000000..afd600f --- /dev/null +++ b/examples/network/googlesuggest/googlesuggest.pro @@ -0,0 +1,9 @@ +QT += network +SOURCES = main.cpp searchbox.cpp googlesuggest.cpp +HEADERS = searchbox.h googlesuggest.h + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlesuggest +sources.files = $$SOURCES $$HEADERS *.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlesuggest +INSTALLS += target sources diff --git a/examples/network/googlesuggest/main.cpp b/examples/network/googlesuggest/main.cpp new file mode 100644 index 0000000..f8d9bc5 --- /dev/null +++ b/examples/network/googlesuggest/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QApplication> + +#include "searchbox.h" + +int main(int argc, char * argv[]) +{ + QApplication app(argc, argv); + SearchBox *searchEdit = new SearchBox; + searchEdit->show(); + return app.exec(); +} diff --git a/examples/network/googlesuggest/searchbox.cpp b/examples/network/googlesuggest/searchbox.cpp new file mode 100644 index 0000000..cd7b122 --- /dev/null +++ b/examples/network/googlesuggest/searchbox.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QDesktopServices> +#include <QUrl> + +#include "searchbox.h" +#include "googlesuggest.h" + +#define GSEARCH_URL "http://www.google.com/search?q=%1" + + +SearchBox::SearchBox(QWidget *parent): QLineEdit(parent) +{ + completer = new GSuggestCompletion(this); + + connect(this, SIGNAL(returnPressed()), SLOT(doSearch())); + + setWindowTitle("Search with Google"); + + adjustSize(); + resize(400, height()); + setFocus(); +} + +void SearchBox::doSearch() +{ + completer->preventSuggest(); + QString url = QString(GSEARCH_URL).arg(text()); + QDesktopServices::openUrl(QUrl(url)); +} diff --git a/examples/network/googlesuggest/searchbox.h b/examples/network/googlesuggest/searchbox.h new file mode 100644 index 0000000..75ceffd --- /dev/null +++ b/examples/network/googlesuggest/searchbox.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SEARCHBOX_H +#define SEARCHBOX_H + +#include <QLineEdit> + +class GSuggestCompletion; + +class SearchBox: public QLineEdit +{ + Q_OBJECT + +public: + SearchBox(QWidget *parent = 0); + +protected slots: + void doSearch(); + +private: + GSuggestCompletion *completer; +}; + + +#endif // SEARCHBOX_H diff --git a/examples/network/network.pro b/examples/network/network.pro index 13b3116..8c45745 100644 --- a/examples/network/network.pro +++ b/examples/network/network.pro @@ -11,6 +11,7 @@ SUBDIRS = blockingfortuneclient \ http \ loopback \ threadedfortuneserver \ + googlesuggest \ torrent contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient diff --git a/examples/webkit/fancybrowser/fancybrowser.pro b/examples/webkit/fancybrowser/fancybrowser.pro new file mode 100644 index 0000000..3de3036 --- /dev/null +++ b/examples/webkit/fancybrowser/fancybrowser.pro @@ -0,0 +1,11 @@ +QT += webkit +HEADERS = mainwindow.h +SOURCES = main.cpp \ + mainwindow.cpp +RESOURCES = jquery.qrc + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/webkit/fancybrowser +sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/fancybrowser +INSTALLS += target sources diff --git a/examples/webkit/fancybrowser/jquery.min.js b/examples/webkit/fancybrowser/jquery.min.js new file mode 100644 index 0000000..b1ae21d --- /dev/null +++ b/examples/webkit/fancybrowser/jquery.min.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
\ No newline at end of file diff --git a/examples/webkit/fancybrowser/jquery.qrc b/examples/webkit/fancybrowser/jquery.qrc new file mode 100644 index 0000000..1022d68 --- /dev/null +++ b/examples/webkit/fancybrowser/jquery.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/" > + <file>jquery.min.js</file> + </qresource> +</RCC> diff --git a/examples/webkit/fancybrowser/main.cpp b/examples/webkit/fancybrowser/main.cpp new file mode 100644 index 0000000..5936469 --- /dev/null +++ b/examples/webkit/fancybrowser/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtGui> +#include "mainwindow.h" + +int main(int argc, char * argv[]) +{ + QApplication app(argc, argv); + MainWindow *browser = new MainWindow; + browser->show(); + return app.exec(); +} diff --git a/examples/webkit/fancybrowser/mainwindow.cpp b/examples/webkit/fancybrowser/mainwindow.cpp new file mode 100644 index 0000000..bf61f9c --- /dev/null +++ b/examples/webkit/fancybrowser/mainwindow.cpp @@ -0,0 +1,167 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtGui> +#include <QtWebKit> +#include "mainwindow.h" + +MainWindow::MainWindow() +{ + progress = 0; + + QFile file; + file.setFileName(":/jquery.min.js"); + file.open(QIODevice::ReadOnly); + jQuery = file.readAll(); + file.close(); + + view = new QWebView(this); + view->load(QUrl("http://www.google.com/ncr")); + connect(view, SIGNAL(loadFinished(bool)), SLOT(adjustLocation())); + connect(view, SIGNAL(titleChanged(const QString&)), SLOT(adjustTitle())); + connect(view, SIGNAL(loadProgress(int)), SLOT(setProgress(int))); + connect(view, SIGNAL(loadFinished(bool)), SLOT(finishLoading(bool))); + + locationEdit = new QLineEdit(this); + locationEdit->setSizePolicy(QSizePolicy::Expanding, locationEdit->sizePolicy().verticalPolicy()); + connect(locationEdit, SIGNAL(returnPressed()), SLOT(changeLocation())); + + QToolBar *toolBar = addToolBar(tr("Navigation")); + toolBar->addAction(view->pageAction(QWebPage::Back)); + toolBar->addAction(view->pageAction(QWebPage::Forward)); + toolBar->addAction(view->pageAction(QWebPage::Reload)); + toolBar->addAction(view->pageAction(QWebPage::Stop)); + toolBar->addWidget(locationEdit); + + QMenu *effectMenu = menuBar()->addMenu(tr("&Effect")); + effectMenu->addAction("Highlight all links", this, SLOT(highlightAllLinks())); + + QAction *rotateAction = new QAction(this); + rotateAction->setIcon(style()->standardIcon(QStyle::SP_FileDialogDetailedView)); + rotateAction->setCheckable(true); + rotateAction->setText(tr("Turn images upside down")); + connect(rotateAction, SIGNAL(toggled(bool)), this, SLOT(rotateImages(bool))); + effectMenu->addAction(rotateAction); + + QMenu *toolsMenu = menuBar()->addMenu(tr("&Tools")); + toolsMenu->addAction(tr("Remove GIF images"), this, SLOT(removeGifImages())); + toolsMenu->addAction(tr("Remove all inline frames"), this, SLOT(removeInlineFrames())); + toolsMenu->addAction(tr("Remove all object elements"), this, SLOT(removeObjectElements())); + toolsMenu->addAction(tr("Remove all embedded elements"), this, SLOT(removeEmbeddedElements())); + + setCentralWidget(view); +} + +void MainWindow::adjustLocation() +{ + locationEdit->setText(view->url().toString()); +} + +void MainWindow::changeLocation() +{ + QUrl url = QUrl(locationEdit->text()); + locationEdit->setText(url.toString()); + view->load(url); + view->setFocus(); +} + +void MainWindow::adjustTitle() +{ + if (progress <= 0 || progress >= 100) + setWindowTitle(view->title()); + else + setWindowTitle(QString("%1 (%2%)").arg(view->title()).arg(progress)); +} + +void MainWindow::setProgress(int p) +{ + progress = p; + adjustTitle(); +} + +void MainWindow::finishLoading(bool) +{ + progress = 100; + adjustTitle(); + view->page()->mainFrame()->evaluateJavaScript(jQuery); +} + +void MainWindow::highlightAllLinks() +{ + QString code = "$('a').each( function () { $(this).css('background-color', 'yellow') } )"; + view->page()->mainFrame()->evaluateJavaScript(code); +} + +void MainWindow::rotateImages(bool toggle) +{ + QString code = "$('img').each( function () { $(this).css('-webkit-transition', '-webkit-transform 2s') } )"; + view->page()->mainFrame()->evaluateJavaScript(code); + if (toggle) + code = "$('img').each( function () { $(this).css('-webkit-transform', 'rotate(180deg)') } )"; + else + code = "$('img').each( function () { $(this).css('-webkit-transform', 'rotate(0deg)') } )"; + view->page()->mainFrame()->evaluateJavaScript(code); +} + +void MainWindow::removeGifImages() +{ + QString code = "$('[src*=gif]').remove()"; + view->page()->mainFrame()->evaluateJavaScript(code); +} + +void MainWindow::removeInlineFrames() +{ + QString code = "$('iframe').remove()"; + view->page()->mainFrame()->evaluateJavaScript(code); +} + +void MainWindow::removeObjectElements() +{ + QString code = "$('object').remove()"; + view->page()->mainFrame()->evaluateJavaScript(code); +} + +void MainWindow::removeEmbeddedElements() +{ + QString code = "$('embed').remove()"; + view->page()->mainFrame()->evaluateJavaScript(code); +} + diff --git a/examples/webkit/fancybrowser/mainwindow.h b/examples/webkit/fancybrowser/mainwindow.h new file mode 100644 index 0000000..9362ca7 --- /dev/null +++ b/examples/webkit/fancybrowser/mainwindow.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QMainWindow> + +QT_BEGIN_NAMESPACE +class QWebView; +class QLineEdit; +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + +protected slots: + + void adjustLocation(); + void changeLocation(); + void adjustTitle(); + void setProgress(int p); + void finishLoading(bool); + + void highlightAllLinks(); + void rotateImages(bool toggle); + void removeGifImages(); + void removeInlineFrames(); + void removeObjectElements(); + void removeEmbeddedElements(); + +private: + QString jQuery; + QWebView *view; + QLineEdit *locationEdit; + int progress; +}; diff --git a/examples/webkit/googlechat/form.ui b/examples/webkit/googlechat/form.ui new file mode 100644 index 0000000..3b9fb82 --- /dev/null +++ b/examples/webkit/googlechat/form.ui @@ -0,0 +1,214 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Form</class> + <widget class="QWidget" name="Form"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>286</width> + <height>413</height> + </rect> + </property> + <property name="windowTitle"> + <string>Google Talk Client</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QStackedWidget" name="stackedWidget"> + <property name="currentIndex"> + <number>1</number> + </property> + <widget class="QWidget" name="page_3"> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <spacer name="verticalSpacer_4"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>170</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="statusLabel"> + <property name="text"> + <string>TextLabel</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QProgressBar" name="progressBar"> + <property name="value"> + <number>24</number> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_5"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>169</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="page"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>119</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="userNameLabel"> + <property name="text"> + <string>Google username:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="userNameEdit"/> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>17</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="passwordLabel"> + <property name="text"> + <string>Password:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="passwordEdit"> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>118</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="loginButton"> + <property name="text"> + <string>Login</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="page_2"> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="spacing"> + <number>0</number> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QWebView" name="webView"> + <property name="url"> + <url> + <string>about:blank</string> + </url> + </property> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>QWebView</class> + <extends>QWidget</extends> + <header>QtWebKit/QWebView</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/examples/webkit/googlechat/googlechat.cpp b/examples/webkit/googlechat/googlechat.cpp new file mode 100644 index 0000000..9ac2cd2 --- /dev/null +++ b/examples/webkit/googlechat/googlechat.cpp @@ -0,0 +1,163 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtGui> +#include <QtWebKit> + +#include "googlechat.h" + +#define GOOGLECHAT_URL "http://talkgadget.google.com/talkgadget/m" + +GoogleChat::GoogleChat(): QWidget() { + form.setupUi(this); + setFixedSize(320, 480); + + form.userNameEdit->setFocus(); + connect(form.userNameEdit, SIGNAL(textChanged(QString)), SLOT(adjustLoginButton())); + connect(form.userNameEdit, SIGNAL(returnPressed()), SLOT(inputPassword())); + + connect(form.passwordEdit, SIGNAL(textChanged(QString)), SLOT(adjustLoginButton())); + connect(form.passwordEdit, SIGNAL(returnPressed()), SLOT(doLogin())); + + form.loginButton->setEnabled(false); + connect(form.loginButton, SIGNAL(clicked()), SLOT(doLogin())); + + connect(form.webView, SIGNAL(loadFinished(bool)), SLOT(initialPage(bool))); + connect(form.webView, SIGNAL(loadProgress(int)), + form.progressBar, SLOT(setValue(int))); + form.webView->setUrl((QUrl(GOOGLECHAT_URL))); + form.webView->setContextMenuPolicy(Qt::PreventContextMenu); + + showStatus("Wait..."); +} + +void GoogleChat::showStatus(const QString &msg) { + form.statusLabel->setText(msg); + form.stackedWidget->setCurrentIndex(0); +} + +void GoogleChat::showError(const QString &msg) { + form.progressBar->hide(); + showStatus(QString("Error: %1").arg(msg)); +} + +QString GoogleChat::evalJS(const QString &js) { + QWebFrame *frame = form.webView->page()->mainFrame(); + return frame->evaluateJavaScript(js).toString(); +} + +void GoogleChat::adjustLoginButton() { + userName = form.userNameEdit->text(); + password = form.passwordEdit->text(); + bool ok = !userName.isEmpty() && !password.isEmpty(); + form.loginButton->setEnabled(ok); +} + +void GoogleChat::inputPassword() { + if (!form.userNameEdit->text().isEmpty()) + form.passwordEdit->setFocus(); +} + +void GoogleChat::doLogin() { + userName = form.userNameEdit->text(); + password = form.passwordEdit->text(); + bool ok = !userName.isEmpty() && !password.isEmpty(); + if (!ok) + return; + + form.progressBar->setValue(0); + form.progressBar->show(); + connect(form.webView, SIGNAL(loadFinished(bool)), SLOT(loginPage(bool))); + connect(form.webView, SIGNAL(loadProgress(int)), + form.progressBar, SLOT(setValue(int))); + showStatus("Logging in..."); + + QString userEmail = userName + "@gmail.com"; + evalJS(QString("document.getElementById('Email').value = \"%1\";").arg(userEmail)); + evalJS(QString("document.getElementById('Passwd').value = \"%1\";").arg(password)); + evalJS("document.getElementById('gaia_loginform').submit();"); +} + +void GoogleChat::initialPage(bool ok) { + if (ok) { + QString s1 = evalJS("document.getElementById('Email').name"); + QString s2 = evalJS("document.getElementById('Passwd').name"); + QString s3 = evalJS("document.getElementById('gaia_loginform').id"); + if (s1 == "Email" && s2 == "Passwd" && s3 == "gaia_loginform") { + form.stackedWidget->setCurrentIndex(1); + form.webView->disconnect(); + return; + } + } + + showError("SERVICE unavailable."); +} + +void GoogleChat::hideElements() +{ + evalJS("var e = document.getElementsByClassName('footer-footer')[0]; e.parentElement.removeChild(e)"); + evalJS("var e = document.getElementsByClassName('title-bar-bg title-bar')[0]; e.parentElement.removeChild(e)"); + QTimer::singleShot(2000, this, SLOT(hideElements())); +} + +void GoogleChat::loginPage(bool ok) { + QString location = form.webView->url().toString(); + if (!ok) { + if (location.indexOf("CheckCookie")) + return; + showError("Service unavailable"); + } else { + // check for any error message + QString c = evalJS("document.getElementsByClassName('errormsg').length"); + if (c == "0") { + form.stackedWidget->setCurrentIndex(2); + QTimer::singleShot(500, this, SLOT(hideElements())); + return; + } + + QString err = "Unknown login failure."; + if (c == "1") { + err = evalJS("document.getElementsByClassName('errormsg')[0].textContent"); + err = err.simplified(); + } + showError(err); + } +} diff --git a/examples/webkit/googlechat/googlechat.h b/examples/webkit/googlechat/googlechat.h new file mode 100644 index 0000000..c92632c --- /dev/null +++ b/examples/webkit/googlechat/googlechat.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QWidget> + +#include "ui_form.h" + +class GoogleChat: public QWidget +{ + Q_OBJECT + +public: + GoogleChat(); + +protected: + void showStatus(const QString &msg); + void showError(const QString &msg); + QString evalJS(const QString &js); + +private slots: + + void adjustLoginButton(); + void inputPassword(); + void doLogin(); + void initialPage(bool ok); + void loginPage(bool ok); + void hideElements(); + +private: + Ui::Form form; + QString userName; + QString password; +}; diff --git a/examples/webkit/googlechat/googlechat.pro b/examples/webkit/googlechat/googlechat.pro new file mode 100644 index 0000000..14b7085 --- /dev/null +++ b/examples/webkit/googlechat/googlechat.pro @@ -0,0 +1,11 @@ +QT += webkit +HEADERS = googlechat.h +SOURCES = main.cpp \ + googlechat.cpp +FORMS = form.ui + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlechat +sources.files = $$SOURCES $$HEADERS $$FORMS *.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlechat +INSTALLS += target sources diff --git a/examples/webkit/googlechat/main.cpp b/examples/webkit/googlechat/main.cpp new file mode 100644 index 0000000..26feeea --- /dev/null +++ b/examples/webkit/googlechat/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtGui> +#include "googlechat.h" + +int main(int argc, char * argv[]) +{ + QApplication app(argc, argv); + GoogleChat *chat = new GoogleChat; + chat->show(); + return app.exec(); +} diff --git a/examples/webkit/webkit.pro b/examples/webkit/webkit.pro index 3777eec..225816a 100644 --- a/examples/webkit/webkit.pro +++ b/examples/webkit/webkit.pro @@ -1,6 +1,8 @@ TEMPLATE = subdirs SUBDIRS += formextractor \ - previewer + previewer \ + fancybrowser \ + googlechat # install target.path = $$[QT_INSTALL_EXAMPLES]/webkit diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index 3fd768a..3c5b277 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -42,6 +42,7 @@ #include "qeventdispatcher_glib_p.h" #include "qeventdispatcher_unix_p.h" +#include <private/qmutexpool_p.h> #include <private/qthread_p.h> #include "qcoreapplication.h" @@ -224,6 +225,8 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context) : mainContext(context) { if (qgetenv("QT_NO_THREADED_GLIB").isEmpty()) { + static int dummyValue = 0; // only used for its address + QMutexLocker locker(QMutexPool::instance()->get(&dummyValue)); if (!g_thread_supported()) g_thread_init(NULL); } diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp index 92bdf73..600f787 100644 --- a/src/corelib/kernel/qeventloop.cpp +++ b/src/corelib/kernel/qeventloop.cpp @@ -188,8 +188,9 @@ int QEventLoop::exec(ProcessEventsFlags flags) d->threadData->eventLoops.push(this); // remove posted quit events when entering a new event loop - if (qApp->thread() == thread()) - QCoreApplication::removePostedEvents(qApp, QEvent::Quit); + QCoreApplication *app = QCoreApplication::instance(); + if (app && app->thread() == thread()) + QCoreApplication::removePostedEvents(app, QEvent::Quit); #if defined(QT_NO_EXCEPTIONS) while (!d->exit) diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index f602821..8f1c698 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -180,8 +180,7 @@ void *QThreadPrivate::start(void *arg) data->quitNow = false; // ### TODO: allow the user to create a custom event dispatcher - if (QCoreApplication::instance()) - createEventDispatcher(data); + createEventDispatcher(data); emit thr->started(); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index 27193c6..7094e3d 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -292,8 +292,7 @@ unsigned int __stdcall QThreadPrivate::start(void *arg) data->quitNow = false; // ### TODO: allow the user to create a custom event dispatcher - if (QCoreApplication::instance()) - createEventDispatcher(data); + createEventDispatcher(data); #if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC) && !defined(Q_OS_WINCE) // sets the name of the current thread. diff --git a/src/corelib/tools/qbytearraymatcher.cpp b/src/corelib/tools/qbytearraymatcher.cpp index cd4cf90..211d190 100644 --- a/src/corelib/tools/qbytearraymatcher.cpp +++ b/src/corelib/tools/qbytearraymatcher.cpp @@ -120,6 +120,7 @@ QByteArrayMatcher::QByteArrayMatcher() : d(0) { p.p = 0; + p.l = 0; qMemSet(p.q_skiptable, 0, sizeof(p.q_skiptable)); } @@ -170,7 +171,7 @@ QByteArrayMatcher::~QByteArrayMatcher() QByteArrayMatcher &QByteArrayMatcher::operator=(const QByteArrayMatcher &other) { q_pattern = other.q_pattern; - qMemCopy(p.q_skiptable, other.p.q_skiptable, sizeof(p.q_skiptable)); + qMemCopy(&p, &other.p, sizeof(p)); return *this; } diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/tools/qbytearraymatcher.h index d7f2366..633e92c 100644 --- a/src/corelib/tools/qbytearraymatcher.h +++ b/src/corelib/tools/qbytearraymatcher.h @@ -67,7 +67,12 @@ public: int indexIn(const QByteArray &ba, int from = 0) const; int indexIn(const char *str, int len, int from = 0) const; - inline QByteArray pattern() const { return q_pattern; } + inline QByteArray pattern() const + { + if (q_pattern.isNull()) + return QByteArray((const char*)p.p, p.l); + return q_pattern; + } private: QByteArrayMatcherPrivate *d; diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index dcac5ca..c3a419d 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -885,6 +885,38 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, bool de /*! \internal + Returns the bounding rect of this item's children (excluding itself). +*/ +void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect) +{ + for (int i = 0; i < children.size(); ++i) { + QGraphicsItem *child = children.at(i); + QGraphicsItemPrivate *childd = child->d_ptr; + bool hasX = childd->hasTransform; + bool hasPos = !childd->pos.isNull(); + if (hasPos || hasX) { + QTransform matrix; + if (hasX) + matrix = child->transform(); + if (hasPos) { + const QPointF &p = childd->pos; + matrix *= QTransform::fromTranslate(p.x(), p.y()); + } + matrix *= *x; + *rect |= matrix.mapRect(child->boundingRect()); + if (!childd->children.isEmpty()) + childd->childrenBoundingRectHelper(&matrix, rect); + } else { + *rect |= x->mapRect(child->boundingRect()); + if (!childd->children.isEmpty()) + childd->childrenBoundingRectHelper(x, rect); + } + } +} + +/*! + \internal + Empty all cached pixmaps from the pixmap cache. */ void QGraphicsItemCache::purge() @@ -3044,13 +3076,8 @@ void QGraphicsItem::setZValue(qreal z) QRectF QGraphicsItem::childrenBoundingRect() const { QRectF childRect; - foreach (QGraphicsItem *child, children()) { - QPointF childPos = child->pos(); - QTransform matrix = child->transform(); - if (!childPos.isNull()) - matrix *= QTransform::fromTranslate(childPos.x(), childPos.y()); - childRect |= matrix.mapRect(child->boundingRect() | child->childrenBoundingRect()); - } + QTransform x; + d_ptr->childrenBoundingRectHelper(&x, &childRect); return childRect; } diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index b1184fb..4a4a108 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -179,6 +179,7 @@ public: void addChild(QGraphicsItem *child); void removeChild(QGraphicsItem *child); void setParentItemHelper(QGraphicsItem *parent, bool deleting); + void childrenBoundingRectHelper(QTransform *x, QRectF *rect); virtual void resolveFont(uint inheritedMask) { diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index 921be22..c6addc1 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -136,27 +136,25 @@ void QActionPrivate::redoGrab(QShortcutMap &map) void QActionPrivate::redoGrabAlternate(QShortcutMap &map) { Q_Q(QAction); - for (int i = 0; i < alternateShortcutIds.size(); ++i) - if (int id = alternateShortcutIds.at(i)) + foreach (int id, alternateShortcutIds) + if (id) map.removeShortcut(id, q); alternateShortcutIds.clear(); if (alternateShortcuts.isEmpty()) return; - for (int i = 0; i < alternateShortcuts.size(); ++i) { - const QKeySequence &alternate = alternateShortcuts.at(i); + foreach (const QKeySequence& alternate, alternateShortcuts) { if (!alternate.isEmpty()) alternateShortcutIds.append(map.addShortcut(q, alternate, shortcutContext)); else alternateShortcutIds.append(0); } - if (!enabled) { - for (int i = 0; i < alternateShortcutIds.size(); ++i) - map.setShortcutEnabled(false, alternateShortcutIds.at(i), q); + foreach (int id, alternateShortcutIds) + map.setShortcutEnabled(false, id, q); } if (!autorepeat) { - for (int i = 0; i < alternateShortcutIds.size(); ++i) - map.setShortcutAutoRepeat(false, alternateShortcutIds.at(i), q); + foreach (int id, alternateShortcutIds) + map.setShortcutAutoRepeat(false, id, q); } } @@ -165,26 +163,10 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map) Q_Q(QAction); if (shortcutId) map.setShortcutEnabled(enable, shortcutId, q); - for (int i = 0; i < alternateShortcutIds.size(); ++i) - if (int id = alternateShortcutIds.at(i)) + foreach (int id, alternateShortcutIds) + if (id) map.setShortcutEnabled(enable, id, q); } - -void QActionPrivate::removeAll(QShortcutMap &map) -{ - Q_Q(QAction); - if (shortcutId) { - map.removeShortcut(shortcutId, q); - shortcutId = 0; - } - - for (int i = 0; i < alternateShortcutIds.size(); ++i) - if (int id = alternateShortcutIds.at(i)) - map.removeShortcut(id, q); - - alternateShortcutIds.clear(); -} - #endif // QT_NO_SHORTCUT @@ -633,8 +615,8 @@ QAction::~QAction() #ifndef QT_NO_SHORTCUT if (d->shortcutId && qApp) { qApp->d_func()->shortcutMap.removeShortcut(d->shortcutId, this); - for (int i = 0; i < d->alternateShortcutIds.size(); ++i) - qApp->d_func()->shortcutMap.removeShortcut(d->alternateShortcutIds.at(i), this); + foreach (int id, d->alternateShortcutIds) + qApp->d_func()->shortcutMap.removeShortcut(id, this); } #endif } @@ -1067,12 +1049,7 @@ void QAction::setVisible(bool b) d->visible = b; d->enabled = b && !d->forceDisabled && (!d->group || d->group->isEnabled()) ; #ifndef QT_NO_SHORTCUT - if (b) { - d->redoGrab(qApp->d_func()->shortcutMap); - d->redoGrabAlternate(qApp->d_func()->shortcutMap); - } else { - d->removeAll(qApp->d_func()->shortcutMap); - } + d->setShortcutEnabled(d->enabled, qApp->d_func()->shortcutMap); #endif d->sendDataChanged(); } diff --git a/src/gui/kernel/qaction_p.h b/src/gui/kernel/qaction_p.h index a5b3731..0617ef5 100644 --- a/src/gui/kernel/qaction_p.h +++ b/src/gui/kernel/qaction_p.h @@ -111,7 +111,6 @@ public: void redoGrab(QShortcutMap &map); void redoGrabAlternate(QShortcutMap &map); void setShortcutEnabled(bool enable, QShortcutMap &map); - void removeAll(QShortcutMap &map); static QShortcutMap *globalMap; #endif // QT_NO_SHORTCUT diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 4814f1a..d7ca2f4 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -402,7 +402,7 @@ extern bool qt_xdnd_dragging; // gui or non-gui from qapplication.cpp extern bool qt_is_gui_used; -/*! +/*! \internal Try to resolve a \a symbol from \a library with the version specified by \a vernum. @@ -840,7 +840,7 @@ bool QApplicationPrivate::x11_apply_settings() } int kdeSessionVersion = QString::fromLocal8Bit(qgetenv("KDE_SESSION_VERSION")).toInt(); - + if (!appFont) { QFont font(QApplication::font()); QString fontDescription; @@ -1953,11 +1953,17 @@ void qt_init(QApplicationPrivate *priv, int, { QString displayName = QLatin1String(XDisplayName(NULL)); - // apparently MITSHM only works for local displays, so do a quick check here - // to determine whether the display is local or not (not 100 % accurate) + // MITSHM only works for local displays, so do a quick check here + // to determine whether the display is local or not (not 100 % accurate). + // BGR server layouts are not supported either, since it requires the raster + // engine to work on a QImage with BGR layout. bool local = displayName.isEmpty() || displayName.lastIndexOf(QLatin1Char(':')) == 0; - if (local && (qgetenv("QT_X11_NO_MITSHM").toInt() == 0)) - X11->use_mitshm = mitshm_pixmaps; + if (local && (qgetenv("QT_X11_NO_MITSHM").toInt() == 0)) { + Visual *defaultVisual = DefaultVisual(X11->display, DefaultScreen(X11->display)); + X11->use_mitshm = mitshm_pixmaps && (defaultVisual->red_mask == 0xff0000 + && defaultVisual->green_mask == 0xff00 + && defaultVisual->blue_mask == 0xff); + } } #endif // QT_NO_MITSHM diff --git a/src/gui/kernel/qshortcut.cpp b/src/gui/kernel/qshortcut.cpp index f3c93c6..50b6e59 100644 --- a/src/gui/kernel/qshortcut.cpp +++ b/src/gui/kernel/qshortcut.cpp @@ -385,21 +385,19 @@ bool QShortcut::event(QEvent *e) { Q_D(QShortcut); bool handled = false; - if (e->type() == QEvent::Shortcut) { + if (d->sc_enabled && e->type() == QEvent::Shortcut) { QShortcutEvent *se = static_cast<QShortcutEvent *>(e); if (se->shortcutId() == d->sc_id && se->key() == d->sc_sequence){ - if (d->sc_enabled) { #ifndef QT_NO_WHATSTHIS - if (QWhatsThis::inWhatsThisMode()) { - QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis); - handled = true; - } else + if (QWhatsThis::inWhatsThisMode()) { + QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis); + handled = true; + } else #endif - if (se->isAmbiguous()) - emit activatedAmbiguously(); - else - emit activated(); - } + if (se->isAmbiguous()) + emit activatedAmbiguously(); + else + emit activated(); handled = true; } } diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 415d71e..ed9654b 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -359,6 +359,8 @@ bool QShortcutMap::tryShortcutEvent(QObject *o, QKeyEvent *e) else e->ignore(); + int identicalMatches = d->identicals.count(); + switch(result) { case QKeySequence::NoMatch: return stateWasAccepted; @@ -368,8 +370,9 @@ bool QShortcutMap::tryShortcutEvent(QObject *o, QKeyEvent *e) default: break; } - - return true; + // If nextState is QKeySequence::ExactMatch && identicals.count == 0 + // we've only found disabled shortcuts + return identicalMatches > 0 || result == QKeySequence::PartialMatch; } /*! \internal @@ -491,7 +494,9 @@ QKeySequence::SequenceMatch QShortcutMap::find(QKeyEvent *e) // We don't need partials, if we have identicals if (d->identicals.size()) break; - partialFound = true; + // We only care about enabled partials, so we don't consume + // key events when all partials are disabled! + partialFound |= (*it).enabled; } } ++it; diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index e759d0b..39c9284 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -298,7 +298,7 @@ qint64 QLocalSocketPrivate::bytesAvailable() if (PeekNamedPipe(handle, NULL, 0, NULL, &bytes, NULL)) { return bytes; } else { - if (ERROR_BROKEN_PIPE == GetLastError() && !pipeClosed) { + if (!pipeClosed) { pipeClosed = true; QTimer::singleShot(0, q, SLOT(_q_pipeClosed())); } diff --git a/tests/auto/qaction/tst_qaction.cpp b/tests/auto/qaction/tst_qaction.cpp index 1b73f06..1ec21f2 100644 --- a/tests/auto/qaction/tst_qaction.cpp +++ b/tests/auto/qaction/tst_qaction.cpp @@ -46,7 +46,6 @@ #include <qevent.h> #include <qaction.h> #include <qmenu.h> -#include <qlineedit.h> //TESTED_CLASS= //TESTED_FILES= @@ -75,7 +74,6 @@ private slots: void setStandardKeys(); void alternateShortcuts(); void enabledVisibleInteraction(); - void invisibleActionWithComplexShortcut(); void task200823_tooltip(); void task229128TriggeredSignalWithoutActiongroup(); void task229128TriggeredSignalWhenInActiongroup(); @@ -367,36 +365,5 @@ void tst_QAction::task229128TriggeredSignalWhenInActiongroup() QCOMPARE(actionSpy.count(), 1); } -void tst_QAction::invisibleActionWithComplexShortcut() -{ - QAction action(0); - action.setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E, Qt::Key_1)); - - QLineEdit edit; - edit.addAction(&action); - edit.show(); - QTest::qWait(100); - - QSignalSpy spy(&action, SIGNAL(triggered())); - - action.setVisible(true); - QTest::keyPress(&edit, Qt::Key_E, Qt::ControlModifier); - QTest::keyRelease(&edit, Qt::Key_E, Qt::ControlModifier); - QTest::keyPress(&edit, Qt::Key_1, Qt::NoModifier); - QTest::keyRelease(&edit, Qt::Key_1, Qt::NoModifier); - QCOMPARE(spy.count(), 1); - QCOMPARE(edit.text(), QLatin1String("")); - - edit.clear(); - spy.clear(); - action.setVisible(false); - QTest::keyPress(&edit, Qt::Key_E, Qt::ControlModifier); - QTest::keyRelease(&edit, Qt::Key_E, Qt::ControlModifier); - QTest::keyPress(&edit, Qt::Key_1, Qt::NoModifier); - QTest::keyRelease(&edit, Qt::Key_1, Qt::NoModifier); - QCOMPARE(spy.count(), 0); - QCOMPARE(edit.text(), QLatin1String("1")); -} - QTEST_MAIN(tst_QAction) #include "tst_qaction.moc" diff --git a/tests/auto/qbytearraymatcher/qbytearraymatcher.pro b/tests/auto/qbytearraymatcher/qbytearraymatcher.pro new file mode 100644 index 0000000..1618c3e --- /dev/null +++ b/tests/auto/qbytearraymatcher/qbytearraymatcher.pro @@ -0,0 +1,4 @@ +load(qttest_p4) +SOURCES += tst_qbytearraymatcher.cpp + +QT = core diff --git a/tests/auto/qbytearraymatcher/tst_qbytearraymatcher.cpp b/tests/auto/qbytearraymatcher/tst_qbytearraymatcher.cpp new file mode 100644 index 0000000..c3f2fd9 --- /dev/null +++ b/tests/auto/qbytearraymatcher/tst_qbytearraymatcher.cpp @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the test suite 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QtTest/QtTest> + +#include <qbytearraymatcher.h> + +class tst_QByteArrayMatcher : public QObject +{ + Q_OBJECT + +private slots: + void interface(); + void task251958(); +}; + +static QByteArrayMatcher matcher1; + +void tst_QByteArrayMatcher::interface() +{ + const char needle[] = "abc123"; + QByteArray haystack(500, 'a'); + haystack.insert(6, "123"); + haystack.insert(31, "abc"); + haystack.insert(42, "abc123"); + haystack.insert(84, "abc123"); + + matcher1 = QByteArrayMatcher(QByteArray(needle)); + QByteArrayMatcher matcher2; + matcher2.setPattern(QByteArray(needle)); + + QByteArrayMatcher matcher3 = QByteArrayMatcher(QByteArray(needle)); + QByteArrayMatcher matcher4(needle, sizeof(needle - 1)); + QByteArrayMatcher matcher5(matcher2); + QByteArrayMatcher matcher6; + matcher6 = matcher3; + + QCOMPARE(matcher1.indexIn(haystack), 42); + QCOMPARE(matcher2.indexIn(haystack), 42); + QCOMPARE(matcher3.indexIn(haystack), 42); + QCOMPARE(matcher4.indexIn(haystack), 42); + QCOMPARE(matcher5.indexIn(haystack), 42); + QCOMPARE(matcher6.indexIn(haystack), 42); + + QCOMPARE(matcher1.indexIn(haystack.constData(), haystack.length()), 42); + + QCOMPARE(matcher1.indexIn(haystack, 43), 84); + QCOMPARE(matcher1.indexIn(haystack.constData(), haystack.length(), 43), 84); + QCOMPARE(matcher1.indexIn(haystack, 85), -1); + QCOMPARE(matcher1.indexIn(haystack.constData(), haystack.length(), 85), -1); + + QByteArrayMatcher matcher7(QByteArray("123")); + QCOMPARE(matcher7.indexIn(haystack), 6); + + matcher7 = QByteArrayMatcher(QByteArray("abc")); + QCOMPARE(matcher7.indexIn(haystack), 31); + + matcher7.setPattern(matcher4.pattern()); + QCOMPARE(matcher7.indexIn(haystack), 42); +} + + +static QByteArrayMatcher matcher; + +void tst_QByteArrayMatcher::task251958() +{ + const char p_data[] = { 0x0, 0x0, 0x1 }; + QByteArray pattern(p_data, sizeof(p_data)); + + QByteArray haystack(8, '\0'); + haystack[7] = 0x1; + + matcher = QByteArrayMatcher(pattern); + QCOMPARE(matcher.indexIn(haystack, 0), 5); + QCOMPARE(matcher.indexIn(haystack, 1), 5); + QCOMPARE(matcher.indexIn(haystack, 2), 5); + + matcher.setPattern(pattern); + QCOMPARE(matcher.indexIn(haystack, 0), 5); + QCOMPARE(matcher.indexIn(haystack, 1), 5); + QCOMPARE(matcher.indexIn(haystack, 2), 5); +} + +QTEST_APPLESS_MAIN(tst_QByteArrayMatcher) +#include "tst_qbytearraymatcher.moc" diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 57e441b..88c64d3 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -172,6 +172,7 @@ private slots: void boundingRects2(); void sceneBoundingRect(); void childrenBoundingRect(); + void childrenBoundingRectTransformed(); void group(); void setGroup(); void nestedGroups(); @@ -2917,9 +2918,57 @@ void tst_QGraphicsItem::childrenBoundingRect() childChild->setParentItem(child); childChild->setPos(500, 500); child->rotate(90); + + + scene.addPolygon(parent->mapToScene(parent->boundingRect() | parent->childrenBoundingRect()))->setPen(QPen(Qt::red));; + + QGraphicsView view(&scene); + view.show(); + + QTest::qWait(5000); + QCOMPARE(parent->childrenBoundingRect(), QRectF(-500, -100, 600, 800)); } +void tst_QGraphicsItem::childrenBoundingRectTransformed() +{ + QGraphicsScene scene; + + QGraphicsRectItem *rect = scene.addRect(QRectF(0, 0, 100, 100)); + QGraphicsRectItem *rect2 = scene.addRect(QRectF(0, 0, 100, 100)); + QGraphicsRectItem *rect3 = scene.addRect(QRectF(0, 0, 100, 100)); + QGraphicsRectItem *rect4 = scene.addRect(QRectF(0, 0, 100, 100)); + QGraphicsRectItem *rect5 = scene.addRect(QRectF(0, 0, 100, 100)); + rect2->setParentItem(rect); + rect3->setParentItem(rect2); + rect4->setParentItem(rect3); + rect5->setParentItem(rect4); + + rect2->setTransform(QTransform().translate(50, 50).rotate(45)); + rect2->setPos(25, 25); + rect3->setTransform(QTransform().translate(50, 50).rotate(45)); + rect3->setPos(25, 25); + rect4->setTransform(QTransform().translate(50, 50).rotate(45)); + rect4->setPos(25, 25); + rect5->setTransform(QTransform().translate(50, 50).rotate(45)); + rect5->setPos(25, 25); + + QRectF subTreeRect = rect->childrenBoundingRect(); + QCOMPARE(subTreeRect.left(), qreal(-206.0660171779821)); + QCOMPARE(subTreeRect.top(), qreal(75.0)); + QCOMPARE(subTreeRect.width(), qreal(351.7766952966369)); + QCOMPARE(subTreeRect.height(), qreal(251.7766952966369)); + + rect->rotate(45); + rect2->rotate(-45); + rect3->rotate(45); + rect4->rotate(-45); + rect5->rotate(45); + + subTreeRect = rect->childrenBoundingRect(); + QCOMPARE(rect->childrenBoundingRect(), QRectF(-100, 75, 275, 250)); +} + void tst_QGraphicsItem::group() { QGraphicsScene scene; diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro index 8ce7c50..7befdf9 100644 --- a/tests/auto/qlocalsocket/test/test.pro +++ b/tests/auto/qlocalsocket/test/test.pro @@ -1,7 +1,5 @@ load(qttest_p4) -include(../src/src.pri) - DEFINES += QLOCALSERVER_DEBUG DEFINES += QLOCALSOCKET_DEBUG !wince*: { @@ -14,14 +12,16 @@ DEFINES += QLOCALSOCKET_DEBUG QT = core network SOURCES += ../tst_qlocalsocket.cpp -TARGET = ../tst_qlocalsocket -win32 { +TARGET = tst_qlocalsocket +CONFIG(debug_and_release) { CONFIG(debug, debug|release) { - TARGET = ../../debug/tst_qlocalsocket -} else { - TARGET = ../../release/tst_qlocalsocket + DESTDIR = ../debug + } else { + DESTDIR = ../release } +} else { + DESTDIR = .. } wince* { diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index f741b96..deabda6 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -95,6 +95,7 @@ private slots: void longPath(); void waitForDisconnect(); + void waitForDisconnectByServer(); void removeServer(); @@ -112,6 +113,8 @@ tst_QLocalSocket::tst_QLocalSocket() #endif )) qWarning() << "lackey executable doesn't exists!"; + + QLocalServer::removeServer("tst_localsocket"); } tst_QLocalSocket::~tst_QLocalSocket() @@ -783,6 +786,25 @@ void tst_QLocalSocket::waitForDisconnect() QVERIFY(timer.elapsed() < 2000); } +void tst_QLocalSocket::waitForDisconnectByServer() +{ + QString name = "tst_localsocket"; + LocalServer server; + QVERIFY(server.listen(name)); + LocalSocket socket; + QSignalSpy spy(&socket, SIGNAL(disconnected())); + QVERIFY(spy.isValid()); + socket.connectToServer(name); + QVERIFY(socket.waitForConnected(3000)); + QVERIFY(server.waitForNewConnection(3000)); + QLocalSocket *serverSocket = server.nextPendingConnection(); + QVERIFY(serverSocket); + serverSocket->close(); + QVERIFY(serverSocket->state() == QLocalSocket::UnconnectedState); + QVERIFY(socket.waitForDisconnected(3000)); + QCOMPARE(spy.count(), 1); +} + void tst_QLocalSocket::removeServer() { // this is a hostile takeover, but recovering from a crash results in the same diff --git a/tests/auto/qshortcut/tst_qshortcut.cpp b/tests/auto/qshortcut/tst_qshortcut.cpp index cd80204..69ebf74 100644 --- a/tests/auto/qshortcut/tst_qshortcut.cpp +++ b/tests/auto/qshortcut/tst_qshortcut.cpp @@ -987,16 +987,17 @@ void tst_QShortcut::keypressConsumption() cut1->setEnabled(false); cut2->setEnabled(false); - edit->clear(); + // Make sure keypresses is passed on, since all multiple keysequences + // with Ctrl+I are disabled sendKeyEvents(edit, Qt::CTRL + Qt::Key_I, 0); // Send key to edit QCOMPARE( currentResult, NoResult ); QCOMPARE( ambigResult, NoResult ); - QVERIFY(edit->toPlainText().isEmpty()); + QVERIFY(edit->toPlainText().endsWith("<Ctrl+I>")); sendKeyEvents(edit, Qt::Key_A, 'a'); // Send key to edit QCOMPARE( currentResult, NoResult ); QCOMPARE( ambigResult, NoResult ); - QVERIFY(edit->toPlainText().isEmpty()); + QVERIFY(edit->toPlainText().endsWith("<Ctrl+I>a")); clearAllShortcuts(); } diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 1b0e671..633747a 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -277,7 +277,11 @@ CentralWidget *CentralWidget::instance() void CentralWidget::newTab() { HelpViewer* viewer = currentHelpViewer(); +#if !defined(QT_NO_WEBKIT) + if (viewer && viewer->hasLoadFinished()) +#else if (viewer) +#endif setSourceInNewTab(viewer->source()); } diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index f7225fa..5ce6e14 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -269,7 +269,10 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *, } HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) - : QWebView(parent), helpEngine(engine), parentWidget(parent) + : QWebView(parent) + , helpEngine(engine) + , parentWidget(parent) + , loadFinished(false) { setAcceptDrops(false); @@ -295,10 +298,12 @@ HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) connect(page(), SIGNAL(linkHovered(QString, QString, QString)), this, SIGNAL(highlighted(QString))); connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl))); + connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool))); } void HelpViewer::setSource(const QUrl &url) { + loadFinished = false; if (url.toString() == QLatin1String("help")) { load(QUrl(QLatin1String("qthelp://com.trolltech.com." "assistantinternal_1.0.0/assistant/assistant.html"))); @@ -385,6 +390,11 @@ void HelpViewer::mousePressEvent(QMouseEvent *event) QWebView::mousePressEvent(event); } +void HelpViewer::setLoadFinished(bool ok) +{ + loadFinished = ok; +} + #else // !defined(QT_NO_WEBKIT) HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index eea7340..c66b69c 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -92,6 +92,8 @@ public: { return pageAction(QWebPage::Forward)->isEnabled(); } inline bool isBackwardAvailable() const { return pageAction(QWebPage::Back)->isEnabled(); } + inline bool hasLoadFinished() const + { return loadFinished; } public Q_SLOTS: void home(); @@ -111,10 +113,12 @@ protected: private Q_SLOTS: void actionChanged(); + void setLoadFinished(bool ok); private: QHelpEngine *helpEngine; CentralWidget* parentWidget; + bool loadFinished; }; #else diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp index 0beb5ee..a2c0950 100644 --- a/tools/assistant/tools/assistant/indexwindow.cpp +++ b/tools/assistant/tools/assistant/indexwindow.cpp @@ -197,6 +197,8 @@ void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index) url = tc.link(); } else if (links.count() == 1) { url = links.constBegin().value(); + } else { + return; } if (url.path().endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive)) diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index bcafacc..2e39186 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -88,7 +88,6 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) : QMainWindow(parent) , m_toolBarMenu(0) , m_cmdLine(cmdLine) - , m_searchWidget(0) , m_progressWidget(0) , m_qtDocInstaller(0) , m_connectedInitSignals(false) @@ -125,20 +124,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) connect(searchEngine, SIGNAL(indexingStarted()), this, SLOT(indexingStarted())); connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished())); -#ifdef QT_CLUCENE_SUPPORT m_centralWidget->createSearchWidget(searchEngine); -#else - QDockWidget *dock = new QDockWidget(tr("Search"), this); - dock->setObjectName(QLatin1String("SearchWindow")); - m_searchWidget = new SearchWidget(searchEngine, this); - dock->setWidget(m_searchWidget); - addDockWidget(Qt::LeftDockWidgetArea, dock); - - connect(m_searchWidget, SIGNAL(requestShowLink(const QUrl&)), - m_centralWidget, SLOT(setSource(const QUrl&))); - connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(const QUrl&)), - m_centralWidget, SLOT(setSourceInNewTab(const QUrl&))); -#endif QString defWindowTitle = tr("Qt Assistant"); setWindowTitle(defWindowTitle); @@ -228,6 +214,18 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) else if (m_cmdLine->bookmarks() == CmdLineParser::Activate) showBookmarks(); + if (!m_cmdLine->currentFilter().isEmpty()) { + const QString &curFilter = m_cmdLine->currentFilter(); + m_helpEngine->setCurrentFilter(curFilter); + int idx = m_filterCombo->findText(curFilter); + if (idx >= 0) { + bool blocked = m_filterCombo->signalsBlocked(); + m_filterCombo->blockSignals(true); + m_filterCombo->setCurrentIndex(idx); + m_filterCombo->blockSignals(blocked); + } + } + if (usesDefaultCollection()) QTimer::singleShot(0, this, SLOT(lookForNewQtDocumentation())); else @@ -304,6 +302,7 @@ bool MainWindow::initHelpDB() hc.addCustomFilter(tr("Unfiltered"), QStringList()); hc.setCustomValue(unfiltered, 1); } + m_helpEngine->blockSignals(true); m_helpEngine->setCurrentFilter(tr("Unfiltered")); m_helpEngine->blockSignals(false); @@ -318,10 +317,10 @@ bool MainWindow::initHelpDB() void MainWindow::lookForNewQtDocumentation() { m_qtDocInstaller = new QtDocInstaller(m_helpEngine->collectionFile()); - connect(m_qtDocInstaller, SIGNAL(errorMessage(const QString&)), - this, SLOT(displayInstallationError(const QString&))); - connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), - this, SLOT(qtDocumentationInstalled(bool))); + connect(m_qtDocInstaller, SIGNAL(errorMessage(QString)), this, + SLOT(displayInstallationError(QString))); + connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this, + SLOT(qtDocumentationInstalled(bool))); QString versionKey = QString(QLatin1String("qtVersion%1$$$qt")). arg(QLatin1String(QT_VERSION_STR)); @@ -353,8 +352,8 @@ void MainWindow::checkInitState() if (!m_connectedInitSignals) { connect(m_helpEngine->contentModel(), SIGNAL(contentsCreated()), this, SLOT(checkInitState())); - connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), - this, SLOT(checkInitState())); + connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this, + SLOT(checkInitState())); m_connectedInitSignals = true; } } else { @@ -601,8 +600,8 @@ void MainWindow::setupFilterToolbar() connect(m_helpEngine, SIGNAL(setupFinished()), this, SLOT(setupFilterCombo())); - connect(m_filterCombo, SIGNAL(activated(const QString&)), this, - SLOT(filterDocumentation(const QString&))); + connect(m_filterCombo, SIGNAL(activated(QString)), this, + SLOT(filterDocumentation(QString))); setupFilterCombo(); } @@ -626,12 +625,12 @@ void MainWindow::setupAddressToolbar() toolBarMenu()->addAction(addressToolBar->toggleViewAction()); // address lineedit - connect(m_addressLineEdit, SIGNAL(returnPressed()), - this, SLOT(gotoAddress())); - connect(m_centralWidget, SIGNAL(currentViewerChanged()), - this, SLOT(showNewAddress())); - connect(m_centralWidget, SIGNAL(sourceChanged(const QUrl&)), - this, SLOT(showNewAddress(const QUrl&))); + connect(m_addressLineEdit, SIGNAL(returnPressed()), this, + SLOT(gotoAddress())); + connect(m_centralWidget, SIGNAL(currentViewerChanged()), this, + SLOT(showNewAddress())); + connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this, + SLOT(showNewAddress(QUrl))); } void MainWindow::updateAboutMenuText() @@ -712,10 +711,10 @@ void MainWindow::showPreferences() { PreferencesDialog dia(m_helpEngine, this); - connect(&dia, SIGNAL(updateApplicationFont()), - this, SLOT(updateApplicationFont())); - connect(&dia, SIGNAL(updateBrowserFont()), - m_centralWidget, SLOT(updateBrowserFont())); + connect(&dia, SIGNAL(updateApplicationFont()), this, + SLOT(updateApplicationFont())); + connect(&dia, SIGNAL(updateBrowserFont()), m_centralWidget, + SLOT(updateBrowserFont())); dia.showDialog(); } @@ -869,19 +868,12 @@ void MainWindow::activateCurrentCentralWidgetTab() void MainWindow::showSearch() { - if (m_searchWidget) - activateDockWidget(m_searchWidget); - else - m_centralWidget->activateSearch(); + m_centralWidget->activateSearch(); } void MainWindow::hideSearch() { - if (m_searchWidget) { - m_searchWidget->parentWidget()->parentWidget()->hide(); - } else { - m_centralWidget->removeSearchWidget(); - } + m_centralWidget->removeSearchWidget(); } void MainWindow::updateApplicationFont() @@ -950,8 +942,7 @@ QWidget* MainWindow::setupBookmarkWidget() { m_bookmarkManager = new BookmarkManager(m_helpEngine); m_bookmarkWidget = new BookmarkWidget(m_bookmarkManager, this); - connect(m_bookmarkWidget, SIGNAL(addBookmark()), - this, SLOT(addBookmark())); + connect(m_bookmarkWidget, SIGNAL(addBookmark()), this, SLOT(addBookmark())); return m_bookmarkWidget; } diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index c716b1c..1bd8005 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -62,8 +62,6 @@ class BookmarkWidget; class CmdLineParser; class QtDocInstaller; -class SearchWidget; - class MainWindow : public QMainWindow { Q_OBJECT @@ -159,7 +157,6 @@ private: QMenu *m_toolBarMenu; CmdLineParser *m_cmdLine; - SearchWidget *m_searchWidget; QWidget *m_progressWidget; QtDocInstaller *m_qtDocInstaller; diff --git a/tools/assistant/tools/assistant/searchwidget.cpp b/tools/assistant/tools/assistant/searchwidget.cpp index 000c73d..677e18e 100644 --- a/tools/assistant/tools/assistant/searchwidget.cpp +++ b/tools/assistant/tools/assistant/searchwidget.cpp @@ -70,16 +70,18 @@ SearchWidget::SearchWidget(QHelpSearchEngine *engine, QWidget *parent) QHelpSearchQueryWidget *queryWidget = searchEngine->queryWidget(); vLayout->addWidget(queryWidget); - vLayout->addWidget(resultWidget); - + vLayout->addWidget(resultWidget); + setFocusProxy(queryWidget); connect(queryWidget, SIGNAL(search()), this, SLOT(search())); - connect(resultWidget, SIGNAL(requestShowLink(const QUrl&)), - this, SIGNAL(requestShowLink(const QUrl&))); + connect(resultWidget, SIGNAL(requestShowLink(QUrl)), this, + SIGNAL(requestShowLink(QUrl))); - connect(searchEngine, SIGNAL(searchingStarted()), this, SLOT(searchingStarted())); - connect(searchEngine, SIGNAL(searchingFinished(int)), this, SLOT(searchingFinished(int))); + connect(searchEngine, SIGNAL(searchingStarted()), this, + SLOT(searchingStarted())); + connect(searchEngine, SIGNAL(searchingFinished(int)), this, + SLOT(searchingFinished(int))); QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); browser->viewport()->installEventFilter(this); @@ -92,10 +94,6 @@ SearchWidget::~SearchWidget() void SearchWidget::zoomIn() { -#ifndef QT_CLUCENE_SUPPORT - return; -#endif - QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); if (browser && zoomCount != 10) { zoomCount++; @@ -105,10 +103,6 @@ void SearchWidget::zoomIn() void SearchWidget::zoomOut() { -#ifndef QT_CLUCENE_SUPPORT - return; -#endif - QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); if (browser && zoomCount != -5) { zoomCount--; @@ -118,10 +112,6 @@ void SearchWidget::zoomOut() void SearchWidget::resetZoom() { -#ifndef QT_CLUCENE_SUPPORT - return; -#endif - if (zoomCount == 0) return; @@ -152,7 +142,8 @@ void SearchWidget::searchingFinished(int hits) bool SearchWidget::eventFilter(QObject* o, QEvent *e) { QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); - if (browser && o == browser->viewport() && e->type() == QEvent::MouseButtonRelease){ + if (browser && o == browser->viewport() + && e->type() == QEvent::MouseButtonRelease){ QMouseEvent *me = static_cast<QMouseEvent*>(e); QUrl link = resultWidget->linkAt(me->pos()); if (!link.isEmpty() || link.isValid()) { @@ -179,7 +170,6 @@ void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent) QMenu menu; QPoint point = contextMenuEvent->globalPos(); -#ifdef QT_CLUCENE_SUPPORT QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); if (!browser) return; @@ -190,22 +180,25 @@ void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent) QUrl link = browser->anchorAt(point); - QAction *copyAction = menu.addAction(tr("&Copy") + - QString(QLatin1String("\t") + QString(QKeySequence(Qt::CTRL | Qt::Key_C)))); + QKeySequence keySeq(QKeySequence::Copy); + QAction *copyAction = menu.addAction(tr("&Copy") + QLatin1String("\t") + + keySeq.toString(QKeySequence::NativeText)); copyAction->setEnabled(QTextCursor(browser->textCursor()).hasSelection()); QAction *copyAnchorAction = menu.addAction(tr("Copy &Link Location")); copyAnchorAction->setEnabled(!link.isEmpty() && link.isValid()); - QAction *newTabAction = menu.addAction(tr("Open Link in New Tab") + - QString(QLatin1String("\t") + QString(QKeySequence(Qt::CTRL))) + + keySeq = QKeySequence(Qt::CTRL); + QAction *newTabAction = menu.addAction(tr("Open Link in New Tab") + + QLatin1String("\t") + keySeq.toString(QKeySequence::NativeText) + QLatin1String("LMB")); newTabAction->setEnabled(!link.isEmpty() && link.isValid()); menu.addSeparator(); - QAction *selectAllAction = menu.addAction(tr("Select All") + - QString(QLatin1String("\t") + QString(QKeySequence(Qt::CTRL | Qt::Key_A)))); + keySeq = QKeySequence::SelectAll; + QAction *selectAllAction = menu.addAction(tr("Select All") + + QLatin1String("\t") + keySeq.toString(QKeySequence::NativeText)); QAction *usedAction = menu.exec(mapToGlobal(contextMenuEvent->pos())); if (usedAction == copyAction) { @@ -222,25 +215,10 @@ void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent) } else if (usedAction == newTabAction) { emit requestShowLinkInNewTab(link); - } + } else if (usedAction == selectAllAction) { browser->selectAll(); } -#else - point = resultWidget->mapFromGlobal(point); - QUrl link = resultWidget->linkAt(point); - if (link.isEmpty() || !link.isValid()) - return; - - QAction *curTab = menu.addAction(tr("Open Link")); - QAction *newTab = menu.addAction(tr("Open Link in New Tab")); - - QAction *action = menu.exec(mapToGlobal(contextMenuEvent->pos())); - if (curTab == action) - emit requestShowLink(link); - else if (newTab == action) - emit requestShowLinkInNewTab(link); -#endif } QT_END_NAMESPACE diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 3268585..2bba8fb 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -99,10 +99,3 @@ SOURCES += apigenerator.cpp \ webxmlgenerator.cpp \ yyindent.cpp - -win32 { - QT_WINCONFIG = release - CONFIG(debug, debug|release) { - QT_WINCONFIG = debug - } -} diff --git a/tools/qvfb/config.ui b/tools/qvfb/config.ui index 7a45bfe..82a3d38 100644 --- a/tools/qvfb/config.ui +++ b/tools/qvfb/config.ui @@ -1,4 +1,5 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <comment>********************************************************************* ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). @@ -40,181 +41,145 @@ ** *********************************************************************</comment> <class>Config</class> - <widget class="QDialog" name="Config" > - <property name="geometry" > + <widget class="QDialog" name="Config"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>600</width> - <height>650</height> + <height>665</height> </rect> </property> - <property name="windowTitle" > + <property name="windowTitle"> <string>Configure</string> </property> - <property name="sizeGripEnabled" > + <property name="sizeGripEnabled"> <bool>true</bool> </property> - <layout class="QVBoxLayout" > - <property name="spacing" > + <layout class="QVBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>8</number> - </property> - <property name="topMargin" > - <number>8</number> - </property> - <property name="rightMargin" > - <number>8</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>8</number> </property> <item> - <layout class="QHBoxLayout" > - <property name="spacing" > + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QGroupBox" name="ButtonGroup1" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > + <widget class="QGroupBox" name="ButtonGroup1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="title" > + <property name="title"> <string>Size</string> </property> - <layout class="QVBoxLayout" > - <property name="spacing" > + <layout class="QVBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>11</number> - </property> - <property name="topMargin" > - <number>11</number> - </property> - <property name="rightMargin" > - <number>11</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>11</number> </property> <item> - <widget class="QRadioButton" name="size_176_220" > - <property name="text" > - <string>176x220 "SmartPhone"</string> + <widget class="QRadioButton" name="size_176_220"> + <property name="text"> + <string>176x220 "SmartPhone"</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="size_240_320" > - <property name="text" > - <string>240x320 "PDA"</string> + <widget class="QRadioButton" name="size_240_320"> + <property name="text"> + <string>240x320 "PDA"</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="size_320_240" > - <property name="text" > - <string>320x240 "TV" / "QVGA"</string> + <widget class="QRadioButton" name="size_320_240"> + <property name="text"> + <string>320x240 "TV" / "QVGA"</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="size_640_480" > - <property name="text" > - <string>640x480 "VGA"</string> + <widget class="QRadioButton" name="size_640_480"> + <property name="text"> + <string>640x480 "VGA"</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="size_800_600" > - <property name="text" > + <widget class="QRadioButton" name="size_800_600"> + <property name="text"> <string>800x600</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="size_1024_768" > - <property name="text" > + <widget class="QRadioButton" name="size_1024_768"> + <property name="text"> <string>1024x768</string> </property> </widget> </item> <item> - <layout class="QHBoxLayout" > - <property name="spacing" > + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QRadioButton" name="size_custom" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <widget class="QRadioButton" name="size_custom"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text" > + <property name="text"> <string>Custom</string> </property> </widget> </item> <item> - <widget class="QSpinBox" name="size_width" > - <property name="minimum" > + <widget class="QSpinBox" name="size_width"> + <property name="minimum"> <number>1</number> </property> - <property name="maximum" > + <property name="maximum"> <number>1280</number> </property> - <property name="singleStep" > + <property name="singleStep"> <number>16</number> </property> - <property name="value" > + <property name="value"> <number>400</number> </property> </widget> </item> <item> - <widget class="QSpinBox" name="size_height" > - <property name="minimum" > + <widget class="QSpinBox" name="size_height"> + <property name="minimum"> <number>1</number> </property> - <property name="maximum" > + <property name="maximum"> <number>1024</number> </property> - <property name="singleStep" > + <property name="singleStep"> <number>16</number> </property> - <property name="value" > + <property name="value"> <number>300</number> </property> </widget> @@ -225,135 +190,128 @@ </widget> </item> <item> - <widget class="QGroupBox" name="ButtonGroup2" > - <property name="title" > + <widget class="QGroupBox" name="ButtonGroup2"> + <property name="title"> <string>Depth</string> </property> - <layout class="QVBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="leftMargin" > - <number>11</number> - </property> - <property name="topMargin" > - <number>11</number> - </property> - <property name="rightMargin" > - <number>11</number> - </property> - <property name="bottomMargin" > - <number>11</number> - </property> + <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QRadioButton" name="depth_1" > - <property name="text" > + <widget class="QRadioButton" name="depth_1"> + <property name="text"> <string>1 bit monochrome</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="depth_4gray" > - <property name="text" > + <widget class="QRadioButton" name="depth_2gray"> + <property name="text"> + <string>2 bit grayscale</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="depth_4gray"> + <property name="text"> <string>4 bit grayscale</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="depth_8" > - <property name="text" > + <widget class="QRadioButton" name="depth_8"> + <property name="text"> <string>8 bit</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="depth_12" > - <property name="text" > + <widget class="QRadioButton" name="depth_12"> + <property name="text"> <string>12 (16) bit</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="depth_15" > - <property name="text" > + <widget class="QRadioButton" name="depth_15"> + <property name="text"> <string>15 bit</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="depth_16" > - <property name="text" > + <widget class="QRadioButton" name="depth_16"> + <property name="text"> <string>16 bit</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="depth_18" > - <property name="text" > + <widget class="QRadioButton" name="depth_18"> + <property name="text"> <string>18 bit</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="depth_24" > - <property name="text" > + <widget class="QRadioButton" name="depth_24"> + <property name="text"> <string>24 bit</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="depth_32" > - <property name="text" > + <widget class="QRadioButton" name="depth_32"> + <property name="text"> <string>32 bit</string> </property> </widget> </item> <item> - <widget class="QRadioButton" name="depth_32_argb" > - <property name="text" > + <widget class="QRadioButton" name="depth_32_argb"> + <property name="text"> <string>32 bit ARGB</string> </property> </widget> </item> + <item> + <widget class="QCheckBox" name="rgbSwapped"> + <property name="toolTip"> + <string>Swap red and blue channels</string> + </property> + <property name="text"> + <string>BGR format</string> + </property> + </widget> + </item> </layout> </widget> </item> </layout> </item> <item> - <layout class="QHBoxLayout" > - <property name="spacing" > + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> - <widget class="QLabel" name="TextLabel1_3" > - <property name="text" > + <widget class="QLabel" name="TextLabel1_3"> + <property name="text"> <string>Skin</string> </property> </widget> </item> <item> - <widget class="QComboBox" name="skin" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <widget class="QComboBox" name="skin"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <item> - <property name="text" > + <property name="text"> <string>None</string> </property> </item> @@ -362,25 +320,25 @@ </layout> </item> <item> - <widget class="QCheckBox" name="touchScreen" > - <property name="text" > + <widget class="QCheckBox" name="touchScreen"> + <property name="text"> <string>Emulate touch screen (no mouse move)</string> </property> </widget> </item> <item> - <widget class="QCheckBox" name="lcdScreen" > - <property name="text" > + <widget class="QCheckBox" name="lcdScreen"> + <property name="text"> <string>Emulate LCD screen (Only with fixed zoom of 3.0 times magnification)</string> </property> </widget> </item> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="sizeHint" > + <property name="sizeHint" stdset="0"> <size> <width>20</width> <height>10</height> @@ -389,204 +347,192 @@ </spacer> </item> <item> - <widget class="QLabel" name="TextLabel1" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > + <widget class="QLabel" name="TextLabel1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text" > - <string><p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>.</string> + <property name="text"> + <string><p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>.</string> </property> - <property name="wordWrap" > + <property name="wordWrap"> <bool>true</bool> </property> </widget> </item> <item> - <widget class="QGroupBox" name="GroupBox1" > - <property name="title" > + <widget class="QGroupBox" name="GroupBox1"> + <property name="title"> <string>Gamma</string> </property> - <layout class="QGridLayout" > - <property name="leftMargin" > - <number>11</number> - </property> - <property name="topMargin" > - <number>11</number> - </property> - <property name="rightMargin" > - <number>11</number> - </property> - <property name="bottomMargin" > + <layout class="QGridLayout"> + <property name="margin"> <number>11</number> </property> - <property name="horizontalSpacing" > + <property name="spacing"> <number>6</number> </property> - <property name="verticalSpacing" > - <number>6</number> - </property> - <item row="6" column="0" > - <widget class="QLabel" name="TextLabel3" > - <property name="text" > + <item row="6" column="0"> + <widget class="QLabel" name="TextLabel3"> + <property name="text"> <string>Blue</string> </property> </widget> </item> - <item row="6" column="1" > - <widget class="QSlider" name="bslider" > - <property name="palette" > + <item row="6" column="1"> + <widget class="QSlider" name="bslider"> + <property name="palette"> <palette> <active> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>127</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>38</red> <green>38</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>170</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -595,153 +541,153 @@ </colorrole> </active> <inactive> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>127</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>38</red> <green>38</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>170</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -750,153 +696,153 @@ </colorrole> </inactive> <disabled> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>127</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>38</red> <green>38</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>170</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -906,183 +852,183 @@ </disabled> </palette> </property> - <property name="maximum" > + <property name="maximum"> <number>400</number> </property> - <property name="value" > + <property name="value"> <number>100</number> </property> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="6" column="2" > - <widget class="QLabel" name="blabel" > - <property name="text" > + <item row="6" column="2"> + <widget class="QLabel" name="blabel"> + <property name="text"> <string>1.0</string> </property> </widget> </item> - <item row="4" column="0" > - <widget class="QLabel" name="TextLabel2" > - <property name="text" > + <item row="4" column="0"> + <widget class="QLabel" name="TextLabel2"> + <property name="text"> <string>Green</string> </property> </widget> </item> - <item row="4" column="1" > - <widget class="QSlider" name="gslider" > - <property name="palette" > + <item row="4" column="1"> + <widget class="QSlider" name="gslider"> + <property name="palette"> <palette> <active> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>255</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>255</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>38</red> <green>255</green> <blue>38</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>127</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>170</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -1091,153 +1037,153 @@ </colorrole> </active> <inactive> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>255</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>255</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>38</red> <green>255</green> <blue>38</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>127</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>170</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -1246,153 +1192,153 @@ </colorrole> </inactive> <disabled> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>255</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>255</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>38</red> <green>255</green> <blue>38</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>127</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>170</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -1402,190 +1348,190 @@ </disabled> </palette> </property> - <property name="maximum" > + <property name="maximum"> <number>400</number> </property> - <property name="value" > + <property name="value"> <number>100</number> </property> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="4" column="2" > - <widget class="QLabel" name="glabel" > - <property name="text" > + <item row="4" column="2"> + <widget class="QLabel" name="glabel"> + <property name="text"> <string>1.0</string> </property> </widget> </item> - <item row="0" column="0" > - <widget class="QLabel" name="TextLabel7" > - <property name="text" > + <item row="0" column="0"> + <widget class="QLabel" name="TextLabel7"> + <property name="text"> <string>All</string> </property> </widget> </item> - <item row="0" column="2" > - <widget class="QLabel" name="TextLabel8" > - <property name="text" > + <item row="0" column="2"> + <widget class="QLabel" name="TextLabel8"> + <property name="text"> <string>1.0</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QSlider" name="gammaslider" > - <property name="palette" > + <item row="0" column="1"> + <widget class="QSlider" name="gammaslider"> + <property name="palette"> <palette> <active> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>127</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>170</red> <green>170</green> <blue>170</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -1594,153 +1540,153 @@ </colorrole> </active> <inactive> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>127</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>170</red> <green>170</green> <blue>170</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -1749,153 +1695,153 @@ </colorrole> </inactive> <disabled> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>127</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>170</red> <green>170</green> <blue>170</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -1905,183 +1851,183 @@ </disabled> </palette> </property> - <property name="maximum" > + <property name="maximum"> <number>400</number> </property> - <property name="value" > + <property name="value"> <number>100</number> </property> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="2" column="0" > - <widget class="QLabel" name="TextLabel1_2" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="TextLabel1_2"> + <property name="text"> <string>Red</string> </property> </widget> </item> - <item row="2" column="2" > - <widget class="QLabel" name="rlabel" > - <property name="text" > + <item row="2" column="2"> + <widget class="QLabel" name="rlabel"> + <property name="text"> <string>1.0</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="QSlider" name="rslider" > - <property name="palette" > + <item row="2" column="1"> + <widget class="QSlider" name="rslider"> + <property name="palette"> <palette> <active> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>127</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>38</green> <blue>38</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>170</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -2090,153 +2036,153 @@ </colorrole> </active> <inactive> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>127</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>38</green> <blue>38</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>170</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -2245,153 +2191,153 @@ </colorrole> </inactive> <disabled> - <colorrole role="WindowText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="WindowText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Button" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Light" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Light"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>127</green> <blue>127</blue> </color> </brush> </colorrole> - <colorrole role="Midlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>38</green> <blue>38</blue> </color> </brush> </colorrole> - <colorrole role="Dark" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Dark"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>127</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Mid" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Mid"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>170</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Text" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Text"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="BrightText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="BrightText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="ButtonText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="ButtonText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>128</red> <green>128</green> <blue>128</blue> </color> </brush> </colorrole> - <colorrole role="Base" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Window" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>220</red> <green>220</green> <blue>220</blue> </color> </brush> </colorrole> - <colorrole role="Shadow" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Shadow"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="Highlight" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Highlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>10</red> <green>95</green> <blue>137</blue> </color> </brush> </colorrole> - <colorrole role="HighlightedText" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="HighlightedText"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>255</red> <green>255</green> <blue>255</blue> </color> </brush> </colorrole> - <colorrole role="Link" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="Link"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="LinkVisited" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="LinkVisited"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>0</red> <green>0</green> <blue>0</blue> </color> </brush> </colorrole> - <colorrole role="AlternateBase" > - <brush brushstyle="SolidPattern" > - <color alpha="255" > + <colorrole role="AlternateBase"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> <red>232</red> <green>232</green> <blue>232</blue> @@ -2401,53 +2347,44 @@ </disabled> </palette> </property> - <property name="maximum" > + <property name="maximum"> <number>400</number> </property> - <property name="value" > + <property name="value"> <number>100</number> </property> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="8" column="0" colspan="3" > - <widget class="QPushButton" name="PushButton3" > - <property name="text" > + <item row="8" column="0" colspan="3"> + <widget class="QPushButton" name="PushButton3"> + <property name="text"> <string>Set all to 1.0</string> </property> </widget> </item> - <item rowspan="9" row="0" column="3" > - <widget class="GammaView" native="1" name="MyCustomWidget1" /> + <item row="0" column="3" rowspan="9"> + <widget class="GammaView" name="MyCustomWidget1" native="true"/> </item> </layout> </widget> </item> <item> - <layout class="QHBoxLayout" > - <property name="spacing" > + <layout class="QHBoxLayout"> + <property name="spacing"> <number>6</number> </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > + <property name="margin"> <number>0</number> </property> <item> <spacer> - <property name="orientation" > + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeHint" > + <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>20</height> @@ -2456,24 +2393,24 @@ </spacer> </item> <item> - <widget class="QPushButton" name="buttonOk" > - <property name="text" > + <widget class="QPushButton" name="buttonOk"> + <property name="text"> <string>&OK</string> </property> - <property name="autoDefault" > + <property name="autoDefault"> <bool>true</bool> </property> - <property name="default" > + <property name="default"> <bool>true</bool> </property> </widget> </item> <item> - <widget class="QPushButton" name="buttonCancel" > - <property name="text" > + <widget class="QPushButton" name="buttonCancel"> + <property name="text"> <string>&Cancel</string> </property> - <property name="autoDefault" > + <property name="autoDefault"> <bool>true</bool> </property> </widget> @@ -2482,7 +2419,7 @@ </item> </layout> </widget> - <layoutdefault spacing="6" margin="11" /> + <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> <class>GammaView</class> @@ -2498,11 +2435,11 @@ <receiver>size_custom</receiver> <slot>click()</slot> <hints> - <hint type="sourcelabel" > + <hint type="sourcelabel"> <x>152</x> <y>193</y> </hint> - <hint type="destinationlabel" > + <hint type="destinationlabel"> <x>94</x> <y>199</y> </hint> @@ -2514,11 +2451,11 @@ <receiver>size_custom</receiver> <slot>click()</slot> <hints> - <hint type="sourcelabel" > + <hint type="sourcelabel"> <x>259</x> <y>196</y> </hint> - <hint type="destinationlabel" > + <hint type="destinationlabel"> <x>64</x> <y>188</y> </hint> diff --git a/tools/qvfb/qvfb.cpp b/tools/qvfb/qvfb.cpp index 62149a1..8de638f 100644 --- a/tools/qvfb/qvfb.cpp +++ b/tools/qvfb/qvfb.cpp @@ -635,6 +635,7 @@ void QVFb::configure() config->touchScreen->setChecked(view->touchScreenEmulation()); config->lcdScreen->setChecked(view->lcdScreenEmulation()); chooseDepth(view->displayDepth(), view->displayFormat()); + config->rgbSwapped->setChecked(view->rgbSwapped()); connect(config->skin, SIGNAL(activated(int)), this, SLOT(skinConfigChosen(int))); if ( view->gammaRed() == view->gammaGreen() && view->gammaGreen() == view->gammaBlue() ) { config->gammaslider->setValue(int(view->gammaRed()*400)); @@ -678,6 +679,8 @@ void QVFb::configure() int d; if ( config->depth_1->isChecked() ) d=1; + else if ( config->depth_2gray->isChecked() ) + d=2; else if ( config->depth_4gray->isChecked() ) d=4; else if ( config->depth_8->isChecked() ) @@ -708,6 +711,7 @@ void QVFb::configure() } view->setViewFormat(displayFormat); view->setTouchscreenEmulation( config->touchScreen->isChecked() ); + view->setRgbSwapped(config->rgbSwapped->isChecked()); bool lcdEmulation = config->lcdScreen->isChecked(); view->setLcdScreenEmulation( lcdEmulation ); if ( lcdEmulation ) @@ -741,6 +745,7 @@ void QVFb::chooseSize(const QSize& sz) void QVFb::chooseDepth(int depth, QVFbView::PixelFormat displayFormat) { config->depth_1->setChecked(depth==1); + config->depth_2gray->setChecked(depth==2); config->depth_4gray->setChecked(depth==4); config->depth_8->setChecked(depth==8); config->depth_12->setChecked(depth==12); diff --git a/tools/qvfb/qvfbview.cpp b/tools/qvfb/qvfbview.cpp index 53a5360..e7c99ed 100644 --- a/tools/qvfb/qvfbview.cpp +++ b/tools/qvfb/qvfbview.cpp @@ -89,7 +89,7 @@ QVFbAbstractView::~QVFbAbstractView() QVFbView::QVFbView(int id, int w, int h, int d, Rotation r, QWidget *parent) : QVFbAbstractView(parent), - viewdepth(d), viewFormat(DefaultFormat), rsh(0), gsh(0), bsh(0), rmax(15), gmax(15), bmax(15), + viewdepth(d), viewFormat(DefaultFormat), rgb_swapped(0), rsh(0), gsh(0), bsh(0), rmax(15), gmax(15), bmax(15), contentsWidth(w), contentsHeight(h), gred(1.0), ggreen(1.0), gblue(1.0), gammatable(0), refreshRate(30), animation(0), hzm(0.0), vzm(0.0), mView(0), @@ -457,6 +457,67 @@ QImage QVFbView::getBuffer(const QRect &r, int &leading) const } break; } + + case 2: { + if (requiredSize > buffer.size()) + buffer.resize(requiredSize); + + // XXX: hw: replace by drawhelper functionality + + const int pixelsPerByte = 4; + quint8 *src = reinterpret_cast<quint8*>(mView->data()) + + r.y() * mView->linestep() + r.x() / pixelsPerByte; + const int align = qMin(r.width(), (4 - (r.x() & 3)) & 3); + const int doAlign = (align > 0 ? 1 : 0); + const int tail = qMin(r.width(), (r.width() - align) & 3); + const int doTail = (tail > 0 ? 1 : 0); + const int width8 = (r.width() - align) / pixelsPerByte; + const int stride = mView->linestep() - (width8 + doAlign); + + uchar *b = reinterpret_cast<uchar*>(buffer.data()); + img = QImage(b, r.width(), r.height(), QImage::Format_RGB32); + for (int y = 0; y < r.height(); ++y) { + quint32 *dest = reinterpret_cast<quint32*>(img.scanLine(y)); + quint8 c; + + if (doAlign) { + switch (align) { + case 3: c = ((*src & 0x30) >> 4) * 0x55; + *dest++ = qRgb(c, c, c); + case 2: c = ((*src & 0x0c) >> 2) * 0x55; + *dest++ = qRgb(c, c, c); + case 1: c = ((*src & 0x03)) * 0x55; + *dest++ = qRgb(c, c, c); + } + ++src; + } + for (int i = 0; i < width8; ++i) { + c = ((*src & 0xc0) >> 6) * 0x55; + *dest++ = qRgb(c, c, c); + c = ((*src & 0x30) >> 4) * 0x55; + *dest++ = qRgb(c, c, c); + c = ((*src & 0x0c) >> 2) * 0x55; + *dest++ = qRgb(c, c, c); + c = ((*src & 0x03)) * 0x55; + *dest++ = qRgb(c, c, c); + + ++src; + } + if (doTail) { + switch (tail) { + case 3: c = ((*src & 0x0c) >> 2) * 0x55; + dest[2] = qRgb(c, c, c); + case 2: c = ((*src & 0x30) >> 4) * 0x55; + dest[1] = qRgb(c, c, c); + case 1: c = ((*src & 0xc0) >> 6) * 0x55; + dest[0] = qRgb(c, c, c); + } + } + src += stride; + } + break; + } + case 4: { if (requiredSize > buffer.size()) buffer.resize(requiredSize); @@ -540,6 +601,9 @@ QImage QVFbView::getBuffer(const QRect &r, int &leading) const break; } + if (rgb_swapped) + img = img.rgbSwapped(); + if ( brightness != 255 ) { if (img.format() == QImage::Format_Indexed8) { QVector<QRgb> c = img.colorTable(); diff --git a/tools/qvfb/qvfbview.h b/tools/qvfb/qvfbview.h index d533613..1d43bdc 100644 --- a/tools/qvfb/qvfbview.h +++ b/tools/qvfb/qvfbview.h @@ -77,6 +77,7 @@ public: virtual int displayHeight() const = 0; virtual int displayDepth() const = 0; virtual PixelFormat displayFormat() const { return DefaultFormat; } + virtual bool rgbSwapped() const { return false; } virtual Rotation displayRotation() const = 0; virtual void setGamma(double gr, double gg, double gb) = 0; @@ -105,6 +106,7 @@ public slots: virtual void skinKeyPressEvent( int code, const QString& text, bool autorep=FALSE ) = 0; virtual void skinKeyReleaseEvent( int code, const QString& text, bool autorep=FALSE ) = 0; virtual void setViewFormat(PixelFormat) {} + virtual void setRgbSwapped( bool ) {}; virtual void embedDisplay(WId) {} }; @@ -120,6 +122,7 @@ public: int displayHeight() const; int displayDepth() const; PixelFormat displayFormat() const; + bool rgbSwapped() const { return rgb_swapped; } Rotation displayRotation() const; bool touchScreenEmulation() const { return emulateTouchscreen; } @@ -151,6 +154,7 @@ public slots: void skinKeyPressEvent(int code, const QString& text, bool autorep=FALSE); void skinKeyReleaseEvent(int code, const QString& text, bool autorep=FALSE); void setViewFormat(PixelFormat); + void setRgbSwapped(bool b) { rgb_swapped = b; } #ifdef Q_WS_X11 void embedDisplay(WId id); #endif @@ -180,6 +184,7 @@ private: void setDirty(const QRect&); int viewdepth; // "faked" depth PixelFormat viewFormat; + bool rgb_swapped; int rsh; int gsh; int bsh; |