Changeset 769 for trunk/demos


Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
21 edited
102 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/demos/browser/browser.pro

    r680 r769  
    66contains(QT_BUILD_PARTS, tools):!embedded: CONFIG += uitools
    77else: DEFINES += QT_NO_UITOOLS
    8 
    9 CONFIG(release,release|debug):DEFINES+=QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT
    108
    119FORMS += \
  • trunk/demos/browser/networkaccessmanager.cpp

    r651 r769  
    113113    double pctPipelined = (double(requestFinishedPipelinedCount) * 100.0/ double(requestFinishedCount));
    114114    double pctSecure = (double(requestFinishedSecureCount) * 100.0/ double(requestFinishedCount));
     115#ifdef QT_DEBUG
    115116    qDebug("STATS [%lli requests total] [%3.2f%% from cache] [%3.2f%% pipelined] [%3.2f%% SSL/TLS]", requestFinishedCount, pctCached, pctPipelined, pctSecure);
    116 
     117#endif
    117118}
    118119
  • trunk/demos/browser/webview.cpp

    r651 r769  
    144144void WebPage::handleUnsupportedContent(QNetworkReply *reply)
    145145{
    146     if (reply->error() == QNetworkReply::NoError) {
    147         BrowserApplication::downloadManager()->handleUnsupportedContent(reply);
     146    QString errorString = reply->errorString();
     147
     148    if (m_loadingUrl != reply->url()) {
     149        // sub resource of this page
     150        qWarning() << "Resource" << reply->url().toEncoded() << "has unknown Content-Type, will be ignored.";
     151        reply->deleteLater();
    148152        return;
     153    }
     154
     155    if (reply->error() == QNetworkReply::NoError && !reply->header(QNetworkRequest::ContentTypeHeader).isValid()) {
     156        errorString = "Unknown Content-Type";
    149157    }
    150158
     
    157165    QString html = QString(QLatin1String(file.readAll()))
    158166                        .arg(title)
    159                         .arg(reply->errorString())
     167                        .arg(errorString)
    160168                        .arg(reply->url().toString());
    161169
  • trunk/demos/composition/composition.cpp

    r651 r769  
    4848#include <QMouseEvent>
    4949#include <qmath.h>
     50
     51const int animationInterval = 15; // update every 16 ms = ~60FPS
    5052
    5153CompositionWidget::CompositionWidget(QWidget *parent)
     
    237239{
    238240    m_animation_enabled = true;
     241    m_animationTimer = startTimer(animationInterval);
    239242#ifdef Q_WS_QWS
    240243    m_image = QPixmap(":res/composition/flower.jpg");
     
    263266    rect.translate(-size.width()/2, -size.height()/2);
    264267    return rect;
     268}
     269
     270void CompositionRenderer::setAnimationEnabled(bool enabled)
     271{
     272    if (m_animation_enabled == enabled)
     273        return;
     274    m_animation_enabled = enabled;
     275    if (enabled) {
     276        Q_ASSERT(!m_animationTimer);
     277        m_animationTimer = startTimer(animationInterval);
     278    } else {
     279        killTimer(m_animationTimer);
     280        m_animationTimer = 0;
     281    }
    265282}
    266283
     
    472489#endif
    473490    }
    474 
    475     if (m_animation_enabled && m_current_object == NoObject) {
    476         updateCirclePos();
    477     }
    478491}
    479492
     
    490503        m_current_object = NoObject;
    491504    }
     505    if (m_animation_enabled) {
     506        killTimer(m_animationTimer);
     507        m_animationTimer = 0;
     508    }
    492509}
    493510
     
    501518    m_current_object = NoObject;
    502519
    503     if (m_animation_enabled)
     520    if (m_animation_enabled) {
     521        Q_ASSERT(!m_animationTimer);
     522        m_animationTimer = startTimer(animationInterval);
     523    }
     524}
     525
     526void CompositionRenderer::timerEvent(QTimerEvent *event)
     527{
     528    if (event->timerId() == m_animationTimer)
    504529        updateCirclePos();
    505530}
  • trunk/demos/composition/composition.h

    r651 r769  
    110110    void paint(QPainter *);
    111111
    112     void mousePressEvent(QMouseEvent *);
    113     void mouseMoveEvent(QMouseEvent *);
    114     void mouseReleaseEvent(QMouseEvent *);
    115 
    116112    void setCirclePos(const QPointF &pos);
    117113
     
    121117    int circleColor() const { return m_circle_hue; }
    122118    int circleAlpha() const { return m_circle_alpha; }
     119
     120protected:
     121    void mousePressEvent(QMouseEvent *);
     122    void mouseMoveEvent(QMouseEvent *);
     123    void mouseReleaseEvent(QMouseEvent *);
     124    void timerEvent(QTimerEvent *);
    123125
    124126public slots:
     
    151153    void setCircleAlpha(int alpha) { m_circle_alpha = alpha; update(); }
    152154    void setCircleColor(int hue) { m_circle_hue = hue; update(); }
    153     void setAnimationEnabled(bool enabled) { m_animation_enabled = enabled; update(); }
     155    void setAnimationEnabled(bool enabled);
    154156
    155157private:
     
    178180    ObjectType m_current_object;
    179181    bool m_animation_enabled;
     182    int m_animationTimer;
    180183
    181184#ifdef QT_OPENGL_SUPPORT
  • trunk/demos/demos.pro

    r640 r769  
    5656contains(QT_CONFIG, phonon):!static:SUBDIRS += demos_mediaplayer
    5757contains(QT_CONFIG, webkit):contains(QT_CONFIG, svg):!symbian:SUBDIRS += demos_browser
     58contains(QT_CONFIG, multimedia):SUBDIRS += demos_spectrum
    5859
    5960# install
     
    8889demos_boxes.subdir = boxes
    8990demos_sub-attaq.subdir = sub-attaq
     91demos_spectrum.subdir = spectrum
    9092
    9193#CONFIG += ordered
  • trunk/demos/embedded/anomaly/anomaly.pro

    r651 r769  
    2828    include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
    2929    HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
    30     LIBS += -lesock -linsock -lconnmon
     30    LIBS += -lesock -lcommdb -linsock # For IAP selection
    3131    TARGET.CAPABILITY = NetworkServices
    3232    TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
  • trunk/demos/embedded/anomaly/src/BrowserView.cpp

    r651 r769  
    8383    connect(m_controlStrip, SIGNAL(backClicked()), m_webView, SLOT(back()));
    8484    connect(m_controlStrip, SIGNAL(forwardClicked()), m_webView, SLOT(forward()));
     85    connect(m_controlStrip, SIGNAL(closeClicked()), qApp, SLOT(quit()));
    8586
    8687    QPalette pal = m_webView->palette();
  • trunk/demos/embedded/anomaly/src/ControlStrip.cpp

    r651 r769  
    5151    backPixmap.load(":/images/go-previous.png");
    5252    forwardPixmap.load(":/images/go-next.png");
     53    closePixmap.load(":/images/button-close.png");
    5354}
    5455
     
    6667{
    6768    int h = height();
     69    int spacing = qMin(h, (width() - h * 4) / 3);
    6870    int x = event->pos().x();
    6971
     
    7577
    7678    if (x > width() - h) {
     79        emit closeClicked();
     80        event->accept();
     81        return;
     82    }
     83
     84    if ((x < width() - (h + spacing)) && (x > width() - (h * 2 + spacing))) {
    7785        emit forwardClicked();
    7886        event->accept();
     
    8088    }
    8189
    82     if ((x < width() - 2 * h) && (x > width() - 3 * h)) {
     90    if ((x < width() - (h * 2 + spacing * 2)) && (x > width() - (h * 3 + spacing * 2))) {
    8391        emit backClicked();
    8492        event->accept();
     
    9098{
    9199    int h = height();
    92     int s = (h - menuPixmap.height()) / 2;
     100    int spacing = qMin(h, (width() - h * 4) / 3);
     101    int s = (height() - menuPixmap.height()) / 2;
    93102
    94103    QPainter p(this);
     
    96105    p.setCompositionMode(QPainter::CompositionMode_SourceOver);
    97106    p.drawPixmap(s, s, menuPixmap);
    98     p.drawPixmap(width() - 3 * h + s, s, backPixmap);
    99     p.drawPixmap(width() - h + s, s, forwardPixmap);
     107    p.drawPixmap(width() - h + s, s, closePixmap);
     108    p.drawPixmap(width() - (h * 2 + spacing) + s, s, forwardPixmap);
     109    p.drawPixmap(width() - (h * 3 + spacing * 2) + s, s, backPixmap);
     110
    100111    p.end();
    101112}
  • trunk/demos/embedded/anomaly/src/ControlStrip.h

    r651 r769  
    5959    void backClicked();
    6060    void forwardClicked();
     61    void closeClicked();
    6162
    6263protected:
     
    6869    QPixmap backPixmap;
    6970    QPixmap forwardPixmap;
     71    QPixmap closePixmap;
    7072};
    7173
  • trunk/demos/embedded/anomaly/src/anomaly.qrc

    r561 r769  
    66        <file>images/list-add.png</file>
    77        <file>images/list-remove.png</file>
     8        <file>images/button-close.png</file>
    89    </qresource>
    910</RCC>
  • trunk/demos/embedded/desktopservices/contenttab.cpp

    r651 r769  
    115115{
    116116    switch (event->key()) {
    117     case Qt::Key_Up:
    118         if (currentRow() == 0) {
    119             setCurrentRow(count() - 1);
    120         } else {
    121             setCurrentRow(currentRow() - 1);
    122         }
    123         break;
    124     case Qt::Key_Down:
    125         if (currentRow() == (count() - 1)) {
    126             setCurrentRow(0);
    127         } else {
    128             setCurrentRow(currentRow() + 1);
    129         }
    130         break;
    131117    case Qt::Key_Select:
    132118        openItem(currentItem());
  • trunk/demos/embedded/flightinfo/flightinfo.pro

    r561 r769  
    1010    include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
    1111    HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
    12     LIBS += -lesock  -lconnmon -linsock
     12    LIBS += -lesock -lcommdb -linsock # For IAP selection
    1313    TARGET.CAPABILITY = NetworkServices
    1414}
  • trunk/demos/embedded/fluidlauncher/config_s60/config.xml

    r561 r769  
    2121    <example filename="digiflip" name="Flipping Clock" image="screenshots/digiflip.png"/>
    2222    <example filename="qmediaplayer" name="Media Player" image="screenshots/mediaplayer.png" args="-small-screen"/>
     23    <example filename="spectrum" name="Spectrum Analyzer" image="screenshots/spectrum.png" args="-small-screen"/>
    2324  </demos>
    2425  <slideshow timeout="60000" interval="10000">
  • trunk/demos/embedded/fluidlauncher/fluidlauncher.pro

    r651 r769  
    9898    contains(QT_CONFIG, phonon) {
    9999        reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/qmediaplayer_reg.rsc
     100    }
     101
     102    contains(QT_CONFIG, multimedia) {
     103        reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/spectrum_reg.rsc
    100104    }
    101105
     
    165169            $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.mif
    166170
    167         # Since Fluidlauncher itself doesn't link webkit, we won't get dependency automatically
    168         executables.pkg_prerules += \
    169             "; Dependency to Qt Webkit" \
    170             "(0x200267C2), $${QT_MAJOR_VERSION}, $${QT_MINOR_VERSION}, $${QT_PATCH_VERSION},  {\"QtWebKit\"}"
     171        isEmpty(QT_LIBINFIX) {
     172            # Since Fluidlauncher itself doesn't link webkit, we won't get dependency automatically
     173            executables.pkg_prerules += \
     174                "; Dependency to Qt Webkit" \
     175                "(0x200267C2), $${QT_MAJOR_VERSION}, $${QT_MINOR_VERSION}, $${QT_PATCH_VERSION},  {\"QtWebKit\"}"
     176        }
    171177    }
    172178
     
    176182        mifs.sources += \
    177183            $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qmediaplayer.mif
     184    }
     185
     186    contains(QT_CONFIG, multimedia) {
     187        executables.sources += spectrum.exe fftreal.dll
     188        resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.rsc
     189        mifs.sources += \
     190            $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.mif
    178191    }
    179192
  • trunk/demos/embedded/lightmaps/lightmaps.pro

    r561 r769  
    77    include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
    88    HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
    9     LIBS += -lesock  -lconnmon -linsock
     9    LIBS += -lesock -lcommdb -linsock # For IAP selection
    1010    TARGET.CAPABILITY = NetworkServices
    1111    TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
  • trunk/demos/embedded/weatherinfo/weatherinfo.pro

    r561 r769  
    99    include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
    1010    HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
    11     LIBS += -lesock -lconnmon -linsock
     11    LIBS += -lesock -lcommdb -linsock # For IAP selection
    1212    TARGET.CAPABILITY = NetworkServices
    1313}
  • trunk/demos/qtdemo/xml/examples.xml

    r561 r769  
    2020    <example filename="boxes" name="Boxes" />
    2121    <example filename="sub-attaq" name="Sub-attaq" />
     22    <example filename="spectrum" name="Spectrum Analyzer" />
    2223  </demos>
    2324  <category dirname="animation" name="Animation Framework">
  • trunk/demos/sqlbrowser/browser.cpp

    r651 r769  
    147147    QSqlTableModel *model = new QSqlTableModel(table, connectionWidget->currentDatabase());
    148148    model->setEditStrategy(QSqlTableModel::OnRowChange);
    149     model->setTable(t);
     149    model->setTable(connectionWidget->currentDatabase().driver()->escapeIdentifier(t, QSqlDriver::TableName));
    150150    model->select();
    151151    if (model->lastError().type() != QSqlError::NoError)
  • trunk/demos/symbianpkgrules.pri

    r561 r769  
    1111    " "
    1212
    13 default_deployment.pkg_prerules += vendorinfo
     13demos_deployment.pkg_prerules += vendorinfo
     14DEPLOYMENT += demos_deployment
    1415
    1516isEmpty(ICON):ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
Note: See TracChangeset for help on using the changeset viewer.