summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorHonglei Zhang <honglei.zhang@nokia.com>2011-07-29 09:57:30 +0300
committerHonglei Zhang <honglei.zhang@nokia.com>2011-07-29 09:57:30 +0300
commit8e2dc4ac2ec35e9b2f57ade5af390c2d44765382 (patch)
tree3ce2618938f3c5cbef56223e183d4f4006fcf134 /src/gui
parent6d2ae84eca2ea4e74a310b4902016151a233ea5d (diff)
parentc9f0c578bbaf73211ad4729e1496e53867a641c9 (diff)
Merge remote-tracking branch 'qt/4.8'
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessible.cpp5
-rw-r--r--src/gui/accessible/qaccessible.h78
-rw-r--r--src/gui/accessible/qaccessible2.cpp112
-rw-r--r--src/gui/accessible/qaccessible2.h112
-rw-r--r--src/gui/accessible/qaccessible_unix.cpp11
-rw-r--r--src/gui/dialogs/qerrormessage.cpp16
-rw-r--r--src/gui/dialogs/qmessagebox.cpp18
-rw-r--r--src/gui/embedded/qkbdlinuxinput_qws.cpp4
-rw-r--r--src/gui/embedded/qmouselinuxinput_qws.cpp13
-rw-r--r--src/gui/graphicsview/qgraphicsgridlayout.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicslayout.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp3
-rw-r--r--src/gui/image/qimage.h13
-rw-r--r--src/gui/image/qpixmap.h10
-rw-r--r--src/gui/image/qtiffhandler.cpp13
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h1
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp16
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp95
-rw-r--r--src/gui/itemviews/qabstractitemview.h1
-rw-r--r--src/gui/itemviews/qabstractitemview_p.h1
-rw-r--r--src/gui/itemviews/qabstractproxymodel.cpp9
-rw-r--r--src/gui/itemviews/qlistview.cpp12
-rw-r--r--src/gui/itemviews/qtableview.cpp17
-rw-r--r--src/gui/itemviews/qtableview_p.h5
-rw-r--r--src/gui/itemviews/qtreeview.cpp52
-rw-r--r--src/gui/itemviews/qtreeview.h3
-rw-r--r--src/gui/itemviews/qtreeview_p.h6
-rw-r--r--src/gui/kernel/qapplication.cpp4
-rw-r--r--src/gui/kernel/qgenericplugin_qpa.cpp1
-rw-r--r--src/gui/kernel/qgenericpluginfactory_qpa.cpp1
-rw-r--r--src/gui/kernel/qkeysequence.cpp4
-rw-r--r--src/gui/kernel/qplatformcursor_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformwindowformat_qpa.cpp8
-rw-r--r--src/gui/kernel/qsizepolicy.qdoc2
-rw-r--r--src/gui/kernel/qwidget_qpa.cpp6
-rw-r--r--src/gui/kernel/qwidget_x11.cpp6
-rw-r--r--src/gui/painting/qbezier_p.h36
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp2
-rw-r--r--src/gui/painting/qpainter.cpp24
-rw-r--r--src/gui/painting/qprinterinfo.cpp4
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp6
-rw-r--r--src/gui/s60framework/qs60keycapture.cpp2
-rw-r--r--src/gui/styles/qmacstyle_mac.mm34
-rw-r--r--src/gui/styles/qs60style.cpp14
-rw-r--r--src/gui/styles/qs60style_p.h2
-rw-r--r--src/gui/styles/qs60style_s60.cpp4
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp17
-rw-r--r--src/gui/text/qfontdatabase.cpp94
-rw-r--r--src/gui/text/qfontdatabase_mac.cpp6
-rw-r--r--src/gui/text/qfontdatabase_qpa.cpp2
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp2
-rw-r--r--src/gui/text/qfontdatabase_win.cpp8
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp14
-rw-r--r--src/gui/text/qfontengine_coretext.mm27
-rw-r--r--src/gui/text/qfontengine_coretext_p.h3
-rw-r--r--src/gui/text/qfontenginedirectwrite.cpp146
-rw-r--r--src/gui/text/qfontenginedirectwrite_p.h6
-rw-r--r--src/gui/text/qfontmetrics.cpp3
-rw-r--r--src/gui/text/qplatformfontdatabase_qpa.cpp2
-rw-r--r--src/gui/text/qtextcursor.cpp1
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtextengine.cpp40
-rw-r--r--src/gui/text/qtextengine_mac.cpp7
-rw-r--r--src/gui/text/qtextengine_p.h4
-rw-r--r--src/gui/text/qtextlayout.cpp24
-rw-r--r--src/gui/widgets/qabstractspinbox.cpp2
-rw-r--r--src/gui/widgets/qcheckbox.cpp1
-rw-r--r--src/gui/widgets/qcombobox.cpp18
-rw-r--r--src/gui/widgets/qlabel.cpp9
-rw-r--r--src/gui/widgets/qlinecontrol.cpp54
-rw-r--r--src/gui/widgets/qlinecontrol_p.h26
-rw-r--r--src/gui/widgets/qlineedit.cpp4
-rw-r--r--src/gui/widgets/qradiobutton.cpp1
-rw-r--r--src/gui/widgets/qtabwidget.cpp1
-rw-r--r--src/gui/widgets/qtextedit.cpp2
75 files changed, 1050 insertions, 268 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 337bb9992d..10e5785cd5 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1048,6 +1048,11 @@ const QAccessibleInterface *other, int otherChild) const
*/
/*!
+ \fn QAccessibleTable2Interface *QAccessibleInterface::table2Interface()
+ \internal
+*/
+
+/*!
\fn QAccessibleActionInterface *QAccessibleInterface::actionInterface()
\internal
*/
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index fc03e1cec7..24a6744643 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -84,40 +84,40 @@ public:
MenuCommand = 0x0018,
// Values from IAccessible2
- ActionChanged = 0x0101,
- ActiveDescendantChanged,
- AttributeChanged,
- DocumentContentChanged,
- DocumentLoadComplete,
- DocumentLoadStopped,
- DocumentReload,
- HyperlinkEndIndexChanged,
- HyperlinkNumberOfAnchorsChanged,
- HyperlinkSelectedLinkChanged,
- HypertextLinkActivated,
- HypertextLinkSelected,
- HyperlinkStartIndexChanged,
- HypertextChanged,
- HypertextNLinksChanged,
- ObjectAttributeChanged,
- PageChanged,
- SectionChanged,
- TableCaptionChanged,
- TableColumnDescriptionChanged,
- TableColumnHeaderChanged,
- TableModelChanged,
- TableRowDescriptionChanged,
- TableRowHeaderChanged,
- TableSummaryChanged,
- TextAttributeChanged,
- TextCaretMoved,
- // TextChanged, deprecated, use TextUpdated
- TextColumnChanged = TextCaretMoved + 2,
- TextInserted,
- TextRemoved,
- TextUpdated,
- TextSelectionChanged,
- VisibleDataChanged,
+ ActionChanged = 0x0101,
+ ActiveDescendantChanged = 0x0102,
+ AttributeChanged = 0x0103,
+ DocumentContentChanged = 0x0104,
+ DocumentLoadComplete = 0x0105,
+ DocumentLoadStopped = 0x0106,
+ DocumentReload = 0x0107,
+ HyperlinkEndIndexChanged = 0x0108,
+ HyperlinkNumberOfAnchorsChanged = 0x0109,
+ HyperlinkSelectedLinkChanged = 0x010A,
+ HypertextLinkActivated = 0x010B,
+ HypertextLinkSelected = 0x010C,
+ HyperlinkStartIndexChanged = 0x010D,
+ HypertextChanged = 0x010E,
+ HypertextNLinksChanged = 0x010F,
+ ObjectAttributeChanged = 0x0110,
+ PageChanged = 0x0111,
+ SectionChanged = 0x0112,
+ TableCaptionChanged = 0x0113,
+ TableColumnDescriptionChanged = 0x0114,
+ TableColumnHeaderChanged = 0x0115,
+ TableModelChanged = 0x0116,
+ TableRowDescriptionChanged = 0x0117,
+ TableRowHeaderChanged = 0x0118,
+ TableSummaryChanged = 0x0119,
+ TextAttributeChanged = 0x011A,
+ TextCaretMoved = 0x011B,
+ // TextChanged = 0x011C, is deprecated in IA2, use TextUpdated
+ TextColumnChanged = 0x011D,
+ TextInserted = 0x011E,
+ TextRemoved = 0x011F,
+ TextUpdated = 0x0120,
+ TextSelectionChanged = 0x0121,
+ VisibleDataChanged = 0x0122,
ObjectCreated = 0x8000,
ObjectDestroyed = 0x8001,
@@ -151,6 +151,7 @@ public:
ReadOnly = 0x00000040,
HotTracked = 0x00000080,
DefaultButton = 0x00000100,
+ // #### Qt5 Expandable
Expanded = 0x00000200,
Collapsed = 0x00000400,
Busy = 0x00000800,
@@ -178,6 +179,8 @@ public:
HasPopup = 0x40000000,
Modal = 0x80000000,
+ // #### Qt5 ManagesDescendants
+ // #### Qt5 remove HasInvokeExtension
HasInvokeExtension = 0x10000000 // internal
};
Q_DECLARE_FLAGS(State, StateFlag)
@@ -348,7 +351,8 @@ namespace QAccessible2
ValueInterface,
TableInterface,
ActionInterface,
- ImageInterface
+ ImageInterface,
+ Table2Interface
};
}
@@ -359,6 +363,7 @@ class QAccessibleValueInterface;
class QAccessibleTableInterface;
class QAccessibleActionInterface;
class QAccessibleImageInterface;
+class QAccessibleTable2Interface;
class Q_GUI_EXPORT QAccessibleInterface : public QAccessible
{
@@ -422,6 +427,9 @@ public:
inline QAccessibleImageInterface *imageInterface()
{ return reinterpret_cast<QAccessibleImageInterface *>(cast_helper(QAccessible2::ImageInterface)); }
+ inline QAccessibleTable2Interface *table2Interface()
+ { return reinterpret_cast<QAccessibleTable2Interface *>(cast_helper(QAccessible2::Table2Interface)); }
+
private:
QAccessible2Interface *cast_helper(QAccessible2::InterfaceType);
};
diff --git a/src/gui/accessible/qaccessible2.cpp b/src/gui/accessible/qaccessible2.cpp
index 35b24f6e24..078ff13e2c 100644
--- a/src/gui/accessible/qaccessible2.cpp
+++ b/src/gui/accessible/qaccessible2.cpp
@@ -42,6 +42,7 @@
#include "qaccessible2.h"
#include "qapplication.h"
#include "qclipboard.h"
+#include "qtextboundaryfinder.h"
#ifndef QT_NO_ACCESSIBILITY
@@ -132,6 +133,117 @@ QT_BEGIN_NAMESPACE
\link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
*/
+
+/*!
+ \internal
+*/
+QString Q_GUI_EXPORT qTextBeforeOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
+ int *startOffset, int *endOffset, const QString& text)
+{
+ QTextBoundaryFinder::BoundaryType type;
+ switch (boundaryType) {
+ case QAccessible2::CharBoundary:
+ type = QTextBoundaryFinder::Grapheme;
+ break;
+ case QAccessible2::WordBoundary:
+ type = QTextBoundaryFinder::Word;
+ break;
+ case QAccessible2::SentenceBoundary:
+ type = QTextBoundaryFinder::Sentence;
+ break;
+ default:
+ // in any other case return the whole line
+ *startOffset = 0;
+ *endOffset = text.length();
+ return text;
+ }
+
+ QTextBoundaryFinder boundary(type, text);
+ boundary.setPosition(offset);
+
+ if (!boundary.isAtBoundary()) {
+ boundary.toPreviousBoundary();
+ }
+ boundary.toPreviousBoundary();
+ *startOffset = boundary.position();
+ boundary.toNextBoundary();
+ *endOffset = boundary.position();
+
+ return text.mid(*startOffset, *endOffset - *startOffset);
+}
+
+/*!
+ \internal
+*/
+QString Q_GUI_EXPORT qTextAfterOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
+ int *startOffset, int *endOffset, const QString& text)
+{
+ QTextBoundaryFinder::BoundaryType type;
+ switch (boundaryType) {
+ case QAccessible2::CharBoundary:
+ type = QTextBoundaryFinder::Grapheme;
+ break;
+ case QAccessible2::WordBoundary:
+ type = QTextBoundaryFinder::Word;
+ break;
+ case QAccessible2::SentenceBoundary:
+ type = QTextBoundaryFinder::Sentence;
+ break;
+ default:
+ // in any other case return the whole line
+ *startOffset = 0;
+ *endOffset = text.length();
+ return text;
+ }
+
+ QTextBoundaryFinder boundary(type, text);
+ boundary.setPosition(offset);
+
+ boundary.toNextBoundary();
+ *startOffset = boundary.position();
+ boundary.toNextBoundary();
+ *endOffset = boundary.position();
+
+ return text.mid(*startOffset, *endOffset - *startOffset);
+}
+
+/*!
+ \internal
+*/
+QString Q_GUI_EXPORT qTextAtOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
+ int *startOffset, int *endOffset, const QString& text)
+{
+ QTextBoundaryFinder::BoundaryType type;
+ switch (boundaryType) {
+ case QAccessible2::CharBoundary:
+ type = QTextBoundaryFinder::Grapheme;
+ break;
+ case QAccessible2::WordBoundary:
+ type = QTextBoundaryFinder::Word;
+ break;
+ case QAccessible2::SentenceBoundary:
+ type = QTextBoundaryFinder::Sentence;
+ break;
+ default:
+ // in any other case return the whole line
+ *startOffset = 0;
+ *endOffset = text.length();
+ return text;
+ }
+
+ QTextBoundaryFinder boundary(type, text);
+ boundary.setPosition(offset);
+
+ if (!boundary.isAtBoundary()) {
+ boundary.toPreviousBoundary();
+ }
+ *startOffset = boundary.position();
+ boundary.toNextBoundary();
+ *endOffset = boundary.position();
+
+ return text.mid(*startOffset, *endOffset - *startOffset);
+}
+
QAccessibleSimpleEditableTextInterface::QAccessibleSimpleEditableTextInterface(
QAccessibleInterface *accessibleInterface)
: iface(accessibleInterface)
diff --git a/src/gui/accessible/qaccessible2.h b/src/gui/accessible/qaccessible2.h
index 5cb03239ef..106b69efcf 100644
--- a/src/gui/accessible/qaccessible2.h
+++ b/src/gui/accessible/qaccessible2.h
@@ -52,6 +52,8 @@ QT_MODULE(Gui)
#ifndef QT_NO_ACCESSIBILITY
+class QModelIndex;
+
namespace QAccessible2
{
enum CoordinateType
@@ -68,6 +70,24 @@ namespace QAccessible2
LineBoundary,
NoBoundary
};
+
+ enum TableModelChangeType {
+ TableModelChangeInsert,
+ TableModelChangeDelete,
+ TableModelChangeUpdate
+ };
+
+ struct TableModelChange {
+ int firstColumn;
+ int firstRow;
+ int lastColumn;
+ int lastRow;
+ TableModelChangeType type;
+
+ TableModelChange()
+ : firstColumn(0), firstRow(0), lastColumn(0), lastRow(0), type(TableModelChangeUpdate)
+ {}
+ };
}
class Q_GUI_EXPORT QAccessible2Interface
@@ -83,6 +103,7 @@ inline QAccessible2Interface *qAccessibleEditableTextCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleTableCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleActionCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleImageCastHelper() { return 0; }
+inline QAccessible2Interface *qAccessibleTable2CastHelper() { return 0; }
#define Q_ACCESSIBLE_OBJECT \
public: \
@@ -101,6 +122,8 @@ inline QAccessible2Interface *qAccessibleImageCastHelper() { return 0; }
return qAccessibleActionCastHelper(); \
case QAccessible2::ImageInterface: \
return qAccessibleImageCastHelper(); \
+ case QAccessible2::Table2Interface: \
+ return qAccessibleTable2CastHelper(); \
} \
return 0; \
} \
@@ -214,6 +237,95 @@ public:
int *columnSpan, bool *isSelected) = 0;
};
+class Q_GUI_EXPORT QAccessibleTable2CellInterface: public QAccessibleInterface
+{
+public:
+ // Returns the number of columns occupied by this cell accessible.
+ virtual int columnExtent() const = 0;
+
+ // Returns the column headers as an array of cell accessibles.
+ virtual QList<QAccessibleInterface*> columnHeaderCells() const = 0;
+
+ // Translates this cell accessible into the corresponding column index.
+ virtual int columnIndex() const = 0;
+ // Returns the number of rows occupied by this cell accessible.
+ virtual int rowExtent() const = 0;
+ // Returns the row headers as an array of cell accessibles.
+ virtual QList<QAccessibleInterface*> rowHeaderCells() const = 0;
+ // Translates this cell accessible into the corresponding row index.
+ virtual int rowIndex() const = 0;
+ // Returns a boolean value indicating whether this cell is selected.
+ virtual bool isSelected() const = 0;
+
+ // Gets the row and column indexes and extents of this cell accessible and whether or not it is selected.
+ virtual void rowColumnExtents(int *row, int *column, int *rowExtents, int *columnExtents, bool *selected) const = 0;
+ // Returns a reference to the accessbile of the containing table.
+ virtual QAccessibleTable2Interface* table() const = 0;
+
+ // #### Qt5 this should not be here but part of the state
+ virtual bool isExpandable() const = 0;
+};
+
+class Q_GUI_EXPORT QAccessibleTable2Interface: public QAccessible2Interface
+{
+public:
+ inline QAccessible2Interface *qAccessibleTable2CastHelper() { return this; }
+
+ // Returns the cell at the specified row and column in the table.
+ virtual QAccessibleTable2CellInterface *cellAt (int row, int column) const = 0;
+ // Returns the caption for the table.
+ virtual QAccessibleInterface *caption() const = 0;
+ // Returns the description text of the specified column in the table.
+ virtual QString columnDescription(int column) const = 0;
+ // Returns the total number of columns in table.
+ virtual int columnCount() const = 0;
+ // Returns the total number of rows in table.
+ virtual int rowCount() const = 0;
+ // Returns the total number of selected cells.
+ virtual int selectedCellCount() const = 0;
+ // Returns the total number of selected columns.
+ virtual int selectedColumnCount() const = 0;
+ // Returns the total number of selected rows.
+ virtual int selectedRowCount() const = 0;
+ // Returns the description text of the specified row in the table.
+ virtual QString rowDescription(int row) const = 0;
+ // Returns a list of accessibles currently selected.
+ virtual QList<QAccessibleTable2CellInterface*> selectedCells() const = 0;
+ // Returns a list of column indexes currently selected (0 based).
+ virtual QList<int> selectedColumns() const = 0;
+ // Returns a list of row indexes currently selected (0 based).
+ virtual QList<int> selectedRows() const = 0;
+ // Returns the summary description of the table.
+ virtual QAccessibleInterface *summary() const = 0;
+ // Returns a boolean value indicating whether the specified column is completely selected.
+ virtual bool isColumnSelected(int column) const = 0;
+ // Returns a boolean value indicating whether the specified row is completely selected.
+ virtual bool isRowSelected(int row) const = 0;
+ // Selects a row and unselects all previously selected rows.
+ virtual bool selectRow(int row) = 0;
+ // Selects a column and unselects all previously selected columns.
+ virtual bool selectColumn(int column) = 0;
+ // Unselects one row, leaving other selected rows selected (if any).
+ virtual bool unselectRow(int row) = 0;
+ // Unselects one column, leaving other selected columns selected (if any).
+ virtual bool unselectColumn(int column) = 0;
+ // Returns the type and extents describing how a table changed.
+ virtual QAccessible2::TableModelChange modelChange() const = 0;
+
+protected:
+ // These functions are called when the model changes.
+ virtual void modelReset() = 0;
+ virtual void rowsInserted(const QModelIndex &parent, int first, int last) = 0;
+ virtual void rowsRemoved(const QModelIndex &parent, int first, int last) = 0;
+ virtual void columnsInserted(const QModelIndex &parent, int first, int last) = 0;
+ virtual void columnsRemoved(const QModelIndex &parent, int first, int last) = 0;
+ virtual void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row) = 0;
+ virtual void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column) = 0;
+
+friend class QAbstractItemView;
+friend class QAbstractItemViewPrivate;
+};
+
class Q_GUI_EXPORT QAccessibleActionInterface : public QAccessible2Interface
{
public:
diff --git a/src/gui/accessible/qaccessible_unix.cpp b/src/gui/accessible/qaccessible_unix.cpp
index a6b7ec3345..19fbe78301 100644
--- a/src/gui/accessible/qaccessible_unix.cpp
+++ b/src/gui/accessible/qaccessible_unix.cpp
@@ -103,6 +103,17 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason)
if (!iface)
return;
+ // updates for List/Table/Tree should send child
+ if (who) {
+ QAccessibleInterface *child;
+ iface->navigate(QAccessible::Child, who, &child);
+ if (child) {
+ delete iface;
+ iface = child;
+ who = 0;
+ }
+ }
+
for (int i = 0; i < bridges()->count(); ++i)
bridges()->at(i)->notifyAccessibilityUpdate(reason, iface, who);
delete iface;
diff --git a/src/gui/dialogs/qerrormessage.cpp b/src/gui/dialogs/qerrormessage.cpp
index 890e6ca6b7..0a6580afef 100644
--- a/src/gui/dialogs/qerrormessage.cpp
+++ b/src/gui/dialogs/qerrormessage.cpp
@@ -249,12 +249,20 @@ QErrorMessage::QErrorMessage(QWidget * parent)
d->icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
#endif
- grid->addWidget(d->icon, 0, 0, Qt::AlignTop);
+#ifdef Q_WS_S60
+ //In Symbian, messagebox icons are in LtR UIs on right. Thus, layout needs to switch icon and text columns.
+ const int preferredIconColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 1 : 0;
+ const int preferredTextColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 0 : 1;
+#else
+ const int preferredIconColumn = 0;
+ const int preferredTextColumn = 1;
+#endif
+ grid->addWidget(d->icon, 0, preferredIconColumn, Qt::AlignTop);
d->errors = new QErrorMessageTextView(this);
- grid->addWidget(d->errors, 0, 1);
+ grid->addWidget(d->errors, 0, preferredTextColumn);
d->again = new QCheckBox(this);
d->again->setChecked(true);
- grid->addWidget(d->again, 1, 1, Qt::AlignTop);
+ grid->addWidget(d->again, 1, preferredTextColumn, Qt::AlignTop);
d->ok = new QPushButton(this);
#ifdef QT_SOFTKEYS_ENABLED
d->okAction = new QAction(d->ok);
@@ -270,7 +278,7 @@ QErrorMessage::QErrorMessage(QWidget * parent)
connect(d->ok, SIGNAL(clicked()), this, SLOT(accept()));
d->ok->setFocus();
grid->addWidget(d->ok, 2, 0, 1, 2, Qt::AlignCenter);
- grid->setColumnStretch(1, 42);
+ grid->setColumnStretch(preferredTextColumn, 42);
grid->setRowStretch(0, 42);
d->retranslateStrings();
}
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index 90ca080715..a2f086b80a 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -259,8 +259,15 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
QGridLayout *grid = new QGridLayout;
#ifndef Q_WS_MAC
- grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop);
- grid->addWidget(label, 0, 1, 1, 1);
+#ifdef Q_WS_S60
+ const int preferredIconColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 1 : 0;
+ const int preferredTextColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 0 : 1;
+#else
+ const int preferredIconColumn = 0;
+ const int preferredTextColumn = 1;
+#endif
+ grid->addWidget(iconLabel, 0, preferredIconColumn, 2, 1, Qt::AlignTop);
+ grid->addWidget(label, 0, preferredTextColumn, 1, 1);
// -- leave space for information label --
grid->addWidget(buttonBox, 2, 0, 1, 2);
#else
@@ -2500,7 +2507,12 @@ void QMessageBox::setInformativeText(const QString &text)
label->hide();
QTextBrowser *textBrowser = new QTextBrowser(this);
textBrowser->setOpenExternalLinks(true);
- grid->addWidget(textBrowser, 1, 1, 1, 1);
+#if defined(Q_OS_SYMBIAN)
+ const int preferredTextColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 0 : 1;
+#else
+ const int preferredTextColumn = 1;
+#endif
+ grid->addWidget(textBrowser, 1, preferredTextColumn, 1, 1);
d->textBrowser = textBrowser;
#else
grid->addWidget(label, 1, 1, 1, 1);
diff --git a/src/gui/embedded/qkbdlinuxinput_qws.cpp b/src/gui/embedded/qkbdlinuxinput_qws.cpp
index 376b0d0f75..b2e7cb3b9a 100644
--- a/src/gui/embedded/qkbdlinuxinput_qws.cpp
+++ b/src/gui/embedded/qkbdlinuxinput_qws.cpp
@@ -103,6 +103,7 @@ QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(QWSLinuxInputKeyboardHandler *h,
QString dev = QLatin1String("/dev/input/event1");
int repeat_delay = -1;
int repeat_rate = -1;
+ int grab = 0;
QStringList args = device.split(QLatin1Char(':'));
foreach (const QString &arg, args) {
@@ -110,12 +111,15 @@ QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(QWSLinuxInputKeyboardHandler *h,
repeat_delay = arg.mid(13).toInt();
else if (arg.startsWith(QLatin1String("repeat-rate=")))
repeat_rate = arg.mid(12).toInt();
+ else if (arg.startsWith(QLatin1String("grab=")))
+ grab = arg.mid(5).toInt();
else if (arg.startsWith(QLatin1String("/dev/")))
dev = arg;
}
m_fd = QT_OPEN(dev.toLocal8Bit().constData(), O_RDWR, 0);
if (m_fd >= 0) {
+ ::ioctl(m_fd, EVIOCGRAB, grab);
if (repeat_delay > 0 && repeat_rate > 0) {
int kbdrep[2] = { repeat_delay, repeat_rate };
::ioctl(m_fd, EVIOCSREP, kbdrep);
diff --git a/src/gui/embedded/qmouselinuxinput_qws.cpp b/src/gui/embedded/qmouselinuxinput_qws.cpp
index 19a9a99fec..5b4f6647a2 100644
--- a/src/gui/embedded/qmouselinuxinput_qws.cpp
+++ b/src/gui/embedded/qmouselinuxinput_qws.cpp
@@ -43,6 +43,7 @@
#include <QScreen>
#include <QSocketNotifier>
+#include <QStringList>
#include <qplatformdefs.h>
#include <private/qcore_unix_p.h> // overrides QT_OPEN
@@ -101,11 +102,19 @@ QWSLinuxInputMousePrivate::QWSLinuxInputMousePrivate(QWSLinuxInputMouseHandler *
setObjectName(QLatin1String("LinuxInputSubsystem Mouse Handler"));
QString dev = QLatin1String("/dev/input/event0");
- if (device.startsWith(QLatin1String("/dev/")))
- dev = device;
+ int grab = 0;
+
+ QStringList args = device.split(QLatin1Char(':'));
+ foreach (const QString &arg, args) {
+ if (arg.startsWith(QLatin1String("grab=")))
+ grab = arg.mid(5).toInt();
+ else if (arg.startsWith(QLatin1String("/dev/")))
+ dev = arg;
+ }
m_fd = QT_OPEN(dev.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
if (m_fd >= 0) {
+ ::ioctl(m_fd, EVIOCGRAB, grab);
m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData()));
} else {
diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp
index 2fbfc5dda9..fb4bd32429 100644
--- a/src/gui/graphicsview/qgraphicsgridlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp
@@ -600,6 +600,8 @@ void QGraphicsGridLayout::removeAt(int index)
}
/*!
+ \since 4.8
+
Removes the layout item \a item without destroying it.
Ownership of the item is transferred to the caller.
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp
index 6fbe8490e5..d01c3af49e 100644
--- a/src/gui/graphicsview/qgraphicslayout.cpp
+++ b/src/gui/graphicsview/qgraphicslayout.cpp
@@ -466,7 +466,6 @@ void QGraphicsLayout::addChildLayoutItem(QGraphicsLayoutItem *layoutItem)
static bool g_instantInvalidatePropagation = false;
/*!
- \internal
\since 4.8
\sa instantInvalidatePropagation()
@@ -496,7 +495,6 @@ void QGraphicsLayout::setInstantInvalidatePropagation(bool enable)
}
/*!
- \internal
\since 4.8
\sa setInstantInvalidatePropagation()
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 655725b8e9..1551944a09 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -1639,7 +1639,8 @@ QGraphicsScene::~QGraphicsScene()
Q_D(QGraphicsScene);
// Remove this scene from qApp's global scene list.
- qApp->d_func()->scene_list.removeAll(this);
+ if (!QApplicationPrivate::is_app_closing)
+ qApp->d_func()->scene_list.removeAll(this);
clear();
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index c783b76b77..2aeb3de03f 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -275,12 +275,13 @@ public:
QString text(const QString &key = QString()) const;
void setText(const QString &key, const QString &value);
- // The following functions are obsolete as of 4.1
- QString text(const char* key, const char* lang=0) const;
- QList<QImageTextKeyLang> textList() const;
- QStringList textLanguages() const;
- QString text(const QImageTextKeyLang&) const;
- void setText(const char* key, const char* lang, const QString&);
+#ifdef QT_DEPRECATED
+ QT_DEPRECATED QString text(const char* key, const char* lang=0) const;
+ QT_DEPRECATED QList<QImageTextKeyLang> textList() const;
+ QT_DEPRECATED QStringList textLanguages() const;
+ QT_DEPRECATED QString text(const QImageTextKeyLang&) const;
+ QT_DEPRECATED void setText(const char* key, const char* lang, const QString&);
+#endif
#endif
#ifdef QT3_SUPPORT
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index 46689134c4..f5479e719a 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -109,8 +109,10 @@ public:
QBitmap mask() const;
void setMask(const QBitmap &);
- QPixmap alphaChannel() const;
- void setAlphaChannel(const QPixmap &);
+#ifdef QT_DEPRECATED
+ QT_DEPRECATED QPixmap alphaChannel() const;
+ QT_DEPRECATED void setAlphaChannel(const QPixmap &);
+#endif
bool hasAlpha() const;
bool hasAlphaChannel() const;
@@ -183,7 +185,9 @@ public:
inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = 0);
void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = 0);
- int serialNumber() const;
+#ifdef QT_DEPRECATED
+ QT_DEPRECATED int serialNumber() const;
+#endif
qint64 cacheKey() const;
bool isDetached() const;
diff --git a/src/gui/image/qtiffhandler.cpp b/src/gui/image/qtiffhandler.cpp
index c753b83294..4dc9775d46 100644
--- a/src/gui/image/qtiffhandler.cpp
+++ b/src/gui/image/qtiffhandler.cpp
@@ -236,14 +236,14 @@ bool QTiffHandler::read(QImage *image)
}
} else {
// create the color table
- uint16 *redTable = static_cast<uint16 *>(qMalloc(tableSize * sizeof(uint16)));
- uint16 *greenTable = static_cast<uint16 *>(qMalloc(tableSize * sizeof(uint16)));
- uint16 *blueTable = static_cast<uint16 *>(qMalloc(tableSize * sizeof(uint16)));
- if (!redTable || !greenTable || !blueTable) {
+ uint16 *redTable = 0;
+ uint16 *greenTable = 0;
+ uint16 *blueTable = 0;
+ if (!TIFFGetField(tiff, TIFFTAG_COLORMAP, &redTable, &greenTable, &blueTable)) {
TIFFClose(tiff);
return false;
}
- if (!TIFFGetField(tiff, TIFFTAG_COLORMAP, &redTable, &greenTable, &blueTable)) {
+ if (!redTable || !greenTable || !blueTable) {
TIFFClose(tiff);
return false;
}
@@ -500,6 +500,9 @@ bool QTiffHandler::write(const QImage &image)
uint16 *greenTable = static_cast<uint16 *>(qMalloc(256 * sizeof(uint16)));
uint16 *blueTable = static_cast<uint16 *>(qMalloc(256 * sizeof(uint16)));
if (!redTable || !greenTable || !blueTable) {
+ qFree(redTable);
+ qFree(greenTable);
+ qFree(blueTable);
TIFFClose(tiff);
return false;
}
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 5d3d8d9bf1..98570153b1 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -108,6 +108,7 @@ private:
bool needsInputPanel();
void commitTemporaryPreeditString();
bool isWidgetVisible(QWidget *widget, int offset = 0);
+ bool isPartialKeyboardSupported();
private Q_SLOTS:
void ensureInputCapabilitiesChanged();
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 5fe25b2f33..5ddd53fd89 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -83,6 +83,8 @@ Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable)
{
S60->partial_keyboard = enable;
+ QApplication::setAttribute(Qt::AA_S60DisablePartialScreenInputMode, !S60->partial_keyboard);
+
QInputContext *ic = 0;
if (QApplication::focusWidget()) {
ic = QApplication::focusWidget()->inputContext();
@@ -116,7 +118,7 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_fepState->SetObjectProvider(this);
int defaultFlags = EAknEditorFlagDefault;
if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
- if (S60->partial_keyboard) {
+ if (isPartialKeyboardSupported()) {
defaultFlags |= QT_EAknEditorFlagEnablePartialScreen;
}
defaultFlags |= QT_EAknEditorFlagSelectionVisible;
@@ -425,7 +427,8 @@ void QCoeFepInputContext::mouseHandler(int x, QMouseEvent *event)
//If splitview is open and T9 word is tapped, pass the pointer event to pointer handler.
//This will open the "suggested words" list. Pass pointer position always as zero, to make
//full word replacement in case user makes a selection.
- if (S60->partial_keyboard && S60->partialKeyboardOpen
+ if (isPartialKeyboardSupported()
+ && S60->partialKeyboardOpen
&& m_pointerHandler
&& !(currentHints & Qt::ImhNoPredictiveText)
&& (x > 0 && x < m_preeditString.length())) {
@@ -539,6 +542,11 @@ bool QCoeFepInputContext::isWidgetVisible(QWidget *widget, int offset)
return visible;
}
+bool QCoeFepInputContext::isPartialKeyboardSupported()
+{
+ return (S60->partial_keyboard || !QApplication::testAttribute(Qt::AA_S60DisablePartialScreenInputMode));
+}
+
// Ensure that the input widget is visible in the splitview rect.
void QCoeFepInputContext::ensureFocusWidgetVisible(QWidget *widget)
@@ -650,7 +658,7 @@ void QCoeFepInputContext::updateHints(bool mustUpdateInputCapabilities)
// we need to update its state separately.
if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
TInt currentFlags = m_fepState->Flags();
- if (S60->partial_keyboard)
+ if (isPartialKeyboardSupported())
currentFlags |= QT_EAknEditorFlagEnablePartialScreen;
else
currentFlags &= ~QT_EAknEditorFlagEnablePartialScreen;
@@ -767,7 +775,7 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
flags = 0;
if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
- if (S60->partial_keyboard)
+ if (isPartialKeyboardSupported())
flags |= QT_EAknEditorFlagEnablePartialScreen;
flags |= QT_EAknEditorFlagSelectionVisible;
}
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index f53705b63c..ded4d63bbe 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -60,6 +60,7 @@
#include <private/qabstractitemmodel_p.h>
#ifndef QT_NO_ACCESSIBILITY
#include <qaccessible.h>
+#include <qaccessible2.h>
#endif
#include <private/qsoftkeymanager_p.h>
@@ -645,6 +646,8 @@ void QAbstractItemView::setModel(QAbstractItemModel *model)
this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
disconnect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(_q_rowsRemoved(QModelIndex,int,int)));
+ disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_rowsInserted(QModelIndex,int,int)));
disconnect(d->model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(_q_columnsAboutToBeRemoved(QModelIndex,int,int)));
disconnect(d->model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
@@ -675,6 +678,8 @@ void QAbstractItemView::setModel(QAbstractItemModel *model)
this, SLOT(_q_headerDataChanged()));
connect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(rowsInserted(QModelIndex,int,int)));
+ connect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_rowsInserted(QModelIndex,int,int)));
connect(d->model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
connect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
@@ -1058,6 +1063,14 @@ void QAbstractItemView::reset()
setRootIndex(QModelIndex());
if (d->selectionModel)
d->selectionModel->reset();
+#ifndef QT_NO_ACCESSIBILITY
+#ifdef Q_WS_X11
+ if (QAccessible::isActive()) {
+ QAccessible::queryAccessibleInterface(this)->table2Interface()->modelReset();
+ QAccessible::updateAccessibility(this, 0, QAccessible::TableModelChanged);
+ }
+#endif
+#endif
}
/*!
@@ -2805,7 +2818,7 @@ void QAbstractItemView::editorDestroyed(QObject *editor)
*/
void QAbstractItemView::setHorizontalStepsPerItem(int steps)
{
- Q_UNUSED(steps);
+ Q_UNUSED(steps)
// do nothing
}
@@ -2834,7 +2847,7 @@ int QAbstractItemView::horizontalStepsPerItem() const
*/
void QAbstractItemView::setVerticalStepsPerItem(int steps)
{
- Q_UNUSED(steps);
+ Q_UNUSED(steps)
// do nothing
}
@@ -3267,12 +3280,24 @@ void QAbstractItemView::rowsAboutToBeRemoved(const QModelIndex &parent, int star
rows are those under the given \a parent from \a start to \a end
inclusive.
*/
-void QAbstractItemViewPrivate::_q_rowsRemoved(const QModelIndex &, int, int)
+void QAbstractItemViewPrivate::_q_rowsRemoved(const QModelIndex &index, int start, int end)
{
+ Q_UNUSED(index)
+ Q_UNUSED(start)
+ Q_UNUSED(end)
+
Q_Q(QAbstractItemView);
if (q->isVisible())
q->updateEditorGeometries();
q->setState(QAbstractItemView::NoState);
+#ifndef QT_NO_ACCESSIBILITY
+#ifdef Q_WS_X11
+ if (QAccessible::isActive()) {
+ QAccessible::queryAccessibleInterface(q)->table2Interface()->rowsRemoved(index, start, end);
+ QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
+ }
+#endif
+#endif
}
/*!
@@ -3335,27 +3360,72 @@ void QAbstractItemViewPrivate::_q_columnsAboutToBeRemoved(const QModelIndex &par
rows are those under the given \a parent from \a start to \a end
inclusive.
*/
-void QAbstractItemViewPrivate::_q_columnsRemoved(const QModelIndex &, int, int)
+void QAbstractItemViewPrivate::_q_columnsRemoved(const QModelIndex &index, int start, int end)
{
+ Q_UNUSED(index)
+ Q_UNUSED(start)
+ Q_UNUSED(end)
+
Q_Q(QAbstractItemView);
if (q->isVisible())
q->updateEditorGeometries();
q->setState(QAbstractItemView::NoState);
+#ifndef QT_NO_ACCESSIBILITY
+#ifdef Q_WS_X11
+ if (QAccessible::isActive()) {
+ QAccessible::queryAccessibleInterface(q)->table2Interface()->columnsRemoved(index, start, end);
+ QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
+ }
+#endif
+#endif
}
+
/*!
\internal
This slot is called when rows have been inserted.
*/
-void QAbstractItemViewPrivate::_q_columnsInserted(const QModelIndex &, int, int)
+void QAbstractItemViewPrivate::_q_rowsInserted(const QModelIndex &index, int start, int end)
{
+ Q_UNUSED(index)
+ Q_UNUSED(start)
+ Q_UNUSED(end)
+
Q_Q(QAbstractItemView);
- if (q->isVisible())
- q->updateEditorGeometries();
+#ifndef QT_NO_ACCESSIBILITY
+#ifdef Q_WS_X11
+ if (QAccessible::isActive()) {
+ QAccessible::queryAccessibleInterface(q)->table2Interface()->rowsInserted(index, start, end);
+ QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
+ }
+#endif
+#endif
}
+/*!
+ \internal
+ This slot is called when columns have been inserted.
+*/
+void QAbstractItemViewPrivate::_q_columnsInserted(const QModelIndex &index, int start, int end)
+{
+ Q_UNUSED(index)
+ Q_UNUSED(start)
+ Q_UNUSED(end)
+
+ Q_Q(QAbstractItemView);
+ if (q->isVisible())
+ q->updateEditorGeometries();
+#ifndef QT_NO_ACCESSIBILITY
+#ifdef Q_WS_X11
+ if (QAccessible::isActive()) {
+ QAccessible::queryAccessibleInterface(q)->table2Interface()->columnsInserted(index, start, end);
+ QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
+ }
+#endif
+#endif
+}
/*!
\internal
@@ -3373,7 +3443,16 @@ void QAbstractItemViewPrivate::_q_modelDestroyed()
*/
void QAbstractItemViewPrivate::_q_layoutChanged()
{
+ Q_Q(QAbstractItemView);
doDelayedItemsLayout();
+#ifndef QT_NO_ACCESSIBILITY
+#ifdef Q_WS_X11
+ if (QAccessible::isActive()) {
+ QAccessible::queryAccessibleInterface(q)->table2Interface()->modelReset();
+ QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
+ }
+#endif
+#endif
}
/*!
@@ -3698,7 +3777,7 @@ QItemSelectionModel::SelectionFlags QAbstractItemView::selectionCommand(const QM
QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::multiSelectionCommand(
const QModelIndex &index, const QEvent *event) const
{
- Q_UNUSED(index);
+ Q_UNUSED(index)
if (event) {
switch (event->type()) {
diff --git a/src/gui/itemviews/qabstractitemview.h b/src/gui/itemviews/qabstractitemview.h
index cb7b78df89..1d0c36e76a 100644
--- a/src/gui/itemviews/qabstractitemview.h
+++ b/src/gui/itemviews/qabstractitemview.h
@@ -355,6 +355,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_columnsAboutToBeRemoved(const QModelIndex&, int, int))
Q_PRIVATE_SLOT(d_func(), void _q_columnsRemoved(const QModelIndex&, int, int))
Q_PRIVATE_SLOT(d_func(), void _q_columnsInserted(const QModelIndex&, int, int))
+ Q_PRIVATE_SLOT(d_func(), void _q_rowsInserted(const QModelIndex&, int, int))
Q_PRIVATE_SLOT(d_func(), void _q_rowsRemoved(const QModelIndex&, int, int))
Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())
Q_PRIVATE_SLOT(d_func(), void _q_layoutChanged())
diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h
index 3ba72277b6..04babde9e2 100644
--- a/src/gui/itemviews/qabstractitemview_p.h
+++ b/src/gui/itemviews/qabstractitemview_p.h
@@ -108,6 +108,7 @@ public:
void init();
virtual void _q_rowsRemoved(const QModelIndex &parent, int start, int end);
+ virtual void _q_rowsInserted(const QModelIndex &parent, int start, int end);
virtual void _q_columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
virtual void _q_columnsRemoved(const QModelIndex &parent, int start, int end);
virtual void _q_columnsInserted(const QModelIndex &parent, int start, int end);
diff --git a/src/gui/itemviews/qabstractproxymodel.cpp b/src/gui/itemviews/qabstractproxymodel.cpp
index 48c84acb56..f00b7eedb4 100644
--- a/src/gui/itemviews/qabstractproxymodel.cpp
+++ b/src/gui/itemviews/qabstractproxymodel.cpp
@@ -298,6 +298,7 @@ bool QAbstractProxyModel::setHeaderData(int section, Qt::Orientation orientation
/*!
\reimp
+ \since 4.8
*/
QModelIndex QAbstractProxyModel::buddy(const QModelIndex &index) const
{
@@ -307,6 +308,7 @@ QModelIndex QAbstractProxyModel::buddy(const QModelIndex &index) const
/*!
\reimp
+ \since 4.8
*/
bool QAbstractProxyModel::canFetchMore(const QModelIndex &parent) const
{
@@ -316,6 +318,7 @@ bool QAbstractProxyModel::canFetchMore(const QModelIndex &parent) const
/*!
\reimp
+ \since 4.8
*/
void QAbstractProxyModel::fetchMore(const QModelIndex &parent)
{
@@ -325,6 +328,7 @@ void QAbstractProxyModel::fetchMore(const QModelIndex &parent)
/*!
\reimp
+ \since 4.8
*/
void QAbstractProxyModel::sort(int column, Qt::SortOrder order)
{
@@ -334,6 +338,7 @@ void QAbstractProxyModel::sort(int column, Qt::SortOrder order)
/*!
\reimp
+ \since 4.8
*/
QSize QAbstractProxyModel::span(const QModelIndex &index) const
{
@@ -343,6 +348,7 @@ QSize QAbstractProxyModel::span(const QModelIndex &index) const
/*!
\reimp
+ \since 4.8
*/
bool QAbstractProxyModel::hasChildren(const QModelIndex &parent) const
{
@@ -352,6 +358,7 @@ bool QAbstractProxyModel::hasChildren(const QModelIndex &parent) const
/*!
\reimp
+ \since 4.8
*/
QMimeData* QAbstractProxyModel::mimeData(const QModelIndexList &indexes) const
{
@@ -364,6 +371,7 @@ QMimeData* QAbstractProxyModel::mimeData(const QModelIndexList &indexes) const
/*!
\reimp
+ \since 4.8
*/
QStringList QAbstractProxyModel::mimeTypes() const
{
@@ -373,6 +381,7 @@ QStringList QAbstractProxyModel::mimeTypes() const
/*!
\reimp
+ \since 4.8
*/
Qt::DropActions QAbstractProxyModel::supportedDropActions() const
{
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index a234fdee85..a0955d256e 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -3168,7 +3168,11 @@ void QListView::currentChanged(const QModelIndex &current, const QModelIndex &pr
if (QAccessible::isActive()) {
if (current.isValid()) {
int entry = visualIndex(current) + 1;
+#ifdef Q_WS_X11
+ QAccessible::updateAccessibility(this, entry, QAccessible::Focus);
+#else
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Focus);
+#endif
}
}
#endif
@@ -3187,12 +3191,20 @@ void QListView::selectionChanged(const QItemSelection &selected,
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
int entry = visualIndex(sel) + 1;
+#ifdef Q_WS_X11
+ QAccessible::updateAccessibility(this, entry, QAccessible::Selection);
+#else
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Selection);
+#endif
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
int entry = visualIndex(desel) + 1;
+#ifdef Q_WS_X11
+ QAccessible::updateAccessibility(this, entry, QAccessible::SelectionRemove);
+#else
QAccessible::updateAccessibility(viewport(), entry, QAccessible::SelectionRemove);
+#endif
}
}
#endif
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 617409ff3f..6f532eb7c7 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -3164,10 +3164,16 @@ void QTableView::currentChanged(const QModelIndex &current, const QModelIndex &p
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
if (current.isValid()) {
+#ifdef Q_WS_X11
+ Q_D(QTableView);
+ int entry = d->accessibleTable2Index(current);
+ QAccessible::updateAccessibility(this, entry, QAccessible::Focus);
+#else
int entry = visualIndex(current) + 1;
if (horizontalHeader())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Focus);
+#endif
}
}
#endif
@@ -3180,22 +3186,33 @@ void QTableView::currentChanged(const QModelIndex &current, const QModelIndex &p
void QTableView::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
{
+ Q_D(QTableView);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
+#ifdef Q_WS_X11
+ int entry = d->accessibleTable2Index(sel);
+ QAccessible::updateAccessibility(this, entry, QAccessible::Selection);
+#else
int entry = visualIndex(sel);
if (horizontalHeader())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Selection);
+#endif
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
+#ifdef Q_WS_X11
+ int entry = d->accessibleTable2Index(sel);
+ QAccessible::updateAccessibility(this, entry, QAccessible::SelectionRemove);
+#else
int entry = visualIndex(sel);
if (horizontalHeader())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::SelectionRemove);
+#endif
}
}
#endif
diff --git a/src/gui/itemviews/qtableview_p.h b/src/gui/itemviews/qtableview_p.h
index f973acf3ce..dce0ed06ac 100644
--- a/src/gui/itemviews/qtableview_p.h
+++ b/src/gui/itemviews/qtableview_p.h
@@ -167,6 +167,11 @@ public:
return horizontalHeader->logicalIndex(visualCol);
}
+ inline int accessibleTable2Index(const QModelIndex &index) const {
+ return (index.row() + (horizontalHeader ? 1 : 0)) * (index.model()->columnCount() + (verticalHeader ? 1 : 0))
+ + index.column() + (verticalHeader ? 1 : 0) + 1;
+ }
+
int sectionSpanEndLogical(const QHeaderView *header, int logical, int span) const;
int sectionSpanSize(const QHeaderView *header, int logical, int span) const;
bool spanContainsSection(const QHeaderView *header, int logical, int spanLogical, int span) const;
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 6a992dbab6..9228ac82a2 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -54,6 +54,7 @@
#include <qdebug.h>
#ifndef QT_NO_ACCESSIBILITY
#include <qaccessible.h>
+#include <qaccessible2.h>
#endif
#include <private/qtreeview_p.h>
@@ -2883,20 +2884,36 @@ void QTreeViewPrivate::expand(int item, bool emitSignal)
void QTreeViewPrivate::insertViewItems(int pos, int count, const QTreeViewItem &viewItem)
{
+ Q_Q(QTreeView);
viewItems.insert(pos, count, viewItem);
QTreeViewItem *items = viewItems.data();
for (int i = pos + count; i < viewItems.count(); i++)
if (items[i].parentItem >= pos)
items[i].parentItem += count;
+#ifndef QT_NO_ACCESSIBILITY
+#ifdef Q_WS_X11
+ if (QAccessible::isActive()) {
+ QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
+ }
+#endif
+#endif
}
void QTreeViewPrivate::removeViewItems(int pos, int count)
{
+ Q_Q(QTreeView);
viewItems.remove(pos, count);
QTreeViewItem *items = viewItems.data();
for (int i = pos; i < viewItems.count(); i++)
if (items[i].parentItem >= pos)
items[i].parentItem -= count;
+#ifndef QT_NO_ACCESSIBILITY
+#ifdef Q_WS_X11
+ if (QAccessible::isActive()) {
+ QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
+ }
+#endif
+#endif
}
#if 0
@@ -3687,14 +3704,6 @@ void QTreeViewPrivate::_q_sortIndicatorChanged(int column, Qt::SortOrder order)
*/
void QTreeView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
-#ifndef QT_NO_ACCESSIBILITY
- if (QAccessible::isActive()) {
- int entry = visualIndex(current) + 1;
- if (header())
- ++entry;
- QAccessible::updateAccessibility(viewport(), entry, QAccessible::Focus);
- }
-#endif
QAbstractItemView::currentChanged(current, previous);
if (allColumnsShowFocus()) {
@@ -3711,6 +3720,19 @@ void QTreeView::currentChanged(const QModelIndex &current, const QModelIndex &pr
viewport()->update(currentRect);
}
}
+#ifndef QT_NO_ACCESSIBILITY
+ if (QAccessible::isActive() && current.isValid()) {
+#ifdef Q_WS_X11
+ int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column() + 1;
+ QAccessible::updateAccessibility(this, entry, QAccessible::Focus);
+#else
+ int entry = visualIndex(current) + 1;
+ if (header())
+ ++entry;
+ QAccessible::updateAccessibility(viewport(), entry, QAccessible::Focus);
+#endif
+ }
+#endif
}
/*!
@@ -3719,26 +3741,38 @@ void QTreeView::currentChanged(const QModelIndex &current, const QModelIndex &pr
void QTreeView::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
{
+ QAbstractItemView::selectionChanged(selected, deselected);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
+#ifdef Q_WS_X11
+ int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column() + 1;
+ Q_ASSERT(entry > 0);
+ QAccessible::updateAccessibility(this, entry, QAccessible::Selection);
+#else
int entry = visualIndex(sel) + 1;
if (header())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Selection);
+#endif
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
+#ifdef Q_WS_X11
+ int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column() + 1;
+ Q_ASSERT(entry > 0);
+ QAccessible::updateAccessibility(this, entry, QAccessible::SelectionRemove);
+#else
int entry = visualIndex(desel) + 1;
if (header())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::SelectionRemove);
+#endif
}
}
#endif
- QAbstractItemView::selectionChanged(selected, deselected);
}
int QTreeView::visualIndex(const QModelIndex &index) const
diff --git a/src/gui/itemviews/qtreeview.h b/src/gui/itemviews/qtreeview.h
index 26c73153e9..b77da4e89a 100644
--- a/src/gui/itemviews/qtreeview.h
+++ b/src/gui/itemviews/qtreeview.h
@@ -219,6 +219,9 @@ protected:
private:
friend class QAccessibleItemView;
+ friend class QAccessibleTable2;
+ friend class QAccessibleTree;
+ friend class QAccessibleTable2Cell;
int visualIndex(const QModelIndex &index) const;
Q_DECLARE_PRIVATE(QTreeView)
diff --git a/src/gui/itemviews/qtreeview_p.h b/src/gui/itemviews/qtreeview_p.h
index b6d84586ee..a9dc452398 100644
--- a/src/gui/itemviews/qtreeview_p.h
+++ b/src/gui/itemviews/qtreeview_p.h
@@ -78,7 +78,7 @@ struct QTreeViewItem
Q_DECLARE_TYPEINFO(QTreeViewItem, Q_MOVABLE_TYPE);
-class QTreeViewPrivate : public QAbstractItemViewPrivate
+class Q_GUI_EXPORT QTreeViewPrivate : public QAbstractItemViewPrivate
{
Q_DECLARE_PUBLIC(QTreeView)
public:
@@ -223,6 +223,10 @@ public:
inline void invalidateHeightCache(int item) const
{ viewItems[item].height = 0; }
+ inline int accessibleTable2Index(const QModelIndex &index) const {
+ return (viewIndex(index) + (header ? 1 : 0)) * model->columnCount()+index.column() + 1;
+ }
+
// used for spanning rows
QVector<QPersistentModelIndex> spanningIndexes;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 361ec6ddec..cd13894609 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -1019,6 +1019,10 @@ void QApplicationPrivate::initialize()
QApplicationPrivate::wheel_scroll_lines = 3;
#endif
+#ifdef Q_WS_S60
+ q->setAttribute(Qt::AA_S60DisablePartialScreenInputMode);
+#endif
+
if (qt_is_gui_used)
initializeMultitouch();
}
diff --git a/src/gui/kernel/qgenericplugin_qpa.cpp b/src/gui/kernel/qgenericplugin_qpa.cpp
index e7b65b730e..dae512d04e 100644
--- a/src/gui/kernel/qgenericplugin_qpa.cpp
+++ b/src/gui/kernel/qgenericplugin_qpa.cpp
@@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE
\class QGenericPlugin
\ingroup plugins
\ingroup qpa
+ \since 4.8
\brief The QGenericPlugin class is an abstract base class for
window-system related plugins in Qt QPA.
diff --git a/src/gui/kernel/qgenericpluginfactory_qpa.cpp b/src/gui/kernel/qgenericpluginfactory_qpa.cpp
index fb6a0d85fd..86e146a79a 100644
--- a/src/gui/kernel/qgenericpluginfactory_qpa.cpp
+++ b/src/gui/kernel/qgenericpluginfactory_qpa.cpp
@@ -61,6 +61,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
/*!
\class QGenericPluginFactory
\ingroup qpa
+ \since 4.8
\brief The QGenericPluginFactory class creates window-system
related plugin drivers in Qt QPA.
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 117b72fd30..5fc72d4f6f 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -933,7 +933,7 @@ QKeySequence::QKeySequence(const QString &key)
}
/*!
- \since 4.x
+ \since 4.7
Creates a key sequence from the \a key string based on \a format.
*/
QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat format)
@@ -1130,7 +1130,7 @@ int QKeySequence::assign(const QString &ks)
/*!
\fn int QKeySequence::assign(const QString &keys, QKeySequence::SequenceFormat format)
- \since 4.x
+ \since 4.7
Adds the given \a keys to the key sequence (based on \a format).
\a keys may contain up to four key codes, provided they are
diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp
index 06954864f2..04262265ec 100644
--- a/src/gui/kernel/qplatformcursor_qpa.cpp
+++ b/src/gui/kernel/qplatformcursor_qpa.cpp
@@ -53,6 +53,7 @@ QList <QWeakPointer<QPlatformCursor> > QPlatformCursorPrivate::instances;
/*!
\class QPlatformCursor
+ \since 4.8
\brief The QPlatformCursor class provides information about
pointer device events (movement, buttons), and requests to change
@@ -105,6 +106,7 @@ QPlatformCursor::QPlatformCursor(QPlatformScreen *scr )
/*!
\class QPlatformCursorImage
+ \since 4.8
\brief The QPlatformCursorImage class provides a set of graphics
intended to be used as cursors.
diff --git a/src/gui/kernel/qplatformwindowformat_qpa.cpp b/src/gui/kernel/qplatformwindowformat_qpa.cpp
index 482ae68a2b..4ab8dfd727 100644
--- a/src/gui/kernel/qplatformwindowformat_qpa.cpp
+++ b/src/gui/kernel/qplatformwindowformat_qpa.cpp
@@ -101,11 +101,11 @@ public:
/*!
\class QPlatformWindowFormat
+ \ingroup painting
+ \since 4.8
\brief The QPlatformWindowFormat class specifies the display format of an OpenGL
rendering context and if possible attributes of the corresponding QPlatformWindow.
- \ingroup painting
-
QWidget has a setter and getter function for QPlatformWindowFormat. These functions can be used
by the application programmer to signal what kind of format he wants to the window and glcontext
should have. However, it is not always possible to fulfill these requirements. The application
@@ -937,6 +937,8 @@ void QPlatformWindowFormat::setDefaultFormat(const QPlatformWindowFormat &f)
/*!
+ \since 4.8
+
Returns true if all the options of the two QPlatformWindowFormat objects
\a a and \a b are equal; otherwise returns false.
@@ -960,6 +962,8 @@ bool operator==(const QPlatformWindowFormat& a, const QPlatformWindowFormat& b)
/*!
+ \since 4.8
+
Returns false if all the options of the two QPlatformWindowFormat objects
\a a and \a b are equal; otherwise returns true.
diff --git a/src/gui/kernel/qsizepolicy.qdoc b/src/gui/kernel/qsizepolicy.qdoc
index 593560ee7f..7002ed3203 100644
--- a/src/gui/kernel/qsizepolicy.qdoc
+++ b/src/gui/kernel/qsizepolicy.qdoc
@@ -263,6 +263,7 @@
/*!
\fn void QSizePolicy::setWidthForHeight(bool dependent)
+ \since 4.8
Sets the flag determining whether the widget's width
depends on its height, to \a dependent.
@@ -276,6 +277,7 @@
/*!
\fn bool QSizePolicy::hasWidthForHeight() const
+ \since 4.8
Returns true if the widget's width depends on its
height; otherwise returns false.
diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp
index 56c3010535..224f574baf 100644
--- a/src/gui/kernel/qwidget_qpa.cpp
+++ b/src/gui/kernel/qwidget_qpa.cpp
@@ -690,6 +690,7 @@ int QWidget::metric(PaintDeviceMetric m) const
/*!
\preliminary
+ \since 4.8
Sets the window to be the platform \a window specified.
@@ -710,6 +711,7 @@ void QWidget::setPlatformWindow(QPlatformWindow *window)
/*!
\preliminary
+ \since 4.8
Returns the QPlatformWindow this widget will be drawn into.
*/
@@ -724,6 +726,8 @@ QPlatformWindow *QWidget::platformWindow() const
}
/*!
+ \since 4.8
+
Sets the platform window format for the widget to the \a format specified.
*/
void QWidget::setPlatformWindowFormat(const QPlatformWindowFormat &format)
@@ -743,6 +747,8 @@ void QWidget::setPlatformWindowFormat(const QPlatformWindowFormat &format)
}
/*!
+ \since 4.8
+
Returns the platform window format for the widget.
*/
QPlatformWindowFormat QWidget::platformWindowFormat() const
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index eaa9405c36..f99cc2c8b1 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -2879,6 +2879,12 @@ void QWidgetPrivate::deleteTLSysExtra()
{
// don't destroy input context here. it will be destroyed in
// QWidget::destroy() destroyInputContext();
+#ifndef QT_NO_XSYNC
+ if (extra && extra->topextra && extra->topextra->syncUpdateCounter) {
+ XSyncDestroyCounter(X11->display, extra->topextra->syncUpdateCounter);
+ extra->topextra->syncUpdateCounter = 0;
+ }
+#endif
}
void QWidgetPrivate::registerDropSite(bool on)
diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h
index 399dd89140..f1f7eb155a 100644
--- a/src/gui/painting/qbezier_p.h
+++ b/src/gui/painting/qbezier_p.h
@@ -162,27 +162,27 @@ inline void QBezier::coefficients(qreal t, qreal &a, qreal &b, qreal &c, qreal &
inline QPointF QBezier::pointAt(qreal t) const
{
-#if 1
- qreal a, b, c, d;
- coefficients(t, a, b, c, d);
- return QPointF(a*x1 + b*x2 + c*x3 + d*x4, a*y1 + b*y2 + c*y3 + d*y4);
-#else
// numerically more stable:
+ qreal x, y;
+
qreal m_t = 1. - t;
- qreal a = x1*m_t + x2*t;
- qreal b = x2*m_t + x3*t;
- qreal c = x3*m_t + x4*t;
- a = a*m_t + b*t;
- b = b*m_t + c*t;
- qreal x = a*m_t + b*t;
- qreal a = y1*m_t + y2*t;
- qreal b = y2*m_t + y3*t;
- qreal c = y3*m_t + y4*t;
- a = a*m_t + b*t;
- b = b*m_t + c*t;
- qreal y = a*m_t + b*t;
+ {
+ qreal a = x1*m_t + x2*t;
+ qreal b = x2*m_t + x3*t;
+ qreal c = x3*m_t + x4*t;
+ a = a*m_t + b*t;
+ b = b*m_t + c*t;
+ x = a*m_t + b*t;
+ }
+ {
+ qreal a = y1*m_t + y2*t;
+ qreal b = y2*m_t + y3*t;
+ qreal c = y3*m_t + y4*t;
+ a = a*m_t + b*t;
+ b = b*m_t + c*t;
+ y = a*m_t + b*t;
+ }
return QPointF(x, y);
-#endif
}
inline QPointF QBezier::normalVector(qreal t) const
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index 994986b0d6..147d2ecf2c 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -1611,6 +1611,8 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p
&& (fill.style() != Qt::NoBrush)
&& ((has_fill_texture && fill.texture().hasAlpha()) || antialias || !solid_fill || has_alpha_pen != has_alpha_brush))
{
+ tessellator->tessellate((QPointF *)clippedPoints, clippedCount,
+ mode == QPaintEngine::WindingMode);
if (tessellator->size > 0) {
XRenderPictureAttributes attrs;
attrs.poly_edge = antialias ? PolyEdgeSmooth : PolyEdgeSharp;
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 435e12ae7b..1d10d756a3 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -6469,10 +6469,16 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
QLineF line(pos.x(), pos.y(), pos.x() + qFloor(width), pos.y());
- const qreal underlineOffset = fe->underlinePosition().toReal();
+ qreal underlineOffset = fe->underlinePosition().toReal();
+ qreal y = pos.y();
+ // compensate for different rounding rule in Core Graphics paint engine,
+ // ideally code like this should be moved to respective engines.
+ if (painter->paintEngine()->type() == QPaintEngine::CoreGraphics) {
+ y = qCeil(y);
+ }
// deliberately ceil the offset to avoid the underline coming too close to
// the text above it.
- const qreal underlinePos = pos.y() + qCeil(underlineOffset);
+ const qreal underlinePos = y + qCeil(underlineOffset);
if (underlineStyle == QTextCharFormat::SpellCheckUnderline) {
underlineStyle = QTextCharFormat::UnderlineStyle(QApplication::style()->styleHint(QStyle::SH_SpellCheckUnderlineStyle));
@@ -6646,6 +6652,10 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
qreal x = p.x();
qreal y = p.y();
+ bool rtl = ti.flags & QTextItem::RightToLeft;
+ if (rtl)
+ x += ti.width.toReal();
+
int start = 0;
int end, i;
for (end = 0; end < ti.glyphs.numGlyphs; ++end) {
@@ -6662,14 +6672,19 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
ti2.width += ti.glyphs.effectiveAdvance(i);
}
+ if (rtl)
+ x -= ti2.width.toReal();
+
d->engine->drawTextItem(QPointF(x, y), ti2);
+ if (!rtl)
+ x += ti2.width.toReal();
+
// reset the high byte for all glyphs and advance to the next sub-string
const int hi = which << 24;
for (i = start; i < end; ++i) {
glyphs.glyphs[i] = hi | glyphs.glyphs[i];
}
- x += ti2.width.toReal();
// change engine
start = end;
@@ -6684,6 +6699,9 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
ti2.width += ti.glyphs.effectiveAdvance(i);
}
+ if (rtl)
+ x -= ti2.width.toReal();
+
if (d->extended)
d->extended->drawTextItem(QPointF(x, y), ti2);
else
diff --git a/src/gui/painting/qprinterinfo.cpp b/src/gui/painting/qprinterinfo.cpp
index a7ddc85a54..c00a1cc103 100644
--- a/src/gui/painting/qprinterinfo.cpp
+++ b/src/gui/painting/qprinterinfo.cpp
@@ -79,6 +79,8 @@ QPrinterInfo::QPrinterInfo()
}
/*!
+ \since 4.8
+
Constructs a copy of \a other.
*/
QPrinterInfo::QPrinterInfo(const QPrinterInfo &other)
@@ -117,6 +119,8 @@ QPrinterInfo::~QPrinterInfo()
}
/*!
+ \since 4.8
+
Sets the QPrinterInfo object to be equal to \a other.
*/
QPrinterInfo &QPrinterInfo::operator=(const QPrinterInfo &other)
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index fdba9c99ea..3973abd218 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -198,7 +198,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
Coord c = { 0, 0, // will be filled in later
glyph_width,
glyph_height, // texture coords
- metrics.x.round().truncate(),
+ metrics.x.truncate(),
-metrics.y.truncate() }; // baseline for horizontal scripts
listItemCoordinates.insert(key, c);
@@ -367,9 +367,7 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
int QImageTextureGlyphCache::glyphMargin() const
{
-#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA))
- return 1;
-#elif defined(Q_WS_X11)
+#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) || defined(Q_WS_X11)
return 0;
#else
return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
diff --git a/src/gui/s60framework/qs60keycapture.cpp b/src/gui/s60framework/qs60keycapture.cpp
index 415c3e17d0..1beefd43c5 100644
--- a/src/gui/s60framework/qs60keycapture.cpp
+++ b/src/gui/s60framework/qs60keycapture.cpp
@@ -42,7 +42,7 @@
#include <remconinterfaceselector.h>
#include <remconcoreapitarget.h>
#include <coemain.h>
-#include "qkeymapper_p.h"
+#include <private/qkeymapper_p.h>
#include "qs60keycapture_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 40c28f6674..8436856e81 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -1195,15 +1195,15 @@ QRect QMacStylePrivate::comboboxEditBounds(const QRect &outerBounds, const HIThe
QRect ret = outerBounds;
switch (bdi.kind){
case kThemeComboBox:
- ret.adjust(5, 8, -21, -4);
+ ret.adjust(5, 8, -22, -4);
break;
case kThemeComboBoxSmall:
- ret.adjust(4, 5, -18, 0);
- ret.setHeight(16);
+ ret.adjust(4, 6, -20, 0);
+ ret.setHeight(14);
break;
case kThemeComboBoxMini:
- ret.adjust(4, 5, -16, 0);
- ret.setHeight(13);
+ ret.adjust(4, 5, -18, -1);
+ ret.setHeight(12);
break;
case kThemePopupButton:
ret.adjust(10, 3, -23, -3);
@@ -3681,9 +3681,27 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled,
tab->text, QPalette::WindowText);
p->restore();
- }
+ QCommonStyle::drawControl(ce, &myTab, p, w);
+ } else if (qMacVersion() >= QSysInfo::MV_10_7 && (tab->state & State_Selected)) {
+ p->save();
+ rotateTabPainter(p, myTab.shape, myTab.rect);
- QCommonStyle::drawControl(ce, &myTab, p, w);
+ QPalette np = tab->palette;
+ np.setColor(QPalette::WindowText, QColor(0, 0, 0, 75));
+ QRect nr = subElementRect(SE_TabBarTabText, opt, w);
+ nr.moveTop(-1);
+ int alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextHideMnemonic;
+ proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled,
+ tab->text, QPalette::WindowText);
+
+ np.setColor(QPalette::WindowText, QColor(255, 255, 255, 255));
+ nr.moveTop(-2);
+ proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled,
+ tab->text, QPalette::WindowText);
+ p->restore();
+ } else {
+ QCommonStyle::drawControl(ce, &myTab, p, w);
+ }
} else {
p->save();
CGContextSetShouldAntialias(cg, true);
@@ -4707,7 +4725,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
HIThemeFrameDrawInfo fdi;
fdi.version = qt_mac_hitheme_version;
- fdi.state = tds;
+ fdi.state = ((sb->state & State_ReadOnly) || !(sb->state & State_Enabled)) ? kThemeStateInactive : kThemeStateActive;
fdi.kind = kHIThemeFrameTextFieldSquare;
fdi.isFocused = false;
HIRect hirect = qt_hirectForQRect(lineeditRect);
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index b47b4c8e55..e9f7a86a35 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -141,6 +141,7 @@ const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameEleme
{SE_Editor, QS60StyleEnums::SP_QsnFrInputCenter},
{SE_TableItemPressed, QS60StyleEnums::SP_QsnFrGridCenterPressed},
{SE_ListItemPressed, QS60StyleEnums::SP_QsnFrListCenterPressed},
+ {SE_DialogBackground, QS60StyleEnums::SP_QsnFrPopupCenter},
};
static const int frameElementsCount =
@@ -263,6 +264,9 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter,
case SE_PopupBackground:
drawFrame(SF_PopupBackground, painter, rect, flags | SF_PointNorth);
break;
+ case SE_DialogBackground:
+ drawFrame(SF_DialogBackground, painter, rect, flags | SF_PointNorth);
+ break;
case SE_SettingsList:
drawFrame(SF_SettingsList, painter, rect, flags | SF_PointNorth);
break;
@@ -497,8 +501,10 @@ bool QS60StylePrivate::equalToThemePalette(qint64 cacheKey, QPalette::ColorRole
{
if (!m_themePalette)
return false;
- if (cacheKey == m_themePalette->brush(role).texture().cacheKey())
+ if ((m_placeHolderTexture && (cacheKey == m_placeHolderTexture->cacheKey()))
+ || (cacheKey == m_themePalette->brush(role).texture().cacheKey()))
return true;
+
return false;
}
@@ -2261,10 +2267,14 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget)
&& QS60StylePrivate::equalToThemePalette(option->palette.window().texture().cacheKey(), QPalette::Window)) {
const bool comboMenu = qobject_cast<const QComboBoxListView *>(widget);
+ const bool menu = qobject_cast<const QMenu *>(widget);
// Add margin area to the background, to avoid background being cut for first and last item.
const int verticalMenuAdjustment = comboMenu ? QS60StylePrivate::pixelMetric(PM_MenuVMargin) : 0;
const QRect adjustedMenuRect = option->rect.adjusted(0, -verticalMenuAdjustment, 0, verticalMenuAdjustment);
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PopupBackground, painter, adjustedMenuRect, flags);
+ if (comboMenu || menu)
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PopupBackground, painter, adjustedMenuRect, flags);
+ else
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_DialogBackground, painter, adjustedMenuRect, flags);
} else {
commonStyleDraws = true;
}
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index de3cab77a5..2fa8c7fdea 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -541,6 +541,7 @@ public:
SE_DropArea,
SE_TableItemPressed,
SE_ListItemPressed,
+ SE_DialogBackground,
};
enum SkinFrameElements {
@@ -560,6 +561,7 @@ public:
SF_ButtonInactive,
SF_TableItemPressed,
SF_ListItemPressed,
+ SF_DialogBackground,
};
enum SkinElementFlag {
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 59d5da4ab0..913352a904 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -1160,6 +1160,10 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme
centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu);
frameId.Set(KAknsIIDQsnFrPopupSub);
break;
+ case QS60StylePrivate::SF_DialogBackground:
+ centerId.Set(KAknsIIDQsnFrPopupCenter);
+ frameId.Set(KAknsIIDQsnFrPopup);
+ break;
case QS60StylePrivate::SF_SettingsList:
// Starting from S60_5_3, the root theme has been changed so that KAknsIIDQsnFrSetOpt is empty.
// Set the theme ID to None, to avoid theme server trying to draw the empty frame.
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index da484bafe1..b894eb43a0 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -76,6 +76,10 @@ static const int windowsRightBorder = 15; // right border on windows
# define CMDLGS_PRESSED 3
# define CMDLGS_DISABLED 4
#endif
+#ifndef PP_TRANSPARENTBAR
+# define PP_TRANSPARENTBAR 11
+# define PP_TRANSPARENTBARVERT 12
+#endif
// Runtime resolved theme engine function calls
@@ -1059,6 +1063,19 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
}
break;
#ifndef QT_NO_PROGRESSBAR
+ case CE_ProgressBarGroove:
+ {
+ Qt::Orientation orient = Qt::Horizontal;
+ if (const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(option))
+ orient = pb2->orientation;
+ partId = (orient == Qt::Horizontal) ? PP_TRANSPARENTBAR : PP_TRANSPARENTBARVERT;
+ name = QLatin1String("PROGRESS");
+ stateId = 1;
+
+ XPThemeData theme(widget, painter, name, partId, stateId, rect);
+ d->drawBackground(theme);
+ }
+ break;
case CE_ProgressBarContents:
if (const QStyleOptionProgressBar *bar
= qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 98186dfd9b..26d9f2c0db 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -218,16 +218,14 @@ struct QtFontStyle
Key(const QString &styleString);
Key() : style(QFont::StyleNormal),
weight(QFont::Normal), stretch(0) { }
- Key(const Key &o) : style(o.style),
- weight(o.weight), stretch(o.stretch) { }
+ Key(const Key &o) : style(o.style), weight(o.weight), stretch(o.stretch) { }
uint style : 2;
signed int weight : 8;
signed int stretch : 12;
bool operator==(const Key & other) {
- return (style == other.style &&
- weight == other.weight &&
- (stretch == 0 || other.stretch == 0 || stretch == other.stretch));
+ return (style == other.style && weight == other.weight &&
+ (stretch == 0 || other.stretch == 0 || stretch == other.stretch));
}
bool operator!=(const Key &other) {
return !operator==(other);
@@ -279,6 +277,7 @@ struct QtFontStyle
bool smoothScalable : 1;
signed int count : 30;
QtFontSize *pixelSizes;
+ QString styleName;
#ifdef Q_WS_X11
const char *weightName;
@@ -353,13 +352,20 @@ struct QtFontFoundry
int count;
QtFontStyle **styles;
- QtFontStyle *style(const QtFontStyle::Key &, bool = false);
+ QtFontStyle *style(const QtFontStyle::Key &, const QString & = QString(), bool = false);
};
-QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, bool create)
+QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, const QString &styleName, bool create)
{
int pos = 0;
if (count) {
+ // if styleName for searching first if possible
+ if (!styleName.isEmpty()) {
+ for (; pos < count; pos++) {
+ if (styles[pos]->styleName == styleName)
+ return styles[pos];
+ }
+ }
int low = 0;
int high = count;
pos = count / 2;
@@ -386,6 +392,7 @@ QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, bool create)
}
QtFontStyle *style = new QtFontStyle(key);
+ style->styleName = styleName;
memmove(styles + pos + 1, styles + pos, (count-pos)*sizeof(QtFontStyle *));
styles[pos] = style;
count++;
@@ -814,7 +821,7 @@ void QFontDatabasePrivate::addFont(const QString &familyname, const char *foundr
}
QtFontFoundry *foundry = f->foundry(QString::fromLatin1(foundryname), true);
- QtFontStyle *style = foundry->style(styleKey, true);
+ QtFontStyle *style = foundry->style(styleKey, QString(), true);
style->smoothScalable = (pixelSize == 0);
style->antialiased = antialiased;
QtFontSize *size = style->pixelSize(pixelSize?pixelSize:SMOOTH_SCALABLE, true);
@@ -1123,15 +1130,17 @@ QT_BEGIN_INCLUDE_NAMESPACE
#elif defined(Q_OS_SYMBIAN)
# include "qfontdatabase_s60.cpp"
#endif
+QT_END_INCLUDE_NAMESPACE
+
#if !defined(Q_WS_X11)
QString QFontDatabase::resolveFontFamilyAlias(const QString &family)
{
return family;
}
#endif
-QT_END_INCLUDE_NAMESPACE
-static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey)
+static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey,
+ const QString &styleName = QString())
{
int best = 0;
int dist = 0xffff;
@@ -1139,6 +1148,12 @@ static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &st
for ( int i = 0; i < foundry->count; i++ ) {
QtFontStyle *style = foundry->styles[i];
+ if (!styleName.isEmpty() && styleName == style->styleName) {
+ dist = 0;
+ best = i;
+ break;
+ }
+
int d = qAbs( styleKey.weight - style->key.weight );
if ( styleKey.stretch != 0 && style->key.stretch != 0 ) {
@@ -1532,7 +1547,8 @@ static QString styleStringHelper(int weight, QFont::Style style)
*/
QString QFontDatabase::styleString(const QFont &font)
{
- return styleStringHelper(font.weight(), font.style());
+ return font.styleName().isEmpty() ? styleStringHelper(font.weight(), font.style())
+ : font.styleName();
}
/*!
@@ -1542,7 +1558,8 @@ QString QFontDatabase::styleString(const QFont &font)
*/
QString QFontDatabase::styleString(const QFontInfo &fontInfo)
{
- return styleStringHelper(fontInfo.weight(), fontInfo.style());
+ return fontInfo.styleName().isEmpty() ? styleStringHelper(fontInfo.weight(), fontInfo.style())
+ : fontInfo.styleName();
}
@@ -1788,13 +1805,17 @@ QStringList QFontDatabase::styles(const QString &family) const
for (int k = 0; k < foundry->count; k++) {
QtFontStyle::Key ke(foundry->styles[k]->key);
ke.stretch = 0;
- allStyles.style(ke, true);
+ allStyles.style(ke, foundry->styles[k]->styleName, true);
}
}
}
- for (int i = 0; i < allStyles.count; i++)
- l.append(styleStringHelper(allStyles.styles[i]->key.weight, (QFont::Style)allStyles.styles[i]->key.style));
+ for (int i = 0; i < allStyles.count; i++) {
+ l.append(allStyles.styles[i]->styleName.isEmpty() ?
+ styleStringHelper(allStyles.styles[i]->key.weight,
+ (QFont::Style)allStyles.styles[i]->key.style) :
+ allStyles.styles[i]->styleName);
+ }
return l;
}
@@ -1852,7 +1873,9 @@ bool QFontDatabase::isBitmapScalable(const QString &family,
QtFontFoundry *foundry = f->foundries[j];
if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
for (int k = 0; k < foundry->count; k++)
- if ((style.isEmpty() || foundry->styles[k]->key == styleKey)
+ if ((style.isEmpty() ||
+ foundry->styles[k]->styleName == style ||
+ foundry->styles[k]->key == styleKey)
&& foundry->styles[k]->bitmapScalable && !foundry->styles[k]->smoothScalable) {
bitmapScalable = true;
goto end;
@@ -1891,7 +1914,9 @@ bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &sty
QtFontFoundry *foundry = f->foundries[j];
if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
for (int k = 0; k < foundry->count; k++)
- if ((style.isEmpty() || foundry->styles[k]->key == styleKey) && foundry->styles[k]->smoothScalable) {
+ if ((style.isEmpty() ||
+ foundry->styles[k]->styleName == style ||
+ foundry->styles[k]->key == styleKey) && foundry->styles[k]->smoothScalable) {
smoothScalable = true;
goto end;
}
@@ -1924,12 +1949,12 @@ bool QFontDatabase::isScalable(const QString &family,
\sa smoothSizes(), standardSizes()
*/
QList<int> QFontDatabase::pointSizes(const QString &family,
- const QString &style)
+ const QString &styleName)
{
#if defined(Q_WS_WIN)
// windows and macosx are always smoothly scalable
Q_UNUSED(family);
- Q_UNUSED(style);
+ Q_UNUSED(styleName);
return standardSizes();
#else
bool smoothScalable = false;
@@ -1940,7 +1965,7 @@ QList<int> QFontDatabase::pointSizes(const QString &family,
QT_PREPEND_NAMESPACE(load)(familyName);
- QtFontStyle::Key styleKey(style);
+ QtFontStyle::Key styleKey(styleName);
QList<int> sizes;
@@ -1957,7 +1982,7 @@ QList<int> QFontDatabase::pointSizes(const QString &family,
for (int j = 0; j < fam->count; j++) {
QtFontFoundry *foundry = fam->foundries[j];
if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
- QtFontStyle *style = foundry->style(styleKey);
+ QtFontStyle *style = foundry->style(styleKey, styleName);
if (!style) continue;
if (style->smoothScalable) {
@@ -2008,17 +2033,20 @@ QFont QFontDatabase::font(const QString &family, const QString &style,
QtFontFoundry *foundry = f->foundries[j];
if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
for (int k = 0; k < foundry->count; k++)
- allStyles.style(foundry->styles[k]->key, true);
+ allStyles.style(foundry->styles[k]->key, foundry->styles[k]->styleName, true);
}
}
QtFontStyle::Key styleKey(style);
- QtFontStyle *s = bestStyle(&allStyles, styleKey);
+ QtFontStyle *s = bestStyle(&allStyles, styleKey, style);
if (!s) // no styles found?
return QApplication::font();
+
QFont fnt(family, pointSize, s->key.weight);
fnt.setStyle((QFont::Style)s->key.style);
+ if (!s->styleName.isEmpty())
+ fnt.setStyleName(s->styleName);
return fnt;
}
@@ -2032,11 +2060,11 @@ QFont QFontDatabase::font(const QString &family, const QString &style,
\sa pointSizes(), standardSizes()
*/
QList<int> QFontDatabase::smoothSizes(const QString &family,
- const QString &style)
+ const QString &styleName)
{
#ifdef Q_WS_WIN
Q_UNUSED(family);
- Q_UNUSED(style);
+ Q_UNUSED(styleName);
return QFontDatabase::standardSizes();
#else
bool smoothScalable = false;
@@ -2047,7 +2075,7 @@ QList<int> QFontDatabase::smoothSizes(const QString &family,
QT_PREPEND_NAMESPACE(load)(familyName);
- QtFontStyle::Key styleKey(style);
+ QtFontStyle::Key styleKey(styleName);
QList<int> sizes;
@@ -2064,7 +2092,7 @@ QList<int> QFontDatabase::smoothSizes(const QString &family,
for (int j = 0; j < fam->count; j++) {
QtFontFoundry *foundry = fam->foundries[j];
if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
- QtFontStyle *style = foundry->style(styleKey);
+ QtFontStyle *style = foundry->style(styleKey, styleName);
if (!style) continue;
if (style->smoothScalable) {
@@ -2131,12 +2159,12 @@ bool QFontDatabase::italic(const QString &family, const QString &style) const
QtFontFoundry *foundry = f->foundries[j];
if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
for (int k = 0; k < foundry->count; k++)
- allStyles.style(foundry->styles[k]->key, true);
+ allStyles.style(foundry->styles[k]->key, foundry->styles[k]->styleName, true);
}
}
QtFontStyle::Key styleKey(style);
- QtFontStyle *s = allStyles.style(styleKey);
+ QtFontStyle *s = allStyles.style(styleKey, style);
return s && s->key.style == QFont::StyleItalic;
}
@@ -2166,12 +2194,12 @@ bool QFontDatabase::bold(const QString &family,
if (foundryName.isEmpty() ||
foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
for (int k = 0; k < foundry->count; k++)
- allStyles.style(foundry->styles[k]->key, true);
+ allStyles.style(foundry->styles[k]->key, foundry->styles[k]->styleName, true);
}
}
QtFontStyle::Key styleKey(style);
- QtFontStyle *s = allStyles.style(styleKey);
+ QtFontStyle *s = allStyles.style(styleKey, style);
return s && s->key.weight >= QFont::Bold;
}
@@ -2202,12 +2230,12 @@ int QFontDatabase::weight(const QString &family,
if (foundryName.isEmpty() ||
foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
for (int k = 0; k < foundry->count; k++)
- allStyles.style(foundry->styles[k]->key, true);
+ allStyles.style(foundry->styles[k]->key, foundry->styles[k]->styleName, true);
}
}
QtFontStyle::Key styleKey(style);
- QtFontStyle *s = allStyles.style(styleKey);
+ QtFontStyle *s = allStyles.style(styleKey, style);
return s ? s->key.weight : -1;
}
diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp
index 60cf5865df..fc8247dad2 100644
--- a/src/gui/text/qfontdatabase_mac.cpp
+++ b/src/gui/text/qfontdatabase_mac.cpp
@@ -106,12 +106,14 @@ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
CTFontDescriptorRef font = (CTFontDescriptorRef)CFArrayGetValueAtIndex(fonts, i);
QCFString family_name = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontFamilyNameAttribute);
+ QCFString style_name = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontStyleNameAttribute);
QtFontFamily *family = db->family(family_name, true);
for(int ws = 1; ws < QFontDatabase::WritingSystemsCount; ++ws)
family->writingSystems[ws] = QtFontFamily::Supported;
QtFontFoundry *foundry = family->foundry(foundry_name, true);
QtFontStyle::Key styleKey;
+ QString styleName = style_name;
if(QCFType<CFDictionaryRef> styles = (CFDictionaryRef)CTFontDescriptorCopyAttribute(font, kCTFontTraitsAttribute)) {
if(CFNumberRef weight = (CFNumberRef)CFDictionaryGetValue(styles, kCTFontWeightTrait)) {
Q_ASSERT(CFNumberIsFloatType(weight));
@@ -132,7 +134,7 @@ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
}
}
- QtFontStyle *style = foundry->style(styleKey, true);
+ QtFontStyle *style = foundry->style(styleKey, styleName, true);
style->smoothScalable = true;
if(QCFType<CFNumberRef> size = (CFNumberRef)CTFontDescriptorCopyAttribute(font, kCTFontSizeAttribute)) {
//qDebug() << "WHEE";
@@ -205,7 +207,7 @@ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
QtFontFamily *family = db->family(familyName, true);
QtFontFoundry *foundry = family->foundry(QString(), true);
- QtFontStyle *style = foundry->style(styleKey, true);
+ QtFontStyle *style = foundry->style(styleKey, QString(), true);
style->pixelSize(0, true);
style->smoothScalable = true;
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp
index fd5c6b4510..6b6f4f1a54 100644
--- a/src/gui/text/qfontdatabase_qpa.cpp
+++ b/src/gui/text/qfontdatabase_qpa.cpp
@@ -73,7 +73,7 @@ Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &fou
}
QtFontFoundry *foundry = f->foundry(foundryname, true);
- QtFontStyle *fontStyle = foundry->style(styleKey, true);
+ QtFontStyle *fontStyle = foundry->style(styleKey, QString(), true);
fontStyle->smoothScalable = scalable;
fontStyle->antialiased = antialiased;
QtFontSize *size = fontStyle->pixelSize(pixelSize?pixelSize:SMOOTH_SCALABLE, true);
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 980b5de1a7..2f4d0556d6 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -508,7 +508,7 @@ static bool registerScreenDeviceFont(int screenDeviceFontIndex,
QtFontFamily *family = privateDb()->family(familyName, true);
family->fixedPitch = faceAttrib.IsMonoWidth();
QtFontFoundry *foundry = family->foundry(QString(), true);
- QtFontStyle *style = foundry->style(styleKey, true);
+ QtFontStyle *style = foundry->style(styleKey, QString(), true);
style->smoothScalable = typefaceSupport.iIsScalable;
style->pixelSize(0, true);
diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp
index 20f945a6c9..788eb307c3 100644
--- a/src/gui/text/qfontdatabase_win.cpp
+++ b/src/gui/text/qfontdatabase_win.cpp
@@ -284,7 +284,7 @@ void addFontToDatabase(QString familyName, const QString &scriptName,
family->english_name = getEnglishName(familyName);
QtFontFoundry *foundry = family->foundry(foundryName, true);
- QtFontStyle *style = foundry->style(styleKey, true);
+ QtFontStyle *style = foundry->style(styleKey, QString(), true);
style->smoothScalable = scalable;
style->pixelSize( size, TRUE);
@@ -292,14 +292,14 @@ void addFontToDatabase(QString familyName, const QString &scriptName,
if (styleKey.weight <= QFont::DemiBold) {
QtFontStyle::Key key(styleKey);
key.weight = QFont::Bold;
- QtFontStyle *style = foundry->style(key, true);
+ QtFontStyle *style = foundry->style(key, QString(), true);
style->smoothScalable = scalable;
style->pixelSize( size, TRUE);
}
if (styleKey.style != QFont::StyleItalic) {
QtFontStyle::Key key(styleKey);
key.style = QFont::StyleItalic;
- QtFontStyle *style = foundry->style(key, true);
+ QtFontStyle *style = foundry->style(key, QString(), true);
style->smoothScalable = scalable;
style->pixelSize( size, TRUE);
}
@@ -307,7 +307,7 @@ void addFontToDatabase(QString familyName, const QString &scriptName,
QtFontStyle::Key key(styleKey);
key.weight = QFont::Bold;
key.style = QFont::StyleItalic;
- QtFontStyle *style = foundry->style(key, true);
+ QtFontStyle *style = foundry->style(key, QString(), true);
style->smoothScalable = scalable;
style->pixelSize( size, TRUE);
}
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index 958daa2506..922a97f3aa 100644
--- a/src/gui/text/qfontdatabase_x11.cpp
+++ b/src/gui/text/qfontdatabase_x11.cpp
@@ -680,7 +680,7 @@ static void loadXlfds(const char *reqFamily, int encoding_id)
family->fontFileIndex = -1;
family->symbol_checked = true;
QtFontFoundry *foundry = family->foundry(QLatin1String(foundryName), true);
- QtFontStyle *style = foundry->style(styleKey, true);
+ QtFontStyle *style = foundry->style(styleKey, QString(), true);
delete [] style->weightName;
style->weightName = qstrdup(tokens[Weight]);
@@ -1034,13 +1034,14 @@ static void loadFontConfig()
FcChar8 *file_value;
int index_value;
FcChar8 *foundry_value;
+ FcChar8 *style_value;
FcBool scalable;
{
FcObjectSet *os = FcObjectSetCreate();
FcPattern *pattern = FcPatternCreate();
const char *properties [] = {
- FC_FAMILY, FC_WEIGHT, FC_SLANT,
+ FC_FAMILY, FC_STYLE, FC_WEIGHT, FC_SLANT,
FC_SPACING, FC_FILE, FC_INDEX,
FC_LANG, FC_CHARSET, FC_FOUNDRY, FC_SCALABLE, FC_PIXEL_SIZE, FC_WEIGHT,
FC_WIDTH,
@@ -1085,6 +1086,8 @@ static void loadFontConfig()
scalable = FcTrue;
if (FcPatternGetString(fonts->fonts[i], FC_FOUNDRY, 0, &foundry_value) != FcResultMatch)
foundry_value = 0;
+ if (FcPatternGetString(fonts->fonts[i], FC_STYLE, 0, &style_value) != FcResultMatch)
+ style_value = 0;
QtFontFamily *family = db->family(familyName, true);
FcLangSet *langset = 0;
@@ -1142,6 +1145,7 @@ static void loadFontConfig()
family->fontFileIndex = index_value;
QtFontStyle::Key styleKey;
+ QString styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString();
styleKey.style = (slant_value == FC_SLANT_ITALIC)
? QFont::StyleItalic
: ((slant_value == FC_SLANT_OBLIQUE)
@@ -1156,7 +1160,7 @@ static void loadFontConfig()
QtFontFoundry *foundry
= family->foundry(foundry_value ? QString::fromUtf8((const char *)foundry_value) : QString(), true);
- QtFontStyle *style = foundry->style(styleKey, true);
+ QtFontStyle *style = foundry->style(styleKey, styleName, true);
if (spacing_value < FC_MONO)
family->fixedPitch = false;
@@ -1208,7 +1212,7 @@ static void loadFontConfig()
for (int i = 0; i < 4; ++i) {
styleKey.style = (i%2) ? QFont::StyleNormal : QFont::StyleItalic;
styleKey.weight = (i > 1) ? QFont::Bold : QFont::Normal;
- QtFontStyle *style = foundry->style(styleKey, true);
+ QtFontStyle *style = foundry->style(styleKey, QString(), true);
style->smoothScalable = true;
QtFontSize *size = style->pixelSize(SMOOTH_SCALABLE, true);
QtFontEncoding *enc = size->encodingID(-1, 0, 0, 0, 0, true);
@@ -1356,7 +1360,7 @@ static void initializeDb()
if (equiv) continue;
// let's fake one...
- equiv = foundry->style(key, true);
+ equiv = foundry->style(key, QString(), true);
equiv->smoothScalable = true;
QtFontSize *equiv_size = equiv->pixelSize(SMOOTH_SCALABLE, true);
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm
index 64b8682024..64d4a2453c 100644
--- a/src/gui/text/qfontengine_coretext.mm
+++ b/src/gui/text/qfontengine_coretext.mm
@@ -492,17 +492,6 @@ void QCoreTextFontEngine::init()
avgCharWidth = QFixed::fromReal(width * fontDef.pixelSize / emSize);
} else
avgCharWidth = QFontEngine::averageCharWidth();
-
- ctMaxCharWidth = ctMinLeftBearing = ctMinRightBearing = 0;
- QByteArray hheaTable = getSfntTable(MAKE_TAG('h', 'h', 'e', 'a'));
- if (hheaTable.size() >= 16) {
- quint16 width = qFromBigEndian<quint16>(reinterpret_cast<const uchar *>(hheaTable.constData() + 10));
- ctMaxCharWidth = width * fontDef.pixelSize / emSize;
- qint16 bearing = qFromBigEndian<qint16>(reinterpret_cast<const uchar *>(hheaTable.constData() + 12));
- ctMinLeftBearing = bearing * fontDef.pixelSize / emSize;
- bearing = qFromBigEndian<qint16>(reinterpret_cast<const uchar *>(hheaTable.constData() + 14));
- ctMinRightBearing = bearing * fontDef.pixelSize / emSize;
- }
}
bool QCoreTextFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs,
@@ -599,20 +588,17 @@ QFixed QCoreTextFontEngine::averageCharWidth() const
qreal QCoreTextFontEngine::maxCharWidth() const
{
- return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
- ? qRound(ctMaxCharWidth) : ctMaxCharWidth;
+ return 0;
}
qreal QCoreTextFontEngine::minLeftBearing() const
{
- return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
- ? qRound(ctMinLeftBearing) : ctMinLeftBearing;
+ return 0;
}
qreal QCoreTextFontEngine::minRightBearing() const
{
- return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
- ? qRound(ctMinRightBearing) : ctMinLeftBearing;
+ return 0;
}
void QCoreTextFontEngine::draw(CGContextRef ctx, qreal x, qreal y, const QTextItemInt &ti, int paintDeviceHeight)
@@ -732,8 +718,9 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position
QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition, int margin, bool aa)
{
+ Q_UNUSED(margin);
const glyph_metrics_t br = boundingBox(glyph);
- QImage im(qRound(br.width) + margin * 2, qRound(br.height) + margin * 2, QImage::Format_RGB32);
+ QImage im(qRound(br.width) + 2, qRound(br.height) + 2, QImage::Format_RGB32);
im.fill(0);
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
@@ -764,8 +751,8 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
CGContextSetFont(ctx, cgFont);
- qreal pos_x = -br.x.toReal() + subPixelPosition.toReal() + margin;
- qreal pos_y = im.height() + br.y.toReal() - margin;
+ qreal pos_x = -br.x.truncate() + subPixelPosition.toReal();
+ qreal pos_y = im.height() + br.y.toReal();
CGContextSetTextPosition(ctx, pos_x, pos_y);
CGSize advance;
diff --git a/src/gui/text/qfontengine_coretext_p.h b/src/gui/text/qfontengine_coretext_p.h
index 3ca8a0ad60..efe8295b20 100644
--- a/src/gui/text/qfontengine_coretext_p.h
+++ b/src/gui/text/qfontengine_coretext_p.h
@@ -103,9 +103,6 @@ private:
int synthesisFlags;
CGAffineTransform transform;
QFixed avgCharWidth;
- qreal ctMaxCharWidth;
- qreal ctMinLeftBearing;
- qreal ctMinRightBearing;
friend class QCoreTextFontEngineMulti;
};
diff --git a/src/gui/text/qfontenginedirectwrite.cpp b/src/gui/text/qfontenginedirectwrite.cpp
index 890cad9824..d6932738f5 100644
--- a/src/gui/text/qfontenginedirectwrite.cpp
+++ b/src/gui/text/qfontenginedirectwrite.cpp
@@ -390,6 +390,60 @@ glyph_metrics_t QFontEngineDirectWrite::boundingBox(const QGlyphLayout &glyphs)
return glyph_metrics_t(0, -m_ascent, w - lastRightBearing(glyphs), m_ascent + m_descent, w, 0);
}
+glyph_metrics_t QFontEngineDirectWrite::alphaMapBoundingBox(glyph_t glyph, QFixed subPixelPosition,
+ const QTransform &matrix,
+ GlyphFormat /*format*/)
+{
+ glyph_metrics_t bbox = QFontEngine::boundingBox(glyph, matrix); // To get transformed advance
+
+ UINT16 glyphIndex = glyph;
+ FLOAT glyphAdvance = 0;
+
+ DWRITE_GLYPH_OFFSET glyphOffset;
+ glyphOffset.advanceOffset = 0;
+ glyphOffset.ascenderOffset = 0;
+
+ DWRITE_GLYPH_RUN glyphRun;
+ glyphRun.fontFace = m_directWriteFontFace;
+ glyphRun.fontEmSize = fontDef.pixelSize;
+ glyphRun.glyphCount = 1;
+ glyphRun.glyphIndices = &glyphIndex;
+ glyphRun.glyphAdvances = &glyphAdvance;
+ glyphRun.isSideways = false;
+ glyphRun.bidiLevel = 0;
+ glyphRun.glyphOffsets = &glyphOffset;
+
+ DWRITE_MATRIX transform;
+ transform.dx = subPixelPosition.toReal();
+ transform.dy = 0;
+ transform.m11 = matrix.m11();
+ transform.m12 = matrix.m12();
+ transform.m21 = matrix.m21();
+ transform.m22 = matrix.m22();
+
+ IDWriteGlyphRunAnalysis *glyphAnalysis = NULL;
+ HRESULT hr = m_directWriteFactory->CreateGlyphRunAnalysis(
+ &glyphRun,
+ 1.0f,
+ &transform,
+ DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
+ DWRITE_MEASURING_MODE_NATURAL,
+ 0.0, 0.0,
+ &glyphAnalysis
+ );
+
+ if (SUCCEEDED(hr)) {
+ RECT rect;
+ glyphAnalysis->GetAlphaTextureBounds(DWRITE_TEXTURE_CLEARTYPE_3x1, &rect);
+ glyphAnalysis->Release();
+
+ return glyph_metrics_t(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
+ bbox.xoff, bbox.yoff);
+ } else {
+ return glyph_metrics_t();
+ }
+}
+
glyph_metrics_t QFontEngineDirectWrite::boundingBox(glyph_t g)
{
if (m_directWriteFontFace == 0)
@@ -459,9 +513,10 @@ qreal QFontEngineDirectWrite::maxCharWidth() const
extern uint qt_pow_gamma[256];
-QImage QFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition)
+QImage QFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition,
+ const QTransform &xform)
{
- QImage im = imageForGlyph(glyph, subPixelPosition, 0, QTransform());
+ QImage im = imageForGlyph(glyph, subPixelPosition, 0, xform);
QImage indexed(im.width(), im.height(), QImage::Format_Indexed8);
QVector<QRgb> colors(256);
@@ -492,12 +547,8 @@ QImage QFontEngineDirectWrite::imageForGlyph(glyph_t t,
int margin,
const QTransform &xform)
{
- glyph_metrics_t metrics = QFontEngine::boundingBox(t, xform);
- int width = (metrics.width + margin * 2 + 4).ceil().toInt() ;
- int height = (metrics.height + margin * 2 + 4).ceil().toInt();
-
UINT16 glyphIndex = t;
- FLOAT glyphAdvance = metrics.xoff.toReal();
+ FLOAT glyphAdvance = 0;
DWRITE_GLYPH_OFFSET glyphOffset;
glyphOffset.advanceOffset = 0;
@@ -513,12 +564,9 @@ QImage QFontEngineDirectWrite::imageForGlyph(glyph_t t,
glyphRun.bidiLevel = 0;
glyphRun.glyphOffsets = &glyphOffset;
- QFixed x = margin - metrics.x.round() + subPixelPosition;
- QFixed y = margin - metrics.y.floor();
-
DWRITE_MATRIX transform;
- transform.dx = x.toReal();
- transform.dy = y.toReal();
+ transform.dx = subPixelPosition.toReal();
+ transform.dy = 0;
transform.m11 = xform.m11();
transform.m12 = xform.m12();
transform.m21 = xform.m21();
@@ -537,48 +585,54 @@ QImage QFontEngineDirectWrite::imageForGlyph(glyph_t t,
if (SUCCEEDED(hr)) {
RECT rect;
- rect.left = 0;
- rect.top = 0;
- rect.right = width;
- rect.bottom = height;
-
- int size = width * height * 3;
- BYTE *alphaValues = new BYTE[size];
- qMemSet(alphaValues, size, 0);
-
- hr = glyphAnalysis->CreateAlphaTexture(DWRITE_TEXTURE_CLEARTYPE_3x1,
- &rect,
- alphaValues,
- size);
-
- if (SUCCEEDED(hr)) {
- QImage img(width, height, QImage::Format_RGB32);
- img.fill(0xffffffff);
+ glyphAnalysis->GetAlphaTextureBounds(DWRITE_TEXTURE_CLEARTYPE_3x1, &rect);
- for (int y=0; y<height; ++y) {
- uint *dest = reinterpret_cast<uint *>(img.scanLine(y));
- BYTE *src = alphaValues + width * 3 * y;
+ rect.left -= margin;
+ rect.top -= margin;
+ rect.right += margin;
+ rect.bottom += margin;
- for (int x=0; x<width; ++x) {
- dest[x] = *(src) << 16
- | *(src + 1) << 8
- | *(src + 2);
+ int width = rect.right - rect.left;
+ int height = rect.bottom - rect.top;
- src += 3;
+ int size = width * height * 3;
+ if (size > 0) {
+ BYTE *alphaValues = new BYTE[size];
+ qMemSet(alphaValues, size, 0);
+
+ hr = glyphAnalysis->CreateAlphaTexture(DWRITE_TEXTURE_CLEARTYPE_3x1,
+ &rect,
+ alphaValues,
+ size);
+
+ if (SUCCEEDED(hr)) {
+ QImage img(width, height, QImage::Format_RGB32);
+ img.fill(0xffffffff);
+
+ for (int y=0; y<height; ++y) {
+ uint *dest = reinterpret_cast<uint *>(img.scanLine(y));
+ BYTE *src = alphaValues + width * 3 * y;
+
+ for (int x=0; x<width; ++x) {
+ dest[x] = *(src) << 16
+ | *(src + 1) << 8
+ | *(src + 2);
+
+ src += 3;
+ }
}
- }
- delete[] alphaValues;
- glyphAnalysis->Release();
+ delete[] alphaValues;
+ glyphAnalysis->Release();
- return img;
- } else {
- delete[] alphaValues;
- glyphAnalysis->Release();
+ return img;
+ } else {
+ delete[] alphaValues;
+ glyphAnalysis->Release();
- qErrnoWarning("QFontEngineDirectWrite::imageForGlyph: CreateAlphaTexture failed");
+ qErrnoWarning("QFontEngineDirectWrite::imageForGlyph: CreateAlphaTexture failed");
+ }
}
-
} else {
qErrnoWarning("QFontEngineDirectWrite::imageForGlyph: CreateGlyphRunAnalysis failed");
}
diff --git a/src/gui/text/qfontenginedirectwrite_p.h b/src/gui/text/qfontenginedirectwrite_p.h
index d0086fc49b..edf1e6a182 100644
--- a/src/gui/text/qfontenginedirectwrite_p.h
+++ b/src/gui/text/qfontenginedirectwrite_p.h
@@ -86,6 +86,10 @@ public:
glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
glyph_metrics_t boundingBox(glyph_t g);
+ glyph_metrics_t alphaMapBoundingBox(glyph_t glyph,
+ QFixed subPixelPosition,
+ const QTransform &matrix,
+ GlyphFormat format);
QFixed ascent() const;
QFixed descent() const;
@@ -97,7 +101,7 @@ public:
bool supportsSubPixelPositions() const;
- QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition);
+ QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin,
const QTransform &xform);
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 9e1646f046..f3d410705f 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -442,6 +442,8 @@ bool QFontMetrics::inFont(QChar ch) const
}
/*!
+ \since 4.8
+
Returns true if the character encoded in UCS-4/UTF-32 is a valid
character in the font; otherwise returns false.
*/
@@ -1330,6 +1332,7 @@ bool QFontMetricsF::inFont(QChar ch) const
/*!
\fn bool QFontMetricsF::inFontUcs4(uint ch) const
+ \since 4.8
Returns true if the character given by \a ch, encoded in UCS-4/UTF-32,
is a valid character in the font; otherwise returns false.
diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp
index 7e829dbd3f..d1d1f94c86 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.cpp
+++ b/src/gui/text/qplatformfontdatabase_qpa.cpp
@@ -203,6 +203,7 @@ bool QSupportedWritingSystems::supported(QFontDatabase::WritingSystem writingSys
\brief The QSupportedWritingSystems class is used when registering fonts with the internal Qt
fontdatabase
\ingroup painting
+ \since 4.8
Its to provide an easy to use interface for indicating what writing systems a specific font
supports.
@@ -322,6 +323,7 @@ QString QPlatformFontDatabase::fontDir() const
\class QPlatformFontDatabase
\brief The QPlatformFontDatabase class makes it possible to customize how fonts
are discovered and how they are rendered
+ \since 4.8
\ingroup painting
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index 8bbe86c4f3..7e7ca6c93c 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -2569,6 +2569,7 @@ QTextDocument *QTextCursor::document() const
/*!
\enum Qt::CursorMoveStyle
+ \since 4.8
This enum describes the movement style available to text cursors. The options
are:
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 0abafb81cc..143dc1ab8c 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -2710,7 +2710,7 @@ void QTextHtmlExporter::emitBlock(const QTextBlock &block)
html += QLatin1Char('>');
if (block.begin().atEnd())
- html += "<br />";
+ html += QLatin1String("<br />");
QTextBlock::Iterator it = block.begin();
if (fragmentMarkers && !it.atEnd() && block == doc->begin())
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 8ddf3eb5d3..41ea56a23a 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -323,7 +323,7 @@ static QChar::Direction skipBoundryNeutrals(QScriptAnalysis *analysis,
const ushort *unicode, int length,
int &sor, int &eor, QBidiControl &control)
{
- QChar::Direction dir;
+ QChar::Direction dir = control.basicDirection();
int level = sor > 0 ? analysis[sor - 1].bidiLevel : control.level;
while (sor < length) {
dir = QChar::direction(unicode[sor]);
@@ -2808,7 +2808,7 @@ QFixed QTextEngine::alignLine(const QScriptLine &line)
if (align & Qt::AlignRight)
x = line.width - (line.textAdvance + leadingSpaceWidth(line));
else if (align & Qt::AlignHCenter)
- x = (line.width - (line.textAdvance + leadingSpaceWidth(line)))/2;
+ x = (line.width - line.textAdvance)/2 - leadingSpaceWidth(line);
}
return x;
}
@@ -2890,6 +2890,7 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end,
}
const HB_CharAttributes *attrs = attributes();
+ logClusters = this->logClusters(si);
clusterLength = getClusterLength(logClusters, attrs, 0, end, glyph_pos, &clusterStart);
if (clusterLength) {
@@ -3051,6 +3052,22 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo
: justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format),
num_chars(0), chars(0), logClusters(0), f(0), fontEngine(0)
{
+ f = font;
+ fontEngine = f->d->engineForScript(si.analysis.script);
+ Q_ASSERT(fontEngine);
+
+ initWithScriptItem(si);
+}
+
+QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format)
+ : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format),
+ num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe)
+{
+}
+
+// Fix up flags and underlineStyle with given info
+void QTextItemInt::initWithScriptItem(const QScriptItem &si)
+{
// explicitly initialize flags so that initFontAttributes can be called
// multiple times on the same TextItem
flags = 0;
@@ -3058,13 +3075,10 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo
flags |= QTextItem::RightToLeft;
ascent = si.ascent;
descent = si.descent;
- f = font;
- fontEngine = f->d->engineForScript(si.analysis.script);
- Q_ASSERT(fontEngine);
- if (format.hasProperty(QTextFormat::TextUnderlineStyle)) {
- underlineStyle = format.underlineStyle();
- } else if (format.boolProperty(QTextFormat::FontUnderline)
+ if (charFormat.hasProperty(QTextFormat::TextUnderlineStyle)) {
+ underlineStyle = charFormat.underlineStyle();
+ } else if (charFormat.boolProperty(QTextFormat::FontUnderline)
|| f->d->underline) {
underlineStyle = QTextCharFormat::SingleUnderline;
}
@@ -3073,18 +3087,12 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo
if (underlineStyle == QTextCharFormat::SingleUnderline)
flags |= QTextItem::Underline;
- if (f->d->overline || format.fontOverline())
+ if (f->d->overline || charFormat.fontOverline())
flags |= QTextItem::Overline;
- if (f->d->strikeOut || format.fontStrikeOut())
+ if (f->d->strikeOut || charFormat.fontStrikeOut())
flags |= QTextItem::StrikeOut;
}
-QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe)
- : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline),
- num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe)
-{
-}
-
QTextItemInt QTextItemInt::midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const
{
QTextItemInt ti = *this;
diff --git a/src/gui/text/qtextengine_mac.cpp b/src/gui/text/qtextengine_mac.cpp
index 251d9b5072..9da8f03caa 100644
--- a/src/gui/text/qtextengine_mac.cpp
+++ b/src/gui/text/qtextengine_mac.cpp
@@ -605,6 +605,12 @@ void QTextEngine::shapeTextMac(int item) const
unsigned short *log_clusters = logClusters(&si);
bool stringToCMapFailed = false;
+ // Skip shaping of line or paragraph separators since we are not
+ // going to draw them anyway
+ if (si.analysis.flags == QScriptAnalysis::LineOrParagraphSeparator
+ && !(option.flags() & QTextOption::ShowLineAndParagraphSeparators))
+ goto cleanUp;
+
if (!fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, attributes(), &si)) {
ensureSpace(num_glyphs);
g = availableGlyphs(&si);
@@ -645,6 +651,7 @@ void QTextEngine::shapeTextMac(int item) const
}
}
+cleanUp:
const ushort *uc = reinterpret_cast<const ushort *>(str);
if ((si.analysis.flags == QScriptAnalysis::SmallCaps || si.analysis.flags == QScriptAnalysis::Uppercase
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 055974a4ad..b1bd0c3359 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -312,11 +312,13 @@ public:
logClusters(0), f(0), fontEngine(0)
{}
QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
- QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe);
+ QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe,
+ const QTextCharFormat &format = QTextCharFormat());
/// copy the structure items, adjusting the glyphs arrays to the right subarrays.
/// the width of the returned QTextItemInt is not adjusted, for speed reasons
QTextItemInt midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const;
+ void initWithScriptItem(const QScriptItem &si);
QFixed descent;
QFixed ascent;
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index c1bc846bd5..3f0b9e8f7d 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -579,6 +579,8 @@ bool QTextLayout::cacheEnabled() const
}
/*!
+ \since 4.8
+
Set the cursor movement style. If the QTextLayout is backed by
a document, you can ignore this and use the option in QTextDocument,
this option is for widgets like QLineEdit or custom widgets without
@@ -592,6 +594,8 @@ void QTextLayout::setCursorMoveStyle(Qt::CursorMoveStyle style)
}
/*!
+ \since 4.8
+
The cursor movement style of this QTextLayout. The default is
Qt::LogicalMoveStyle.
@@ -725,9 +729,11 @@ int QTextLayout::previousCursorPosition(int oldPos, CursorMode mode) const
}
/*!
+ \since 4.8
+
Returns the cursor position to the right of \a oldPos, next to it.
- It's dependent on the visual position of characters, after bi-directional
- reordering.
+ The position is dependent on the visual position of characters, after
+ bi-directional reordering.
\sa leftCursorPosition(), nextCursorPosition()
*/
@@ -739,9 +745,11 @@ int QTextLayout::rightCursorPosition(int oldPos) const
}
/*!
+ \since 4.8
+
Returns the cursor position to the left of \a oldPos, next to it.
- It's dependent on the visual position of characters, after bi-directional
- reordering.
+ The position is dependent on the visual position of characters, after
+ bi-directional reordering.
\sa rightCursorPosition(), previousCursorPosition()
*/
@@ -2381,13 +2389,13 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
unsigned short *logClusters = eng->logClusters(&si);
QGlyphLayout glyphs = eng->shapedGlyphs(&si);
- QTextItemInt gf(si, &f, format);
- gf.glyphs = glyphs.mid(iterator.glyphsStart, iterator.glyphsEnd - iterator.glyphsStart);
- gf.chars = eng->layoutData->string.unicode() + iterator.itemStart;
+ QTextItemInt gf(glyphs.mid(iterator.glyphsStart, iterator.glyphsEnd - iterator.glyphsStart),
+ &f, eng->layoutData->string.unicode() + iterator.itemStart,
+ iterator.itemEnd - iterator.itemStart, eng->fontEngine(si), format);
gf.logClusters = logClusters + iterator.itemStart - si.position;
- gf.num_chars = iterator.itemEnd - iterator.itemStart;
gf.width = iterator.itemWidth;
gf.justified = line.justified;
+ gf.initWithScriptItem(si);
Q_ASSERT(gf.fontEngine);
diff --git a/src/gui/widgets/qabstractspinbox.cpp b/src/gui/widgets/qabstractspinbox.cpp
index 4372ae3341..7a985a1722 100644
--- a/src/gui/widgets/qabstractspinbox.cpp
+++ b/src/gui/widgets/qabstractspinbox.cpp
@@ -1655,6 +1655,8 @@ void QAbstractSpinBox::initStyleOption(QStyleOptionSpinBox *option) const
: (QAbstractSpinBox::StepDownEnabled|QAbstractSpinBox::StepUpEnabled);
option->frame = d->frame;
+ if (d->readOnly)
+ option->state |= QStyle::State_ReadOnly;
}
/*!
diff --git a/src/gui/widgets/qcheckbox.cpp b/src/gui/widgets/qcheckbox.cpp
index 9904a15ac0..221048867b 100644
--- a/src/gui/widgets/qcheckbox.cpp
+++ b/src/gui/widgets/qcheckbox.cpp
@@ -303,6 +303,7 @@ QSize QCheckBox::sizeHint() const
/*!
\reimp
+ \since 4.8
*/
QSize QCheckBox::minimumSizeHint() const
{
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 621cae92da..41394e3e5b 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -80,6 +80,9 @@
#if defined(Q_WS_S60)
#include "private/qt_s60_p.h"
#endif
+#ifndef QT_NO_ACCESSIBILITY
+#include "qaccessible.h"
+#endif
QT_BEGIN_NAMESPACE
@@ -1018,6 +1021,9 @@ void QComboBoxPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIn
}
q->update();
}
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::updateAccessibility(q, 0, QAccessible::NameChanged);
+#endif
}
void QComboBoxPrivate::_q_rowsInserted(const QModelIndex &parent, int start, int end)
@@ -1271,6 +1277,9 @@ void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index)
Q_Q(QComboBox);
emit q->currentIndexChanged(index.row());
emit q->currentIndexChanged(itemText(index));
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::updateAccessibility(q, 0, QAccessible::NameChanged);
+#endif
}
QString QComboBoxPrivate::itemText(const QModelIndex &index) const
@@ -2635,6 +2644,9 @@ void QComboBox::clear()
{
Q_D(QComboBox);
d->model->removeRows(0, d->model->rowCount(d->root), d->root);
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
+#endif
}
/*!
@@ -2651,6 +2663,9 @@ void QComboBox::clearEditText()
Q_D(QComboBox);
if (d->lineEdit)
d->lineEdit->clear();
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
+#endif
}
/*!
@@ -2661,6 +2676,9 @@ void QComboBox::setEditText(const QString &text)
Q_D(QComboBox);
if (d->lineEdit)
d->lineEdit->setText(text);
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
+#endif
}
/*!
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index 26dd0e1120..dcf35aadcb 100644
--- a/src/gui/widgets/qlabel.cpp
+++ b/src/gui/widgets/qlabel.cpp
@@ -55,6 +55,10 @@
#include "private/qstylesheetstyle_p.h"
#include <qmath.h>
+#ifndef QT_NO_ACCESSIBILITY
+#include <qaccessible.h>
+#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -370,6 +374,11 @@ void QLabel::setText(const QString &text)
#endif
d->updateLabel();
+
+#ifndef QT_NO_ACCESSIBILITY
+ if (accessibleName().isEmpty())
+ QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
+#endif
}
QString QLabel::text() const
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index bf36033c08..84674a51d3 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -59,6 +59,22 @@
QT_BEGIN_NAMESPACE
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+static int qt_passwordEchoDelay = QT_GUI_PASSWORD_ECHO_DELAY;
+#endif
+
+/*!
+ \macro QT_GUI_PASSWORD_ECHO_DELAY
+
+ \internal
+
+ Defines the amount of time in milliseconds the last entered character
+ should be displayed unmasked in the Password echo mode.
+
+ If not defined in qplatformdefs.h there will be no delay in masking
+ password characters.
+*/
+
/*!
\internal
@@ -74,9 +90,25 @@ void QLineControl::updateDisplayText(bool forceUpdate)
else
str = m_text;
- if (m_echoMode == QLineEdit::Password || (m_echoMode == QLineEdit::PasswordEchoOnEdit
- && !m_passwordEchoEditing))
+ if (m_echoMode == QLineEdit::Password) {
str.fill(m_passwordCharacter);
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+ if (m_passwordEchoTimer != 0 && !str.isEmpty()) {
+ int cursor = m_text.length() - 1;
+ QChar uc = m_text.at(cursor);
+ str[cursor] = uc;
+ if (cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) {
+ // second half of a surrogate, check if we have the first half as well,
+ // if yes restore both at once
+ uc = m_text.at(cursor - 1);
+ if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00)
+ str[cursor - 1] = uc;
+ }
+ }
+#endif
+ } else if (m_echoMode == QLineEdit::PasswordEchoOnEdit && !m_passwordEchoEditing) {
+ str.fill(m_passwordCharacter);
+ }
// replace certain non-printable characters with spaces (to avoid
// drawing boxes when using fonts that don't have glyphs for such
@@ -311,6 +343,7 @@ void QLineControl::init(const QString &txt)
*/
void QLineControl::updatePasswordEchoEditing(bool editing)
{
+ cancelPasswordEchoTimer();
m_passwordEchoEditing = editing;
updateDisplayText();
}
@@ -640,6 +673,7 @@ bool QLineControl::finishChange(int validateFromState, bool update, bool edited)
*/
void QLineControl::internalSetText(const QString &txt, int pos, bool edited)
{
+ cancelPasswordEchoTimer();
internalDeselect();
emit resetInputContext();
QString oldText = m_text;
@@ -692,6 +726,13 @@ void QLineControl::addCommand(const Command &cmd)
*/
void QLineControl::internalInsert(const QString &s)
{
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+ if (m_echoMode == QLineEdit::Password) {
+ if (m_passwordEchoTimer != 0)
+ killTimer(m_passwordEchoTimer);
+ m_passwordEchoTimer = startTimer(qt_passwordEchoDelay);
+ }
+#endif
if (hasSelectedText())
addCommand(Command(SetSelection, m_cursor, 0, m_selstart, m_selend));
if (m_maskData) {
@@ -729,6 +770,7 @@ void QLineControl::internalInsert(const QString &s)
void QLineControl::internalDelete(bool wasBackspace)
{
if (m_cursor < (int) m_text.length()) {
+ cancelPasswordEchoTimer();
if (hasSelectedText())
addCommand(Command(SetSelection, m_cursor, 0, m_selstart, m_selend));
addCommand(Command((CommandType)((m_maskData ? 2 : 0) + (wasBackspace ? Remove : Delete)),
@@ -755,6 +797,7 @@ void QLineControl::internalDelete(bool wasBackspace)
void QLineControl::removeSelectedText()
{
if (m_selstart < m_selend && m_selend <= (int) m_text.length()) {
+ cancelPasswordEchoTimer();
separate();
int i ;
addCommand(Command(SetSelection, m_cursor, 0, m_selstart, m_selend));
@@ -1153,6 +1196,7 @@ void QLineControl::internalUndo(int until)
{
if (!isUndoAvailable())
return;
+ cancelPasswordEchoTimer();
internalDeselect();
while (m_undoState && m_undoState > until) {
Command& cmd = m_history[--m_undoState];
@@ -1357,6 +1401,12 @@ void QLineControl::timerEvent(QTimerEvent *event)
} else if (event->timerId() == m_tripleClickTimer) {
killTimer(m_tripleClickTimer);
m_tripleClickTimer = 0;
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+ } else if (event->timerId() == m_passwordEchoTimer) {
+ killTimer(m_passwordEchoTimer);
+ m_passwordEchoTimer = 0;
+ updateDisplayText();
+#endif
}
}
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index cca4bfaeba..6a1b4e33be 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -66,6 +66,8 @@
#include "QtGui/qcompleter.h"
#include "QtGui/qaccessible.h"
+#include "qplatformdefs.h"
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -85,6 +87,9 @@ public:
m_ascent(0), m_maxLength(32767), m_lastCursorPos(-1),
m_tripleClickTimer(0), m_maskData(0), m_modifiedState(0), m_undoState(0),
m_selstart(0), m_selend(0), m_passwordEchoEditing(false)
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+ , m_passwordEchoTimer(0)
+#endif
{
init(txt);
}
@@ -222,6 +227,7 @@ public:
uint echoMode() const { return m_echoMode; }
void setEchoMode(uint mode)
{
+ cancelPasswordEchoTimer();
m_echoMode = mode;
m_passwordEchoEditing = false;
updateDisplayText();
@@ -271,7 +277,13 @@ public:
QString preeditAreaText() const { return m_textLayout.preeditAreaText(); }
void updatePasswordEchoEditing(bool editing);
- bool passwordEchoEditing() const { return m_passwordEchoEditing; }
+ bool passwordEchoEditing() const {
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+ if (m_passwordEchoTimer != 0)
+ return true;
+#endif
+ return m_passwordEchoEditing ;
+ }
QChar passwordCharacter() const { return m_passwordCharacter; }
void setPasswordCharacter(const QChar &character) { m_passwordCharacter = character; updateDisplayText(); }
@@ -419,6 +431,18 @@ private:
bool m_passwordEchoEditing;
QChar m_passwordCharacter;
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+ int m_passwordEchoTimer;
+#endif
+ void cancelPasswordEchoTimer()
+ {
+#ifdef QT_GUI_PASSWORD_ECHO_DELAY
+ if (m_passwordEchoTimer != 0) {
+ killTimer(m_passwordEchoTimer);
+ m_passwordEchoTimer = 0;
+ }
+#endif
+ }
Q_SIGNALS:
void cursorPositionChanged(int, int);
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index 2d63f63184..7d357661b5 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1128,6 +1128,8 @@ void QLineEdit::setDragEnabled(bool b)
*/
/*!
+ \since 4.8
+
Returns the movement style for the cursor in the line edit.
*/
Qt::CursorMoveStyle QLineEdit::cursorMoveStyle() const
@@ -1137,6 +1139,8 @@ Qt::CursorMoveStyle QLineEdit::cursorMoveStyle() const
}
/*!
+ \since 4.8
+
Sets the movement style for the cursor in the line edit to the given
\a style.
*/
diff --git a/src/gui/widgets/qradiobutton.cpp b/src/gui/widgets/qradiobutton.cpp
index eeef40e00a..9ce4ebac3e 100644
--- a/src/gui/widgets/qradiobutton.cpp
+++ b/src/gui/widgets/qradiobutton.cpp
@@ -206,6 +206,7 @@ QSize QRadioButton::sizeHint() const
/*!
\reimp
+ \since 4.8
*/
QSize QRadioButton::minimumSizeHint() const
{
diff --git a/src/gui/widgets/qtabwidget.cpp b/src/gui/widgets/qtabwidget.cpp
index c6551e591e..78dda2304d 100644
--- a/src/gui/widgets/qtabwidget.cpp
+++ b/src/gui/widgets/qtabwidget.cpp
@@ -885,6 +885,7 @@ QSize QTabWidget::minimumSizeHint() const
/*!
\reimp
+ \since 4.8
*/
int QTabWidget::heightForWidth(int width) const
{
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index 2670089133..61d4fed722 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -2472,6 +2472,8 @@ bool QTextEdit::find(const QString &exp, QTextDocument::FindFlags options)
and the text edit will try to guess the right format.
Use setHtml() or setPlainText() directly to avoid text edit's guessing.
+
+ \sa toPlainText(), toHtml()
*/
void QTextEdit::setText(const QString &text)
{