Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/dialogs/qerrormessage.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6262#include <stdlib.h>
    6363
    64 #ifdef Q_OS_WINCE
     64#ifdef Q_WS_WINCE
    6565extern bool qt_wince_is_mobile();    //defined in qguifunctions_wince.cpp
    6666extern bool qt_wince_is_high_dpi();  //defined in qguifunctions_wince.cpp
    6767
    6868#include "qguifunctions_wince.h"
     69#endif
     70
     71#if defined(QT_SOFTKEYS_ENABLED)
     72#include <qaction.h>
     73#ifdef Q_WS_S60
     74#include "private/qt_s60_p.h"
     75#endif
    6976#endif
    7077
     
    7986    QTextEdit * errors;
    8087    QLabel * icon;
     88#ifdef QT_SOFTKEYS_ENABLED
     89    QAction *okAction;
     90#endif
    8191    QQueue<QPair<QString, QString> > pending;
    8292    QSet<QString> doNotShow;
     
    101111QSize QErrorMessageTextView::minimumSizeHint() const
    102112{
    103 #ifdef Q_OS_WINCE
     113#ifdef Q_WS_WINCE
    104114    if (qt_wince_is_mobile())
    105115         if (qt_wince_is_high_dpi())
     
    116126QSize QErrorMessageTextView::sizeHint() const
    117127{
    118 #ifdef Q_OS_WINCE
     128#ifdef Q_WS_WINCE
    119129    if (qt_wince_is_mobile())
    120130         if (qt_wince_is_high_dpi())
     
    125135      return QSize(300, 100);
    126136#else
     137
     138#ifdef Q_WS_S60
     139    const int smallerDimension = qMin(S60->screenHeightInPixels, S60->screenWidthInPixels);
     140    // In S60 layout data, error messages seem to be one third of the screen height (in portrait) minus two.
     141    return QSize(smallerDimension, smallerDimension/3-2);
     142#else
    127143    return QSize(250, 75);
    128 #endif
     144#endif //Q_WS_S60
     145#endif //Q_WS_WINCE
    129146}
    130147
     
    134151    \brief The QErrorMessage class provides an error message display dialog.
    135152
    136     \ingroup dialogs
    137     \ingroup misc
     153    \ingroup standard-dialog
    138154
    139155    An error message widget consists of a text label and a checkbox. The
     
    241257    grid->addWidget(d->again, 1, 1, Qt::AlignTop);
    242258    d->ok = new QPushButton(this);
    243 #ifdef Q_OS_WINCE
     259#ifdef QT_SOFTKEYS_ENABLED
     260    d->okAction = new QAction(d->ok);
     261    d->okAction->setSoftKeyRole(QAction::PositiveSoftKey);
     262    connect(d->okAction, SIGNAL(triggered()), this, SLOT(accept()));
     263    addAction(d->okAction);
     264#endif
     265
     266
     267#if defined(Q_WS_WINCE) || defined(Q_WS_S60)
    244268    d->ok->setFixedSize(0,0);
    245269#endif
     
    301325        qtMessageHandler = new QErrorMessage(0);
    302326        qAddPostRoutine(deleteStaticcQErrorMessage); // clean up
    303         qtMessageHandler->setWindowTitle(qApp->applicationName());
     327        qtMessageHandler->setWindowTitle(QApplication::applicationName());
    304328        qInstallMsgHandler(jump);
    305329    }
     
    374398}
    375399
    376 
    377400/*!
    378401    \reimp
     
    391414    again->setText(QErrorMessage::tr("&Show this message again"));
    392415    ok->setText(QErrorMessage::tr("&OK"));
     416#ifdef QT_SOFTKEYS_ENABLED
     417    okAction->setText(ok->text());
     418#endif
    393419}
    394420
Note: See TracChangeset for help on using the changeset viewer.