summaryrefslogtreecommitdiffstats
path: root/Python/structmember.c
blob: af0296d802fd81cab89ebdb20f24d44c58636bb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296

/* Map C struct members to Python object attributes */

#include "Python.h"

#include "structmember.h"

PyObject *
PyMember_GetOne(const char *addr, PyMemberDef *l)
{
    PyObject *v;

    addr += l->offset;
    switch (l->type) {
    case T_BOOL:
        v = PyBool_FromLong(*(char*)addr);
        break;
    case T_BYTE:
        v = PyLong_FromLong(*(char*)addr);
        break;
    case T_UBYTE:
        v = PyLong_FromUnsignedLong(*(unsigned char*)addr);
        break;
    case T_SHORT:
        v = PyLong_FromLong(*(short*)addr);
        break;
    case T_USHORT:
        v = PyLong_FromUnsignedLong(*(unsigned short*)addr);
        break;
    case T_INT:
        v = PyLong_FromLong(*(int*)addr);
        break;
    case T_UINT:
        v = PyLong_FromUnsignedLong(*(unsigned int*)addr);
        break;
    case T_LONG:
        v = PyLong_FromLong(*(long*)addr);
        break;
    case T_ULONG:
        v = PyLong_FromUnsignedLong(*(unsigned long*)addr);
        break;
    case T_PYSSIZET:
        v = PyLong_FromSsize_t(*(Py_ssize_t*)addr);
        break;
    case T_FLOAT:
        v = PyFloat_FromDouble((double)*(float*)addr);
        break;
    case T_DOUBLE:
        v = PyFloat_FromDouble(*(double*)addr);
        break;
    case T_STRING:
        if (*(char**)addr == NULL) {
            Py_INCREF(Py_None);
            v = Py_None;
        }
        else
            v = PyUnicode_FromString(*(char**)addr);
        break;
    case T_STRING_INPLACE:
        v = PyUnicode_FromString((char*)addr);
        break;
    case T_CHAR:
        v = PyUnicode_FromStringAndSize((char*)addr, 1);
        break;
    case T_OBJECT:
        v = *(PyObject **)addr;
        if (v == NULL)
            v = Py_None;
        Py_INCREF(v);
        break;
    case T_OBJECT_EX:
        v = *(PyObject **)addr;
        if (v == NULL)
            PyErr_SetString(PyExc_AttributeError, l->name);
        Py_XINCREF(v);
        break;
#ifdef HAVE_LONG_LONG
    case T_LONGLONG:
        v = PyLong_FromLongLong(*(PY_LONG_LONG *)addr);
        break;
    case T_ULONGLONG:
        v = PyLong_FromUnsignedLongLong(*(unsigned PY_LONG_LONG *)addr);
        break;
#endif /* HAVE_LONG_LONG */
    case T_NONE:
        v = Py_None;
        Py_INCREF(v);
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "bad memberdescr type");
        v = NULL;
    }
    return v;
}

#define WARN(msg)                                               \
    do {                                                        \
    if (PyErr_WarnEx(PyExc_RuntimeWarning, msg, 1) < 0)         \
        return -1;                                              \
    } while (0)

int
PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v)
{
    PyObject *oldv;

    addr += l->offset;

    if ((l->flags & READONLY))
    {
        PyErr_SetString(PyExc_AttributeError, "readonly attribute");
        return -1;
    }
    if (v == NULL) {
        if (l->type == T_OBJECT_EX) {
            /* Check if the attribute is set. */
            if (*(PyObject **)addr == NULL) {
                PyErr_SetString(PyExc_AttributeError, l->name);
                return -1;
            }
        }
        else if (l->type != T_OBJECT) {
            PyErr_SetString(PyExc_TypeError,
                            "can't delete numeric/char attribute");
            return -1;
        }
    }
    switch (l->type) {
    case T_BOOL:{
        if (!PyBool_Check(v)) {
            PyErr_SetString(PyExc_TypeError,
                            "attribute value type must be bool");
            return -1;
        }
        if (v == Py_True)
            *(char*)addr = (char) 1;
        else
            *(char*)addr = (char) 0;
        break;
        }
    case T_BYTE:{
        long long_val = PyLong_AsLong(v);
        if ((long_val == -1) && PyErr_Occurred())
            return -1;
        *(char*)addr = (char)long_val;
        /* XXX: For compatibility, only warn about truncations
           for now. */
        if ((long_val > CHAR_MAX) || (long_val < CHAR_MIN))
            WARN("Truncation of value to char");
        break;
        }
    case T_UBYTE:{
        long long_val = PyLong_AsLong(v);
        if ((long_val == -1) && PyErr_Occurred())
            return -1;
        *(unsigned char*)addr = (unsigned char)long_val;
        if ((long_val > UCHAR_MAX) || (long_val < 0))
            WARN("Truncation of value to unsigned char");
        break;
        }
    case T_SHORT:{
        long long_val = PyLong_AsLong(v);
        if ((long_val == -1) && PyErr_Occurred())
            return -1;
        *(short*)addr = (short)long_val;
        if ((long_val > SHRT_MAX) || (long_val < SHRT_MIN))
            WARN("Truncation of value to short");
        break;
        }
    case T_USHORT:{
        long long_val = PyLong_AsLong(v);
        if ((long_val == -1) && PyErr_Occurred())
            return -1;
        *(unsigned short*)addr = (unsigned short)long_val;
        if ((long_val > USHRT_MAX) || (long_val < 0))
            WARN("Truncation of value to unsigned short");
        break;
        }
    case T_INT:{
        long long_val = PyLong_AsLong(v);
        if ((long_val == -1) && PyErr_Occurred())
            return -1;
        *(int *)addr = (int)long_val;
        if ((long_val > INT_MAX) || (long_val < INT_MIN))
            WARN("Truncation of value to int");
        break;
        }
    case T_UINT:{
        unsigned long ulong_val = PyLong_AsUnsignedLong(v);
        if ((ulong_val == (unsigned long)-1) && PyErr_Occurred()) {
            /* XXX: For compatibility, accept negative int values
               as well. */
            PyErr_Clear();
            ulong_val = PyLong_AsLong(v);
            if ((ulong_val == (unsigned long)-1) &&
                PyErr_Occurred())
                return -1;
            *(unsigned int *)addr = (unsigned int)ulong_val;
            WARN("Writing negative value into unsigned field");
        } else
            *(unsigned int *)addr = (unsigned int)ulong_val;
        if (ulong_val > UINT_MAX)
            WARN("Truncation of value to unsigned int");
        break;
        }
    case T_LONG:{
        *(long*)addr = PyLong_AsLong(v);
        if ((*(long*)addr == -1) && PyErr_Occurred())
            return -1;
        break;
        }
    case T_ULONG:{
        *(unsigned long*)addr = PyLong_AsUnsignedLong(v);
        if ((*(unsigned long*)addr == (unsigned long)-1)
            && PyErr_Occurred()) {
            /* XXX: For compatibility, accept negative int values
               as well. */
            PyErr_Clear();
            *(unsigned long*)addr = PyLong_AsLong(v);
            if ((*(unsigned long*)addr == (unsigned long)-1)
                && PyErr_Occurred())
                return -1;
            WARN("Writing negative value into unsigned field");
        }
        break;
        }
    case T_PYSSIZET:{
        *(Py_ssize_t*)addr = PyLong_AsSsize_t(v);
        if ((*(Py_ssize_t*)addr == (Py_ssize_t)-1)
            && PyErr_Occurred())
                        return -1;
        break;
        }
    case T_FLOAT:{
        double double_val = PyFloat_AsDouble(v);
        if ((double_val == -1) && PyErr_Occurred())
            return -1;
        *(float*)addr = (float)double_val;
        break;
        }
    case T_DOUBLE:
        *(double*)addr = PyFloat_AsDouble(v);
        if ((*(double*)addr == -1) && PyErr_Occurred())
            return -1;
        break;
    case T_OBJECT:
    case T_OBJECT_EX:
        Py_XINCREF(v);
        oldv = *(PyObject **)addr;
        *(PyObject **)addr = v;
        Py_XDECREF(oldv);
        break;
    case T_CHAR: {
        char *string;
        Py_ssize_t len;

        string = _PyUnicode_AsStringAndSize(v, &len);
        if (string == NULL || len != 1) {
            PyErr_BadArgument();
            return -1;
        }
        *(char*)addr = string[0];
        break;
        }
    case T_STRING:
    case T_STRING_INPLACE:
        PyErr_SetString(PyExc_TypeError, "readonly attribute");
        return -1;
#ifdef HAVE_LONG_LONG
    case T_LONGLONG:{
        PY_LONG_LONG value;
        *(PY_LONG_LONG*)addr = value = PyLong_AsLongLong(v);
        if ((value == -1) && PyErr_Occurred())
            return -1;
        break;
        }
    case T_ULONGLONG:{
        unsigned PY_LONG_LONG value;
        /* ??? PyLong_AsLongLong accepts an int, but PyLong_AsUnsignedLongLong
            doesn't ??? */
        if (PyLong_Check(v))
            *(unsigned PY_LONG_LONG*)addr = value = PyLong_AsUnsignedLongLong(v);
        else
            *(unsigned PY_LONG_LONG*)addr = value = PyLong_AsLong(v);
        if ((value == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())
            return -1;
        break;
        }
#endif /* HAVE_LONG_LONG */
    default:
        PyErr_Format(PyExc_SystemError,
                     "bad memberdescr type for %s", l->name);
        return -1;
    }
    return 0;
}
(connectedSignals & (ulong(1) << signal_index)); + || (connectedSignals[signal_index >> 5] & (1 << (signal_index & 0x1f))); } diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp index 67a9c46..a2524aa 100644 --- a/tests/auto/qobject/tst_qobject.cpp +++ b/tests/auto/qobject/tst_qobject.cpp @@ -3058,10 +3058,8 @@ void tst_QObject::isSignalConnected() QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig05()"))); QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig15()"))); QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig29()"))); - if (sizeof(void *) >= 8) { //on 32bit isSignalConnected only works with the first 32 signals - QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig60()"))); - QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig61()"))); - } + QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig60()"))); + QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig61()"))); #endif QObject::connect(&o, SIGNAL(sig00()), &o, SIGNAL(sig69())); @@ -3115,6 +3113,8 @@ void tst_QObject::isSignalConnected() QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig04()"))); QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig21()"))); QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig25()"))); + QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig55()"))); + QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig61()"))); #endif emit o.sig00(); -- cgit v0.12 From 6744e241ee41a50b02a76e3e755ec448676589a4 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 9 Dec 2009 13:21:23 +0100 Subject: Compile with QT_NO_DEPRECATED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uses of QT_DEPRECATED must be protected by #ifdef Task-number: QTBUG-6649 Reviewed-by: João Abecasis --- src/corelib/tools/qregexp.h | 2 ++ src/gui/embedded/qscreen_qws.h | 2 ++ src/gui/image/qimage.h | 6 ++++++ src/gui/image/qpixmap.h | 2 ++ src/gui/painting/qmatrix.h | 2 ++ src/gui/painting/qpaintdevice.h | 2 ++ src/gui/painting/qregion.h | 2 ++ src/gui/widgets/qlcdnumber.h | 3 ++- src/gui/widgets/qprintpreviewwidget.h | 2 ++ tools/assistant/lib/qhelpsearchengine.h | 2 ++ 10 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qregexp.h b/src/corelib/tools/qregexp.h index 2bad40e..8a46b98 100644 --- a/src/corelib/tools/qregexp.h +++ b/src/corelib/tools/qregexp.h @@ -119,7 +119,9 @@ public: #endif int matchedLength() const; #ifndef QT_NO_REGEXP_CAPTURE +#ifdef QT_DEPRECATED QT_DEPRECATED int numCaptures() const; +#endif int captureCount() const; QStringList capturedTexts() const; QStringList capturedTexts(); diff --git a/src/gui/embedded/qscreen_qws.h b/src/gui/embedded/qscreen_qws.h index b3246f9..7ab49fb 100644 --- a/src/gui/embedded/qscreen_qws.h +++ b/src/gui/embedded/qscreen_qws.h @@ -243,7 +243,9 @@ public: int totalSize() const { return mapsize; } QRgb * clut() { return screenclut; } +#ifdef QT_DEPRECATED QT_DEPRECATED int numCols() { return screencols; } +#endif int colorCount() { return screencols; } virtual QSize mapToDevice(const QSize &) const; diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index d8809ef..ce7f450 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -165,12 +165,16 @@ public: QRect rect() const; int depth() const; +#ifdef QT_DEPRECATED QT_DEPRECATED int numColors() const; +#endif int colorCount() const; QRgb color(int i) const; void setColor(int i, QRgb c); +#ifdef QT_DEPRECATED QT_DEPRECATED void setNumColors(int); +#endif void setColorCount(int); bool allGray() const; @@ -178,7 +182,9 @@ public: uchar *bits(); const uchar *bits() const; +#ifdef QT_DEPRECATED QT_DEPRECATED int numBytes() const; +#endif int byteCount() const; uchar *scanLine(int); diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index d95b4ee..e02b0d6 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -185,7 +185,9 @@ public: const uchar *qwsBits() const; int qwsBytesPerLine() const; QRgb *clut() const; +#ifdef QT_DEPRECATED QT_DEPRECATED int numCols() const; +#endif int colorCount() const; #elif defined(Q_WS_MAC) Qt::HANDLE macQDHandle() const; diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h index 152b3c9..af48bcb 100644 --- a/src/gui/painting/qmatrix.h +++ b/src/gui/painting/qmatrix.h @@ -102,7 +102,9 @@ public: bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); } qreal determinant() const { return _m11*_m22 - _m12*_m21; } +#ifdef QT_DEPRECATED QT_DEPRECATED qreal det() const { return _m11*_m22 - _m12*_m21; } +#endif QMatrix inverted(bool *invertible = 0) const; diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h index 9148e4b..0f8191e 100644 --- a/src/gui/painting/qpaintdevice.h +++ b/src/gui/painting/qpaintdevice.h @@ -96,7 +96,9 @@ public: int logicalDpiY() const { return metric(PdmDpiY); } int physicalDpiX() const { return metric(PdmPhysicalDpiX); } int physicalDpiY() const { return metric(PdmPhysicalDpiY); } +#ifdef QT_DEPRECATED QT_DEPRECATED int numColors() const { return metric(PdmNumColors); } +#endif int colorCount() const { return metric(PdmNumColors); } int depth() const { return metric(PdmDepth); } diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index 2a1be86..f99fbf6 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -116,7 +116,9 @@ public: QRect boundingRect() const; QVector rects() const; void setRects(const QRect *rect, int num); +#ifdef QT_DEPRECATED QT_DEPRECATED int numRects() const; +#endif int rectCount() const; const QRegion operator|(const QRegion &r) const; diff --git a/src/gui/widgets/qlcdnumber.h b/src/gui/widgets/qlcdnumber.h index e65637d..b7162cd 100644 --- a/src/gui/widgets/qlcdnumber.h +++ b/src/gui/widgets/qlcdnumber.h @@ -82,9 +82,10 @@ public: }; bool smallDecimalPoint() const; - +#ifdef QT_DEPRECATED QT_DEPRECATED int numDigits() const; QT_DEPRECATED void setNumDigits(int nDigits); +#endif int digitCount() const; void setDigitCount(int nDigits); diff --git a/src/gui/widgets/qprintpreviewwidget.h b/src/gui/widgets/qprintpreviewwidget.h index 08e596d..d8504de 100644 --- a/src/gui/widgets/qprintpreviewwidget.h +++ b/src/gui/widgets/qprintpreviewwidget.h @@ -82,7 +82,9 @@ public: ViewMode viewMode() const; ZoomMode zoomMode() const; int currentPage() const; +#ifdef QT_DEPRECATED QT_DEPRECATED int numPages() const; +#endif int pageCount() const; void setVisible(bool visible); diff --git a/tools/assistant/lib/qhelpsearchengine.h b/tools/assistant/lib/qhelpsearchengine.h index 21f04c5..632ac0b 100644 --- a/tools/assistant/lib/qhelpsearchengine.h +++ b/tools/assistant/lib/qhelpsearchengine.h @@ -86,7 +86,9 @@ public: QHelpSearchQueryWidget* queryWidget(); QHelpSearchResultWidget* resultWidget(); +#ifdef QT_DEPRECATED QT_DEPRECATED int hitsCount() const; +#endif int hitCount() const; typedef QPair SearchHit; -- cgit v0.12 From c4d66e27ea69b84bf280209fc72239132924930d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 9 Dec 2009 12:14:58 +0100 Subject: GLES 2 should *not* use a multisampled format by default. This is a platform regression and should never have been there in the first place. Having this as the default format on embedded devices may drop the framerates with as much as 30% on selected HW. Reviewed-by: Tom Cooksey --- src/opengl/qgl.cpp | 3 +-- src/opengl/qgl_p.h | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 25285b5..dcf8c00 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -397,8 +397,7 @@ static inline GLint qgluProject(GLdouble objx, GLdouble objy, GLdouble objz, \i \link setDirectRendering() Direct rendering:\endlink Enabled. \i \link setOverlay() Overlay:\endlink Disabled. \i \link setPlane() Plane:\endlink 0 (i.e., normal plane). - \i \link setSampleBuffers() Multisample buffers:\endlink Enabled on - OpenGL/ES 2.0, disabled on other platforms. + \i \link setSampleBuffers() Multisample buffers:\endlink Disabled. \endlist */ diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 615fb60..8a0b31f 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -133,9 +133,6 @@ public: : ref(1) { opts = QGL::DoubleBuffer | QGL::DepthBuffer | QGL::Rgba | QGL::DirectRendering | QGL::StencilBuffer; -#if defined(QT_OPENGL_ES_2) - opts |= QGL::SampleBuffers; -#endif pln = 0; depthSize = accumSize = stencilSize = redSize = greenSize = blueSize = alphaSize = -1; numSamples = -1; -- cgit v0.12 From 7fecd890ce50d86120566acc7e71fcac915a671f Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 9 Dec 2009 14:19:33 +0100 Subject: Fixed a regression in dock widget resizing It could happen that they grow much more than the movement of the mouse Task-number: QTBUG-6499 Reviewed-by: gabi --- src/gui/widgets/qdockarealayout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index 0a26a77..cf82da0 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -1303,9 +1303,9 @@ QDockAreaLayoutInfo *QDockAreaLayoutInfo::info(const QList &path) index = -index - 1; if (index >= item_list.count()) return this; - if (path.count() == 1 || item_list.at(index).subinfo == 0) + if (path.count() == 1 || item_list[index].subinfo == 0) return this; - return item_list.at(index).subinfo->info(path.mid(1)); + return item_list[index].subinfo->info(path.mid(1)); } QRect QDockAreaLayoutInfo::itemRect(int index) const -- cgit v0.12 From bdb485519d957bb551d5eeae8a866df45a59c647 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 9 Dec 2009 14:35:32 +0100 Subject: Use realpath() only on systems we know it works on. We use realpath(X,0) extension that is defined by the latest POSIX standard and not many systems support it at the moment. For now we limit it to Linux and Symbian. Mac supports it starting with 10.6, and we'll implement it properly for Mac in 4.7. We know that neither *BSD systems nor Solaris do not support it. Reviewed-by: Markus Goetz --- src/corelib/io/qfsfileengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index 37b0ea1..e4c4e3f 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -144,7 +144,7 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path) return path; #endif // Mac OS X 10.5.x doesn't support the realpath(X,0) extenstion we use here. -#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_LINIX) || defined(Q_OS_SYMBIAN) char *ret = realpath(path.toLocal8Bit().constData(), (char*)0); if (ret) { QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret)); -- cgit v0.12 From 9f3cde38bffb79da82d6248a873a687d37177954 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 9 Dec 2009 14:49:15 +0100 Subject: Don't assert on valid math in qbezier --- src/gui/painting/qbezier_p.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h index 7dbd0c2..c284871 100644 --- a/src/gui/painting/qbezier_p.h +++ b/src/gui/painting/qbezier_p.h @@ -166,8 +166,6 @@ inline void QBezier::coefficients(qreal t, qreal &a, qreal &b, qreal &c, qreal & inline QPointF QBezier::pointAt(qreal t) const { - Q_ASSERT(t >= 0); - Q_ASSERT(t <= 1); #if 1 qreal a, b, c, d; coefficients(t, a, b, c, d); -- cgit v0.12 From 0c30418556d978f730c33aa3bb066961981ccc9b Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 9 Dec 2009 15:15:35 +0100 Subject: Fix crash when rotating cleartype text under gl engine. Reviewed-by: Eskil --- src/gui/painting/qtextureglyphcache_p.h | 5 +---- src/gui/text/qfontengine.cpp | 10 ++++++---- src/gui/text/qfontengine_p.h | 4 ++-- src/gui/text/qfontengineglyphcache_p.h | 7 +++++-- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 4 ++-- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index 57473d1..bb0c630 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -76,7 +76,7 @@ class Q_GUI_EXPORT QTextureGlyphCache : public QFontEngineGlyphCache { public: QTextureGlyphCache(QFontEngineGlyphCache::Type type, const QTransform &matrix) - : QFontEngineGlyphCache(matrix), m_w(0), m_h(0), m_cx(0), m_cy(0), m_type(type) { } + : QFontEngineGlyphCache(matrix, type), m_w(0), m_h(0), m_cx(0), m_cy(0) { } virtual ~QTextureGlyphCache() { } @@ -98,8 +98,6 @@ public: virtual void resizeTextureData(int width, int height) = 0; virtual int glyphMargin() const { return 0; } - QFontEngineGlyphCache::Type cacheType() const { return m_type; } - virtual void fillTexture(const Coord &coord, glyph_t glyph) = 0; inline void createCache(int width, int height) { @@ -121,7 +119,6 @@ protected: int m_h; // image height int m_cx; // current x int m_cy; // current y - QFontEngineGlyphCache::Type m_type; }; diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 27fc3c1..0eadf04 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -742,14 +742,15 @@ void QFontEngine::expireGlyphCache() } } -void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data) +void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data, QFontEngineGlyphCache::Type type) { Q_ASSERT(data); QList items = m_glyphPointerHash.value(key); for (QList::iterator it = items.begin(), end = items.end(); it != end; ++it) { QFontEngineGlyphCache *c = *it; - if (qtransform_equals_no_translate(c->m_transform, data->m_transform)) { + if (qtransform_equals_no_translate(c->m_transform, data->m_transform) + && c->cacheType() == type) { if (c == data) return; items.removeAll(c); @@ -786,13 +787,14 @@ void QFontEngine::setGlyphCache(QFontEngineGlyphCache::Type key, QFontEngineGlyp expireGlyphCache(); } -QFontEngineGlyphCache *QFontEngine::glyphCache(void *key, const QTransform &transform) const +QFontEngineGlyphCache *QFontEngine::glyphCache(void *key, const QTransform &transform, QFontEngineGlyphCache::Type type) const { QList items = m_glyphPointerHash.value(key); for (QList::iterator it = items.begin(), end = items.end(); it != end; ++it) { QFontEngineGlyphCache *c = *it; - if (qtransform_equals_no_translate(c->m_transform, transform)) { + if (qtransform_equals_no_translate(c->m_transform, transform) + && type == c->cacheType()) { m_glyphCacheQueue.removeAll(c); // last used, move it up m_glyphCacheQueue.append(c); return c; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 728c344..62bff85 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -218,9 +218,9 @@ public: virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints); - void setGlyphCache(void *key, QFontEngineGlyphCache *data); + void setGlyphCache(void *key, QFontEngineGlyphCache *data, QFontEngineGlyphCache::Type type); void setGlyphCache(QFontEngineGlyphCache::Type key, QFontEngineGlyphCache *data); - QFontEngineGlyphCache *glyphCache(void *key, const QTransform &transform) const; + QFontEngineGlyphCache *glyphCache(void *key, const QTransform &transform, QFontEngineGlyphCache::Type type) const; QFontEngineGlyphCache *glyphCache(QFontEngineGlyphCache::Type key, const QTransform &transform) const; static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize); diff --git a/src/gui/text/qfontengineglyphcache_p.h b/src/gui/text/qfontengineglyphcache_p.h index e04f4ac..c6112ba 100644 --- a/src/gui/text/qfontengineglyphcache_p.h +++ b/src/gui/text/qfontengineglyphcache_p.h @@ -75,17 +75,20 @@ QT_BEGIN_NAMESPACE class QFontEngineGlyphCache { public: - QFontEngineGlyphCache(const QTransform &matrix) : m_transform(matrix) { } - enum Type { Raster_RGBMask, Raster_A8, Raster_Mono }; + QFontEngineGlyphCache(const QTransform &matrix, Type type) : m_transform(matrix), m_type(type) { } + virtual ~QFontEngineGlyphCache() { } + Type cacheType() const { return m_type; } + QTransform m_transform; + QFontEngineGlyphCache::Type m_type; }; typedef QHash > GlyphPointerHash; typedef QHash > GlyphIntHash; diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 17af9cb..9f42217 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1562,11 +1562,11 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); QGLTextureGlyphCache *cache = - (QGLTextureGlyphCache *) ti.fontEngine->glyphCache(ctx, QTransform()); + (QGLTextureGlyphCache *) ti.fontEngine->glyphCache(ctx, QTransform(), glyphType); if (!cache || cache->cacheType() != glyphType) { cache = new QGLTextureGlyphCache(ctx, glyphType, QTransform()); - ti.fontEngine->setGlyphCache(ctx, cache); + ti.fontEngine->setGlyphCache(ctx, cache, glyphType); } cache->setPaintEnginePrivate(this); -- cgit v0.12 From 293db01f907ad8644e8242055521e6b8e7c4dfec Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 9 Dec 2009 16:07:13 +0100 Subject: Fix a crash on the focus chain when removing items from the scene. The crash was because of the dangling pointer set on the tabFocusFirst attribute in QGraphicsScene. A child which was the tabFocusFirst was removed from the scene and fixFocusChainBeforeReparenting was setting the new tabFocusFirst pointer to the parent (since in that example it was the focusNext) but later on the parent was removed also from the scene (due to the recursion of removeItem if you call it with the parent : first children, then the parent itself) and fixFocusChainBeforeReparenting was not called again so if you delete the parent then the scene has the dangling pointer set. Task-number:QTBUG-6544 Reviewed-by:janarve --- src/gui/graphicsview/qgraphicsscene.cpp | 11 ++++---- src/gui/graphicsview/qgraphicswidget.cpp | 2 +- src/gui/graphicsview/qgraphicswidget_p.cpp | 4 +-- src/gui/graphicsview/qgraphicswidget_p.h | 2 +- tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 32 ++++++++++++++++++++++ 5 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 27ebb79..2af90b8 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -569,14 +569,10 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item) item->d_ptr->clearSubFocus(); - if (!item->d_ptr->inDestructor && item == tabFocusFirst) { - QGraphicsWidget *widget = static_cast(item); - widget->d_func()->fixFocusChainBeforeReparenting(0, 0); - } - if (item->flags() & QGraphicsItem::ItemSendsScenePositionChanges) unregisterScenePosItem(item); + QGraphicsScene *oldScene = item->d_func()->scene; item->d_func()->scene = 0; //We need to remove all children first because they might use their parent @@ -587,6 +583,11 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item) q->removeItem(item->d_ptr->children.at(i)); } + if (!item->d_ptr->inDestructor && item == tabFocusFirst) { + QGraphicsWidget *widget = static_cast(item); + widget->d_func()->fixFocusChainBeforeReparenting(0, oldScene, 0); + } + // Unregister focus proxy. item->d_ptr->resetFocusProxy(); diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index fe569f4..8de81c2 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -1054,7 +1054,7 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant & break; case ItemParentChange: { QGraphicsItem *parent = qVariantValue(value); - d->fixFocusChainBeforeReparenting((parent && parent->isWidget()) ? static_cast(parent) : 0); + d->fixFocusChainBeforeReparenting((parent && parent->isWidget()) ? static_cast(parent) : 0, scene()); // Deliver ParentAboutToChange. QEvent event(QEvent::ParentAboutToChange); diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp index b747a30..5b6490f 100644 --- a/src/gui/graphicsview/qgraphicswidget_p.cpp +++ b/src/gui/graphicsview/qgraphicswidget_p.cpp @@ -743,7 +743,7 @@ bool QGraphicsWidgetPrivate::hasDecoration() const /** * is called after a reparent has taken place to fix up the focus chain(s) */ -void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *newScene) +void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *oldScene, QGraphicsScene *newScene) { Q_Q(QGraphicsWidget); @@ -789,7 +789,7 @@ void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *new // update tabFocusFirst for oldScene if the item is going to be removed from oldScene if (newParent) newScene = newParent->scene(); - QGraphicsScene *oldScene = q->scene(); + if (oldScene && newScene != oldScene) oldScene->d_func()->tabFocusFirst = firstOld; diff --git a/src/gui/graphicsview/qgraphicswidget_p.h b/src/gui/graphicsview/qgraphicswidget_p.h index eb53649..65e6962 100644 --- a/src/gui/graphicsview/qgraphicswidget_p.h +++ b/src/gui/graphicsview/qgraphicswidget_p.h @@ -98,7 +98,7 @@ public: mutable qreal *margins; void ensureMargins() const; - void fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *newScene = 0); + void fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *oldScene, QGraphicsScene *newScene = 0); void setLayout_helper(QGraphicsLayout *l); // Layouts diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index 3303df5..a835259 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -168,6 +168,7 @@ private slots: void task236127_bspTreeIndexFails(); void task243004_setStyleCrash(); void task250119_shortcutContext(); + void QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems(); }; @@ -2855,6 +2856,37 @@ void tst_QGraphicsWidget::polishEvent2() QVERIFY(widget->events.contains(QEvent::Polish)); } +void tst_QGraphicsWidget::QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems() +{ + QGraphicsScene scene; + QGraphicsWidget* parent1 = new QGraphicsWidget; + QGraphicsWidget* child1_0 = new QGraphicsWidget; + QGraphicsWidget* child1_1 = new QGraphicsWidget; + + QGraphicsWidget* parent2 = new QGraphicsWidget; + + // Add the parent and child to the scene. + scene.addItem(parent1); + child1_0->setParentItem(parent1); + child1_1->setParentItem(parent1); + + // Hide and show the child. + child1_0->setParentItem(NULL); + scene.removeItem(child1_0); + + // Remove parent from the scene. + scene.removeItem(parent1); + + delete child1_0; + delete child1_1; + delete parent1; + + // Add an item into the scene. + scene.addItem(parent2); + + //This should not crash +} + QTEST_MAIN(tst_QGraphicsWidget) #include "tst_qgraphicswidget.moc" -- cgit v0.12 From 16de24d638deafb6e985b531fdf0c15691c0b7b4 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 10 Dec 2009 09:28:04 +1000 Subject: Recreate VGImage properly in out of memory case If vgCreateImage() runs out of memory, then the drawPixmap() will fail. But previously, it would also prevent future attempts to call vgImageSubData() to populate the data when memory was present. Task-number: QTBUG-6639 Reviewed-by: Sarah Smith --- src/openvg/qpixmapdata_vg.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index 5d5fcbf..af6f0f0 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -250,6 +250,10 @@ VGImage QVGPixmapData::toVGImage() if (vgImage == VG_INVALID_HANDLE) { vgImage = vgCreateImage (VG_sARGB_8888_PRE, w, h, VG_IMAGE_QUALITY_FASTER); + + // Bail out if we run out of GPU memory - try again next time. + if (vgImage == VG_INVALID_HANDLE) + return VG_INVALID_HANDLE; } if (!source.isNull() && recreate) { @@ -280,6 +284,10 @@ VGImage QVGPixmapData::toVGImage(qreal opacity) if (vgImageOpacity == VG_INVALID_HANDLE) { vgImageOpacity = vgCreateImage (VG_sARGB_8888_PRE, w, h, VG_IMAGE_QUALITY_FASTER); + + // Bail out if we run out of GPU memory - try again next time. + if (vgImageOpacity == VG_INVALID_HANDLE) + return VG_INVALID_HANDLE; } VGfloat matrix[20] = { 1.0f, 0.0f, 0.0f, 0.0f, -- cgit v0.12 From c73d4f8b55dbb79b7a2df38d167a7c5ffd4520ce Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 10 Dec 2009 10:04:36 +0100 Subject: Fix compilation: private headers must be #included with "" The reason is that the private headers don't exist in any of the -I lines, so they need to be found by the preprocessor relative to the source file, which means "". Task-number: QTBUG-6665 Reviewed-by: Trust Me --- src/dbus/qdbusargument_p.h | 2 +- src/dbus/qdbusconnection_p.h | 2 +- src/dbus/qdbusconnectioninterface.cpp | 2 +- src/dbus/qdbuserror.cpp | 2 +- src/dbus/qdbusintegrator_p.h | 2 +- src/dbus/qdbusinterface.cpp | 2 +- src/dbus/qdbusinterface_p.h | 4 ++-- src/dbus/qdbusinternalfilters.cpp | 2 +- src/dbus/qdbusmessage.cpp | 2 +- src/dbus/qdbusmetatype.cpp | 2 +- src/dbus/qdbusutil.cpp | 2 +- src/dbus/qdbusxmlparser_p.h | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/dbus/qdbusargument_p.h b/src/dbus/qdbusargument_p.h index 47c5e62..17302b4 100644 --- a/src/dbus/qdbusargument_p.h +++ b/src/dbus/qdbusargument_p.h @@ -54,7 +54,7 @@ // #include -#include +#include "qdbus_symbols_p.h" QT_BEGIN_NAMESPACE diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index b65e101..d6f7598 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -67,7 +67,7 @@ #include #include -#include +#include "qdbus_symbols_p.h" #include diff --git a/src/dbus/qdbusconnectioninterface.cpp b/src/dbus/qdbusconnectioninterface.cpp index 0f9a67f..ec61859 100644 --- a/src/dbus/qdbusconnectioninterface.cpp +++ b/src/dbus/qdbusconnectioninterface.cpp @@ -49,7 +49,7 @@ #include #include -#include // for the DBUS_* constants +#include "qdbus_symbols_p.h" // for the DBUS_* constants QT_BEGIN_NAMESPACE diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index 5c2fa2b..a48b878 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include "qdbus_symbols_p.h" #include "qdbusmessage.h" #include "qdbusmessage_p.h" diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h index 5b18aca..85c6cb2 100644 --- a/src/dbus/qdbusintegrator_p.h +++ b/src/dbus/qdbusintegrator_p.h @@ -54,7 +54,7 @@ #ifndef QDBUSINTEGRATOR_P_H #define QDBUSINTEGRATOR_P_H -#include +#include "qdbus_symbols_p.h" #include "qcoreevent.h" #include "qeventloop.h" diff --git a/src/dbus/qdbusinterface.cpp b/src/dbus/qdbusinterface.cpp index d0a693f..c05e6a9 100644 --- a/src/dbus/qdbusinterface.cpp +++ b/src/dbus/qdbusinterface.cpp @@ -41,7 +41,7 @@ #include "qdbusinterface.h" -#include +#include "qdbus_symbols_p.h" #include #include diff --git a/src/dbus/qdbusinterface_p.h b/src/dbus/qdbusinterface_p.h index 3d11af1..a601608 100644 --- a/src/dbus/qdbusinterface_p.h +++ b/src/dbus/qdbusinterface_p.h @@ -54,8 +54,8 @@ #ifndef QDBUSINTERFACEPRIVATE_H #define QDBUSINTERFACEPRIVATE_H -#include -#include +#include "qdbusabstractinterface_p.h" +#include "qdbusmetaobject_p.h" #include QT_BEGIN_NAMESPACE diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp index acd04d3..37110c5 100644 --- a/src/dbus/qdbusinternalfilters.cpp +++ b/src/dbus/qdbusinternalfilters.cpp @@ -41,7 +41,7 @@ #include "qdbusconnection_p.h" -#include +#include "qdbus_symbols_p.h" #include #include #include diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index 4f1950b..a37ba1f 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include "qdbus_symbols_p.h" #include "qdbusargument_p.h" #include "qdbuserror.h" diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp index 237aea3..afa3bbf 100644 --- a/src/dbus/qdbusmetatype.cpp +++ b/src/dbus/qdbusmetatype.cpp @@ -42,7 +42,7 @@ #include "qdbusmetatype.h" #include -#include +#include "qdbus_symbols_p.h" #include #include diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp index bf5a739..01b1dbd 100644 --- a/src/dbus/qdbusutil.cpp +++ b/src/dbus/qdbusutil.cpp @@ -41,7 +41,7 @@ #include "qdbusutil_p.h" -#include +#include "qdbus_symbols_p.h" #include diff --git a/src/dbus/qdbusxmlparser_p.h b/src/dbus/qdbusxmlparser_p.h index 3dbae1b..1a0523b 100644 --- a/src/dbus/qdbusxmlparser_p.h +++ b/src/dbus/qdbusxmlparser_p.h @@ -56,7 +56,7 @@ #include #include #include -#include +#include "qdbusintrospection_p.h" QT_BEGIN_NAMESPACE -- cgit v0.12 From 2705480b5cd740eee3ed684a26508b0497b00477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Thu, 10 Dec 2009 09:51:03 +0100 Subject: Doc: Try to explain better when and how the easing curve is applied Maybe not perfect, but it should be *better* at least. Task-number: QTBUG-6623 Reviewed-by: Thierry --- src/corelib/animation/qvariantanimation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index d529f67..bc0d35e 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -373,6 +373,13 @@ QVariantAnimation::~QVariantAnimation() Another example is QEasingCurve::InOutElastic, which provides an elastic effect on the values of the interpolated variant. + QVariantAnimation will use the QEasingCurve::valueForProgress() to + transform the "normalized progress" (currentTime / totalDuration) + of the animation into the effective progress actually + used by the animation. It is this effective progress that will be + the progress when interpolated() is called. Also, the steps in the + keyValues are referring to this effective progress. + The easing curve is used with the interpolator, the interpolated() virtual function, the animation's duration, and iterationCount, to control how the current value changes as the animation progresses. -- cgit v0.12 From f85306467b84cbc300d13aa52e0f5db4b1a2b1e6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 10 Dec 2009 10:10:43 +0100 Subject: Fix compilation if QT_NO_DATESTRING is defined. If we have no string parsing in QDateTime, then we use sscanf, so we must include Task-number: QTBUG-6668 Reviewed-by: Markus Goetz --- src/network/access/qnetworkrequest.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index c91c608..923f2e3 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -49,6 +49,9 @@ #include "QtCore/qdatetime.h" #include +#ifndef QT_NO_DATESTRING +# include +#endif QT_BEGIN_NAMESPACE -- cgit v0.12 From ba9ea2b97bdd2329cb479bb7a6aef1bc7cee82d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Thu, 10 Dec 2009 10:26:06 +0100 Subject: Doc: The ctor of of QGraphicsLayout might install the layout. Task-number: QTBUG-6447 --- src/gui/graphicsview/qgraphicslayout.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp index 2e9a30c..1e426c8 100644 --- a/src/gui/graphicsview/qgraphicslayout.cpp +++ b/src/gui/graphicsview/qgraphicslayout.cpp @@ -148,6 +148,10 @@ QT_BEGIN_NAMESPACE \a parent is passed to QGraphicsLayoutItem's constructor and the QGraphicsLayoutItem's isLayout argument is set to \e true. + + If \a parent is a QGraphicsWidget the layout will be installed + on that widget. (Note that installing a layout will delete the old one + installed.) */ QGraphicsLayout::QGraphicsLayout(QGraphicsLayoutItem *parent) : QGraphicsLayoutItem(*new QGraphicsLayoutPrivate) -- cgit v0.12 From ab5d00edea76d3b1d38d6e7e59159042ec69f2f2 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 10 Dec 2009 10:41:53 +0100 Subject: Clean up the QFontEngine glyphcaching code to not crash and be more tidy Reviewed-by: Eskil --- src/gui/painting/qpaintengine_raster.cpp | 4 +- src/gui/text/qfontengine.cpp | 124 ++++----------------- src/gui/text/qfontengine_p.h | 18 +-- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 5 +- 4 files changed, 32 insertions(+), 119 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 4a72434..aa3b89e 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3018,10 +3018,10 @@ void QRasterPaintEngine::drawCachedGlyphs(const QPointF &p, const QTextItemInt & QFontEngineGlyphCache::Type glyphType = ti.fontEngine->glyphFormat >= 0 ? QFontEngineGlyphCache::Type(ti.fontEngine->glyphFormat) : d->glyphCacheType; QImageTextureGlyphCache *cache = - (QImageTextureGlyphCache *) ti.fontEngine->glyphCache(glyphType, s->matrix); + (QImageTextureGlyphCache *) ti.fontEngine->glyphCache(0, glyphType, s->matrix); if (!cache) { cache = new QImageTextureGlyphCache(glyphType, s->matrix); - ti.fontEngine->setGlyphCache(glyphType, cache); + ti.fontEngine->setGlyphCache(0, cache); } cache->populate(ti, glyphs, positions); diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 0eadf04..d364025 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -185,22 +185,11 @@ QFontEngine::QFontEngine() QFontEngine::~QFontEngine() { - for (GlyphPointerHash::const_iterator it = m_glyphPointerHash.constBegin(), - end = m_glyphPointerHash.constEnd(); it != end; ++it) { - for (QList::const_iterator it2 = it.value().constBegin(), - end2 = it.value().constEnd(); it2 != end2; ++it2) { - delete *it2; - } - } - m_glyphPointerHash.clear(); - for (GlyphIntHash::const_iterator it = m_glyphIntHash.constBegin(), - end = m_glyphIntHash.constEnd(); it != end; ++it) { - for (QList::const_iterator it2 = it.value().constBegin(), - end2 = it.value().constEnd(); it2 != end2; ++it2) { - delete *it2; - } + for (QLinkedList::const_iterator it = m_glyphCaches.constBegin(), + end = m_glyphCaches.constEnd(); it != end; ++it) { + delete it->cache; } - m_glyphIntHash.clear(); + m_glyphCaches.clear(); qHBFreeFace(hbFace); } @@ -713,105 +702,30 @@ QByteArray QFontEngine::getSfntTable(uint tag) const return table; } -void QFontEngine::expireGlyphCache() -{ - if (m_glyphCacheQueue.count() > 10) { // hold only 10 caches in memory. - QFontEngineGlyphCache *old = m_glyphCacheQueue.takeFirst(); - // remove the value from either of our hashes - for (GlyphPointerHash::iterator i = m_glyphPointerHash.begin(); i != m_glyphPointerHash.end(); ++i) { - QList list = i.value(); - if (list.removeAll(old)) { - if (list.isEmpty()) - m_glyphPointerHash.remove(i.key()); - else - m_glyphPointerHash.insert(i.key(), list); - break; - } - } - for (GlyphIntHash::iterator i = m_glyphIntHash.begin(); i != m_glyphIntHash.end(); ++i) { - QList list = i.value(); - if (list.removeAll(old)) { - if (list.isEmpty()) - m_glyphIntHash.remove(i.key()); - else - m_glyphIntHash.insert(i.key(), list); - break; - } - } - delete old; - } -} - -void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data, QFontEngineGlyphCache::Type type) +void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data) { Q_ASSERT(data); - QList items = m_glyphPointerHash.value(key); - - for (QList::iterator it = items.begin(), end = items.end(); it != end; ++it) { - QFontEngineGlyphCache *c = *it; - if (qtransform_equals_no_translate(c->m_transform, data->m_transform) - && c->cacheType() == type) { - if (c == data) - return; - items.removeAll(c); - delete c; - break; - } - } - items.append(data); - m_glyphPointerHash.insert(key, items); - m_glyphCacheQueue.append(data); - expireGlyphCache(); -} + GlyphCacheEntry entry = { key, data }; + if (m_glyphCaches.contains(entry)) + return; -void QFontEngine::setGlyphCache(QFontEngineGlyphCache::Type key, QFontEngineGlyphCache *data) -{ - Q_ASSERT(data); - QList items = m_glyphIntHash.value(key); - - for (QList::iterator it = items.begin(), end = items.end(); it != end; ++it) { - QFontEngineGlyphCache *c = *it; - if (qtransform_equals_no_translate(c->m_transform, data->m_transform)) { - if (c == data) - return; - items.removeAll(c); - delete c; - break; - } - } - items.append(data); - m_glyphIntHash.insert(key, items); + // Limit the glyph caches to 4. This covers all 90 degree rotations and limits + // memory use when there is continous or random rotation + if (m_glyphCaches.size() == 4) + delete m_glyphCaches.takeLast().cache; - m_glyphCacheQueue.append(data); - expireGlyphCache(); -} + m_glyphCaches.push_front(entry); -QFontEngineGlyphCache *QFontEngine::glyphCache(void *key, const QTransform &transform, QFontEngineGlyphCache::Type type) const -{ - QList items = m_glyphPointerHash.value(key); - - for (QList::iterator it = items.begin(), end = items.end(); it != end; ++it) { - QFontEngineGlyphCache *c = *it; - if (qtransform_equals_no_translate(c->m_transform, transform) - && type == c->cacheType()) { - m_glyphCacheQueue.removeAll(c); // last used, move it up - m_glyphCacheQueue.append(c); - return c; - } - } - return 0; } -QFontEngineGlyphCache *QFontEngine::glyphCache(QFontEngineGlyphCache::Type key, const QTransform &transform) const +QFontEngineGlyphCache *QFontEngine::glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const { - QList items = m_glyphIntHash.value(key); - - for (QList::iterator it = items.begin(), end = items.end(); it != end; ++it) { - QFontEngineGlyphCache *c = *it; - if (qtransform_equals_no_translate(c->m_transform, transform)) { - m_glyphCacheQueue.removeAll(c); // last used, move it up - m_glyphCacheQueue.append(c); + for (QLinkedList::const_iterator it = m_glyphCaches.constBegin(), end = m_glyphCaches.constEnd(); it != end; ++it) { + QFontEngineGlyphCache *c = it->cache; + if (key == it->context + && type == c->cacheType() + && qtransform_equals_no_translate(c->m_transform, transform)) { return c; } } diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 62bff85..a9883b4 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -56,6 +56,7 @@ #include "QtCore/qglobal.h" #include "QtCore/qatomic.h" #include +#include #include "private/qtextengine_p.h" #include "private/qfont_p.h" @@ -218,10 +219,8 @@ public: virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints); - void setGlyphCache(void *key, QFontEngineGlyphCache *data, QFontEngineGlyphCache::Type type); - void setGlyphCache(QFontEngineGlyphCache::Type key, QFontEngineGlyphCache *data); - QFontEngineGlyphCache *glyphCache(void *key, const QTransform &transform, QFontEngineGlyphCache::Type type) const; - QFontEngineGlyphCache *glyphCache(QFontEngineGlyphCache::Type key, const QTransform &transform) const; + void setGlyphCache(void *key, QFontEngineGlyphCache *data); + QFontEngineGlyphCache *glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const; static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize); static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode); @@ -254,12 +253,13 @@ protected: static const QVector &grayPalette(); private: - /// remove old entries from the glyph cache. Helper method for the setGlyphCache ones. - void expireGlyphCache(); + struct GlyphCacheEntry { + void *context; + QFontEngineGlyphCache *cache; + bool operator==(const GlyphCacheEntry &other) { return context == other.context && cache == other.cache; } + }; - GlyphPointerHash m_glyphPointerHash; - GlyphIntHash m_glyphIntHash; - mutable QList m_glyphCacheQueue; + mutable QLinkedList m_glyphCaches; }; inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId &f2) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 9f42217..fb9bcb4 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1554,7 +1554,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly const QTextItemInt &ti) { Q_Q(QGL2PaintEngineEx); - QOpenGL2PaintEngineState *s = q->state(); QVarLengthArray positions; QVarLengthArray glyphs; @@ -1562,11 +1561,11 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); QGLTextureGlyphCache *cache = - (QGLTextureGlyphCache *) ti.fontEngine->glyphCache(ctx, QTransform(), glyphType); + (QGLTextureGlyphCache *) ti.fontEngine->glyphCache(ctx, glyphType, QTransform()); if (!cache || cache->cacheType() != glyphType) { cache = new QGLTextureGlyphCache(ctx, glyphType, QTransform()); - ti.fontEngine->setGlyphCache(ctx, cache, glyphType); + ti.fontEngine->setGlyphCache(ctx, cache); } cache->setPaintEnginePrivate(this); -- cgit v0.12 From 0160b439764726800f9b4c55acee8d554e1b1413 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 10 Dec 2009 11:04:01 +0100 Subject: Update polish translations --- translations/assistant_pl.ts | 56 +- translations/designer_pl.ts | 34 +- translations/linguist_pl.ts | 50 +- translations/qt_help_pl.ts | 45 +- translations/qt_pl.ts | 1316 ++++++++++++++++++++++++++++++------------ translations/qvfb_pl.ts | 11 +- 6 files changed, 1040 insertions(+), 472 deletions(-) diff --git a/translations/assistant_pl.ts b/translations/assistant_pl.ts index 069b5a0..0ef3251 100644 --- a/translations/assistant_pl.ts +++ b/translations/assistant_pl.ts @@ -78,7 +78,7 @@ BookmarkManager - + Bookmarks Zakładki @@ -102,7 +102,7 @@ BookmarkWidget - + Filter: Filtr: @@ -150,7 +150,7 @@ CentralWidget - + Add new page Dodaj nową stronę @@ -165,7 +165,7 @@ Wydrukuj dokument - + unknown nieznany @@ -191,7 +191,7 @@ Dodaj zakładkę dla tej strony... - + Search Wyszukaj @@ -225,7 +225,7 @@ FindWidget - + Previous Poprzedni @@ -281,7 +281,7 @@ HelpViewer - + Help Pomoc @@ -326,7 +326,7 @@ Wy&szukaj: - + Open Link Otwórz odsyłacz @@ -440,19 +440,19 @@ MainWindow - + Index Indeks - - + + Contents Spis treści - - + + Bookmarks Zakładki @@ -462,14 +462,14 @@ Wyszukaj - - - + + + Qt Assistant Qt Assistant - + Unfiltered Nieprzefiltrowany @@ -515,7 +515,12 @@ Znajdź w &tekście... - + + &Find + &Znajdź + + + Find &Next Znajdź &następny @@ -585,7 +590,12 @@ Znajdź bieżącą stronę w spisie treści - + + Sync + + + + Next Page Następna strona @@ -635,7 +645,7 @@ Przefiltrowane przez: - + Address Toolbar Pasek adresu @@ -660,7 +670,7 @@ Uaktualnianie indeksu wyszukiwawczego - + Looking for Qt Documentation... Szukanie dokumentacji Qt... @@ -962,7 +972,7 @@ Qt Assistant - + Could not register documentation file %1 @@ -1024,7 +1034,7 @@ Powód: SearchWidget - + &Copy S&kopiuj diff --git a/translations/designer_pl.ts b/translations/designer_pl.ts index f9c6dd0..005ad5a4 100644 --- a/translations/designer_pl.ts +++ b/translations/designer_pl.ts @@ -517,12 +517,12 @@ - + Move action Przenieś akcję - + Change Title Zmień tytuł @@ -703,7 +703,7 @@ ConnectionDelegate - + <object> <obiekt> @@ -1028,7 +1028,7 @@ FormBuilder - + Invalid stretch value for '%1': '%2' Parsing layout stretch values Niepoprawna wartość rozciągniecia dla '%1': '%2' @@ -1413,7 +1413,7 @@ Niepoprawny plik UI: brak głównego elementu <ui>. - + The creation of a widget of the class '%1' failed. Utworzenie widżetu klasy '%1' nie powiodło się. @@ -2277,7 +2277,7 @@ Strony pojemników powinny być dodawane jedynie poprzez wyspecyfikowanie ich w QFormBuilder - + An empty class name was passed on to %1 (object name: '%2'). Empty class name passed to widget factory method Pusta nazwa klasy została przekazana do %1 (nazwa obiektu: '%2'). @@ -4709,7 +4709,7 @@ Czy chcesz nadpisać szablon? The file "%1" has changed outside Designer. Do you want to reload it? - Plik "%1" zmienił się na zewnątrz Designera. Czy chcesz go ponownie załadować? + Plik "%1" zmienił się na zewnątrz Designera. Czy chcesz go ponownie załadować? @@ -4834,7 +4834,7 @@ Czy chcesz nadpisać szablon? qdesigner_internal::FormWindowManager - + Cu&t Wy&tnij @@ -5560,18 +5560,15 @@ Wybierz inną nazwę. qdesigner_internal::ObjectInspector - - &Find in Text... - Z&najdź w tekście... - - - - qdesigner_internal::ObjectInspector::ObjectInspectorPrivate - - + Change Current Page Zmień bieżącą stronę + + + &Find in Text... + Z&najdź w tekście... + qdesigner_internal::OrderDialog @@ -5785,9 +5782,6 @@ Wybierz inną nazwę. Browse... Przeglądaj... - - - qdesigner_internal::PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate Load Custom Device Skin diff --git a/translations/linguist_pl.ts b/translations/linguist_pl.ts index cdff54b..963c39b 100644 --- a/translations/linguist_pl.ts +++ b/translations/linguist_pl.ts @@ -4,7 +4,7 @@ AboutDialog - + Qt Linguist Qt Linguist @@ -110,11 +110,17 @@ + <p>[more duplicates omitted] <p>[pominięto resztę powtórzeń] - + + <p>* ID: %1 + <p>* identyfikator: %1 + + + <p>* Context: %1<br>* Source: %2 <p>* Kontekst: %1<br>* Źródło: %2 @@ -124,7 +130,7 @@ <br>* Komentarz: %3 - + Linguist does not know the plural rules for '%1'. Will assume a single universal form. Linguist nie zna reguł liczby mnogiej dla "%1". @@ -312,7 +318,7 @@ Przyjmie on uniwersalną formę liczby pojedynczej. LRelease - + Dropped %n message(s) which had no ID. Opuszczono %n wyrażenie które nie miało identyfikatora. @@ -714,7 +720,7 @@ Przyjmie on uniwersalną formę liczby pojedynczej. Zamienia tłumaczenia we wszystkich pasujących do wzorca wpisach. - + This is the application's main window. @@ -732,27 +738,27 @@ Przyjmie on uniwersalną formę liczby pojedynczej. - + Context Kontekst - + Items Elementy - + This panel lists the source contexts. Ten panel pokazuje listę kontekstów. - + Strings Tłumaczenia - + Phrases and guesses Wyrażenia i podpowiedzi @@ -773,7 +779,7 @@ Przyjmie on uniwersalną formę liczby pojedynczej. MOD - + Loading... Ładowanie... @@ -811,7 +817,7 @@ Czy chcesz pominąć pierwszy plik? - + Related files (%1);; Związane pliki (%1);; @@ -1176,7 +1182,7 @@ Wszystkie pliki (*) Czy chcesz zachować książke wyrażeń '%1'? - + All Wszystko @@ -1242,7 +1248,7 @@ Wszystkie pliki (*) - + Translation Tłumaczenie @@ -1579,7 +1585,7 @@ Wszystkie pliki (*) Tutaj można wprowadzić komentarze na własny użytek. One nie mają wpływu na przetłumaczoną aplikację. - + %1 translation (%2) Tłumaczenie na język %1 (%2) @@ -1609,7 +1615,7 @@ Linia: %2 MessageModel - + Completion status for %1 Stan ukończenia dla %1 @@ -1632,7 +1638,7 @@ Linia: %2 MsgEdit - + This is the right panel of the main window. @@ -1811,8 +1817,8 @@ Linia: %2 Wszystkie pliki (*) - - + + @@ -1847,7 +1853,7 @@ Linia: %2 Pliki XLIFF - + Qt Linguist 'Phrase Book' Qt Linguist "Książka wyrażeń" @@ -1998,12 +2004,12 @@ Linia: %2 TranslationSettingsDialog - + Any Country Dowolny kraj - + Settings for '%1' - Qt Linguist Ustawienia dla '%1' - Qt Linguist diff --git a/translations/qt_help_pl.ts b/translations/qt_help_pl.ts index 220f70c..f2eb6c9 100644 --- a/translations/qt_help_pl.ts +++ b/translations/qt_help_pl.ts @@ -32,13 +32,9 @@ QHelpCollectionHandler - The collection file is not set up yet! - Plik z kolekcją nie jest jeszcze ustawiony! - - The collection file '%1' is not set up yet! - + Plik z kolekcją "%1" nie jest jeszcze ustawiony! @@ -59,31 +55,27 @@ The collection file '%1' already exists! - + Plik z kolekcją "%1" już istnieje! Unknown filter '%1'! - + Nieznany filtr "%1"! Invalid documentation file '%1'! - + Niepoprawny plik z dokumentacją "%1"! Cannot register namespace '%1'! - + Nie można zarejestrować przestrzeni nazw "%1"! Cannot open database '%1' to optimize! - - - - The specified collection file already exists! - Podany plik z kolekcją już istnieje! + Nie można otworzyć bazy danych "%1" do zoptymalizowania! @@ -96,10 +88,6 @@ Nie można skopiować pliku z kolekcją: %1 - Unknown filter! - Nieznany filtr! - - Cannot register filter %1! Nie można zarejestrować pliku %1! @@ -110,10 +98,6 @@ Nie można otworzyć pliku z dokumentacją %1! - Invalid documentation file! - Niepoprawny plik z dokumentacją! - - The namespace %1 was not registered! Przestrzeń nazw %1 nie została zarejestrowana! @@ -123,14 +107,6 @@ Namespace %1 already exists! Przestrzeń nazw %1 już istnieje! - - Cannot register namespace! - Nie można zarejestrować przestrzeni nazw! - - - Cannot open database to optimize! - Nie można otworzyć bazy danych do zoptymalizowania! - QHelpDBReader @@ -144,7 +120,7 @@ QHelpEngineCore - + The specified namespace does not exist! Podana przestrzeń nazw nie istnieje! @@ -152,7 +128,7 @@ QHelpEngineCorePrivate - + Cannot open documentation file %1: %2! Nie można otworzyć pliku z dokumentacją %1: %2! @@ -342,11 +318,6 @@ QObject - - Untitled - Nienazwany - - Unknown token. Nieznany znak. diff --git a/translations/qt_pl.ts b/translations/qt_pl.ts index f79ecb0..6368b8f 100644 --- a/translations/qt_pl.ts +++ b/translations/qt_pl.ts @@ -4,7 +4,7 @@ CloseButton - + Close Tab Zamknij kartę @@ -12,7 +12,7 @@ FakeReply - + Fake error ! @@ -58,7 +58,7 @@ Phonon::AudioOutput - + <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> <html>Urządzenie dźwiękowe <b>%1</b> nie działa.<br/>Przywracanie do <b>%2</b>.</html> @@ -76,7 +76,7 @@ Phonon::Gstreamer::Backend - + Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. Some video features have been disabled. Ostrzeżenie: Wygląda na to, że pakiet gstreamer0.10-plugins-good nie jest zainstalowany w tym systemie. @@ -96,7 +96,7 @@ Obsługa dźwięku i wideo została wyłączona Cannot start playback. -Check your Gstreamer installation and make sure you +Check your GStreamer installation and make sure you have libgstreamer-plugins-base installed. Nie można rozpocząć odtwarzania. @@ -109,10 +109,10 @@ zainstalowałeś libgstreamer-plugins-base. Brak wymaganego kodeka. Aby odtworzyć zawartość musisz zainstalować poniższy kodek: %0 - + - + @@ -121,12 +121,12 @@ zainstalowałeś libgstreamer-plugins-base. Nie można otworzyć źródła mediów. - + Invalid source type. Niepoprawny typ źródła. - + Could not locate media source. Nie można znaleźć źródła mediów. @@ -144,7 +144,7 @@ zainstalowałeś libgstreamer-plugins-base. Phonon::MMF - + Audio Output Wyjście dźwięku @@ -166,12 +166,12 @@ zainstalowałeś libgstreamer-plugins-base. Phonon::MMF::EffectFactory - audio equalizer + Audio Equalizer Korektor graficzny - Bass boost + Bass Boost Wzmocnienie basów @@ -202,6 +202,14 @@ zainstalowałeś libgstreamer-plugins-base. + Phonon::MMF::MediaObject + + + Media type could not be determined + Nie można określić typu mediów + + + Phonon::VolumeSlider @@ -268,7 +276,7 @@ zainstalowałeś libgstreamer-plugins-base. Q3FileDialog - + %1 File not found. Check path and filename. @@ -285,7 +293,7 @@ Sprawdź ścieżkę i nazwę pliku. - + All Files (*) Wszystkie pliki (*) @@ -905,8 +913,8 @@ na QAbstractSocket - - + + Connection refused Połączenie odrzucone @@ -925,8 +933,8 @@ na Przekroczony czas połączenia - - + + Operation on socket is not supported Operacja na gnieździe nieobsługiwana @@ -970,7 +978,7 @@ na Press - Wciśnij + Wciśnij @@ -996,7 +1004,7 @@ na Niekompatybilność biblioteki Qt - + QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. LTR @@ -1173,7 +1181,7 @@ na QDB2Driver - + Unable to connect Nie można nawiązać połączenia @@ -1196,7 +1204,7 @@ na QDB2Result - + Unable to execute statement Nie można wykonać polecenia @@ -1284,7 +1292,7 @@ na QDialogButtonBox - + Abort Przerwij @@ -1511,7 +1519,7 @@ na Cannot remove source file - Nie można usunąć oryginalnego pilku + Nie można usunąć oryginalnego pliku @@ -1575,7 +1583,7 @@ Proszę o sprawdzenie podanej nazwy pliku. Czy na pewno chcesz skasować '%1'? - + Recent Places Ostatnie miejsca @@ -1586,7 +1594,7 @@ Proszę o sprawdzenie podanej nazwy pliku. Powrót - + Could not delete directory. Nie można skasować katalogu. @@ -1803,9 +1811,8 @@ Proszę o sprawdzenie podanej nazwy pliku. - %1 bytes - %1 b + %1 bajtów @@ -1854,62 +1861,67 @@ Proszę o sprawdzenie podanej nazwy pliku. Computer Komputer + + + %1 byte(s) + %1 bajt(ów) + QFontDatabase - + Normal Normalny - + - + Bold Pogrubiony - - + + Demi Bold Na wpół pogrubiony - + - + Black it's about font weight Bardzo gruby - + Demi Na wpół - + Light it's about font weight Cienki - - + + Italic Kursywa - - + + Oblique Pochyły - + Any Każdy @@ -2073,6 +2085,11 @@ Proszę o sprawdzenie podanej nazwy pliku. Runic Runiczny + + + N'Ko + N'Ko + QFontDialog @@ -2272,7 +2289,7 @@ Proszę o sprawdzenie podanej nazwy pliku. QHostInfo - + Unknown error Nieznany błąd @@ -2326,7 +2343,7 @@ Proszę o sprawdzenie podanej nazwy pliku. Podłączony do hosta %1 - + Connection closed Połączenie zakończone @@ -2633,7 +2650,7 @@ Proszę o sprawdzenie podanej nazwy pliku. QIODevice - + No space left on device Brak wolnego miejsca na urządzeniu @@ -2653,7 +2670,7 @@ Proszę o sprawdzenie podanej nazwy pliku. Zbyt wiele otwartych plików - + Unknown error Nieznany błąd @@ -2717,7 +2734,7 @@ Proszę o sprawdzenie podanej nazwy pliku. Błąd podczas weryfikacji danych we wtyczce '%1' - + The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] Wtyczka '%1' używa niepoprawnej wersji biblioteki QT. (%2.%3.%4) [%5] @@ -2769,37 +2786,37 @@ Proszę o sprawdzenie podanej nazwy pliku. QLineEdit - + &Copy S&kopiuj - + Cu&t W&ytnij - + Delete Skasuj - + &Paste &Wklej - + &Redo &Przywróć - + Select All Zaznacz wszystko - + &Undo &Cofnij @@ -2808,7 +2825,7 @@ Proszę o sprawdzenie podanej nazwy pliku. QLocalServer - + %1: Name error %1: Błąd nazwy @@ -2902,7 +2919,7 @@ Proszę o sprawdzenie podanej nazwy pliku. QMYSQLDriver - + Unable to begin transaction Nie można rozpocząć transakcji @@ -2912,7 +2929,7 @@ Proszę o sprawdzenie podanej nazwy pliku. Nie można potwierdzić transakcji - + Unable to connect Nie można nawiązać połączenia @@ -2922,7 +2939,7 @@ Proszę o sprawdzenie podanej nazwy pliku. Nie można otworzyć bazy danych ' - + Unable to rollback transaction Nie można wycofać transakcji @@ -2930,7 +2947,7 @@ Proszę o sprawdzenie podanej nazwy pliku. QMYSQLResult - + Unable to bind outvalues Nie można powiązać wartości zewnętrznych @@ -2951,12 +2968,13 @@ Proszę o sprawdzenie podanej nazwy pliku. Nie można wykonać polecenia - + + Unable to fetch data Nie można pobrać danych - + Unable to prepare statement Nie można przygotować polecenia @@ -3332,27 +3350,30 @@ Proszę o sprawdzenie podanej nazwy pliku. QNetworkAccessFileBackend + Request for opening non-local file %1 Żądanie otwarcia zdalnego pliku %1 - + + Error opening %1: %2 Błąd otwierania %1: %2 - + Write error writing to %1: %2 Błąd w trakcie zapisywania do %1: %2 - + + Cannot open %1: Path is a directory Nie można otworzyć %1: Ścieżka jest katalogiem - + Read error reading from %1: %2 Błąd w trakcie czytania z %1: %2 @@ -3418,7 +3439,7 @@ Proszę o sprawdzenie podanej nazwy pliku. QOCIDriver - + Unable to initialize QOCIDriver Nie można dokonać inicjalizacji @@ -3447,8 +3468,8 @@ Proszę o sprawdzenie podanej nazwy pliku. QOCIResult - - + + Unable to bind column for batch execute Nie można powiązać kolumny dla wykonania zestawu poleceń @@ -3552,7 +3573,7 @@ Proszę o sprawdzenie podanej nazwy pliku. Nie można przygotować polecenia - + Unable to fetch last @@ -3611,7 +3632,7 @@ Proszę o sprawdzenie podanej nazwy pliku. QPPDOptionsModel - + Name Nazwa @@ -3927,7 +3948,7 @@ Proszę o sprawdzenie podanej nazwy pliku. Wydrukuj zakres - + unknown nieznany @@ -3975,12 +3996,12 @@ Proszę o sprawdzenie podanej nazwy pliku. Wydrukuj - + Print To File ... Wydrukuj do pliku ... - + File %1 is not writable. Please choose a different file name. Plik %1 jest plikiem tylko do odczytu. @@ -4171,7 +4192,7 @@ Proszę wybrać inną nazwę pliku. Niestandardowy - + &Options >> &Opcje >> @@ -4483,7 +4504,7 @@ Proszę wybrać inną nazwę pliku. QProcess - + Could not open input redirection for reading Nie można otworzyć wejściowego przekierowania do odczytu @@ -4500,7 +4521,7 @@ Proszę wybrać inną nazwę pliku. Błąd zasobów (błąd forkowania): %1 - + @@ -4664,7 +4685,7 @@ Proszę wybrać inną nazwę pliku. QSQLiteDriver - + Error closing database Błąd zamykania bazy danych @@ -4707,8 +4728,8 @@ Proszę wybrać inną nazwę pliku. Nie można wykonać polecenia - - + + Unable to fetch row Nie można pobrać wiersza danych @@ -4719,7 +4740,7 @@ Proszę wybrać inną nazwę pliku. Nie można skasować polecenia - + No query Brak zapytania @@ -4744,7 +4765,7 @@ Proszę wybrać inną nazwę pliku. Ignore-count - + Licznik pominięć @@ -4754,7 +4775,7 @@ Proszę wybrać inną nazwę pliku. Hit-count - Ilość trafień + Licznik trafień @@ -5031,7 +5052,7 @@ Proszę wybrać inną nazwę pliku. Debug Output - Wyjscie debuggera + Wyjście debuggera @@ -5167,7 +5188,7 @@ Proszę wybrać inną nazwę pliku. - + %1: permission denied %1: brak dostępu @@ -5262,7 +5283,7 @@ Proszę wybrać inną nazwę pliku. QShortcut - + + + @@ -5273,12 +5294,12 @@ Proszę wybrać inną nazwę pliku. Alt - + Back Back - + Backspace Backspace @@ -5288,7 +5309,7 @@ Proszę wybrać inną nazwę pliku. Backtab - + Bass Boost Wzmocnienie basów @@ -5303,7 +5324,7 @@ Proszę wybrać inną nazwę pliku. Basy w górę - + Call Wywołaj @@ -5313,289 +5334,734 @@ Proszę wybrać inną nazwę pliku. Caps Lock - + CapsLock CapsLock - - Context1 - Kontekst1 + + Monitor Brightness Up + Zwiększ jasność monitora - Context2 - Kontekst2 + Monitor Brightness Down + Zmniejsz jasność monitora - Context3 - Kontekst3 + Keyboard Light On/Off + - Context4 - Kontekst4 + Keyboard Brightness Up + - - - Ctrl - Ctrl + + Keyboard Brightness Down + - - Del - Del + + Power Off + - - Delete - Delete + + Wake Up + - - Down - Dół + + Eject + Wysuń - - End - End + + Screensaver + Wygaszacz ekranu - - Enter - Enter + + WWW + WWW - - Esc - Esc + + Sleep + - - Escape - Escape + + LightBulb + - - F%1 - F%1 + + Shop + Sklep - - Favorites - Ulubione + + History + Historia - - Flip - Odwróć + + Add Favorite + Dodaj do ulubionych - - Forward - Do przodu + + Hot Links + - - Hangup - Zawieś + + Adjust Brightness + - - Help - Pomoc + + Finance + - - Home - Home + + Community + Społeczność - - Home Page - Strona startowa + + Audio Rewind + - - Ins - Ins + + Back Forward + - - Insert - Insert + + Application Left + - - Launch (0) - Uruchom (0) + + Application Right + - Launch (1) - Uruchom (1) + Book + Książka - Launch (2) - Uruchom (2) + CD + CD - Launch (3) - Uruchom (3) + Calculator + Kalkulator - Launch (4) - Uruchom (4) + Clear + Wyczyść - Launch (5) - Uruchom (5) + Clear Grab + - Launch (6) - Uruchom (6) + Close + Zamknij - Launch (7) - Uruchom (7) + Copy + Skopiuj - Launch (8) - Uruchom (8) + Cut + Wytnij - Launch (9) - Uruchom (9) + Display + - Launch (A) - Uruchom (A) + DOS + DOS - Launch (B) - Uruchom (B) + Documents + Dokumenty - Launch (C) - Uruchom (C) + Spreadsheet + - Launch (D) - Uruchom (D) + Browser + Przeglądarka - Launch (E) - Uruchom (E) + Game + - Launch (F) - Uruchom (F) + Go + Przejdź - - Launch Mail - Uruchom program pocztowy + + iTouch + iTouch - Launch Media - Uruchom przeglądarkę mediów + Logoff + - - Left - Lewo + + Market + Rynek - - Media Next - Następna ścieżka + + Meeting + Spotkanie - - Media Play - Odtwarzaj + + Keyboard Menu + - - Media Previous - Poprzednia ścieżka + + Menu PB + - - Media Record - Nagrywaj + + My Sites + Moje strony - - Media Stop - Zatrzymaj + + News + Wiadomości - - Menu - Menu + + Home Office + - - - Meta - Meta + + Option + Opcje - - No - Nie + + Paste + Wklej - - Num Lock - Num Lock + + Phone + Telefon - Number Lock - Number Lock + Reply + Odpowiedz - - NumLock - NumLock + + Reload + Przeładuj - - Open URL - Otwórz adres + + Rotate Windows + Obróć okna - - Page Down - Strona do góry + + Rotation PB + - - Page Up - Strona w dół - + + Rotation KB + + + + + Save + Zachowaj + + + + Send + Wyślij + + + + Spellchecker + + + + + Split Screen + Podziel ekran + + + + Support + Pomoc techniczna + + + + Task Panel + + + + + Terminal + Terminal + + + + Tools + Narzędzia + + + + Travel + Podróże + + + + Video + Wideo + + + + Word Processor + + + + + XFer + + + + + Zoom In + Powiększ + + + + Zoom Out + Pomniejsz + + + + Away + + + + + Messenger + + + + + WebCam + WebCam + + + + Mail Forward + + + + + Pictures + Zdjęcia + + + + Music + Muzyka + + + + Battery + Bateria + + + + Bluetooth + Bluetooth + + + + Wireless + Bezprzewodowy + + + + Ultra Wide Band + + + + + Audio Forward + + + + + Audio Repeat + + + + + Audio Random Play + + + + + Subtitle + Napisy + + + + Audio Cycle Track + + + + + Time + Czas + + + + View + Widok + + + + Top Menu + Menu główne + + + + Suspend + + + + + Hibernate + + + + + Context1 + Kontekst1 + + + + Context2 + Kontekst2 + + + + Context3 + Kontekst3 + + + + Context4 + Kontekst4 + + + + + Ctrl + Ctrl + + + + Del + Del + + + + Delete + Delete + + + + Down + Dół + + + + End + End + + + + Enter + Enter + + + + Esc + Esc + + + + Escape + Escape + + + + F%1 + F%1 + + + + Favorites + Ulubione + + + + Flip + Odwróć + + + + Forward + Do przodu + + + + Hangup + Zawieś + + + + Help + Pomoc + + + + Home + Home + + + + Home Page + Strona startowa + + + + Ins + Ins + + + + Insert + Insert + + + + Launch (0) + Uruchom (0) + + + + Launch (1) + Uruchom (1) + + + + Launch (2) + Uruchom (2) + + + + Launch (3) + Uruchom (3) + + + + Launch (4) + Uruchom (4) + + + + Launch (5) + Uruchom (5) + + + + Launch (6) + Uruchom (6) + + + + Launch (7) + Uruchom (7) + + + + Launch (8) + Uruchom (8) + + + + Launch (9) + Uruchom (9) + + + + Launch (A) + Uruchom (A) + + + + Launch (B) + Uruchom (B) + + + + Launch (C) + Uruchom (C) + + + + Launch (D) + Uruchom (D) + + + + Launch (E) + Uruchom (E) + + + + Launch (F) + Uruchom (F) + - + + Launch Mail + Uruchom program pocztowy + + + + Launch Media + Uruchom przeglądarkę mediów + + + + Left + Lewo + + + + Media Next + Następna ścieżka + + + + Media Play + Odtwarzaj + + + + Media Previous + Poprzednia ścieżka + + + + Media Record + Nagrywaj + + + + Media Stop + Zatrzymaj + + + + Menu + Menu + + + + + Meta + Meta + + + + No + Nie + + + + Num Lock + Num Lock + + + + Number Lock + Number Lock + + + + NumLock + NumLock + + + + Open URL + Otwórz adres + + + + Page Down + Strona do góry + + + + Page Up + Strona w dół + + + Pause Pauza @@ -5615,17 +6081,17 @@ Proszę wybrać inną nazwę pliku. Print - + Print Screen Wydrukuj zawartość ekranu - + Refresh Odśwież - + Return Powrót @@ -5635,38 +6101,39 @@ Proszę wybrać inną nazwę pliku. Prawo - + Scroll Lock Scroll Lock - + ScrollLock ScrollLock - + Search Szukaj - + + Select Wybierz - + Shift Shift - + Space Spacja - + Standby Tryb oczekiwania @@ -5676,22 +6143,22 @@ Proszę wybrać inną nazwę pliku. Zatrzymaj - + SysReq SysReq - + System Request Żądanie systemu - + Tab Tabulator - + Treble Down Soprany w dół @@ -5701,12 +6168,12 @@ Proszę wybrać inną nazwę pliku. Soprany w górę - + Up Góra - + Volume Down Przycisz @@ -5721,7 +6188,7 @@ Proszę wybrać inną nazwę pliku. Zrób głośniej - + Yes Tak @@ -5822,7 +6289,7 @@ Proszę wybrać inną nazwę pliku. Nieznany kod błędu (0x%1) pośrednika SOCKS wersji 5 - + Network operation timed out Przekroczony czas operacji sieciowej @@ -5830,7 +6297,7 @@ Proszę wybrać inną nazwę pliku. QSoftKeyManager - + Ok OK @@ -5855,7 +6322,7 @@ Proszę wybrać inną nazwę pliku. Anuluj - + Exit Wyjście @@ -5958,7 +6425,12 @@ Proszę wybrać inną nazwę pliku. Niepoprawna lub pusta lista szyfrów (%1) - + + Private key does not certify public key, %1 + Prywatny klucz nie uwiarygodnia publicznego, %1 + + + Error creating SSL session, %1 Błąd tworzenia sesji SSL, %1 @@ -5983,15 +6455,125 @@ Proszę wybrać inną nazwę pliku. Błąd ładowania prywatnego klucza, %1 - - Private key does not certificate public key, %1 - Prywatny klucz nie uwiarygodnia publicznego, %1 + + No error + Brak błędu + + + + The issuer certificate could not be found + Nie można odnaleźć wydawcy certyfikatu + + + + The certificate signature could not be decrypted + Nie można odszyfrować podpisu certyfikatu + + + + The public key in the certificate could not be read + Nie można odczytać publicznego klucza w certyfikacie + + + + The signature of the certificate is invalid + Niepoprawny podpis certyfikatu + + + + The certificate is not yet valid + Certyfikat nie jest jeszcze ważny + + + + The certificate has expired + Certyfikat utracił ważność + + + + The certificate's notBefore field contains an invalid time + Pole "notBefore" certyfikatu zawiera niepoprawną datę + + + + The certificate's notAfter field contains an invalid time + Pole "notAfter" certyfikatu zawiera niepoprawną datę + + + + The certificate is self-signed, and untrusted + + + + + The root certificate of the certificate chain is self-signed, and untrusted + + + + + The issuer certificate of a locally looked up certificate could not be found + + + + + No certificates could be verified + + + + + One of the CA certificates is invalid + + + + + The basicConstraints path length parameter has been exceeded + + + + + The supplied certificate is unsuitable for this purpose + + + + + The root CA certificate is not trusted for this purpose + + + + + The root CA certificate is marked to reject the specified purpose + + + + + The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate + + + + + The current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate + + + + + The peer did not present any certificate + + + + + The host name did not match any of the valid hosts for this certificate + + + + + Unknown error + Nieznany błąd QStateMachine - + Missing initial state in compound state '%1' Brak stanu początkowego w stanie złożonym '%1' @@ -6045,7 +6627,7 @@ Proszę wybrać inną nazwę pliku. QTDSDriver - + Unable to open connection Nie można otworzyć połączenia @@ -6079,7 +6661,7 @@ Proszę wybrać inną nazwę pliku. QTextControl - + &Copy S&kopiuj @@ -6179,7 +6761,7 @@ Proszę wybrać inną nazwę pliku. QUnicodeControlCharacterMenu - + Insert Unicode control character Wstaw znak kontroli Unicode @@ -6237,7 +6819,7 @@ Proszę wybrać inną nazwę pliku. QWebFrame - + Request cancelled Prośba anulowana @@ -6657,13 +7239,13 @@ Proszę wybrać inną nazwę pliku. Movie time scrubber Media controller element - + Suwak czasu Movie time scrubber thumb Media controller element - + Uchwyt suwaka czasu @@ -6779,7 +7361,7 @@ Proszę wybrać inną nazwę pliku. Wizytator sieciowy - %2 - + Bad HTTP request Niepoprawna komenda HTTP @@ -6883,7 +7465,7 @@ Proszę wybrać inną nazwę pliku. - + JavaScript Alert - %1 Ostrzeżenie JavaScript - %1 @@ -6908,9 +7490,9 @@ Proszę wybrać inną nazwę pliku. Skrypt na tej stronie nie działa poprawnie. Czy chcesz przerwać ten skrypt? - + Move the cursor to the next character - Przesuń kursor do nastepnego znaku + Przesuń kursor do następnego znaku @@ -6920,7 +7502,7 @@ Proszę wybrać inną nazwę pliku. Move the cursor to the next word - Przesuń kursor do nastepnego słowa + Przesuń kursor do następnego słowa @@ -6930,7 +7512,7 @@ Proszę wybrać inną nazwę pliku. Move the cursor to the next line - Przesuń kursor do nastepnej linii + Przesuń kursor do następnej linii @@ -7080,7 +7662,7 @@ Proszę wybrać inną nazwę pliku. Insert Bulleted List - Wstaw listę wypunktową + Wstaw listę wypunktowaną @@ -7129,7 +7711,7 @@ Proszę wybrać inną nazwę pliku. QWidget - + * * @@ -7557,7 +8139,7 @@ Proszę wybrać inną nazwę pliku. The standalone pseudo attribute must appear after the encoding. - Pseudo atrybut "standalone" musi pojawić sie po "encoding". + Pseudo atrybut "standalone" musi pojawić się po "encoding". @@ -7752,17 +8334,22 @@ Proszę wybrać inną nazwę pliku. A positional predicate must evaluate to a single numeric value. - Wynikiem predykatu pozycyjnego musi być pojedyńcza wartość liczbowa. + Wynikiem predykatu pozycyjnego musi być pojedyncza wartość liczbowa. + + + + The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, %2 is invalid. + Docelowa nazwa w instrukcji przetwarzania nie może być %1 w żadnej kombinacji wielkich i małych liter. Dlatego nazwa %2 jest niepoprawna. - + %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. %1 nie jest poprawną nazwą docelową w instrukcji przetwarzania. Nazwa musi być wartością %2, np. %3. The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. - Ostatni krok w ścieżce musi zawierać albo wezły albo wartości atomowe. Nie może zawierać obu jednocześnie. + Ostatni krok w ścieżce musi zawierać albo węzły albo wartości atomowe. Nie może zawierać obu jednocześnie. @@ -7818,7 +8405,7 @@ Proszę wybrać inną nazwę pliku. %1 must be followed by %2 or %3, not at the end of the replacement string. - Po %1 musi następowac %2 lub %3, lecz nie na końcu zastępczego ciągu. + Po %1 musi następować %2 lub %3, lecz nie na końcu zastępczego ciągu. @@ -7907,7 +8494,12 @@ Proszę wybrać inną nazwę pliku. %1 jest nieznanym typem schematu. - + + A template with name %1 has already been declared. + Szablon o nazwie %1 został już zadeklarowany. + + + Only one %1 declaration can occur in the query prolog. Tylko jedna deklaracja %1 może się pojawić w prologu zapytania. @@ -7962,12 +8554,7 @@ Proszę wybrać inną nazwę pliku. Cecha "Import modułu" nie jest obsługiwana - - No value is available for the external variable by name %1. - Brak wartości dla zewnętrznej zmiennej o nazwie %1. - - - + The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. Przestrzeń nazw %1 jest zarezerwowana, dlatego funkcje zdefiniowane przez użytkownika nie mogą jej użyć. Spróbuj predefiniowany przedrostek %2, który istnieje w takich przypadkach. @@ -7987,12 +8574,7 @@ Proszę wybrać inną nazwę pliku. Zewnętrzne funkcje nie są obsługiwane. Wszystkie obsługiwane funkcje mogą być używane bezpośrednio, bez ich uprzedniego deklarowania jako zewnętrzne - - An argument by name %1 has already been declared. Every argument name must be unique. - Argument o nazwie %1 został już zadeklarowany. Każda nazwa argumentu musi być unikatowa. - - - + The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. Nazwa zmiennej powiązanej w wyrażeniu "for" musi być inna od zmiennej pozycjonującej. W związku z tym dwie zmienne o nazwie %1 kolidują ze sobą. @@ -8019,12 +8601,12 @@ Proszę wybrać inną nazwę pliku. W3C XML Schema identity constraint selector - Selektor ograniczenia jednostki W3C XML Schema + Selektor narzucenia niepowtarzalności W3C XML Schema W3C XML Schema identity constraint field - Pole ograniczenia jednostki W3C XML Schema + Pole narzucenia niepowtarzalności W3C XML Schema @@ -8032,37 +8614,37 @@ Proszę wybrać inną nazwę pliku. Wystąpiła konstrukcja która jest niedozwolona w bieżącym języku (%1). - - No variable by name %1 exists - Zmienna o nazwie %1 nie istnieje - - - - A template by name %1 has already been declared. - Szablon o nazwie %1 został już zadeklarowany. + + The keyword %1 cannot occur with any other mode name. + Słowo kluczowe %1 nie może wystąpić z inną nazwą trybu. - - The keyword %1 cannot occur with any other mode name. - Słowo kluczowe %1 nie może wystapić z inną nazwą trybu. + + No variable with name %1 exists + Zmienna o nazwie %1 nie istnieje - - The value of attribute %1 must of type %2, which %3 isn't. + + The value of attribute %1 must be of type %2, which %3 isn't. Wartość atrybutu %1 musi być typu %2, którym nie jest %3. - The prefix %1 can not be bound. By default, it is already bound to the namespace %2. + The prefix %1 cannot be bound. By default, it is already bound to the namespace %2. Przedrostek %1 nie może być powiązany. Jest on domyślnie powiązany z przestrzenią nazw %2. - A variable by name %1 has already been declared. + A variable with name %1 has already been declared. Zmienna o nazwie %1 została już zadeklarowana. - + + No value is available for the external variable with name %1. + Brak wartości dla zewnętrznej zmiennej o nazwie %1. + + + A stylesheet function must have a prefixed name. Funkcja arkusza stylu musi zawierać nazwę z przedrostkiem. @@ -8072,7 +8654,12 @@ Proszę wybrać inną nazwę pliku. Przestrzeń nazw dla funkcji zdefiniowanej przez użytkownika nie może być pusta (spróbuj predefiniowany przedrostek %1, który stworzono specjalnie do takich sytuacji) - + + An argument with name %1 has already been declared. Every argument name must be unique. + Argument o nazwie %1 został już zadeklarowany. Każda nazwa argumentu musi być unikatowa. + + + When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. Gdy funkcja %1 jest wykorzystana do dopasowania wewnątrz wzorca, jej argument musi być referencją do zmiennej lub napisem. @@ -8113,11 +8700,16 @@ Proszę wybrać inną nazwę pliku. - No function by name %1 is available. + No function with name %1 is available. Żadna funkcja o nazwie %1 nie jest dostępna. - + + An attribute with name %1 has already appeared on this element. + Atrybut o nazwie %1 już się pojawił w tym elemencie. + + + The namespace URI cannot be the empty string when binding to a prefix, %1. Przestrzeń nazw URI nie może być pustym ciągiem w powiązaniu z przedrostkiem, %1. @@ -8152,12 +8744,7 @@ Proszę wybrać inną nazwę pliku. Przestrzeń nazw URI nie może być stałą i nie może używać zawartych w niej wyrażeń. - - An attribute by name %1 has already appeared on this element. - Atrybut o nazwie %1 już się pojawił w tym elemencie. - - - + A direct element constructor is not well-formed. %1 is ended with %2. Konstruktor elementu bezpośredniego nie jest dobrze sformatowany. %1 jest zakończony %2. @@ -8262,11 +8849,6 @@ Proszę wybrać inną nazwę pliku. Modulus division (%1) by zero (%2) is undefined. Dzielenie modulo (%1) przez zero (%2) jest niezdefiniowane. - - - The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, is %2 invalid. - Docelowa nazwa w instrukcji przetwarzania nie może być %1 w żadnej kombinacji wielkich i małych liter. Dlatego nazwa %2 jest niepoprawna. - %1 takes at most %n argument(s). %2 is therefore invalid. @@ -8409,7 +8991,7 @@ Proszę wybrać inną nazwę pliku. In a simplified stylesheet module, attribute %1 must be present. - W uproszczonym module arkuszu stylu musi wystapić atrybut %1. + W uproszczonym module arkuszu stylu musi wystąpić atrybut %1. @@ -8419,7 +9001,7 @@ Proszę wybrać inną nazwę pliku. Element %1 must have at least one of the attributes %2 or %3. - Element %1 musi posiadać przynajmiej jeden z atrybutów: %2 lub %3. + Element %1 musi posiadać przynajmniej jeden z atrybutów: %2 lub %3. @@ -8531,12 +9113,12 @@ Proszę wybrać inną nazwę pliku. %1 is not allowed to derive from %2 by restriction as the latter defines it as final. - Nie można wywieść %1 z %2 ograniczając go ponieważ jest on zdefiniowany jako ostateczny. + Nie można wywieść %1 z %2 ograniczając go ponieważ jest on zdefiniowany jako końcowy. %1 is not allowed to derive from %2 by extension as the latter defines it as final. - Nie można wywieść %1 z %2 rozszerzając go ponieważ jest on zdefiniowany jako ostateczny. + Nie można wywieść %1 z %2 rozszerzając go ponieważ jest on zdefiniowany jako końcowy. @@ -8562,13 +9144,13 @@ Proszę wybrać inną nazwę pliku. Simple type %1 cannot derive from %2 as the latter defines restriction as final. - Typ prosty %1 nie może wywodzić się z %2 ponieważ ten ostatni jest zdefiniowany jako ostateczny. + Typ prosty %1 nie może wywodzić się z %2 ponieważ ten ostatni jest zdefiniowany jako końcowy. Variety of item type of %1 must be either atomic or union. - Typem elementu %1 musi być albo typ atomowy albo unia. + Typem elementów listy %1 musi być albo typ atomowy albo unia. @@ -8595,12 +9177,12 @@ Proszę wybrać inną nazwę pliku. Base type of simple type %1 has defined derivation by restriction as final. - Typ podstawowy dla typu prostego %1 ma zdefiniowane wywodzenie poprzez ograniczenie jako ostateczne. + Typ podstawowy dla typu prostego %1 ma zdefiniowane wywodzenie poprzez ograniczenie jako końcowe. Item type of base type does not match item type of %1. - Typ elementu w podstawowym typie nie pasuje do typu %1. + Typ elementów listy typu podstawowego nie pasuje do typu elementów listy %1. @@ -8657,7 +9239,7 @@ Proszę wybrać inną nazwę pliku. Content model of complex type %1 is not a valid extension of content model of %2. - Model zawartości typu złożonego %1 nie jest poprawnym rozszerzenien modelu zawartości %2. + Model zawartości typu złożonego %1 nie jest poprawnym rozszerzeniem modelu zawartości %2. @@ -8687,7 +9269,7 @@ Proszę wybrać inną nazwę pliku. Item type of simple type %1 cannot be a complex type. - Typ elementu w prostym typie %1 nie może być typem złożonym. + Typ elementów listy w prostym typie %1 nie może być typem złożonym. @@ -8731,7 +9313,7 @@ Proszę wybrać inną nazwę pliku. %1 facet contains invalid regular expression - Aspekt %1 zawiera niepoprawe wyrażenie regularne + Aspekt %1 zawiera niepoprawne wyrażenie regularne @@ -8902,7 +9484,7 @@ Proszę wybrać inną nazwę pliku. processContent of base wildcard must be weaker than derived wildcard. - "processContent" podstawowego znacznika musi być słabszy od wywiedzionego znacznika. + "processContent" podstawowego dżokera musi być słabszy od wywiedzionego dżokera. @@ -8913,7 +9495,7 @@ Proszę wybrać inną nazwę pliku. Particle contains non-deterministic wildcards. - Element zawiera nieokreślone znaczniki. + Element zawiera nieokreślone dżokery. @@ -8933,13 +9515,13 @@ Proszę wybrać inną nazwę pliku. - Derived attribute %1 does not exists in the base definition. - Wywyiedziony atrybut %1 nie istnieje w podstawowej definicji. + Derived attribute %1 does not exist in the base definition. + Wywiedziony atrybut %1 nie istnieje w podstawowej definicji. Derived attribute %1 does not match the wildcard in the base definition. - Wywiedziony atrybut %1 nie pasuje do znacznika w podstawowej definicji. + Wywiedziony atrybut %1 nie pasuje do dżokera w podstawowej definicji. @@ -8954,12 +9536,12 @@ Proszę wybrać inną nazwę pliku. Derived wildcard is not a subset of the base wildcard. - Wywiedziony znacznik nie jest podzbiorem podstawowego znacznika. + Wywiedziony dżoker nie jest podzbiorem podstawowego dżokera. %1 of derived wildcard is not a valid restriction of %2 of base wildcard - %1 wywiedzionego znacznika nie jest poprawnym ograniczeniem %2 podstawowego znacznika + %1 wywiedzionego dżokera nie jest poprawnym ograniczeniem %2 podstawowego dżokera @@ -8984,12 +9566,12 @@ Proszę wybrać inną nazwę pliku. %1 references identity constraint %2 that is no %3 or %4 element. - %1 odwołuje się do ograniczenia jednostki %2 które nie jest elementem %3 ani %4. + %1 odwołuje się do narzucenia niepowtarzalności %2 które nie jest elementem %3 ani %4. %1 has a different number of fields from the identity constraint %2 that it references. - %1 posiada inna liczbę pól od ograniczenia jednostki %2 które się do niego odwołuje. + %1 posiada inna liczbę pól od narzucenia niepowtarzalności %2 które się do niego odwołuje. @@ -8999,7 +9581,7 @@ Proszę wybrać inną nazwę pliku. Item type %1 of %2 element cannot be resolved. - Nie można rozwiązać typu elementu %1 w elemencie %2. + Nie można rozwiązać typu elementów listy %1 w elemencie %2. @@ -9100,17 +9682,17 @@ Proszę wybrać inną nazwę pliku. Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2. - Znacznik atrybutu %1 nie jest poprawnym ograniczeniem znacznika atrybutu typu podstawowego %2. + Atrybut dżokera %1 nie jest poprawnym ograniczeniem atrybutu dżokera typu podstawowego %2. %1 has attribute wildcard but its base type %2 has not. - %1 posiada znacznik atrybutu lecz jego typ podstawowy %2 go nie posiada. + %1 posiada atrybut dżokera lecz jego typ podstawowy %2 go nie posiada. Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible. - Nie można wyrazić unii znacznika atrybutu typu %1 i znacznika atrybutu jego typu podstawowego %2. + Nie można wyrazić unii atrybutu dżokera typu %1 i atrybutu dżokera jego typu podstawowego %2. @@ -9181,17 +9763,17 @@ Proszę wybrać inną nazwę pliku. Element %1 does not match namespace constraint of wildcard in base particle. - Element %1 nie pasuje do znacznika w ograniczeniu przestrzeni nazw w elemencie podstawowym. + Element %1 nie pasuje do ograniczenia przestrzeni nazw dżokera w elemencie podstawowym. Wildcard in derived particle is not a valid subset of wildcard in base particle. - Znacznik w wywiedzionym elemencie nie jest poprawnym podzbiorem znacznika w elemencie podstawowym. + Dżoker w wywiedzionym elemencie nie jest poprawnym podzbiorem dżokera w elemencie podstawowym. processContent of wildcard in derived particle is weaker than wildcard in base particle. - "processContent" znacznika w wywiedzionym elemencie jest słabszy od znacznika w podstawowym elemencie. + "processContent" dżokera w wywiedzionym elemencie jest słabszy od dżokera w podstawowym elemencie. @@ -9385,7 +9967,7 @@ Proszę wybrać inną nazwę pliku. - Component with id %1 has been defined previously. + Component with ID %1 has been defined previously. Komponent o identyfikatorze %1 został uprzednio zdefiniowany. @@ -9421,7 +10003,7 @@ Proszę wybrać inną nazwę pliku. Identity constraint %1 already defined. - Ograniczenie jednostki %1 jest już zdefiniowane. + Narzucenie niepowtarzalności %1 jest już zdefiniowane. @@ -9800,11 +10382,16 @@ Proszę wybrać inną nazwę pliku. - Fixed value constrained not allowed if element is nillable. + Fixed value constraint not allowed if element is nillable. Ograniczenie stałej wartości jest niedozwolone gdy element jest zerowalny. - + + Element %1 cannot contain other elements, as it has a fixed content. + Element %1 nie może zawierać innych elementów ponieważ posiada on stałą zawartość. + + + Specified type %1 is not validly substitutable with element type %2. Podany typ %1 nie jest poprawnie zastępowalny typem elementu %2. @@ -9848,19 +10435,14 @@ Proszę wybrać inną nazwę pliku. Element %1 zawiera niedozwolony text. - - Element %1 can not contain other elements, as it has a fixed content. - Element %1 nie może zawierać innych elementów ponieważ posiada on stałą zawartość. - - - + Element %1 is missing required attribute %2. Brak wymaganego atrybutu %2 w elemencie %1. Attribute %1 does not match the attribute wildcard. - Atrybut %1 nie pasuje do znacznika atrybutu. + Atrybut %1 nie pasuje do atrybutu dżokera. @@ -9912,7 +10494,7 @@ Proszę wybrać inną nazwę pliku. No referenced value found for key reference %1. - Brak wartości do której odwołuje sie klucz %1. + Brak wartości do której odwołuje się klucz %1. diff --git a/translations/qvfb_pl.ts b/translations/qvfb_pl.ts index bc3313e..9b85ad9 100644 --- a/translations/qvfb_pl.ts +++ b/translations/qvfb_pl.ts @@ -4,7 +4,7 @@ AnimationSaveWidget - + Record Nagraj @@ -260,6 +260,11 @@ BGR format format BGR + + + 800x480 + 800x480 + DeviceSkin @@ -322,12 +327,12 @@ QVFb - + Browse... Przeglądaj... - + Load Custom Skin... Załaduj skórki użytkownika... -- cgit v0.12 From 16e4047a627d85182d9d9622a839fa51a9650aca Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 10 Dec 2009 11:15:28 +0100 Subject: Fixes a qfileinfo autotest. Canonical file paths can begin with slash only on unix platforms. Reviewed-by: Prasanth --- tests/auto/qfileinfo/tst_qfileinfo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index cd58fd6..1445f5b 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -513,9 +513,11 @@ void tst_QFileInfo::canonicalFilePath() QFileInfo info("/tmp/../../../../../../../../../../../../../../../../../"); info.canonicalFilePath(); +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) // This used to crash on Mac QFileInfo dontCrash(QLatin1String("/")); QCOMPARE(dontCrash.canonicalFilePath(), QLatin1String("/")); +#endif #ifndef Q_OS_WIN // test symlinks -- cgit v0.12 From bb0ab1d8cf57dd4a7b69c8478c2a40c1cd1782e9 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 10 Dec 2009 11:27:51 +0100 Subject: Fix spinbox input when seecting the prefix If you were selcting the prefix and entering a digit the cursor position would not be updated correctly Task-number: QTBUG-6670 Reviewed-by: ogoffart --- src/gui/widgets/qabstractspinbox.cpp | 4 +++- tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qabstractspinbox.cpp b/src/gui/widgets/qabstractspinbox.cpp index a18af4f..c015589 100644 --- a/src/gui/widgets/qabstractspinbox.cpp +++ b/src/gui/widgets/qabstractspinbox.cpp @@ -1856,8 +1856,10 @@ QValidator::State QSpinBoxValidator::validate(QString &input, int &pos) const if (dptr->specialValueText.size() > 0 && input == dptr->specialValueText) return QValidator::Acceptable; - if (!dptr->prefix.isEmpty() && !input.startsWith(dptr->prefix)) + if (!dptr->prefix.isEmpty() && !input.startsWith(dptr->prefix)) { input.prepend(dptr->prefix); + pos += dptr->prefix.length(); + } if (!dptr->suffix.isEmpty() && !input.endsWith(dptr->suffix)) input.append(dptr->suffix); diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp index 7f03153..a3f0915 100644 --- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp +++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp @@ -148,6 +148,7 @@ private slots: void task255471_decimalsValidation(); void taskQTBUG_5008_textFromValueAndValidate(); + void taskQTBUG_6670_selectAllWithPrefix(); public slots: void valueChangedHelper(const QString &); @@ -1084,5 +1085,16 @@ void tst_QDoubleSpinBox::taskQTBUG_5008_textFromValueAndValidate() QCOMPARE(spinbox.text(), spinbox.locale().toString(spinbox.value())); } +void tst_QDoubleSpinBox::taskQTBUG_6670_selectAllWithPrefix() +{ + DoubleSpinBox spin; + spin.setPrefix("$ "); + spin.lineEdit()->selectAll(); + QTest::keyClick(spin.lineEdit(), Qt::Key_1); + QCOMPARE(spin.value(), 1.); + QTest::keyClick(spin.lineEdit(), Qt::Key_2); + QCOMPARE(spin.value(), 12.); +} + QTEST_MAIN(tst_QDoubleSpinBox) #include "tst_qdoublespinbox.moc" -- cgit v0.12 From a2ccf692cdc4113cc90ef12c27ba8c4aa552d81f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 10 Dec 2009 11:35:53 +0100 Subject: Fixes internal drag and drop in QListWidget while dropping to the end Task-number: QTBUG-6565 Reviewed-by: Gabriel --- src/gui/itemviews/qlistwidget.cpp | 2 +- tests/auto/qlistwidget/tst_qlistwidget.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/itemviews/qlistwidget.cpp b/src/gui/itemviews/qlistwidget.cpp index 929d688..0ce0e5e 100644 --- a/src/gui/itemviews/qlistwidget.cpp +++ b/src/gui/itemviews/qlistwidget.cpp @@ -173,7 +173,7 @@ void QListModel::move(int srcRow, int dstRow) { if (srcRow == dstRow || srcRow < 0 || srcRow >= items.count() - || dstRow < 0 || dstRow >= items.count()) + || dstRow < 0 || dstRow > items.count()) return; if (!beginMoveRows(QModelIndex(), srcRow, srcRow, QModelIndex(), dstRow)) diff --git a/tests/auto/qlistwidget/tst_qlistwidget.cpp b/tests/auto/qlistwidget/tst_qlistwidget.cpp index 863c308..e165190 100644 --- a/tests/auto/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/qlistwidget/tst_qlistwidget.cpp @@ -862,12 +862,18 @@ void tst_QListWidget::moveItemsPriv_data() QTest::newRow("Empty") << 0 << 0 << 0 << false; QTest::newRow("Overflow src") << 5 << 5 << 2 << false; QTest::newRow("Underflow src") << 5 << -1 << 2 << false; - QTest::newRow("Overflow dst") << 5 << 2 << 5 << false; + QTest::newRow("Overflow dst") << 5 << 2 << 6 << false; QTest::newRow("Underflow dst") << 5 << 2 << -1 << false; QTest::newRow("Same place") << 5 << 2 << 2 << false; QTest::newRow("Up") << 5 << 4 << 2 << true; QTest::newRow("Down") << 5 << 2 << 4 << true; QTest::newRow("QTBUG-6532 assert") << 5 << 0 << 1 << false; + QTest::newRow("QTBUG-6565 to the end") << 5 << 3 << 5 << true; + QTest::newRow("Same place 2") << 2 << 0 << 1 << false; + QTest::newRow("swap") << 2 << 0 << 2 << true; + QTest::newRow("swap2") << 4 << 1 << 3 << true; + QTest::newRow("swap3") << 4 << 3 << 2 << true; + QTest::newRow("swap4") << 2 << 1 << 0 << true; } void tst_QListWidget::moveItemsPriv() -- cgit v0.12 From 4d3839eb99d720393e1386d63fa04c83367bb076 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 10 Dec 2009 11:29:22 +0100 Subject: Ensure that QProcessEnvironment::operator== doesn't crash Also add an extensive autotest suite for QProcessEnvironment Task-number: QTBUG-6701 Reviewed-by: Markus Goetz --- src/corelib/io/qprocess.cpp | 3 +- tests/auto/auto.pro | 1 + .../qprocessenvironment/qprocessenvironment.pro | 5 + .../tst_qprocessenvironment.cpp | 265 +++++++++++++++++++++ 4 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 tests/auto/qprocessenvironment/qprocessenvironment.pro create mode 100644 tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 37161bc..c78af3c 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -275,7 +275,7 @@ QProcessEnvironment &QProcessEnvironment::operator=(const QProcessEnvironment &o */ bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const { - return d->hash == other.d->hash; + return d == other.d || (d && other.d && d->hash == other.d->hash); } /*! @@ -334,6 +334,7 @@ bool QProcessEnvironment::contains(const QString &name) const */ void QProcessEnvironment::insert(const QString &name, const QString &value) { + // d detaches from null d->hash.insert(prepareName(name), prepareValue(value)); } diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 92d29ae..5041812 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -256,6 +256,7 @@ SUBDIRS += \ qprinter \ qprinterinfo \ qprocess \ + qprocessenvironment \ qprogressbar \ qprogressdialog \ qpropertyanimation \ diff --git a/tests/auto/qprocessenvironment/qprocessenvironment.pro b/tests/auto/qprocessenvironment/qprocessenvironment.pro new file mode 100644 index 0000000..398facc --- /dev/null +++ b/tests/auto/qprocessenvironment/qprocessenvironment.pro @@ -0,0 +1,5 @@ +load(qttest_p4) + +QT = core + +SOURCES += tst_qprocessenvironment.cpp diff --git a/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp new file mode 100644 index 0000000..1cde33c --- /dev/null +++ b/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp @@ -0,0 +1,265 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +// Note: +// in cross-platform tests, ALWAYS use UPPERCASE variable names +// That's because on Windows, the variables are uppercased + +class tst_QProcessEnvironment: public QObject +{ + Q_OBJECT +private slots: + void operator_eq(); + void clearAndIsEmpty(); + void insert(); + void emptyNull(); + void toStringList(); + + void caseSensitivity(); + void systemEnvironment(); + void putenv(); +}; + +void tst_QProcessEnvironment::operator_eq() +{ + QProcessEnvironment e1; + QVERIFY(e1 == e1); + e1.clear(); + QVERIFY(e1 == e1); + + e1 = QProcessEnvironment(); + QProcessEnvironment e2; + QVERIFY(e1 == e2); + + e1.clear(); + QVERIFY(e1 != e2); + + e2.clear(); + + QVERIFY(e1 == e2); +} + +void tst_QProcessEnvironment::clearAndIsEmpty() +{ + QProcessEnvironment e; + e.insert("FOO", "bar"); + QVERIFY(!e.isEmpty()); + e.clear(); + QVERIFY(e.isEmpty()); +} + +void tst_QProcessEnvironment::insert() +{ + QProcessEnvironment e; + e.insert("FOO", "bar"); + QVERIFY(!e.isEmpty()); + QVERIFY(e.contains("FOO")); + QCOMPARE(e.value("FOO"), QString("bar")); + + e.remove("FOO"); + QVERIFY(!e.contains("FOO")); + QVERIFY(e.value("FOO").isNull()); + + e.clear(); + QVERIFY(!e.contains("FOO")); +} + +void tst_QProcessEnvironment::emptyNull() +{ + QProcessEnvironment e; + + e.insert("FOO", ""); + QVERIFY(e.contains("FOO")); + QVERIFY(e.value("FOO").isEmpty()); + QVERIFY(!e.value("FOO").isNull()); + + e.insert("FOO", QString()); + QVERIFY(e.contains("FOO")); + QVERIFY(e.value("FOO").isEmpty()); + // don't test if it's NULL, since we shall not make a guarantee + + e.remove("FOO"); + QVERIFY(!e.contains("FOO")); +} + +void tst_QProcessEnvironment::toStringList() +{ + QProcessEnvironment e; + QVERIFY(e.isEmpty()); + QVERIFY(e.toStringList().isEmpty()); + + e.insert("FOO", "bar"); + QStringList result = e.toStringList(); + QVERIFY(!result.isEmpty()); + QCOMPARE(result.length(), 1); + QCOMPARE(result.at(0), QString("FOO=bar")); + + e.clear(); + e.insert("BAZ", ""); + result = e.toStringList(); + QCOMPARE(result.at(0), QString("BAZ=")); + + e.insert("FOO", "bar"); + e.insert("A", "bc"); + e.insert("HELLO", "World"); + result = e.toStringList(); + QCOMPARE(result.length(), 4); + + // order is not specified, so use contains() + QVERIFY(result.contains("FOO=bar")); + QVERIFY(result.contains("BAZ=")); + QVERIFY(result.contains("A=bc")); + QVERIFY(result.contains("HELLO=World")); +} + +void tst_QProcessEnvironment::caseSensitivity() +{ + QProcessEnvironment e; + e.insert("foo", "bar"); + +#ifdef Q_OS_WIN + // on Windows, it's uppercased + QVERIFY(e.contains("foo")); + QVERIFY(e.contains("FOO")); + QVERIFY(e.contains("FoO")); + + QCOMPARE(e.value("foo"), QString("bar")); + QCOMPARE(e.value("FOO"), QString("bar")); + QCOMPARE(e.value("FoO"), QString("bar")); + + QStringList list = e.toStringList(); + QCOMPARE(list.at(0), QString("FOO=bar")); +#else + // otherwise, it's case sensitive + QVERIFY(e.contains("foo")); + QVERIFY(!e.contains("FOO")); + + e.insert("FOO", "baz"); + QVERIFY(e.contains("FOO")); + QCOMPARE(e.value("FOO"), QString("baz")); + QCOMPARE(e.value("foo"), QString("bar")); + + QStringList list = e.toStringList(); + QVERIFY(list.contains("foo=bar")); + QVERIFY(list.contains("FOO=baz")); +#endif +} + +void tst_QProcessEnvironment::systemEnvironment() +{ + static const char envname[] = "THIS_ENVIRONMENT_VARIABLE_HOPEFULLY_DOESNT_EXIST"; + QByteArray path = qgetenv("PATH"); + QByteArray nonexistant = qgetenv(envname); + QProcessEnvironment system = QProcessEnvironment::systemEnvironment(); + + QVERIFY(nonexistant.isNull()); + +#ifdef Q_WS_WINCE + // Windows CE has no environment + QVERIFY(path.isEmpty()); + QVERIFY(!system.contains("PATH")); + QVERIFY(system.isEmpty()); +#else + // all other system have environments + if (path.isEmpty()) + QFAIL("Could not find the PATH environment variable -- please correct the test environment"); + + QVERIFY(system.contains("PATH")); + QCOMPARE(system.value("PATH"), QString::fromLocal8Bit(path)); + + QVERIFY(!system.contains(envname)); + +# ifdef Q_OS_WIN + // check case-insensitive too + QVERIFY(system.contains("path")); + QCOMPARE(system.value("path"), QString::fromLocal8Bit(path)); + + QVERIFY(!system.contains(QString(envname).toLower())); +# endif +#endif +} + +void tst_QProcessEnvironment::putenv() +{ +#ifdef Q_WS_WINCE + QSKIP("Windows CE has no environment", SkipAll); +#else + static const char envname[] = "WE_RE_SETTING_THIS_ENVIRONMENT_VARIABLE"; + static bool testRan = false; + + if (testRan) + QFAIL("You cannot run this test more than once, since we modify the environment"); + testRan = true; + + QByteArray valBefore = qgetenv(envname); + if (!valBefore.isNull()) + QFAIL("The environment variable we set in the environment is already set! -- please correct the test environment"); + QProcessEnvironment eBefore = QProcessEnvironment::systemEnvironment(); + + qputenv(envname, "Hello, World"); + QByteArray valAfter = qgetenv(envname); + if (valAfter != "Hello, World") + QSKIP("Could not test: qputenv did not do its job", SkipAll); + + QProcessEnvironment eAfter = QProcessEnvironment::systemEnvironment(); + + QVERIFY(!eBefore.contains(envname)); + QVERIFY(eAfter.contains(envname)); + QCOMPARE(eAfter.value(envname), QString("Hello, World")); + +# ifdef Q_OS_WIN + // check case-insensitive too + QString lower = envname; + lower = lower.toLower(); + QVERIFY(!eBefore.contains(lower)); + QVERIFY(eAfter.contains(lower)); + QCOMPARE(eAfter.value(lower), QString("Hello, World")); +# endif +#endif +} + +QTEST_MAIN(tst_QProcessEnvironment) + +#include "tst_qprocessenvironment.moc" -- cgit v0.12 From c8ac0418fa47316bf4f288a8c0b07611b388c3c6 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Thu, 10 Dec 2009 12:30:04 +0100 Subject: Fix .gitignore to not ignore qdoc.pro Remove an old ignore that was introduced before qdoc moved to $QTDIR/bin Reviewed-by: Oswald Buddenhagen --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 33c9b7c..2069ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -93,7 +93,6 @@ tests/auto/qprocess/fileWriterProcess.txt .com.apple.timemachine.supported tests/auto/qlibrary/libmylib.so* tests/auto/qresourceengine/runtime_resource.rcc -tools/qdoc3/qdoc3* tools/qtestlib/updater/updater* tools/activeqt/testcon/testcon.tlb translations/*.qm -- cgit v0.12 From 6db96dcd4acccbc13161f85adf3164907b7b5cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 10 Dec 2009 12:52:10 +0100 Subject: Fix redraw bugs when using graphics effects in device coordinate mode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QGraphicsEffect::boundingRectFor() needs the source bounding rect in device coordinates. This patch fixes the documentation to reflect this, and fixes some internal usage of boundingRectFor() to ensure it always gets the device rect of the source. Task-number: QTBUG-5918 Reviewed-by: Bjørn Erik Nilsen --- src/gui/effects/qgraphicseffect.cpp | 14 +++++-- src/gui/graphicsview/qgraphicsitem.cpp | 54 +++++++++++++++++++++----- src/gui/graphicsview/qgraphicsitem_p.h | 2 + src/gui/graphicsview/qgraphicsview.cpp | 26 +++++++++++++ src/gui/graphicsview/qgraphicsview.h | 1 + src/gui/graphicsview/qgraphicsview_p.h | 3 ++ tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 9 ++++- 7 files changed, 95 insertions(+), 14 deletions(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 239e29c..d6cabaa 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -160,6 +160,10 @@ QRectF QGraphicsEffectSource::boundingRect(Qt::CoordinateSystem system) const /*! Returns the bounding rectangle of the source mapped to the given \a system. + Calling this function with Qt::DeviceCoordinates outside of + QGraphicsEffect::draw() will give undefined results, as there is no device + context available. + \sa draw() */ QRectF QGraphicsEffect::sourceBoundingRect(Qt::CoordinateSystem system) const @@ -348,6 +352,10 @@ QPixmap QGraphicsEffectSource::pixmap(Qt::CoordinateSystem system, QPoint *offse The returned pixmap is clipped to the current painter's device rectangle when \a system is Qt::DeviceCoordinates. + Calling this function with Qt::DeviceCoordinates outside of + QGraphicsEffect::draw() will give undefined results, as there is no device + context available. + \sa draw(), boundingRect() */ QPixmap QGraphicsEffect::sourcePixmap(Qt::CoordinateSystem system, QPoint *offset, QGraphicsEffect::PixmapPadMode mode) const @@ -398,8 +406,8 @@ QGraphicsEffect::~QGraphicsEffect() /*! Returns the effective bounding rectangle for this effect, i.e., the - bounding rectangle of the source, adjusted by any margins applied by - the effect itself. + bounding rectangle of the source in device coordinates, adjusted by + any margins applied by the effect itself. \sa boundingRectFor(), updateBoundingRect() */ @@ -413,7 +421,7 @@ QRectF QGraphicsEffect::boundingRect() const /*! Returns the effective bounding rectangle for this effect, given the - provided \a rect in the source's coordinate space. When writing + provided \a rect in the device coordinates. When writing you own custom effect, you must call updateBoundingRect() whenever any parameters are changed that may cause this this function to return a different value. diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 90cc132..8bbe929 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2584,6 +2584,35 @@ void QGraphicsItem::setGraphicsEffect(QGraphicsEffect *effect) /*! \internal \since 4.6 + Returns the effective bounding rect of the given item space rect. + If the item has no effect, the rect is returned unmodified. + If the item has an effect, the effective rect can be extend beyond the + item's bounding rect, depending on the effect. + + \sa boundingRect() +*/ +QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const +{ +#ifndef QT_NO_GRAPHICSEFFECT + Q_Q(const QGraphicsItem); + QGraphicsEffect *effect = graphicsEffect; + if (scene && effect && effect->isEnabled()) { + QRectF sceneRect = q->mapRectToScene(rect); + QRectF sceneEffectRect; + foreach (QGraphicsView *view, scene->views()) { + QRectF deviceRect = view->d_func()->mapRectFromScene(sceneRect); + QRect deviceEffectRect = effect->boundingRectFor(deviceRect).toAlignedRect(); + sceneEffectRect |= view->d_func()->mapRectToScene(deviceEffectRect); + } + return q->mapRectFromScene(sceneEffectRect); + } +#endif //QT_NO_GRAPHICSEFFECT + return rect; +} + +/*! + \internal + \since 4.6 Returns the effective bounding rect of the item. If the item has no effect, this is the same as the item's bounding rect. If the item has an effect, the effective rect can be larger than the item's @@ -2594,16 +2623,19 @@ void QGraphicsItem::setGraphicsEffect(QGraphicsEffect *effect) QRectF QGraphicsItemPrivate::effectiveBoundingRect() const { #ifndef QT_NO_GRAPHICSEFFECT - QGraphicsEffect *effect = graphicsEffect; - QRectF brect = effect && effect->isEnabled() ? effect->boundingRect() : q_ptr->boundingRect(); + Q_Q(const QGraphicsItem); + QRectF brect = effectiveBoundingRect(q_ptr->boundingRect()); if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) return brect; const QGraphicsItem *effectParent = parent; while (effectParent) { - effect = effectParent->d_ptr->graphicsEffect; - if (effect && effect->isEnabled()) - brect = effect->boundingRectFor(brect); + QGraphicsEffect *effect = effectParent->d_ptr->graphicsEffect; + if (scene && effect && effect->isEnabled()) { + const QRectF brectInParentSpace = q->mapRectToItem(effectParent, brect); + const QRectF effectRectInParentSpace = effectParent->d_ptr->effectiveBoundingRect(brectInParentSpace); + brect = effectParent->mapRectToItem(q, effectRectInParentSpace); + } if (effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) return brect; effectParent = effectParent->d_ptr->parent; @@ -10649,17 +10681,21 @@ QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QP QGraphicsScenePrivate *scened = item->d_ptr->scene->d_func(); const QRectF sourceRect = boundingRect(system); - QRect effectRect; + QRectF effectRectF; if (mode == QGraphicsEffect::PadToEffectiveBoundingRect) { - effectRect = item->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect(); + effectRectF = item->graphicsEffect()->boundingRectFor(boundingRect(Qt::DeviceCoordinates)); + if (system == Qt::LogicalCoordinates) + effectRectF = info->painter->worldTransform().inverted().mapRect(effectRectF); } else if (mode == QGraphicsEffect::PadToTransparentBorder) { // adjust by 1.5 to account for cosmetic pens - effectRect = sourceRect.adjusted(-1.5, -1.5, 1.5, 1.5).toAlignedRect(); + effectRectF = sourceRect.adjusted(-1.5, -1.5, 1.5, 1.5); } else { - effectRect = sourceRect.toAlignedRect(); + effectRectF = sourceRect; } + QRect effectRect = effectRectF.toAlignedRect(); + if (offset) *offset = effectRect.topLeft(); diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 8f9fe54..2d8de65 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -236,6 +236,8 @@ public: QRectF effectiveBoundingRect() const; QRectF sceneEffectiveBoundingRect() const; + QRectF effectiveBoundingRect(const QRectF &rect) const; + virtual void resolveFont(uint inheritedMask) { for (int i = 0; i < children.size(); ++i) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 3f9f443..ffe64aa 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -545,6 +545,32 @@ qint64 QGraphicsViewPrivate::verticalScroll() const /*! \internal + + Maps the given rectangle to the scene using QTransform::mapRect() +*/ +QRectF QGraphicsViewPrivate::mapRectToScene(const QRect &rect) const +{ + if (dirtyScroll) + const_cast(this)->updateScroll(); + QRectF scrolled = QRectF(rect.translated(scrollX, scrollY)); + return identityMatrix ? scrolled : matrix.inverted().mapRect(scrolled); +} + + +/*! + \internal + + Maps the given rectangle from the scene using QTransform::mapRect() +*/ +QRectF QGraphicsViewPrivate::mapRectFromScene(const QRectF &rect) const +{ + if (dirtyScroll) + const_cast(this)->updateScroll(); + return (identityMatrix ? rect : matrix.mapRect(rect)).translated(-scrollX, -scrollY); +} + +/*! + \internal */ void QGraphicsViewPrivate::updateScroll() { diff --git a/src/gui/graphicsview/qgraphicsview.h b/src/gui/graphicsview/qgraphicsview.h index 2aed0e6..90576e5 100644 --- a/src/gui/graphicsview/qgraphicsview.h +++ b/src/gui/graphicsview/qgraphicsview.h @@ -278,6 +278,7 @@ private: friend class QGraphicsSceneWidget; friend class QGraphicsScene; friend class QGraphicsScenePrivate; + friend class QGraphicsItemPrivate; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QGraphicsView::CacheMode) diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h index cd161ad..d4b718e 100644 --- a/src/gui/graphicsview/qgraphicsview_p.h +++ b/src/gui/graphicsview/qgraphicsview_p.h @@ -86,6 +86,9 @@ public: qint64 horizontalScroll() const; qint64 verticalScroll() const; + QRectF mapRectToScene(const QRect &rect) const; + QRectF mapRectFromScene(const QRectF &rect) const; + QPointF mousePressItemPoint; QPointF mousePressScenePoint; QPoint mousePressViewPoint; diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 6266933..3e7a2eb 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -233,6 +233,7 @@ public: void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { hints = painter->renderHints(); + painter->setBrush(brush); painter->drawRect(boundingRect()); ++repaints; } @@ -247,6 +248,7 @@ public: QPainter::RenderHints hints; int repaints; QRectF br; + QBrush brush; }; class tst_QGraphicsItem : public QObject @@ -7646,17 +7648,20 @@ void tst_QGraphicsItem::hitTestGraphicsEffectItem() EventTester *item1 = new EventTester; item1->br = itemBoundingRect; item1->setPos(-200, -200); + item1->brush = Qt::red; EventTester *item2 = new EventTester; item2->br = itemBoundingRect; item2->setFlag(QGraphicsItem::ItemIgnoresTransformations); item2->setParentItem(item1); item2->setPos(200, 200); + item2->brush = Qt::green; EventTester *item3 = new EventTester; item3->br = itemBoundingRect; item3->setParentItem(item2); item3->setPos(80, 80); + item3->brush = Qt::blue; scene.addItem(item1); QTest::qWait(100); @@ -7671,8 +7676,8 @@ void tst_QGraphicsItem::hitTestGraphicsEffectItem() item1->setGraphicsEffect(shadow); QTest::qWait(50); - // Make sure all items are repainted. - QCOMPARE(item