diff options
31 files changed, 80 insertions, 1371 deletions
@@ -238,3 +238,6 @@ src/xml/lib/ *.dep *.map work + +# Generated static plugin import sources +*_plugin_import.cpp diff --git a/.qmake.conf b/.qmake.conf index 42ba8e4..5de255c 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1 +1,2 @@ load(qt_build_config) +CONFIG += qt_example_installs diff --git a/dist/changes-5.0.1 b/dist/changes-5.0.1 new file mode 100644 index 0000000..cc5a670 --- /dev/null +++ b/dist/changes-5.0.1 @@ -0,0 +1,51 @@ +Qt 5.0.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.0.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.0/ + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + +**************************************************************************** +* General * +**************************************************************************** + +General Improvements +-------------------- + +Third party components +---------------------- + +**************************************************************************** +* Library * +**************************************************************************** + + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + + +**************************************************************************** +* Compiler Specific Changes * +**************************************************************************** + + +**************************************************************************** +* Tools * +**************************************************************************** + + +**************************************************************************** +* Plugins * +**************************************************************************** + diff --git a/examples/xmlpatterns/filetree/filetree.pro b/examples/xmlpatterns/filetree/filetree.pro index 43ffcb9..4b7d5f8 100644 --- a/examples/xmlpatterns/filetree/filetree.pro +++ b/examples/xmlpatterns/filetree/filetree.pro @@ -5,11 +5,8 @@ QT += widgets xmlpatterns RESOURCES += queries.qrc INCLUDEPATH += ../shared/ -# install -target.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/filetree -sources.files = $$SOURCES $$HEADERS $$RESOURCES forms queries *.pro *.xq *.html -sources.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/filetree -INSTALLS += target sources +target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/filetree +INSTALLS += target maemo5: CONFIG += qt_example diff --git a/examples/xmlpatterns/recipes/recipes.pro b/examples/xmlpatterns/recipes/recipes.pro index 44c2557..633138b 100644 --- a/examples/xmlpatterns/recipes/recipes.pro +++ b/examples/xmlpatterns/recipes/recipes.pro @@ -6,10 +6,8 @@ RESOURCES = recipes.qrc SOURCES = main.cpp querymainwindow.cpp ../shared/xmlsyntaxhighlighter.cpp INCLUDEPATH += ../shared/ -target.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/recipes -sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.xq *.html forms files -sources.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/recipes -INSTALLS += target sources +target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/recipes +INSTALLS += target maemo5: CONFIG += qt_example diff --git a/examples/xmlpatterns/schema/schema.pro b/examples/xmlpatterns/schema/schema.pro index cc57ef4..dd56375 100644 --- a/examples/xmlpatterns/schema/schema.pro +++ b/examples/xmlpatterns/schema/schema.pro @@ -5,10 +5,8 @@ RESOURCES = schema.qrc SOURCES = main.cpp mainwindow.cpp ../shared/xmlsyntaxhighlighter.cpp INCLUDEPATH += ../shared/ -target.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/schema -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xq *.html files -sources.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/schema -INSTALLS += target sources +target.path = $$[QT_INSTALL_EXAMPLES]/xmlpatterns/schema +INSTALLS += target maemo5: CONFIG += qt_example diff --git a/examples/xmlpatterns/trafficinfo/doc/src/trafficinfo.qdoc b/examples/xmlpatterns/trafficinfo/doc/src/trafficinfo.qdoc deleted file mode 100644 index 8b32563..0000000 --- a/examples/xmlpatterns/trafficinfo/doc/src/trafficinfo.qdoc +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example xmlpatterns/trafficinfo - \title TrafficInfo Example - \ingroup xmlpattern_examples - Shows how XQuery can be used extract information from WML documents provided by a WAP service. - - \section1 Overview - - The WAP service used in this example is \l{Trafikanten}{wap.trafikanten.no} - that is run by the Norwegian governmental agency for public transport in - Oslo. The service provides real time information about the departure of - busses, trams and undergrounds for every station in the city area. - - This example application displays the departure information for a specific - station and provides the feature to filter for a special bus or tram line. - - \image trafficinfo-example.png - - \section1 Retrieving the Data - - Without the knowledge of XQuery, one would use QNetworkAccessManager to - query the WML document from the WAP service and then using the QDom - classes or QXmlStreamReader classes to iterate over the document and - extract the needed information. - However this approach results in a lot of glue code and consumes valuable - developer time, so we are looking for something that can access XML - documents locally or over the network and extract data according to given - filter rules. That's the point where XQuery enters the stage! - - If we want to know when the underground number 6 in direction - \Aring\c{}sjordet is passing the underground station in Nydalen on November - 14th 2008 after 1pm, we use the following URL: - - \c{http://wap.trafikanten.no/F.asp?f=03012130&t=13&m=00&d=14.11.2008&start=1} - - The parameters have the following meanings: - \list - \li \e{f} The unique station ID of Nydalen. - \li \e{t} The hour in 0-23 format. - \li \e{m} The minute in 0-59 format. - \li \e{d} The date in dd.mm.yyyy format. - \li \e{start} Not interesting for our use but should be passed. - \endlist - - As a result we get the following document: - - \quotefile xmlpatterns/trafficinfo/time_example.wml - - So for every departure we have a \c <a> tag that contains the time as a - text element, and the following text element contains the line number - and direction. - - To encapsulate the XQuery code in the example application, we create a - custom \c TimeQuery class. This provides the \c queryInternal() function - that takes a station ID and date/time as input and returns the list of - times and directions: - - \snippet xmlpatterns/trafficinfo/timequery.cpp 1 - - The first lines of this function synthesize the XQuery strings that fetch - the document and extract the data. - For better readability, two separated queries are used here: the first one - fetches the times and the second fetches the line numbers and directions. - - The \c doc() XQuery method opens a local or remote XML document and returns - it, so the \c{/wml/card/p/small/} statement behind it selects all XML nodes - that can be reached by the path, \c wml \rarrow \c card \rarrow \c p \rarrow - \c small. - Now we are on the node that contains all the XML nodes we are interested in. - - In the first query we select all \c a nodes that have a \c href attribute - starting with the string "Rute" and return the text of these nodes. - - In the second query we select all text nodes that are children of the - \c small node which start with a number. - These two queries are passed to the QXmlQuery instance and are evaluated - to string lists. After some sanity checking, we have collected all the - information we need. - - In the section above we have seen that an unique station ID must be passed - as an argument to the URL for retrieving the time, so how to find out which - is the right station ID to use? The WAP service provides a page for that - as well, so the URL - - \c{http://wap.trafikanten.no/FromLink1.asp?fra=Nydalen} - - will return the following document: - - \snippet xmlpatterns/trafficinfo/station_example.wml 0 - - The names of the available stations are listed as separate text elements - and the station ID is part of the \c href attribute of the parent \c a - (anchor) element. In our example, the \c StationQuery class encapsulates - the action of querying the stations that match the given name pattern with - the following code: - - \snippet xmlpatterns/trafficinfo/stationquery.cpp 0 - - Just as in the \c TimeQuery implementation, the first step is to - synthesize the XQuery strings for selecting the station names and the - station IDs. As the station name that we pass in the URL will be input - from the user, we should protect the XQuery from code injection by using - the QXmlQuery::bindVariable() method to do proper quoting of the variable - content for us instead of concatenating the two strings manually. - - So, we define a XQuery \c $station variable that is bound to the user - input. This variable is concatenated inside the XQuery code with the - \c concat method. To extract the station IDs, we select all \c a elements - that have an \c title attribute with the content "Velg", and from these - elements we take the substring of the \c href attribute that starts at the - 18th character. - - The station name can be extracted a bit more easily by just taking the - text elements of the selected \a elements. - - After some sanity checks we have all the station IDs and the corresponding - names available. - - The rest of the code in this example is just for representing the time and - station information to the user, and uses techniques described in the - \l{Widget Examples}. -*/ diff --git a/examples/xmlpatterns/trafficinfo/main.cpp b/examples/xmlpatterns/trafficinfo/main.cpp deleted file mode 100644 index f2a20b3..0000000 --- a/examples/xmlpatterns/trafficinfo/main.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" - -#include <QtWidgets/QApplication> - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - MainWindow window; - window.show(); - - return app.exec(); -} diff --git a/examples/xmlpatterns/trafficinfo/mainwindow.cpp b/examples/xmlpatterns/trafficinfo/mainwindow.cpp deleted file mode 100644 index 3e43925..0000000 --- a/examples/xmlpatterns/trafficinfo/mainwindow.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" -#include "stationdialog.h" - -#include <QtCore/QSettings> -#include <QtCore/QTimer> -#include <QtWidgets/QAction> -#include <QtWidgets/QApplication> -#include <QtGui/QBitmap> -#include <QtGui/QLinearGradient> -#include <QtGui/QMouseEvent> -#include <QtGui/QPainter> - -MainWindow::MainWindow() - : QWidget(0, Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) -{ - QAction *quitAction = new QAction(tr("E&xit"), this); - quitAction->setShortcuts(QKeySequence::Quit); - connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); - - QAction *configAction = new QAction(tr("&Select station..."), this); - configAction->setShortcut(tr("Ctrl+C")); - connect(configAction, SIGNAL(triggered()), this, SLOT(configure())); - - addAction(configAction); - addAction(quitAction); - - setContextMenuPolicy(Qt::ActionsContextMenu); - - setWindowTitle(tr("Traffic Info Oslo")); - - const QSettings settings("Qt Traffic Info", "trafficinfo"); - m_station = StationInformation(settings.value("stationId", "03012130").toString(), - settings.value("stationName", "Nydalen [T-bane] (OSL)").toString()); - m_lines = settings.value("lines", QStringList()).toStringList(); - - QTimer *timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(updateTimeInformation())); - timer->start(1000*60*5); - QMetaObject::invokeMethod(this, SLOT(updateTimeInformation()), Qt::QueuedConnection); -} - -MainWindow::~MainWindow() -{ - QSettings settings("Qt Traffic Info", "trafficinfo"); - settings.setValue("stationId", m_station.id()); - settings.setValue("stationName", m_station.name()); - settings.setValue("lines", m_lines); -} - -QSize MainWindow::sizeHint() const -{ - return QSize(300, 200); -} - -void MainWindow::mouseMoveEvent(QMouseEvent *event) -{ - if (event->buttons() & Qt::LeftButton) { - move(event->globalPos() - m_dragPosition); - event->accept(); - } -} - -void MainWindow::mousePressEvent(QMouseEvent *event) -{ - if (event->button() == Qt::LeftButton) { - m_dragPosition = event->globalPos() - frameGeometry().topLeft(); - event->accept(); - } -} - -void MainWindow::paintEvent(QPaintEvent*) -{ - const QPoint start(width()/2, 0); - const QPoint finalStop(width()/2, height()); - QLinearGradient gradient(start, finalStop); - const QColor qtGreen(102, 176, 54); - gradient.setColorAt(0, qtGreen.dark()); - gradient.setColorAt(0.5, qtGreen); - gradient.setColorAt(1, qtGreen.dark()); - - QPainter p(this); - p.fillRect(0, 0, width(), height(), gradient); - - QFont headerFont("Sans Serif", 12, QFont::Bold); - QFont normalFont("Sans Serif", 9, QFont::Normal); - - // draw it twice for shadow effect - p.setFont(headerFont); - QRect headerRect(1, 1, width(), 25); - p.setPen(Qt::black); - p.drawText(headerRect, Qt::AlignCenter, m_station.name()); - - headerRect.moveTopLeft(QPoint(0, 0)); - p.setPen(Qt::white); - p.drawText(headerRect, Qt::AlignCenter, m_station.name()); - - p.setFont(normalFont); - int pos = 40; - for (int i = 0; i < m_times.count() && i < 9; ++i) { - p.setPen(Qt::black); - p.drawText(51, pos + 1, m_times.at(i).time()); - p.drawText(101, pos + 1, m_times.at(i).direction()); - - p.setPen(Qt::white); - p.drawText(50, pos, m_times.at(i).time()); - p.drawText(100, pos, m_times.at(i).direction()); - - pos += 18; - } -} - -void MainWindow::resizeEvent(QResizeEvent*) -{ - QBitmap maskBitmap(width(), height()); - maskBitmap.clear(); - - QPainter p(&maskBitmap); - p.setBrush(Qt::black); - p.drawRoundRect(0, 0, width(), height(), 20, 30); - p.end(); - - setMask(maskBitmap); -} - -void MainWindow::updateTimeInformation() -{ - m_times = TimeQuery::query(m_station.id(), m_lines, QDateTime::currentDateTime()); - - update(); -} - -void MainWindow::configure() -{ - StationDialog dlg(m_station.name(), m_lines, this); - if (dlg.exec()) { - m_station = dlg.selectedStation(); - m_lines = dlg.lineNumbers(); - updateTimeInformation(); - } -} diff --git a/examples/xmlpatterns/trafficinfo/mainwindow.h b/examples/xmlpatterns/trafficinfo/mainwindow.h deleted file mode 100644 index 4573e5a..0000000 --- a/examples/xmlpatterns/trafficinfo/mainwindow.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include "stationquery.h" -#include "timequery.h" - -#include <QtWidgets/QWidget> - -class MainWindow : public QWidget -{ - Q_OBJECT - - public: - MainWindow(); - ~MainWindow(); - - QSize sizeHint() const; - - protected: - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); - - private Q_SLOTS: - void updateTimeInformation(); - void configure(); - - private: - QPoint m_dragPosition; - TimeInformation::List m_times; - StationInformation m_station; - QStringList m_lines; -}; - -#endif diff --git a/examples/xmlpatterns/trafficinfo/station_example.wml b/examples/xmlpatterns/trafficinfo/station_example.wml deleted file mode 100644 index da7f82f..0000000 --- a/examples/xmlpatterns/trafficinfo/station_example.wml +++ /dev/null @@ -1,31 +0,0 @@ -//! [0] -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> -<wml> -<template> - <do type="prev" name="b" label="Tilbake"><prev/></do> - <do type="options" label="Nytt søk"><go href="velkommen.wml"/></do> -</template> -<card id="Liste" title="Trafikanten"> -<p> -<small> -Velg stoppsted: <br /> - - <a title="Velg" href="DateLink.asp?fra=05280320">Nydalen (Østre Toten) (Ø-T)</a><br /> - - <a title="Velg" href="DateLink.asp?fra=03012126">Nydalen st. (i Store ringvei) (OSL)</a><br /> - - <a title="Velg" href="DateLink.asp?fra=03012131">Nydalen T [buss] (OSL)</a><br /> - - <a title="Velg" href="DateLink.asp?fra=03012130">Nydalen [T-bane] (OSL)</a><br /> - - <a title="Velg" href="DateLink.asp?fra=03012125">Nydalen [tog] (OSL)</a><br /> - -<br/> -<a title="Nytt søk" href="Velkommen.wml">"Nytt søk"</a> -<br/> -</small> -</p> -</card> -</wml> -//! [0] diff --git a/examples/xmlpatterns/trafficinfo/stationdialog.cpp b/examples/xmlpatterns/trafficinfo/stationdialog.cpp deleted file mode 100644 index 6cd267f..0000000 --- a/examples/xmlpatterns/trafficinfo/stationdialog.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "stationdialog.h" -#include "ui_stationdialog.h" - -#include <QtCore/QAbstractListModel> - -class StationModel : public QAbstractListModel -{ - public: - enum Role - { - StationIdRole = Qt::UserRole + 1, - StationNameRole - }; - - StationModel(QObject *parent = 0) - : QAbstractListModel(parent) - { - } - - void setStations(const StationInformation::List &list) - { - m_stations = list; - layoutChanged(); - } - - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const - { - if (!parent.isValid()) - return m_stations.count(); - else - return 0; - } - - virtual int columnCount(const QModelIndex &parent = QModelIndex()) const - { - if (!parent.isValid()) - return 1; - else - return 0; - } - - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const - { - if (!index.isValid()) - return QVariant(); - - if (index.column() > 1 || index.row() >= m_stations.count()) - return QVariant(); - - const StationInformation info = m_stations.at(index.row()); - if (role == Qt::DisplayRole || role == StationNameRole) - return info.name(); - else if (role == StationIdRole) - return info.id(); - - return QVariant(); - } - - private: - StationInformation::List m_stations; -}; - -StationDialog::StationDialog(const QString &name, const QStringList &lineNumbers, QWidget *parent) - : QDialog(parent) -{ - m_ui.setupUi(this); - - connect(m_ui.m_searchButton, SIGNAL(clicked()), this, SLOT(searchStations())); - - m_ui.m_searchButton->setDefault(true); - m_ui.m_input->setText(name); - - m_model = new StationModel(this); - m_ui.m_view->setModel(m_model); - - for (int i = 0; i < lineNumbers.count(); ++i) { - if (i == 0) - m_ui.m_line1->setText(lineNumbers.at(i)); - else if (i == 1) - m_ui.m_line2->setText(lineNumbers.at(i)); - else if (i == 2) - m_ui.m_line3->setText(lineNumbers.at(i)); - else if (i == 3) - m_ui.m_line4->setText(lineNumbers.at(i)); - } - - QMetaObject::invokeMethod(this, SLOT(searchStations()), Qt::QueuedConnection); -} - -StationInformation StationDialog::selectedStation() const -{ - const QModelIndex index = m_ui.m_view->currentIndex(); - - if (!index.isValid()) - return StationInformation(); - - return StationInformation(index.data(StationModel::StationIdRole).toString(), - index.data(StationModel::StationNameRole).toString()); -} - -QStringList StationDialog::lineNumbers() const -{ - QStringList lines; - - if (!m_ui.m_line1->text().simplified().isEmpty()) - lines.append(m_ui.m_line1->text().simplified()); - if (!m_ui.m_line2->text().simplified().isEmpty()) - lines.append(m_ui.m_line2->text().simplified()); - if (!m_ui.m_line3->text().simplified().isEmpty()) - lines.append(m_ui.m_line3->text().simplified()); - if (!m_ui.m_line4->text().simplified().isEmpty()) - lines.append(m_ui.m_line4->text().simplified()); - - return lines; -} - -void StationDialog::searchStations() -{ - m_model->setStations(StationQuery::query(m_ui.m_input->text())); - m_ui.m_view->keyboardSearch(m_ui.m_input->text()); -} diff --git a/examples/xmlpatterns/trafficinfo/stationdialog.h b/examples/xmlpatterns/trafficinfo/stationdialog.h deleted file mode 100644 index c720292..0000000 --- a/examples/xmlpatterns/trafficinfo/stationdialog.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef STATIONDIALOG_H -#define STATIONDIALOG_H - -#include <QtWidgets/QDialog> - -#include "stationquery.h" -#include "ui_stationdialog.h" - -class StationModel; - -class StationDialog : public QDialog -{ - Q_OBJECT - - public: - StationDialog(const QString &id, const QStringList &lineNumbers, QWidget *parent); - - StationInformation selectedStation() const; - QStringList lineNumbers() const; - - private Q_SLOTS: - void searchStations(); - - private: - Ui_StationDialog m_ui; - StationModel *m_model; -}; - -#endif diff --git a/examples/xmlpatterns/trafficinfo/stationdialog.ui b/examples/xmlpatterns/trafficinfo/stationdialog.ui deleted file mode 100644 index 254dedb..0000000 --- a/examples/xmlpatterns/trafficinfo/stationdialog.ui +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>StationDialog</class> - <widget class="QDialog" name="StationDialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>462</width> - <height>391</height> - </rect> - </property> - <property name="windowTitle"> - <string>Select Station</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QLineEdit" name="m_input"/> - </item> - <item row="0" column="1"> - <widget class="QPushButton" name="m_searchButton"> - <property name="text"> - <string>Search</string> - </property> - </widget> - </item> - <item row="1" column="0" colspan="2"> - <widget class="QListView" name="m_view"/> - </item> - <item row="2" column="0" colspan="2"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Lines:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="m_line1"/> - </item> - <item> - <widget class="QLineEdit" name="m_line2"/> - </item> - <item> - <widget class="QLineEdit" name="m_line3"/> - </item> - <item> - <widget class="QLineEdit" name="m_line4"/> - </item> - </layout> - </item> - <item row="3" column="0" colspan="2"> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <resources/> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>accepted()</signal> - <receiver>StationDialog</receiver> - <slot>accept()</slot> - <hints> - <hint type="sourcelabel"> - <x>228</x> - <y>373</y> - </hint> - <hint type="destinationlabel"> - <x>157</x> - <y>274</y> - </hint> - </hints> - </connection> - <connection> - <sender>buttonBox</sender> - <signal>rejected()</signal> - <receiver>StationDialog</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel"> - <x>296</x> - <y>372</y> - </hint> - <hint type="destinationlabel"> - <x>286</x> - <y>274</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/examples/xmlpatterns/trafficinfo/stationquery.cpp b/examples/xmlpatterns/trafficinfo/stationquery.cpp deleted file mode 100644 index e445f15..0000000 --- a/examples/xmlpatterns/trafficinfo/stationquery.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "stationquery.h" - -#include <QtCore/QStringList> -#include <QtXmlPatterns/QXmlQuery> - -StationInformation::StationInformation() -{ -} - -StationInformation::StationInformation(const QString &id, const QString &name) - : m_id(id), m_name(name) -{ -} - -QString StationInformation::id() const -{ - return m_id; -} - -QString StationInformation::name() const -{ - return m_name; -} - -//! [0] -StationInformation::List StationQuery::query(const QString &name) -{ - const QString stationIdQueryUrl = QString("doc(concat('http://wap.trafikanten.no/FromLink1.asp?fra=', $station))/wml/card/p/small/a[@title='Velg']/substring(@href,18)"); - const QString stationNameQueryUrl = QString("doc(concat('http://wap.trafikanten.no/FromLink1.asp?fra=', $station))/wml/card/p/small/a[@title='Velg']/string()"); - - QStringList stationIds; - QStringList stationNames; - - QXmlQuery query; - - query.bindVariable("station", QVariant(QString::fromLatin1(QUrl::toPercentEncoding(name)))); - query.setQuery(stationIdQueryUrl); - query.evaluateTo(&stationIds); - - query.bindVariable("station", QVariant(QString::fromLatin1(QUrl::toPercentEncoding(name)))); - query.setQuery(stationNameQueryUrl); - query.evaluateTo(&stationNames); - - if (stationIds.count() != stationNames.count()) // something went wrong... - return StationInformation::List(); - - StationInformation::List information; - for (int i = 0; i < stationIds.count(); ++i) - information.append(StationInformation(stationIds.at(i), stationNames.at(i))); - - return information; -} -//! [0] diff --git a/examples/xmlpatterns/trafficinfo/stationquery.h b/examples/xmlpatterns/trafficinfo/stationquery.h deleted file mode 100644 index bda7f11..0000000 --- a/examples/xmlpatterns/trafficinfo/stationquery.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef STATIONQUERY_H -#define STATIONQUERY_H - -#include <QtCore/QList> -#include <QtCore/QString> - -//! [0] -class StationInformation -{ - public: - typedef QList<StationInformation> List; - - StationInformation(); - StationInformation(const QString &id, const QString &name); - - QString id() const; - QString name() const; - - private: - QString m_id; - QString m_name; -}; -//! [0] - -//! [1] -class StationQuery -{ - public: - static StationInformation::List query(const QString &name); -}; -//! [1] - -#endif diff --git a/examples/xmlpatterns/trafficinfo/time_example.wml b/examples/xmlpatterns/trafficinfo/time_example.wml deleted file mode 100644 index 75e3408..0000000 --- a/examples/xmlpatterns/trafficinfo/time_example.wml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> -<wml> -<template> - <do type="prev" name="b" label="Tilbake"><prev/></do> - <do type="options" name="n" label="Nytt søk"><go href="velkommen.wml"/></do> -</template> -<card id="Liste" title="Trafikanten"> -<p> -<small> -Fra Nydalen [T-bane]:<br /> - - <a href="Rute.asp?d=3011030&t=21832&l=4&Start=1">13.00</a> - 4 Bergkrystallen [T-bane]<br /> - - <a href="Rute.asp?d=3012585&t=22543&l=6&Start=1">13.05</a> - 6 Åsjordet<br /> - - <a href="Rute.asp?d=3011730&t=22264&l=5&Start=1">13.09</a> - 5 Vestli [T-bane]<br /> - - <a href="Rute.asp?d=3012120&t=22080&l=5&Start=1">13.13</a> - 5 Storo [T-bane]<br /> - - <a href="Rute.asp?d=3011030&t=21831&l=4&Start=1">13.15</a> - 4 Bergkrystallen [T-bane]<br /> - - <a href="Rute.asp?d=3012585&t=22542&l=6&Start=1">13.20</a> - 6 Åsjordet<br /> - - <a href="Rute.asp?d=3011730&t=22263&l=5&Start=1">13.24</a> - 5 Vestli [T-bane]<br /> - - <a href="Rute.asp?d=3012120&t=22079&l=5&Start=1">13.28</a> - 5 Storo [T-bane]<br /> - - <a href="Rute.asp?d=3011030&t=21830&l=4&Start=1">13.30</a> - 4 Bergkrystallen [T-bane]<br /> - - <a href="Rute.asp?d=3012585&t=22541&l=6&Start=1">13.35</a> - 6 Åsjordet<br /> - - <br /> - <a title="Neste 10" href="F.asp?f=03012130&t=13&m=35&d=14.11.2008&Start=11">Neste 10 avganger</a> - -<br/> -<a href="F.asp?f=03012130&t=14&d=14.11.2008&Start=1">Neste timeintervall</a> -<br/> -<a href="F.asp?f=03012130&t=12&d=14.11.2008&Start=1">Forrige timeintervall</a> -<br/> -<a href="Velkommen.wml">"Nytt søk"</a> -<br/> -</small> -</p> -</card> -</wml> diff --git a/examples/xmlpatterns/trafficinfo/timequery.cpp b/examples/xmlpatterns/trafficinfo/timequery.cpp deleted file mode 100644 index 547c3b6..0000000 --- a/examples/xmlpatterns/trafficinfo/timequery.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "timequery.h" - -#include <QtCore/QStringList> -#include <QtXmlPatterns/QXmlQuery> - -TimeInformation::TimeInformation(const QString &time, const QString &direction) - : m_time(time), m_direction(direction) -{ -} - -QString TimeInformation::time() const -{ - return m_time; -} - -QString TimeInformation::direction() const -{ - return m_direction; -} - -TimeInformation::List TimeQuery::query(const QString &stationId, const QStringList &lineNumbers, const QDateTime &dateTime) -{ - const TimeInformation::List information = queryInternal(stationId, dateTime); - - TimeInformation::List filteredInformation; - - if (!lineNumbers.isEmpty()) { - for (int i = 0; i < information.count(); ++i) { - const TimeInformation info = information.at(i); - for (int j = 0; j < lineNumbers.count(); ++j) { - if (info.direction().startsWith(QString("%1 ").arg(lineNumbers.at(j)))) - filteredInformation.append(info); - } - } - } else { - filteredInformation = information; - } - - return filteredInformation; -} - -//! [1] -TimeInformation::List TimeQuery::queryInternal(const QString &stationId, const QDateTime &dateTime) -{ - const QString timesQueryUrl = QString("doc('http://wap.trafikanten.no/F.asp?f=%1&t=%2&m=%3&d=%4&start=1')/wml/card/p/small/a[fn:starts-with(@href, 'Rute')]/string()") - .arg(stationId) - .arg(dateTime.time().hour()) - .arg(dateTime.time().minute()) - .arg(dateTime.toString("dd.MM.yyyy")); - const QString directionsQueryUrl = QString("doc('http://wap.trafikanten.no/F.asp?f=%1&t=%2&m=%3&d=%4&start=1')/wml/card/p/small/text()[matches(., '[0-9].*')]/string()") - .arg(stationId) - .arg(dateTime.time().hour()) - .arg(dateTime.time().minute()) - .arg(dateTime.toString("dd.MM.yyyy")); - - QStringList times; - QStringList directions; - - QXmlQuery query; - query.setQuery(timesQueryUrl); - query.evaluateTo(×); - - query.setQuery(directionsQueryUrl); - query.evaluateTo(&directions); - - if (times.count() != directions.count()) // something went wrong... - return TimeInformation::List(); - - TimeInformation::List information; - for (int i = 0; i < times.count(); ++i) - information.append(TimeInformation(times.at(i).simplified(), directions.at(i).simplified())); - - return information; -} -//! [1] diff --git a/examples/xmlpatterns/trafficinfo/timequery.h b/examples/xmlpatterns/trafficinfo/timequery.h deleted file mode 100644 index a792dd8..0000000 --- a/examples/xmlpatterns/trafficinfo/timequery.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TIMEQUERY_H -#define TIMEQUERY_H - -#include <QtCore/QDateTime> -#include <QtCore/QList> -#include <QtCore/QStringList> - -class TimeInformation -{ - public: - typedef QList<TimeInformation> List; - - TimeInformation(const QString &time, const QString &direction); - - QString time() const; - QString direction() const; - - private: - QString m_time; - QString m_direction; -}; - - -class TimeQuery -{ - public: - static TimeInformation::List query(const QString &stationId, const QStringList &lineNumbers, const QDateTime &dateTime); - - private: - static TimeInformation::List queryInternal(const QString &stationId, const QDateTime &dateTime); -}; - -#endif diff --git a/examples/xmlpatterns/trafficinfo/trafficinfo.desktop b/examples/xmlpatterns/trafficinfo/trafficinfo.desktop deleted file mode 100644 index 246d34b..0000000 --- a/examples/xmlpatterns/trafficinfo/trafficinfo.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=TrafficInfo -Exec=/opt/usr/bin/trafficinfo -Icon=trafficinfo -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/xmlpatterns/trafficinfo/trafficinfo.pro b/examples/xmlpatterns/trafficinfo/trafficinfo.pro deleted file mode 100644 index dcde8df..0000000 --- a/examples/xmlpatterns/trafficinfo/trafficinfo.pro +++ /dev/null @@ -1,14 +0,0 @@ -QT += widgets xmlpatterns -HEADERS = mainwindow.h stationdialog.h stationquery.h timequery.h -SOURCES = main.cpp mainwindow.cpp stationdialog.cpp stationquery.cpp timequery.cpp -FORMS = stationdialog.ui - -target.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/trafficinfo -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/trafficinfo -INSTALLS += target sources - -maemo5: CONFIG += qt_example - -maemo5: warning(This example might not fully work on Maemo platform) -simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/xmlpatterns/xmlpatterns.pro b/examples/xmlpatterns/xmlpatterns.pro index ea9c719..cce970f 100644 --- a/examples/xmlpatterns/xmlpatterns.pro +++ b/examples/xmlpatterns/xmlpatterns.pro @@ -1,9 +1,7 @@ TEMPLATE = subdirs SUBDIRS += xquery -!contains(QT_CONFIG, no-widgets): SUBDIRS += filetree trafficinfo schema recipes +!contains(QT_CONFIG, no-widgets): SUBDIRS += filetree schema recipes + +EXAMPLE_FILES = \ + shared -# install -target.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns -sources.files = xmlpatterns.pro shared -sources.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns -INSTALLS += target sources diff --git a/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro b/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro deleted file mode 100644 index c3128b0..0000000 --- a/examples/xmlpatterns/xquery/globalVariables/globalVariables.pro +++ /dev/null @@ -1,11 +0,0 @@ -# We don't have any C++ files to build, so in order to trick qmake which -# doesn't understand that, we use the subdirs template, but without specifying -# any subdirs. -TEMPLATE = subdirs - -target.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/xquery/globalVariables -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.cpp *.pro *.xq *.html globals.gccxml -sources.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/xquery/globalVariables -INSTALLS += target sources - -maemo5: CONFIG += qt_example diff --git a/examples/xmlpatterns/xquery/xquery.pro b/examples/xmlpatterns/xquery/xquery.pro index 0084f1d..ee1c9c8 100644 --- a/examples/xmlpatterns/xquery/xquery.pro +++ b/examples/xmlpatterns/xquery/xquery.pro @@ -1,10 +1,4 @@ -TEMPLATE = subdirs -SUBDIRS += globalVariables - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/xquery -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS xquery.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/qtxmlpatterns/xmlpatterns/xquery -INSTALLS += target sources +TEMPLATE = aux +EXAMPLE_FILES = globalVariables maemo5: CONFIG += qt_example diff --git a/src/xmlpatterns/api/qcoloroutput_p.h b/src/xmlpatterns/api/qcoloroutput_p.h index bd2d5a5..bdcdc8c 100644 --- a/src/xmlpatterns/api/qcoloroutput_p.h +++ b/src/xmlpatterns/api/qcoloroutput_p.h @@ -70,8 +70,9 @@ namespace QPatternist ForegroundShift = 10, BackgroundShift = 20, SpecialShift = 20, - ForegroundMask = 0xffc00, - BackgroundMask = 0xfff00000 +// ### FIXME: this looks very suspicious. Make ForegroundShift = 0x10 etc? + ForegroundMask = 0x1f << ForegroundShift, + BackgroundMask = 0x7 << BackgroundShift }; public: diff --git a/src/xmlpatterns/common.pri b/src/xmlpatterns/common.pri index 27253d8..5c7b8b7 100644 --- a/src/xmlpatterns/common.pri +++ b/src/xmlpatterns/common.pri @@ -14,5 +14,3 @@ INCLUDEPATH += $$PWD/acceltree \ $$PWD/type \ $$PWD/utils -DEPENDPATH += $$INCLUDEPATH - diff --git a/src/xmlpatterns/doc/qtxmlpatterns.qdocconf b/src/xmlpatterns/doc/qtxmlpatterns.qdocconf index 85453f7..22e9af1 100644 --- a/src/xmlpatterns/doc/qtxmlpatterns.qdocconf +++ b/src/xmlpatterns/doc/qtxmlpatterns.qdocconf @@ -16,7 +16,7 @@ headerdirs += .. imagedirs += images sourcedirs += .. -depends += qtcore qtxml qtwidgets +depends += qtcore qtxml qtwidgets qtdesigner # The following parameters are for creating a qhp file, the qhelpgenerator # program can convert the qhp file into a qch file which can be opened in @@ -36,11 +36,12 @@ qhp.qtxmlpatterns.namespace = org.qt-project.qtxmlpatterns.500 # Title for the package, will be the main title for the package in # Assistant/Creator. -qhp.qtxmlpatterns.indexTitle = Qt XML Patterns Documentation +qhp.qtxmlpatterns.indexTitle = Qt XML Patterns # Only update the name of the project for the next variables. qhp.qtxmlpatterns.virtualFolder = qtxmlpatterns qhp.qtxmlpatterns.subprojects = classes -qhp.qtxmlpatterns.subprojects.classes.title = Qt XML Patterns C++ Classes +qhp.qtxmlpatterns.subprojects.classes.title = C++ Classes +qhp.qtxmlpatterns.subprojects.classes.indexTitle = Qt XML Patterns C++ Classes qhp.qtxmlpatterns.subprojects.classes.selectors = class fake:headerfile qhp.qtxmlpatterns.subprojects.classes.sortPages = true diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro index a4a3a95..29bd8ee 100644 --- a/tests/auto/checkxmlfiles/checkxmlfiles.pro +++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro @@ -8,12 +8,13 @@ include (../xmlpatterns.pri) wince*: { QT += network +requires(!isEmpty(_QMAKE_SUPER_CACHE_)) addFiles.files = \ - $$QT.sql.sources/../../examples/sql/masterdetail/albumdetails.xml \ ../../../examples/xquery/globalVariables/globals.gccxml \ ../../../../qtdoc/doc/src/diagrams/stylesheet/treeview.svg \ ../../../../qtdoc/doc/src/diagrams/designer-manual/designer-mainwindow-actions.ui \ - $$QT.widgets.sources/../../examples/tools/undo/undo.qrc + ../../../../qtsql/examples/sql/masterdetail/albumdetails.xml \ + ../../../../qtbase/examples/widgets/tools/undo/undo.qrc addFiles.path = xmlfiles DEPLOYMENT += addFiles } else { diff --git a/tests/auto/headersclean/headersclean.pro b/tests/auto/headersclean/headersclean.pro index 534f8aa..ecf5f1f 100644 --- a/tests/auto/headersclean/headersclean.pro +++ b/tests/auto/headersclean/headersclean.pro @@ -1,5 +1,3 @@ -TARGET = tst_headersclean -CONFIG += testcase -SOURCES += tst_headersclean.cpp -QT = core xmlpatterns testlib +QT = xmlpatterns +load(qt_headersclean) DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/headersclean/tst_headersclean.cpp b/tests/auto/headersclean/tst_headersclean.cpp deleted file mode 100644 index 684f5fc..0000000 --- a/tests/auto/headersclean/tst_headersclean.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** 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, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#define QT_NO_KEYWORDS -#define signals int -#define slots int -#define emit public:; -#define foreach public:; -#define forever public:; - -#include <QtCore/QtCore> -#include <QtTest/QtTest> - -#include <QtXmlPatterns/QtXmlPatterns> - -class tst_HeadersClean: public QObject -{ - Q_OBJECT -public: - tst_HeadersClean() {} -}; - -QTEST_MAIN(tst_HeadersClean) -#include "tst_headersclean.moc" diff --git a/tests/auto/xmlpatterns.pri b/tests/auto/xmlpatterns.pri index ea939f1..96d8261 100644 --- a/tests/auto/xmlpatterns.pri +++ b/tests/auto/xmlpatterns.pri @@ -9,6 +9,7 @@ wince*: { QT += network } QT -= gui +QMAKE_RPATHLINKDIR *= $$QT.gui.libs XMLPATTERNS_SDK = QtXmlPatternsSDK if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { |