diff options
36 files changed, 1512 insertions, 357 deletions
diff --git a/doc/src/examples/dragdroprobot.qdoc b/doc/src/examples/dragdroprobot.qdoc index 413f190..887b254 100644 --- a/doc/src/examples/dragdroprobot.qdoc +++ b/doc/src/examples/dragdroprobot.qdoc @@ -43,9 +43,337 @@ \example graphicsview/dragdroprobot \title Drag and Drop Robot Example - This GraphicsView example shows how to implement drag and drop in - a QGraphicsItem subclass, as well as how to animate items using - QGraphicsItemAnimation and QTimeLine. + This GraphicsView example shows how to implement Drag and Drop in a + QGraphicsItem subclass, as well as how to animate items using Qt's + \l{Animation Framework}. \image dragdroprobot-example.png + + Graphics View provides the QGraphicsScene class for managing and + interacting with a large number of custom-made 2D graphical items derived + from the QGraphicsItem class, and a QGraphicsView widget for visualizing + the items, with support for zooming and rotation. + + This example consists of a \c Robot class, a \c ColorItem class, and a main + function: the \c Robot class describes a simple robot consisting of several + \c RobotPart derived limbs, including \c RobotHead and \c RobotLimb, the \c + ColorItem class provides a draggable colored ellipse, and the \c main() + function provides the main application window. + + We will first review the \c Robot class to see how to assemble the + different parts so that they can be individually rotated and animated using + QPropertyAnimation, and we will then review the \c ColorItem class to + demonstrate how to implement Drag and Drop between items. Finally we will + review the main() function to see how we can put all the pieces together, + to form the final application. + + \section1 Robot Class Definition + + The robot consists of three main classes: the \c RobotHead, the \c + RobotTorso, and the \c RobotLimb, which is used for the upper and lower + arms and legs. All parts derive from the \c RobotPart class, which in turn + inherits \c QGraphicsObject. The \c Robot class itself has no visual + appearance and serves only as a root node for the robot. + + Let's start with the \c RobotPart class declaration. + + \snippet examples/graphicsview/dragdroprobot/robot.h 0 + + This base class inherits QGraphicsObject. QGraphicsObject provides signals + and slots through inheriting QObject, and it also declares QGraphicsItem's + properties using Q_PROPERTY, which makes the properties accessible for + QPropertyAnimation. + + RobotPart also implements the three most important event handlers for + accepting drop events: + \l{QGraphicsItem::dragEnterEvent()}{dragEnterEvent()}, + \l{QGraphicsItem::dragLeaveEvent()}{dragLeaveEvent()}, and + \l{QGraphicsItem::dropEvent()}{dropEvent()}. + + The color is stored as a member variable, along with the \c dragOver + variable, which we will use later to indicate visually that the limb can + accept colors that are is dragged onto it. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 0 + + \c RobotPart's constructor initializes the dragOver member and sets the + color to Qt::lightGray. In the constructor body we enable support for + accepting drop events by calling + \l{QGraphicsItem::setAcceptDrops()}{setAcceptDrops(true)}. + + The rest of this class's implementation is to support Drag and Drop. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 1 + + The \l{QGraphicsItem::dragEnterEvent()}{dragEnterEvent()} handler is called + when a Drag and Drop element is dragged into the robot part's area. + + The handler implementation determines whether or not this item as a whole + can accept the mime data assiciated with the incoming drag object. \c + RobotPart provides a base behavior for all parts that accepts color drops. + So if the incoming drag object contains a color, the event is accepted, we + set \c dragOver to \c true and call update() to help provide positive + visual feedback to the user; otherwise the event is ignored, which in turn + allows the event to propagate to parent elements. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 2 + + The \l{QGraphicsItem::dragLeaveEvent()}{dragLeaveEvent()} handler is called + when a Drag and Drop element is dragged away from the robot part's area. + Our implementation simply resets \e dragOver to false and calls + \l{QGraphicsItem::update()}{update()} to help provide visual feedback that + the drag has left this item. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 3 + + The \l{QGraphicsItem::dropEvent()}{dropEvent()} handler is called when a + Drag and Drop element is dropped onto an item (i.e., when the mouse button + is released over the item while dragging). + + We reset \c dragOver to false, assign the item's new color, and call + \l{QGraphicsItem::update()}{update()}. + + The declaration and implementation of \c RobotHead, \c RobotTorso, and \c + RobotLimb are practically identical. We will review \c RobotHead in detail, + as this class has one minor difference, and leave the other classes as an + exercise for the reader. + + \snippet examples/graphicsview/dragdroprobot/robot.h 1 + + The \c RobotHead class inherits \c RobotPart and provides the necessary + implementations of \l{QGraphicsItem::boundingRect()}{boundingRect()} and + \l{QGraphicsItem::paint()}{paint()}. It also reimplements + \l{QGraphicsItem::dragEnterEvent()}{dragEnterEvent()} and dropEvent() to + provide special handling of image drops. + + The class contains a private pixmap member that we can use to implement + support for accepting image drops. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 4 + + \c RobotHead has a rather plain constructor that simply forwards to + \c RobotPart's constructor. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 5 + + The \l{QGraphicsItem::boundingRect()}{boundingRect()} reimplementation + returns the extents for the head. Because we want the center of rotation to + be the bottom center of the item, we have chosen a bounding rectangle that + starts at (-15, -50) and extends to 30 units wide and 50 units tall. When + rotating the head, the "neck" will stay still while the top of the head + tilts from side to side. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 6 + + In \l{QGraphicsItem::paint()}{paint()} we draw the actual head. The + implementation is split into two sections; if an image has been dropped + onto the head, we draw the image, otherwise we draw a round rectangular + robot head with simple vector graphics. + + For performance reasons, depending on the complexity of what is painted, it + can often be faster to draw the head as an image rather than using a + sequence of vector operations. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 7 + + The robot head can accept image drops. In order to support this, its + reimplementation of \l{QGraphicsItem::dragEnterEvent()}{dragEnterEvent()} + checks if the drag object contains image data, and if it does, then the + event is accepted. Otherwise we fall back to the base \c RobotPart + implementation. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 8 + + To follow up on image support, we must also implement + \l{QGraphicsItem::dropEvent()}{dropEvent()}. We check if the drag object + contains image data, and if it does, we store this data as a member pixmap + and call \l{QGraphicsItem::update()}{update()}. This pixmap is used inside + the \l{QGraphicsItem::paint()}{paint()} implementation that we reviewed + before. + + \c RobotTorso and \c RobotLimb are similar to \c RobotHead, so let's + skip directly to the \c Robot class. + + \snippet examples/graphicsview/dragdroprobot/robot.h 4 + + The \c Robot class also inherits \c RobotPart, and like the other parts it + also implements \l{QGraphicsItem::boundingRect()}{boundingRect()} and + \l{QGraphicsItem::paint()}{paint()}. It provides a rather special + implementation, though: + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 9 + + Because the \c Robot class is only used as a base node for the rest of the + robot, it has no visual representation. Its + \l{QGraphicsItem::boundingRect()}{boundingRect()} implementation can + therefore return a null QRectF, and its paint() function does nothing. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 10 + + The constuctor starts by setting the flag + \l{QGraphicsItem::ItemHasNoContents}{ItemHasNoContents}, which is a minor + optimization for items that have no visual appearance. + + We then construct all the robot parts (head, torso, and upper/lower arms + and legs). The stacking order is very important, and we use the + parent-child hierarchy to ensure the elements rotate and move properly. We + construct the torso first, as this is the root element. We then construct + the head and pass the torso to \c HeadItem's constructor. This will make + the head a child of the torso; if you rotate the torso, the head will + follow. The same pattern is applied to the rest of the limbs. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 11 + + Each robot part is carefully positioned. For example, the upper left arm is + moved precisely to the top-left area of the torso, and the upper right arm + is moved to the top-right area. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 12 + + The next section creates all animation objects. This snippet shows the two + animations that operate on the head's scale and rotation. The two + QPropertyAnimation instances simply set the object, property, and + respective start and end values. + + All animations are controlled by one top-level parallel animation group. + The scale and rotation animations are added to this group. + + The rest of the animations are defined in a similar way. + + \snippet examples/graphicsview/dragdroprobot/robot.cpp 13 + + Finally we set an easing curve and duration on each animation, ensure the + toplevel animation group loops forever, and start the toplevel animation. + + \section1 ColorItem Class Definition + + The \c ColorItem class represents a circular item that can be pressed to + drag colors onto robot parts. + + \snippet examples/graphicsview/dragdroprobot/coloritem.h 0 + + This class is very simple. It does not use animations, and has no need for + properties nor signals and slots, so to save resources, it's most natural + that it inherits QGraphicsItem (as opposed to QGraphicsObject). + + It declares the mandatory \l{QGraphicsItem::boundingRect()}{boundingRect()} + and \l{QGraphicsItem::paint()}{paint()} functions, and adds + reimplementations of + \l{QGraphicsItem::mousePressEvent()}{mousePressEvent()}, + \l{QGraphicsItem::mouseMoveEvent()}{mouseMoveEvent()}, and + \l{QGraphicsItem::mouseReleaseEvent()}{mouseReleaseEvent()}. It contains a + single private color member. + + Let's take a look at its implementation. + + \snippet examples/graphicsview/dragdroprobot/coloritem.cpp 0 + + \c ColorItem's constructor assigns an opaque random color to its color + member by making use of qrand(). For improved usability, it assigns a + tooltip that provides a useful hint to the user, and it also sets a + suitable cursor. This ensures that the cursor will chance to + Qt::OpenHandCursor when the mouse pointer hovers over the item. + + Finally, we call + \l{QGraphicsItem::setAcceptedMouseButtons()}{setAcceptedMouseButtons()} to + ensure that this item can only process Qt::LeftButton. This simplifies the + mouse event handlers greatly, as we can always assume that only the left + mouse button is pressed and released. + + \snippet examples/graphicsview/dragdroprobot/coloritem.cpp 1 + + The item's bounding rect is a fixed 30x30 units centered around the item's + origin (0, 0), and adjusted by 0.5 units in all directions to allow a + scalable pen to draw its outline. For a final visual touch the bounds + also compensate with a few units down and to the right to make room + for a simple dropshadow. + + \snippet examples/graphicsview/dragdroprobot/coloritem.cpp 2 + + The \l{QGraphicsItem::paint()}{paint()} implementation draws an ellipse + with a 1-unit black outline, a plain color fill, and a dark gray + dropshadow. + + \snippet examples/graphicsview/dragdroprobot/coloritem.cpp 3 + + The \l{QGraphicsItem::mousePressEvent()}{mousePressEvent()} handler is + called when you press the mouse button inside the item's area. Our + implementation simply sets the cursor to Qt::ClosedHandCursor. + + \snippet examples/graphicsview/dragdroprobot/coloritem.cpp 4 + + The \l{QGraphicsItem::mouseReleaseEvent()}{mouseReleaseEvent()} handler is + called when you release the mouse button after having pressed it inside an + item's area. Our implementation sets the cursor back to Qt::OpenHandCursor. + The mouse press and release event handlers together provide useful visual + feedback to the user: when you move the mouse pointer over a \c CircleItem, + the cursor changes to an open hand. Pressing the item will show a closed + hand cursor. Releasing will restore to an open hand cursor again. + + \snippet examples/graphicsview/dragdroprobot/coloritem.cpp 5 + + The \l{QGraphicsItem::mouseMoveEvent()}{mouseMoveEvent()} handler is called + when you move the mouse around after pressing the mouse button inside the + \c ColorItem's area. This implementation provides the most important piece + of logic for \c CircleItem: the code that starts and manages drags. + + The implementation starts by checking if the mouse has been dragged far + enough to eliminate mouse jitter noise. We only want to start a drag if the + mouse has been dragged farther than the application start drag distance. + + Continuing, we create a QDrag object, passing the event + \l{QGraphicsSceneEvent::widget()}{widget} (i.e., the QGraphicsView + viewport) to its constructor. Qt will ensure that this object is deleted at + the right time. We also create a QMimeData instance that can contain our + color or image data, and assign this to the drag object. + + \snippet examples/graphicsview/dragdroprobot/coloritem.cpp 6 + + This snippet has a somewhat random outcome: once in a while, a special + image is assigned to the drag object's mime data. The pixmap is also + assiged as the drag object's pixmap. This will ensure that you can see the + image that is being dragged as a pixmap under the mouse cursor. + + \snippet examples/graphicsview/dragdroprobot/coloritem.cpp 7 + + Otherwise, and this is the most common outcome, a simple color is assigned + to the drag object's mime data. We render this \c ColorItem into a new + pixmap to give the user visual feedback that the color is being "dragged". + + \snippet examples/graphicsview/dragdroprobot/coloritem.cpp 8 + + Finally we execute the drag. QDrag::exec() will reenter the event loop, and + only exit if the drag has either been dropped, or canceled. In any case we + reset the cursor to Qt::OpenHandCursor. + + \section1 The main() Function + + Now that the \c Robot and \c ColorItem classes are complete, we can put all + the pieces together inside the main() function. + + \snippet examples/graphicsview/dragdroprobot/main.cpp 0 + + We start off by constructing QApplication, and initializing the random + number generator. This ensures that the color items have different colors + every time the application starts. + + \snippet examples/graphicsview/dragdroprobot/main.cpp 1 + + We construct a fixed size scene, and create 10 \c ColorItem instances + arranged in a circle. Each item is added to the scene. + + In the center of this circle we create one \c Robot instance. The + robot is scaled and moved up a few units. It is then added to the scene. + + \snippet examples/graphicsview/dragdroprobot/main.cpp 2 + + Finally we create a QGraphicsView window, and assign the scene to it. + + For increased visual quality, we enable antialiasing. We also choose to use + bounding rectangle updates to simplify visual update handling. + The view is given a fixed sand-colored background, and a window title. + + We then show the view. The animations start immediately after + control enters the event loop. */ + diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 071a107..c96c70f 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -649,7 +649,7 @@ \list \o \l{graphicsview/collidingmice}{Colliding Mice}\raisedaster \o \l{graphicsview/diagramscene}{Diagram Scene}\raisedaster - \o \l{graphicsview/dragdroprobot}{Drag and Drop Robot} + \o \l{graphicsview/dragdroprobot}{Drag and Drop Robot}\raisedaster \o \l{graphicsview/elasticnodes}{Elastic Nodes} \o \l{graphicsview/portedasteroids}{Ported Asteroids} \o \l{graphicsview/portedcanvas}{Ported Canvas} diff --git a/examples/graphicsview/dragdroprobot/coloritem.cpp b/examples/graphicsview/dragdroprobot/coloritem.cpp index 95878b1..08edd38 100644 --- a/examples/graphicsview/dragdroprobot/coloritem.cpp +++ b/examples/graphicsview/dragdroprobot/coloritem.cpp @@ -43,6 +43,7 @@ #include "coloritem.h" +//! [0] ColorItem::ColorItem() : color(qrand() % 256, qrand() % 256, qrand() % 256) { @@ -50,13 +51,18 @@ ColorItem::ColorItem() .arg(color.red()).arg(color.green()).arg(color.blue()) .arg("Click and drag this color onto the robot!")); setCursor(Qt::OpenHandCursor); + setAcceptedMouseButtons(Qt::LeftButton); } +//! [0] +//! [1] QRectF ColorItem::boundingRect() const { return QRectF(-15.5, -15.5, 34, 34); } +//! [1] +//! [2] void ColorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option); @@ -68,17 +74,16 @@ void ColorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, painter->setBrush(QBrush(color)); painter->drawEllipse(-15, -15, 30, 30); } +//! [2] +//! [3] void ColorItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() != Qt::LeftButton) { - event->ignore(); - return; - } - setCursor(Qt::ClosedHandCursor); } +//! [3] +//! [5] void ColorItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { if (QLineF(event->screenPos(), event->buttonDownScreenPos(Qt::LeftButton)) @@ -89,7 +94,9 @@ void ColorItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QDrag *drag = new QDrag(event->widget()); QMimeData *mime = new QMimeData; drag->setMimeData(mime); +//! [5] +//! [6] static int n = 0; if (n++ > 2 && (qrand() % 3) == 0) { QImage image(":/images/head.png"); @@ -97,6 +104,8 @@ void ColorItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) drag->setPixmap(QPixmap::fromImage(image).scaled(30, 40)); drag->setHotSpot(QPoint(15, 30)); +//! [6] +//! [7] } else { mime->setColorData(color); mime->setText(QString("#%1%2%3") @@ -118,12 +127,17 @@ void ColorItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) drag->setPixmap(pixmap); drag->setHotSpot(QPoint(15, 20)); } +//! [7] +//! [8] drag->exec(); setCursor(Qt::OpenHandCursor); } +//! [8] +//! [4] void ColorItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *) { setCursor(Qt::OpenHandCursor); } +//! [4] diff --git a/examples/graphicsview/dragdroprobot/coloritem.h b/examples/graphicsview/dragdroprobot/coloritem.h index 788d19e..eb19db6 100644 --- a/examples/graphicsview/dragdroprobot/coloritem.h +++ b/examples/graphicsview/dragdroprobot/coloritem.h @@ -44,6 +44,7 @@ #include <QGraphicsItem> +//! [0] class ColorItem : public QGraphicsItem { public: @@ -60,5 +61,6 @@ protected: private: QColor color; }; +//! [0] #endif diff --git a/examples/graphicsview/dragdroprobot/main.cpp b/examples/graphicsview/dragdroprobot/main.cpp index 02585e1..2669c41 100644 --- a/examples/graphicsview/dragdroprobot/main.cpp +++ b/examples/graphicsview/dragdroprobot/main.cpp @@ -46,12 +46,14 @@ #include <math.h> +//! [0] int main(int argc, char **argv) { QApplication app(argc, argv); qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); - +//! [0] +//! [1] QGraphicsScene scene(-200, -200, 400, 400); for (int i = 0; i < 10; ++i) { @@ -66,7 +68,8 @@ int main(int argc, char **argv) robot->scale(1.2, 1.2); robot->setPos(0, -20); scene.addItem(robot); - +//! [1] +//! [2] QGraphicsView view(&scene); view.setRenderHint(QPainter::Antialiasing); view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); @@ -76,3 +79,4 @@ int main(int argc, char **argv) return app.exec(); } +//! [2] diff --git a/examples/graphicsview/dragdroprobot/robot.cpp b/examples/graphicsview/dragdroprobot/robot.cpp index 9ac6d26..705bd9d 100644 --- a/examples/graphicsview/dragdroprobot/robot.cpp +++ b/examples/graphicsview/dragdroprobot/robot.cpp @@ -43,16 +43,18 @@ #include "robot.h" +//! [0] RobotPart::RobotPart(QGraphicsItem *parent) - : QGraphicsItem(parent), color(Qt::lightGray), dragOver(false) + : QGraphicsObject(parent), color(Qt::lightGray), dragOver(false) { setAcceptDrops(true); } +//! [0] +//! [1] void RobotPart::dragEnterEvent(QGraphicsSceneDragDropEvent *event) { - if (event->mimeData()->hasColor() - || (qgraphicsitem_cast<RobotHead *>(this) && event->mimeData()->hasImage())) { + if (event->mimeData()->hasColor()) { event->setAccepted(true); dragOver = true; update(); @@ -60,34 +62,42 @@ void RobotPart::dragEnterEvent(QGraphicsSceneDragDropEvent *event) event->setAccepted(false); } } +//! [1] +//! [2] void RobotPart::dragLeaveEvent(QGraphicsSceneDragDropEvent *event) { Q_UNUSED(event); dragOver = false; update(); } +//! [2] +//! [3] void RobotPart::dropEvent(QGraphicsSceneDragDropEvent *event) { dragOver = false; if (event->mimeData()->hasColor()) color = qVariantValue<QColor>(event->mimeData()->colorData()); - else if (event->mimeData()->hasImage()) - pixmap = qVariantValue<QPixmap>(event->mimeData()->imageData()); update(); } +//! [3] +//! [4] RobotHead::RobotHead(QGraphicsItem *parent) : RobotPart(parent) { } +//! [4] +//! [5] QRectF RobotHead::boundingRect() const { return QRectF(-15, -50, 30, 50); } +//! [5] +//! [6] void RobotHead::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { @@ -110,11 +120,33 @@ void RobotHead::paint(QPainter *painter, painter->drawPixmap(QPointF(-15 * 4.4, -50 * 3.54), pixmap); } } +//! [6] -int RobotHead::type() const +//! [7] +void RobotHead::dragEnterEvent(QGraphicsSceneDragDropEvent *event) { - return Type; + if (event->mimeData()->hasImage()) { + event->setAccepted(true); + dragOver = true; + update(); + } else { + RobotPart::dragEnterEvent(event); + } } +//! [7] + +//! [8] +void RobotHead::dropEvent(QGraphicsSceneDragDropEvent *event) +{ + if (event->mimeData()->hasImage()) { + dragOver = false; + pixmap = qVariantValue<QPixmap>(event->mimeData()->imageData()); + update(); + } else { + RobotPart::dropEvent(event); + } +} +//! [8] RobotTorso::RobotTorso(QGraphicsItem *parent) : RobotPart(parent) @@ -161,19 +193,25 @@ void RobotLimb::paint(QPainter *painter, painter->drawEllipse(-5, -5, 10, 10); } -Robot::Robot() +//! [10] +Robot::Robot(QGraphicsItem *parent) + : RobotPart(parent) { - QGraphicsItem *torsoItem = new RobotTorso(this); - QGraphicsItem *headItem = new RobotHead(torsoItem); - QGraphicsItem *upperLeftArmItem = new RobotLimb(torsoItem); - QGraphicsItem *lowerLeftArmItem = new RobotLimb(upperLeftArmItem); - QGraphicsItem *upperRightArmItem = new RobotLimb(torsoItem); - QGraphicsItem *lowerRightArmItem = new RobotLimb(upperRightArmItem); - QGraphicsItem *upperRightLegItem = new RobotLimb(torsoItem); - QGraphicsItem *lowerRightLegItem = new RobotLimb(upperRightLegItem); - QGraphicsItem *upperLeftLegItem = new RobotLimb(torsoItem); - QGraphicsItem *lowerLeftLegItem = new RobotLimb(upperLeftLegItem); - + setFlag(ItemHasNoContents); + + QGraphicsObject *torsoItem = new RobotTorso(this); + QGraphicsObject *headItem = new RobotHead(torsoItem); + QGraphicsObject *upperLeftArmItem = new RobotLimb(torsoItem); + QGraphicsObject *lowerLeftArmItem = new RobotLimb(upperLeftArmItem); + QGraphicsObject *upperRightArmItem = new RobotLimb(torsoItem); + QGraphicsObject *lowerRightArmItem = new RobotLimb(upperRightArmItem); + QGraphicsObject *upperRightLegItem = new RobotLimb(torsoItem); + QGraphicsObject *lowerRightLegItem = new RobotLimb(upperRightLegItem); + QGraphicsObject *upperLeftLegItem = new RobotLimb(torsoItem); + QGraphicsObject *lowerLeftLegItem = new RobotLimb(upperLeftLegItem); +//! [10] + +//! [11] headItem->setPos(0, -18); upperLeftArmItem->setPos(-15, -10); lowerLeftArmItem->setPos(30, 0); @@ -183,82 +221,78 @@ Robot::Robot() lowerRightLegItem->setPos(30, 0); upperLeftLegItem->setPos(-10, 32); lowerLeftLegItem->setPos(30, 0); +//! [11] - timeLine = new QTimeLine; - - QGraphicsItemAnimation *headAnimation = new QGraphicsItemAnimation; - headAnimation->setItem(headItem); - headAnimation->setTimeLine(timeLine); - headAnimation->setRotationAt(0, 20); - headAnimation->setRotationAt(1, -20); - headAnimation->setScaleAt(1, 1.1, 1.1); - - QGraphicsItemAnimation *upperLeftArmAnimation = new QGraphicsItemAnimation; - upperLeftArmAnimation->setItem(upperLeftArmItem); - upperLeftArmAnimation->setTimeLine(timeLine); - upperLeftArmAnimation->setRotationAt(0, 190); - upperLeftArmAnimation->setRotationAt(1, 180); - - QGraphicsItemAnimation *lowerLeftArmAnimation = new QGraphicsItemAnimation; - lowerLeftArmAnimation->setItem(lowerLeftArmItem); - lowerLeftArmAnimation->setTimeLine(timeLine); - lowerLeftArmAnimation->setRotationAt(0, 50); - lowerLeftArmAnimation->setRotationAt(1, 10); - - QGraphicsItemAnimation *upperRightArmAnimation = new QGraphicsItemAnimation; - upperRightArmAnimation->setItem(upperRightArmItem); - upperRightArmAnimation->setTimeLine(timeLine); - upperRightArmAnimation->setRotationAt(0, 300); - upperRightArmAnimation->setRotationAt(1, 310); - - QGraphicsItemAnimation *lowerRightArmAnimation = new QGraphicsItemAnimation; - lowerRightArmAnimation->setItem(lowerRightArmItem); - lowerRightArmAnimation->setTimeLine(timeLine); - lowerRightArmAnimation->setRotationAt(0, 0); - lowerRightArmAnimation->setRotationAt(1, -70); - - QGraphicsItemAnimation *upperLeftLegAnimation = new QGraphicsItemAnimation; - upperLeftLegAnimation->setItem(upperLeftLegItem); - upperLeftLegAnimation->setTimeLine(timeLine); - upperLeftLegAnimation->setRotationAt(0, 150); - upperLeftLegAnimation->setRotationAt(1, 80); - - QGraphicsItemAnimation *lowerLeftLegAnimation = new QGraphicsItemAnimation; - lowerLeftLegAnimation->setItem(lowerLeftLegItem); - lowerLeftLegAnimation->setTimeLine(timeLine); - lowerLeftLegAnimation->setRotationAt(0, 70); - lowerLeftLegAnimation->setRotationAt(1, 10); - - QGraphicsItemAnimation *upperRightLegAnimation = new QGraphicsItemAnimation; - upperRightLegAnimation->setItem(upperRightLegItem); - upperRightLegAnimation->setTimeLine(timeLine); - upperRightLegAnimation->setRotationAt(0, 40); - upperRightLegAnimation->setRotationAt(1, 120); - - QGraphicsItemAnimation *lowerRightLegAnimation = new QGraphicsItemAnimation; - lowerRightLegAnimation->setItem(lowerRightLegItem); - lowerRightLegAnimation->setTimeLine(timeLine); - lowerRightLegAnimation->setRotationAt(0, 10); - lowerRightLegAnimation->setRotationAt(1, 50); - - QGraphicsItemAnimation *torsoAnimation = new QGraphicsItemAnimation; - torsoAnimation->setItem(torsoItem); - torsoAnimation->setTimeLine(timeLine); - torsoAnimation->setRotationAt(0, 5); - torsoAnimation->setRotationAt(1, -20); - - timeLine->setUpdateInterval(1000 / 25); - timeLine->setCurveShape(QTimeLine::SineCurve); - timeLine->setLoopCount(0); - timeLine->setDuration(2000); - timeLine->start(); -} +//! [12] + QParallelAnimationGroup *animation = new QParallelAnimationGroup(this); -Robot::~Robot() -{ - delete timeLine; + QPropertyAnimation *headAnimation = new QPropertyAnimation(headItem, "rotation"); + headAnimation->setStartValue(20); + headAnimation->setEndValue(-20); + QPropertyAnimation *headScaleAnimation = new QPropertyAnimation(headItem, "scale"); + headScaleAnimation->setEndValue(1.1); + animation->addAnimation(headAnimation); + animation->addAnimation(headScaleAnimation); +//! [12] + + QPropertyAnimation *upperLeftArmAnimation = new QPropertyAnimation(upperLeftArmItem, "rotation"); + upperLeftArmAnimation->setStartValue(190); + upperLeftArmAnimation->setEndValue(180); + animation->addAnimation(upperLeftArmAnimation); + + QPropertyAnimation *lowerLeftArmAnimation = new QPropertyAnimation(lowerLeftArmItem, "rotation"); + lowerLeftArmAnimation->setStartValue(50); + lowerLeftArmAnimation->setEndValue(10); + animation->addAnimation(lowerLeftArmAnimation); + + QPropertyAnimation *upperRightArmAnimation = new QPropertyAnimation(upperRightArmItem, "rotation"); + upperRightArmAnimation->setStartValue(300); + upperRightArmAnimation->setEndValue(310); + animation->addAnimation(upperRightArmAnimation); + + QPropertyAnimation *lowerRightArmAnimation = new QPropertyAnimation(lowerRightArmItem, "rotation"); + lowerRightArmAnimation->setStartValue(0); + lowerRightArmAnimation->setEndValue(-70); + animation->addAnimation(lowerRightArmAnimation); + + QPropertyAnimation *upperLeftLegAnimation = new QPropertyAnimation(upperLeftLegItem, "rotation"); + upperLeftLegAnimation->setStartValue(150); + upperLeftLegAnimation->setEndValue(80); + animation->addAnimation(upperLeftLegAnimation); + + QPropertyAnimation *lowerLeftLegAnimation = new QPropertyAnimation(lowerLeftLegItem, "rotation"); + lowerLeftLegAnimation->setStartValue(70); + lowerLeftLegAnimation->setEndValue(10); + animation->addAnimation(lowerLeftLegAnimation); + + QPropertyAnimation *upperRightLegAnimation = new QPropertyAnimation(upperRightLegItem, "rotation"); + upperRightLegAnimation->setStartValue(40); + upperRightLegAnimation->setEndValue(120); + animation->addAnimation(upperRightLegAnimation); + + QPropertyAnimation *lowerRightLegAnimation = new QPropertyAnimation(lowerRightLegItem, "rotation"); + lowerRightLegAnimation->setStartValue(10); + lowerRightLegAnimation->setEndValue(50); + animation->addAnimation(lowerRightLegAnimation); + + QPropertyAnimation *torsoAnimation = new QPropertyAnimation(torsoItem, "rotation"); + torsoAnimation->setStartValue(5); + torsoAnimation->setEndValue(-20); + animation->addAnimation(torsoAnimation); + +//! [13] + for (int i = 0; i < animation->animationCount(); ++i) { + QPropertyAnimation *anim = qobject_cast<QPropertyAnimation *>(animation->animationAt(i)); + anim->setEasingCurve(QEasingCurve::SineCurve); + anim->setDuration(2000); + } + + animation->setLoopCount(-1); + animation->start(); +//! [13] } +//! [9] QRectF Robot::boundingRect() const { return QRectF(); @@ -271,3 +305,4 @@ void Robot::paint(QPainter *painter, Q_UNUSED(option); Q_UNUSED(widget); } +//! [9] diff --git a/examples/graphicsview/dragdroprobot/robot.h b/examples/graphicsview/dragdroprobot/robot.h index 88c4364..f5ff32c 100644 --- a/examples/graphicsview/dragdroprobot/robot.h +++ b/examples/graphicsview/dragdroprobot/robot.h @@ -46,10 +46,11 @@ QT_BEGIN_NAMESPACE class QGraphicsSceneMouseEvent; -class QTimeLine; +class QParallelAnimationGroup; QT_END_NAMESPACE -class RobotPart : public QGraphicsItem +//! [0] +class RobotPart : public QGraphicsObject { public: RobotPart(QGraphicsItem *parent = 0); @@ -59,11 +60,12 @@ protected: void dragLeaveEvent(QGraphicsSceneDragDropEvent *event); void dropEvent(QGraphicsSceneDragDropEvent *event); - QPixmap pixmap; QColor color; bool dragOver; }; +//! [0] +//! [1] class RobotHead : public RobotPart { public: @@ -72,10 +74,16 @@ public: QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); - enum { Type = UserType + 1 }; - int type() const; +protected: + void dragEnterEvent(QGraphicsSceneDragDropEvent *event); + void dropEvent(QGraphicsSceneDragDropEvent *event); + +private: + QPixmap pixmap; }; +//! [1] +//! [2] class RobotTorso : public RobotPart { public: @@ -84,7 +92,9 @@ public: QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); }; +//! [2] +//! [3] class RobotLimb : public RobotPart { public: @@ -93,18 +103,17 @@ public: QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); }; +//! [3] +//! [4] class Robot : public RobotPart { public: - Robot(); - ~Robot(); + Robot(QGraphicsItem *parent = 0); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); - -private: - QTimeLine *timeLine; }; +//! [4] #endif diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 8c9bba8..1b4e51b 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -934,10 +934,6 @@ void VcprojGenerator::initCompilerTool() } // Common for both release and debug - if(project->isActiveConfig("warn_off")) - conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_WARN_OFF")); - else if(project->isActiveConfig("warn_on")) - conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_WARN_ON")); if(project->isActiveConfig("windows")) conf.compiler.PreprocessorDefinitions += project->values("MSVCPROJ_WINCONDEF"); @@ -1009,13 +1005,6 @@ void VcprojGenerator::initLinkerTool() if(project->isActiveConfig("dll")){ conf.linker.parseOptions(project->values("QMAKE_LFLAGS_QT_DLL")); } - - if(project->isActiveConfig("console")){ - conf.linker.parseOptions(project->values("QMAKE_LFLAGS_CONSOLE")); - } else { - conf.linker.parseOptions(project->values("QMAKE_LFLAGS_WINDOWS")); - } - } void VcprojGenerator::initResourceTool() diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index 6a91c6b..85239fe 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -311,10 +311,6 @@ void VcxprojGenerator::initCompilerTool() } // Common for both release and debug - if(project->isActiveConfig("warn_off")) - conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_WARN_OFF")); - else if(project->isActiveConfig("warn_on")) - conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_WARN_ON")); if(project->isActiveConfig("windows")) conf.compiler.PreprocessorDefinitions += project->values("MSVCPROJ_WINCONDEF"); @@ -372,13 +368,6 @@ void VcxprojGenerator::initLinkerTool() if(project->isActiveConfig("dll")){ conf.linker.parseOptions(project->values("QMAKE_LFLAGS_QT_DLL")); } - - if(project->isActiveConfig("console")){ - conf.linker.parseOptions(project->values("QMAKE_LFLAGS_CONSOLE")); - } else { - conf.linker.parseOptions(project->values("QMAKE_LFLAGS_WINDOWS")); - } - } void VcxprojGenerator::initResourceTool() diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index a60f206..4e580dd 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2997,7 +2997,9 @@ bool qt_check_std3rules(const QChar *uc, int len) // only LDH is present if (c == '-' || (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') - || (c >= 'a' && c <= 'z')) + || (c >= 'a' && c <= 'z') + //underscore is not supposed to be allowed, but other browser accept it (QTBUG-7434) + || c == '_') continue; return false; diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 6f5bb9b..6cc6fc1 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -853,9 +853,7 @@ void **QListData::erase(void **xi) same as takeAt(0). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function. - This operation is very fast (\l{constant time}), because QList - preallocates extra space on both sides of its internal buffer to - allow for fast growth at both ends of the list. + This operation takes \l{constant time}. If you don't use the return value, removeFirst() is more efficient. @@ -870,9 +868,7 @@ void **QListData::erase(void **xi) not empty. To avoid failure, call isEmpty() before calling this function. - This operation is very fast (\l{constant time}), because QList - preallocates extra space on both sides of its internal buffer to - allow for fast growth at both ends of the list. + This operation takes \l{constant time}. If you don't use the return value, removeLast() is more efficient. diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp index 1f89714..320395e 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget.cpp +++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp @@ -975,6 +975,7 @@ bool QGraphicsProxyWidget::eventFilter(QObject *object, QEvent *event) d->styleChangeMode = QGraphicsProxyWidgetPrivate::NoMode; } break; +#ifndef QT_NO_TOOLTIP case QEvent::ToolTipChange: // Propagate tooltip change to the proxy. if (!d->tooltipChangeMode) { @@ -983,6 +984,7 @@ bool QGraphicsProxyWidget::eventFilter(QObject *object, QEvent *event) d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::NoMode; } break; +#endif default: break; } diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp index 80334a6..4492e53 100644 --- a/src/gui/itemviews/qtableview.cpp +++ b/src/gui/itemviews/qtableview.cpp @@ -2145,8 +2145,8 @@ int QTableView::sizeHintForRow(int row) const ensurePolished(); - int left = qMax(0, columnAt(0)); - int right = columnAt(d->viewport->width()); + int left = qMax(0, d->horizontalHeader->visualIndexAt(0)); + int right = d->horizontalHeader->visualIndexAt(d->viewport->width()); if (right == -1) // the table don't have enough columns to fill the viewport right = d->model->columnCount(d->root) - 1; @@ -2204,8 +2204,8 @@ int QTableView::sizeHintForColumn(int column) const ensurePolished(); - int top = qMax(0, rowAt(0)); - int bottom = rowAt(d->viewport->height()); + int top = qMax(0, d->verticalHeader->visualIndexAt(0)); + int bottom = d->verticalHeader->visualIndexAt(d->viewport->height()); if (!isVisible() || bottom == -1) // the table don't have enough rows to fill the viewport bottom = d->model->rowCount(d->root) - 1; diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index e94d247..8652816 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -363,3 +363,57 @@ QT_END_NAMESPACE } [super displayIfNeeded]; } + +// This is a hack and it should be removed once we find the real cause for +// the painting problems. +// We have a static variable that signals if we have been called before or not. +static bool firstDrawingInvocation = true; + +// The method below exists only as a workaround to draw/not draw the baseline +// in the title bar. This is to support unifiedToolbar look. + +// This method is very special. To begin with, it is a +// method that will get called only if we enable documentMode. +// Furthermore, it won't get called as a normal method, we swap +// this method with the normal implementation of drawRect in +// _NSThemeFrame. When this method is active, its mission is to +// first call the original drawRect implementation so the widget +// gets proper painting. After that, it needs to detect if there +// is a toolbar or not, in order to decide how to handle the unified +// look. The distinction is important since the presence and +// visibility of a toolbar change the way we enter into unified mode. +// When there is a toolbar and that toolbar is visible, the problem +// is as simple as to tell the toolbar not to draw its baseline. +// However when there is not toolbar or the toolbar is not visible, +// we need to draw a line on top of the baseline, because the baseline +// in that case will belong to the title. For this case we need to draw +// a line on top of the baseline. +// As usual, there is a special case. When we first are called, we might +// need to repaint ourselves one more time. We only need that if we +// didn't get the activation, i.e. when we are launched via the command +// line. And this only if the toolbar is visible from the beginning, +// so we have a special flag that signals if we need to repaint or not. +- (void)drawRectSpecial:(NSRect)rect +{ + // Call the original drawing method. + [self drawRectOriginal:rect]; + NSWindow *window = [self window]; + NSToolbar *toolbar = [window toolbar]; + if(!toolbar) { + // There is no toolbar, we have to draw a line on top of the line drawn by Cocoa. + macDrawRectOnTop((void *)window); + } else { + if([toolbar isVisible]) { + // We tell Cocoa to avoid drawing the line at the end. + if(firstDrawingInvocation) { + firstDrawingInvocation = false; + macSyncDrawingOnFirstInvocation((void *)window); + } else + [toolbar setShowsBaselineSeparator:NO]; + } else { + // There is a toolbar but it is not visible so + // we have to draw a line on top of the line drawn by Cocoa. + macDrawRectOnTop((void *)window); + } + } +} diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index dd12f65..4953c48 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -1554,7 +1554,8 @@ Qt::DropAction QDragManager::drag(QDrag *o) qt_button_down = 0; [dndParams.view release]; [image release]; - dragPrivate()->executed_action = Qt::IgnoreAction; + if (dragPrivate()) + dragPrivate()->executed_action = Qt::IgnoreAction; object = 0; Qt::DropAction performedAction(qt_mac_mapNSDragOperation(qMacDnDParams()->performedAction)); // do post drag processing, if required. diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index a05c7d5..024c1fc 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1163,15 +1163,81 @@ void qt_mac_updateContentBorderMetricts(void * /*OSWindowRef */window, const ::H #endif } +#if QT_MAC_USE_COCOA +void qt_mac_replaceDrawRect(void * /*OSWindowRef */window, QWidgetPrivate *widget) +{ + QMacCocoaAutoReleasePool pool; + OSWindowRef theWindow = static_cast<OSWindowRef>(window); + if(!theWindow) + return; + id theClass = [[[theWindow contentView] superview] class]; + // What we do here is basically to add a new selector to NSThemeFrame called + // "drawRectOriginal:" which will contain the original implementation of + // "drawRect:". After that we get the new implementation from QCocoaWindow + // and exchange them. The new implementation is called drawRectSpecial. + // We cannot just add the method because it might have been added before and since + // we cannot remove a method once it has been added we need to ask QCocoaWindow if + // we did the swap or not. + if(!widget->drawRectOriginalAdded) { + Method m2 = class_getInstanceMethod(theClass, @selector(drawRect:)); + if(!m2) { + // This case is pretty extreme, no drawRect means no drawing! + return; + } + class_addMethod(theClass, @selector(drawRectOriginal:), method_getImplementation(m2), method_getTypeEncoding(m2)); + widget->drawRectOriginalAdded = true; + } + if(widget->originalDrawMethod) { + Method m0 = class_getInstanceMethod([theWindow class], @selector(drawRectSpecial:)); + if(!m0) { + // Ok, this means the methods were never swapped. Just ignore + return; + } + Method m1 = class_getInstanceMethod(theClass, @selector(drawRect:)); + if(!m1) { + // Ok, this means the methods were never swapped. Just ignore + return; + } + // We have the original method here. Proceed and swap the methods. + method_exchangeImplementations(m1, m0); + widget->originalDrawMethod = false; + [window display]; + } +} + +void qt_mac_replaceDrawRectOriginal(void * /*OSWindowRef */window, QWidgetPrivate *widget) +{ + QMacCocoaAutoReleasePool pool; + OSWindowRef theWindow = static_cast<OSWindowRef>(window); + id theClass = [[[theWindow contentView] superview] class]; + // Now we need to revert the methods to their original state. + // We cannot remove the method, so we just keep track of it in QCocoaWindow. + Method m0 = class_getInstanceMethod([theWindow class], @selector(drawRectSpecial:)); + if(!m0) { + // Ok, this means the methods were never swapped. Just ignore + return; + } + Method m1 = class_getInstanceMethod(theClass, @selector(drawRect:)); + if(!m1) { + // Ok, this means the methods were never swapped. Just ignore + return; + } + method_exchangeImplementations(m1, m0); + widget->originalDrawMethod = true; + [window display]; +} +#endif // QT_MAC_USE_COCOA + void qt_mac_showBaseLineSeparator(void * /*OSWindowRef */window, bool show) { + if(!window) + return; #if QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; OSWindowRef theWindow = static_cast<OSWindowRef>(window); NSToolbar *macToolbar = [theWindow toolbar]; - if (macToolbar) - [macToolbar setShowsBaselineSeparator: show]; -#endif + [macToolbar setShowsBaselineSeparator:show]; +#endif // QT_MAC_USE_COCOA } QStringList qt_mac_NSArrayToQStringList(void *nsarray) @@ -1403,4 +1469,52 @@ void qt_mac_post_retranslateAppMenu() #endif } +#ifdef QT_MAC_USE_COCOA +// This method implements the magic for the drawRectSpecial method. +// We draw a line at the upper edge of the content view in order to +// override the title baseline. +void macDrawRectOnTop(void * /*OSWindowRef */window) +{ + OSWindowRef theWindow = static_cast<OSWindowRef>(window); + NSView *contentView = [theWindow contentView]; + if(!contentView) + return; + // Get coordinates of the content view + NSRect contentRect = [contentView frame]; + // Draw a line on top of the already drawn line. + // We need to check if we are active or not to use the proper color. + if([window isKeyWindow] || [window isMainWindow]) { + [[NSColor colorWithCalibratedRed:1.0 green:1.0 blue:1.0 alpha:1.0] set]; + } else { + [[NSColor colorWithCalibratedRed:1.0 green:1.0 blue:1.0 alpha:1.0] set]; + } + NSPoint origin = NSMakePoint(0, contentRect.size.height); + NSPoint end = NSMakePoint(contentRect.size.width, contentRect.size.height); + [NSBezierPath strokeLineFromPoint:origin toPoint:end]; +} + +// This method will (or at least should) get called only once. +// Its mission is to find out if we are active or not. If we are active +// we assume that we were launched via finder, otherwise we assume +// we were called from the command line. The distinction is important, +// since in the first case we don't need to trigger a paintEvent, while +// in the second case we do. +void macSyncDrawingOnFirstInvocation(void * /*OSWindowRef */window) +{ + OSWindowRef theWindow = static_cast<OSWindowRef>(window); + NSApplication *application = [NSApplication sharedApplication]; + NSToolbar *toolbar = [window toolbar]; + if([application isActive]) { + // Launched from finder + [toolbar setShowsBaselineSeparator:NO]; + } else { + // Launched from commandline + [toolbar setVisible:false]; + [toolbar setShowsBaselineSeparator:NO]; + [toolbar setVisible:true]; + [theWindow display]; + } +} +#endif // QT_MAC_USE_COCOA + QT_END_NAMESPACE diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h index 3fd62a4..5db121a 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h +++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h @@ -131,6 +131,8 @@ void macWindowSetHasShadow( void * /*OSWindowRef*/ window, bool hasShadow ); void macWindowFlush(void * /*OSWindowRef*/ window); void macSendToolbarChangeEvent(QWidget *widget); void qt_mac_updateContentBorderMetricts(void * /*OSWindowRef */window, const ::HIContentBorderMetrics &metrics); +void qt_mac_replaceDrawRect(void * /*OSWindowRef */window, QWidgetPrivate *widget); +void qt_mac_replaceDrawRectOriginal(void * /*OSWindowRef */window, QWidgetPrivate *widget); void qt_mac_showBaseLineSeparator(void * /*OSWindowRef */window, bool show); void * /*NSImage */qt_mac_create_nsimage(const QPixmap &pm); void qt_mac_update_mouseTracking(QWidget *widget); @@ -140,6 +142,9 @@ void qt_dispatchTabletProximityEvent(void * /*NSEvent * */ tabletEvent); #ifdef QT_MAC_USE_COCOA bool qt_dispatchKeyEventWithCocoa(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEvent); void qt_cocoaChangeOverrideCursor(const QCursor &cursor); +// These methods exists only for supporting unified mode. +void macDrawRectOnTop(void * /*OSWindowRef */ window); +void macSyncDrawingOnFirstInvocation(void * /*OSWindowRef */window); #endif void qt_mac_menu_collapseSeparators(void * /*NSMenu */ menu, bool collapse); bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEvent); diff --git a/src/gui/kernel/qt_mac_p.h b/src/gui/kernel/qt_mac_p.h index 7bfb257..3341ce1 100644 --- a/src/gui/kernel/qt_mac_p.h +++ b/src/gui/kernel/qt_mac_p.h @@ -57,6 +57,7 @@ #ifdef __OBJC__ #include <Cocoa/Cocoa.h> +#include <objc/runtime.h> #endif #include <CoreServices/CoreServices.h> diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 0da5a38..399a27b 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -220,6 +220,11 @@ QWidgetPrivate::QWidgetPrivate(int version) isWidget = true; memset(high_attributes, 0, sizeof(high_attributes)); +#if QT_MAC_USE_COCOA + drawRectOriginalAdded = false; + originalDrawMethod = true; + changeMethods = false; +#endif // QT_MAC_USE_COCOA #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; qDebug() << "widgets" << ++count; @@ -12309,6 +12314,28 @@ void QWidgetPrivate::_q_delayedDestroy(WId winId) } #endif +#if QT_MAC_USE_COCOA +void QWidgetPrivate::syncUnifiedMode() { + // The whole purpose of this method is to keep the unifiedToolbar in sync. + // That means making sure we either exchange the drawing methods or we let + // the toolbar know that it does not require to draw the baseline. + Q_Q(QWidget); + // This function makes sense only if this is a top level + if(!q->isWindow()) + return; + OSWindowRef window = qt_mac_window_for(q); + if(changeMethods) { + // Ok, we are in documentMode. + if(originalDrawMethod) + qt_mac_replaceDrawRect(window, this); + } else { + if(!originalDrawMethod) + qt_mac_replaceDrawRectOriginal(window, this); + } +} + +#endif // QT_MAC_USE_COCOA + QT_END_NAMESPACE #include "moc_qwidget.cpp" diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 05a859c..9926b2c 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -774,6 +774,13 @@ public: void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef); void syncCocoaMask(); void finishCocoaMaskSetup(); + void syncUnifiedMode(); + // Did we add the drawRectOriginal method? + bool drawRectOriginalAdded; + // Is the original drawRect method available? + bool originalDrawMethod; + // Do we need to change the methods? + bool changeMethods; #endif void determineWindowClass(); void transferChildren(); diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index e8400d6..aaa113b 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -2066,6 +2066,7 @@ bool QMenuBarPrivate::macUpdateMenuBarImmediatly() cancelAllMenuTracking(); QWidget *w = findWindowThatShouldDisplayMenubar(); QMenuBar *mb = findMenubarForWindow(w); + extern bool qt_mac_app_fullscreen; //qapplication_mac.mm // We need to see if we are in full screen mode, if so we need to // switch the full screen mode to be able to show or hide the menubar. @@ -2074,12 +2075,14 @@ bool QMenuBarPrivate::macUpdateMenuBarImmediatly() if(w->isFullScreen()) { // Ok, switch to showing the menubar when hovering over it. SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar); + qt_mac_app_fullscreen = true; } } else if(w) { // Removing a menubar if(w->isFullScreen()) { // Ok, switch to not showing the menubar when hovering on it SetSystemUIMode(kUIModeAllHidden, 0); + qt_mac_app_fullscreen = true; } } diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index d03a2f4..8aaaade 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -69,6 +69,7 @@ QT_BEGIN_NAMESPACE + inline static bool verticalTabs(QTabBar::Shape shape) { return shape == QTabBar::RoundedWest @@ -95,9 +96,20 @@ void QTabBarPrivate::updateMacBorderMetrics() metrics.left = 0; metrics.right = 0; qt_mac_updateContentBorderMetricts(window, metrics); - - // hide the base line separator if the tabs have docuemnt mode enabled (Cocoa) - qt_mac_showBaseLineSeparator(window, !documentMode); +#if QT_MAC_USE_COCOA + // In Cocoa we need to keep track of the drawRect method. + // If documentMode is enabled we need to change it, unless + // a toolbar is present. + // Notice that all the information is kept in the window, + // that's why we get the private widget for it instead of + // the private widget for this widget. + QWidgetPrivate *privateWidget = qt_widget_private(q->window()); + if(privateWidget) + privateWidget->changeMethods = documentMode; + // Since in Cocoa there is no simple way to remove the baseline, so we just ask the + // top level to do the magic for us. + privateWidget->syncUnifiedMode(); +#endif // QT_MAC_USE_COCOA } #endif } @@ -2193,6 +2205,7 @@ bool QTabBar::documentMode() const void QTabBar::setDocumentMode(bool enabled) { Q_D(QTabBar); + d->documentMode = enabled; d->updateMacBorderMetrics(); } diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp index 7f6df0a..97219f4 100644 --- a/src/network/access/qftp.cpp +++ b/src/network/access/qftp.cpp @@ -2311,7 +2311,7 @@ void QFtpPrivate::_q_piError(int errorCode, const QString &text) Q_Q(QFtp); if (pending.isEmpty()) { - qWarning() << "QFtpPrivate::_q_piError was called without pending command!"; + qWarning("QFtpPrivate::_q_piError was called without pending command!"); return; } diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h index a0ffb07..95e45f0 100644 --- a/src/network/access/qnetworkaccessmanager.h +++ b/src/network/access/qnetworkaccessmanager.h @@ -62,7 +62,7 @@ class QNetworkReply; class QNetworkProxy; class QNetworkProxyFactory; class QSslError; -#ifndef QT_NO_BEARERMANAGEMENT +#if !defined(QT_NO_BEARERMANAGEMENT) && !defined(QT_MOBILITY_BEARER) class QNetworkConfiguration; #endif @@ -121,11 +121,13 @@ public: QNetworkReply *deleteResource(const QNetworkRequest &request); QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data = 0); -#ifndef QT_NO_BEARERMANAGEMENT +#if !defined(QT_NO_BEARERMANAGEMENT) && !defined(QT_MOBILITY_BEARER) void setConfiguration(const QNetworkConfiguration &config); QNetworkConfiguration configuration() const; QNetworkConfiguration activeConfiguration() const; +#endif +#ifndef QT_NO_BEARERMANAGEMENT void setNetworkAccessible(NetworkAccessibility accessible); NetworkAccessibility networkAccessible() const; #endif @@ -140,9 +142,11 @@ Q_SIGNALS: void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors); #endif -#ifndef QT_NO_BEARERMANAGEMENT +#if !defined(QT_NO_BEARERMANAGEMENT) && !defined(QT_MOBILITY_BEARER) void networkSessionConnected(); +#endif +#ifndef QT_NO_BEARERMANAGEMENT void networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility accessible); #endif @@ -155,7 +159,7 @@ private: Q_DECLARE_PRIVATE(QNetworkAccessManager) Q_PRIVATE_SLOT(d_func(), void _q_replyFinished()) Q_PRIVATE_SLOT(d_func(), void _q_replySslErrors(QList<QSslError>)) -#ifndef QT_NO_BEARERMANAGEMENT +#if !defined(QT_NO_BEARERMANAGEMENT) && !defined(QT_MOBILITY_BEARER) Q_PRIVATE_SLOT(d_func(), void _q_networkSessionClosed()) Q_PRIVATE_SLOT(d_func(), void _q_networkSessionNewConfigurationActivated()) Q_PRIVATE_SLOT(d_func(), void _q_networkSessionPreferredConfigurationChanged(QNetworkConfiguration,bool)) diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index 3379296..8dba951 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -282,7 +282,7 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\n\ uniform mediump vec2 halfViewportSize; \n\ uniform highp vec2 invertedTextureSize; \n\ uniform highp mat3 brushTransform; \n\ - varying highp vec2 textureCoords; \n\ + varying highp vec2 brushTextureCoords; \n\ void setPosition(void) \n\ { \n\ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\ @@ -292,7 +292,7 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\n\ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\ - textureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \n\ + brushTextureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \n\ }\n"; static const char* const qglslAffinePositionWithTextureBrushVertexShader @@ -303,28 +303,28 @@ static const char* const qglslAffinePositionWithTextureBrushVertexShader // we emulate GL_REPEAT by only taking the fractional part of the texture coords. // TODO: Special case POT textures which don't need this emulation static const char* const qglslTextureBrushSrcFragmentShader = "\n\ - varying highp vec2 textureCoords; \n\ + varying highp vec2 brushTextureCoords; \n\ uniform lowp sampler2D brushTexture; \n\ lowp vec4 srcPixel() { \n\ - return texture2D(brushTexture, fract(textureCoords)); \n\ + return texture2D(brushTexture, fract(brushTextureCoords)); \n\ }\n"; #else static const char* const qglslTextureBrushSrcFragmentShader = "\n\ - varying highp vec2 textureCoords; \n\ + varying highp vec2 brushTextureCoords; \n\ uniform lowp sampler2D brushTexture; \n\ lowp vec4 srcPixel() \n\ { \n\ - return texture2D(brushTexture, textureCoords); \n\ + return texture2D(brushTexture, brushTextureCoords); \n\ }\n"; #endif static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\n\ - varying highp vec2 textureCoords; \n\ + varying highp vec2 brushTextureCoords; \n\ uniform lowp vec4 patternColor; \n\ uniform lowp sampler2D brushTexture; \n\ lowp vec4 srcPixel() \n\ { \n\ - return patternColor * (1.0 - texture2D(brushTexture, textureCoords).r); \n\ + return patternColor * (1.0 - texture2D(brushTexture, brushTextureCoords).r); \n\ }\n"; // Solid Fill Brush diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 92a347b..7efa9bc 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -97,7 +97,6 @@ extern Q_GUI_EXPORT bool qt_win_owndc_required; QGLGraphicsSystem::QGLGraphicsSystem(bool useX11GL) : QGraphicsSystem(), m_useX11GL(useX11GL) { - QGLWindowSurface::surfaceFormat.setSampleBuffers(true); #if defined(Q_WS_X11) && !defined(QT_OPENGL_ES) // only override the system defaults if the user hasn't already // picked a visual diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index daa827e..f39d538 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -605,7 +605,11 @@ int QAccessibleDisplay::navigate(RelationFlag rel, int entry, QAccessibleInterfa /*! \reimp */ QString QAccessibleDisplay::imageDescription() { +#ifndef QT_NO_TOOLTIP return widget()->toolTip(); +#else + return QString::null; +#endif } /*! \reimp */ diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index b6e771f..d545440 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -3751,7 +3751,7 @@ bool QSvgHandler::characters(const QStringRef &str) QCss::Parser(css).parse(&sheet); m_selector->styleSheets.append(sheet); return true; - } else if (m_skipNodes.isEmpty() || m_skipNodes.top() == Unknown) + } else if (m_skipNodes.isEmpty() || m_skipNodes.top() == Unknown || m_nodes.isEmpty()) return true; if (m_nodes.top()->type() == QSvgNode::TEXT || m_nodes.top()->type() == QSvgNode::TEXTAREA) { diff --git a/tests/auto/qlist/tst_qlist.cpp b/tests/auto/qlist/tst_qlist.cpp index e2944cc..ba8aefa 100644 --- a/tests/auto/qlist/tst_qlist.cpp +++ b/tests/auto/qlist/tst_qlist.cpp @@ -62,6 +62,33 @@ private slots: void append() const; void prepend() const; void mid() const; + void at() const; + void first() const; + void last() const; + void begin() const; + void end() const; + void contains() const; + void count() const; + void empty() const; + void endsWith() const; + void lastIndexOf() const; + void move() const; + void removeAll() const; + void removeAt() const; + void removeOne() const; + void replace() const; + void startsWith() const; + void swap() const; + void takeAt() const; + void takeFirst() const; + void takeLast() const; + void toSet() const; + void toStdList() const; + void toVector() const; + void value() const; + + void testSTLIterators() const; + void testOperators() const; }; void tst_QList::length() const @@ -173,5 +200,467 @@ void tst_QList::mid() const QList<QString>() << "bak" << "buck" << "hello"); } +void tst_QList::at() const +{ + // test at() and make sure it functions correctly with some simple list manipulation. + QList<QString> list; + + // create a list + list << "foo" << "bar" << "baz"; + QVERIFY(list.size() == 3); + QCOMPARE(list.at(0), QLatin1String("foo")); + QCOMPARE(list.at(1), QLatin1String("bar")); + QCOMPARE(list.at(2), QLatin1String("baz")); + + // append an item + list << "hello"; + QVERIFY(list.size() == 4); + QCOMPARE(list.at(0), QLatin1String("foo")); + QCOMPARE(list.at(1), QLatin1String("bar")); + QCOMPARE(list.at(2), QLatin1String("baz")); + QCOMPARE(list.at(3), QLatin1String("hello")); + + // remove an item + list.removeAt(1); + QVERIFY(list.size() == 3); + QCOMPARE(list.at(0), QLatin1String("foo")); + QCOMPARE(list.at(1), QLatin1String("baz")); + QCOMPARE(list.at(2), QLatin1String("hello")); +} + +void tst_QList::first() const +{ + QList<QString> list; + list << "foo" << "bar"; + + QCOMPARE(list.first(), QLatin1String("foo")); + + // remove an item, make sure it still works + list.pop_front(); + QVERIFY(list.size() == 1); + QCOMPARE(list.first(), QLatin1String("bar")); +} + +void tst_QList::last() const +{ + QList<QString> list; + list << "foo" << "bar"; + + QCOMPARE(list.last(), QLatin1String("bar")); + + // remove an item, make sure it still works + list.pop_back(); + QVERIFY(list.size() == 1); + QCOMPARE(list.last(), QLatin1String("foo")); +} + +void tst_QList::begin() const +{ + QList<QString> list; + list << "foo" << "bar"; + + QCOMPARE(*list.begin(), QLatin1String("foo")); + + // remove an item, make sure it still works + list.pop_front(); + QVERIFY(list.size() == 1); + QCOMPARE(*list.begin(), QLatin1String("bar")); +} + +void tst_QList::end() const +{ + QList<QString> list; + list << "foo" << "bar"; + + QCOMPARE(*--list.end(), QLatin1String("bar")); + + // remove an item, make sure it still works + list.pop_back(); + QVERIFY(list.size() == 1); + QCOMPARE(*--list.end(), QLatin1String("foo")); +} + +void tst_QList::contains() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + QVERIFY(list.contains(QLatin1String("foo")) == true); + QVERIFY(list.contains(QLatin1String("pirates")) != true); + + // add it and make sure it matches + list.append(QLatin1String("ninjas")); + QVERIFY(list.contains(QLatin1String("ninjas")) == true); +} + +void tst_QList::count() const +{ + QList<QString> list; + + // starts empty + QVERIFY(list.count() == 0); + + // goes up + list.append(QLatin1String("foo")); + QVERIFY(list.count() == 1); + + // and up + list.append(QLatin1String("bar")); + QVERIFY(list.count() == 2); + + // and down + list.pop_back(); + QVERIFY(list.count() == 1); + + // and empty. :) + list.pop_back(); + QVERIFY(list.count() == 0); +} + +void tst_QList::empty() const +{ + QList<QString> list; + + // make sure it starts empty + QVERIFY(list.empty()); + + // and doesn't stay empty + list.append(QLatin1String("foo")); + QVERIFY(!list.empty()); + + // and goes back to being empty + list.pop_back(); + QVERIFY(list.empty()); +} + +void tst_QList::endsWith() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // test it returns correctly in both cases + QVERIFY(list.endsWith(QLatin1String("baz"))); + QVERIFY(!list.endsWith(QLatin1String("bar"))); + + // remove an item and make sure the end item changes + list.pop_back(); + QVERIFY(list.endsWith(QLatin1String("bar"))); +} + +void tst_QList::lastIndexOf() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // one instance of the target item + QVERIFY(list.lastIndexOf(QLatin1String("baz")) == 2); + + // shouldn't find this + QVERIFY(list.lastIndexOf(QLatin1String("shouldntfindme")) == -1); + + // multiple instances + list.append("baz"); + list.append("baz"); + QVERIFY(list.lastIndexOf(QLatin1String("baz")) == 4); + + // search from the middle to find the last one + QVERIFY(list.lastIndexOf(QLatin1String("baz"), 3) == 3); + + // try find none + QVERIFY(list.lastIndexOf(QLatin1String("baz"), 1) == -1); +} + +void tst_QList::move() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // move an item + list.move(0, list.count() - 1); + QCOMPARE(list, QList<QString>() << "bar" << "baz" << "foo"); + + // move it back + list.move(list.count() - 1, 0); + QCOMPARE(list, QList<QString>() << "foo" << "bar" << "baz"); + + // move an item in the middle + list.move(1, 0); + QCOMPARE(list, QList<QString>() << "bar" << "foo" << "baz"); +} + +void tst_QList::removeAll() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // remove one instance + list.removeAll(QLatin1String("bar")); + QCOMPARE(list, QList<QString>() << "foo" << "baz"); + + // many instances + list << "foo" << "bar" << "baz"; + list << "foo" << "bar" << "baz"; + list << "foo" << "bar" << "baz"; + list.removeAll(QLatin1String("bar")); + QCOMPARE(list, QList<QString>() << "foo" << "baz" << "foo" << "baz" << "foo" << "baz" << "foo" << "baz"); + + // try remove something that doesn't exist + list.removeAll(QLatin1String("you won't remove anything I hope")); + QCOMPARE(list, QList<QString>() << "foo" << "baz" << "foo" << "baz" << "foo" << "baz" << "foo" << "baz"); +} + +void tst_QList::removeAt() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // middle + list.removeAt(1); + QCOMPARE(list, QList<QString>() << "foo" << "baz"); + + // start + list.removeAt(0); + QCOMPARE(list, QList<QString>() << "baz"); + + // final + list.removeAt(0); + QCOMPARE(list, QList<QString>()); +} + +void tst_QList::removeOne() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // middle + list.removeOne(QLatin1String("bar")); + QCOMPARE(list, QList<QString>() << "foo" << "baz"); + + // start + list.removeOne(QLatin1String("foo")); + QCOMPARE(list, QList<QString>() << "baz"); + + // last + list.removeOne(QLatin1String("baz")); + QCOMPARE(list, QList<QString>()); + + // make sure it really only removes one :) + list << "foo" << "foo"; + list.removeOne("foo"); + QCOMPARE(list, QList<QString>() << "foo"); + + // try remove something that doesn't exist + list.removeOne(QLatin1String("you won't remove anything I hope")); + QCOMPARE(list, QList<QString>() << "foo"); +} + +void tst_QList::replace() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // start + list.replace(0, "moo"); + QCOMPARE(list, QList<QString>() << "moo" << "bar" << "baz"); + + // middle + list.replace(1, "cow"); + QCOMPARE(list, QList<QString>() << "moo" << "cow" << "baz"); + + // end + list.replace(2, "milk"); + QCOMPARE(list, QList<QString>() << "moo" << "cow" << "milk"); +} + +void tst_QList::startsWith() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // make sure it starts ok + QVERIFY(list.startsWith(QLatin1String("foo"))); + + // remove an item + list.removeFirst(); + QVERIFY(list.startsWith(QLatin1String("bar"))); +} + +void tst_QList::swap() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // swap + list.swap(0, 2); + QCOMPARE(list, QList<QString>() << "baz" << "bar" << "foo"); + + // swap again + list.swap(1, 2); + QCOMPARE(list, QList<QString>() << "baz" << "foo" << "bar"); +} + +void tst_QList::takeAt() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + QCOMPARE(list.takeAt(0), QLatin1String("foo")); + QVERIFY(list.size() == 2); + QCOMPARE(list.takeAt(1), QLatin1String("baz")); + QVERIFY(list.size() == 1); + QCOMPARE(list.takeAt(0), QLatin1String("bar")); + QVERIFY(list.size() == 0); +} + +void tst_QList::takeFirst() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + QCOMPARE(list.takeFirst(), QLatin1String("foo")); + QVERIFY(list.size() == 2); + QCOMPARE(list.takeFirst(), QLatin1String("bar")); + QVERIFY(list.size() == 1); + QCOMPARE(list.takeFirst(), QLatin1String("baz")); + QVERIFY(list.size() == 0); +} + +void tst_QList::takeLast() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + QCOMPARE(list.takeLast(), QLatin1String("baz")); + QCOMPARE(list.takeLast(), QLatin1String("bar")); + QCOMPARE(list.takeLast(), QLatin1String("foo")); +} + +void tst_QList::toSet() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // no duplicates + QCOMPARE(list.toSet(), QSet<QString>() << "foo" << "bar" << "baz"); + QCOMPARE(list, QList<QString>() << "foo" << "bar" << "baz"); + + // duplicates (is this more of a QSet test?) + list << "foo" << "bar" << "baz"; + QCOMPARE(list.toSet(), QSet<QString>() << "foo" << "bar" << "baz"); + QCOMPARE(list, QList<QString>() << "foo" << "bar" << "baz" << "foo" << "bar" << "baz"); +} + +void tst_QList::toStdList() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // yuck. + std::list<QString> slist; + slist.push_back(QLatin1String("foo")); + slist.push_back(QLatin1String("bar")); + slist.push_back(QLatin1String("baz")); + + QCOMPARE(list.toStdList(), slist); + QCOMPARE(list, QList<QString>() << "foo" << "bar" << "baz"); +} + +void tst_QList::toVector() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + QCOMPARE(list.toVector(), QVector<QString>() << "foo" << "bar" << "baz"); +} + +void tst_QList::value() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + // test real values + QCOMPARE(list.value(0), QLatin1String("foo")); + QCOMPARE(list.value(2), QLatin1String("baz")); + + // test empty default + QCOMPARE(list.value(3), QString()); + QCOMPARE(list.value(-1), QString()); + + // test defaults + QLatin1String defaultstr("default"); + QCOMPARE(list.value(-1, defaultstr), defaultstr); + QCOMPARE(list.value(3, defaultstr), defaultstr); +} + +void tst_QList::testOperators() const +{ + QList<QString> list; + list << "foo" << "bar" << "baz"; + + QList<QString> listtwo; + listtwo << "foo" << "bar" << "baz"; + + // test equal + QVERIFY(list == listtwo); + + // not equal + listtwo.append("not equal"); + QVERIFY(list != listtwo); + + // += + list += listtwo; + QVERIFY(list.size() == 7); + QVERIFY(listtwo.size() == 4); + QCOMPARE(list, QList<QString>() << "foo" << "bar" << "baz" << "foo" << "bar" << "baz" << "not equal"); + + // = + list = listtwo; + QCOMPARE(list, listtwo); + QCOMPARE(list, QList<QString>() << "foo" << "bar" << "baz" << "not equal"); + + // [] + QCOMPARE(list[0], QLatin1String("foo")); + QCOMPARE(list[list.size() - 1], QLatin1String("not equal")); +} + +void tst_QList::testSTLIterators() const +{ + QList<QString> list; + + // create a list + list << "foo" << "bar" << "baz"; + QList<QString>::iterator it = list.begin(); + QCOMPARE(*it, QLatin1String("foo")); it++; + QCOMPARE(*it, QLatin1String("bar")); it++; + QCOMPARE(*it, QLatin1String("baz")); it++; + QCOMPARE(it, list.end()); it--; + + // walk backwards + QCOMPARE(*it, QLatin1String("baz")); it--; + QCOMPARE(*it, QLatin1String("bar")); it--; + QCOMPARE(*it, QLatin1String("foo")); + + // test erase + it = list.erase(it); + QVERIFY(list.size() == 2); + QCOMPARE(*it, QLatin1String("bar")); + + // test multiple erase + it = list.erase(it, it + 2); + QVERIFY(list.size() == 0); + QCOMPARE(it, list.end()); + + // insert again + it = list.insert(it, QLatin1String("foo")); + QVERIFY(list.size() == 1); + QCOMPARE(*it, QLatin1String("foo")); + + // insert again + it = list.insert(it, QLatin1String("bar")); + QVERIFY(list.size() == 2); + QCOMPARE(*it++, QLatin1String("bar")); + QCOMPARE(*it, QLatin1String("foo")); +} + QTEST_APPLESS_MAIN(tst_QList) #include "tst_qlist.moc" diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 2062e8e..3e5d077 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -202,6 +202,7 @@ private slots: void taskQTBUG_8585_crashForNoGoodReason(); void taskQTBUG_7774_RtoLVisualRegionForSelection(); void taskQTBUG_8777_scrollToSpans(); + void taskQTBUG_10169_sizeHintForRow(); void mouseWheel_data(); void mouseWheel(); @@ -478,6 +479,11 @@ public: return QTableView::selectedIndexes(); } + int sizeHintForRow(int row) const + { + return QTableView::sizeHintForRow(row); + } + bool checkSignalOrder; public slots: void currentChanged(QModelIndex , QModelIndex ) { @@ -4042,5 +4048,20 @@ void tst_QTableView::taskQTBUG_8777_scrollToSpans() QVERIFY(table.verticalScrollBar()->value() > 10); } +void tst_QTableView::taskQTBUG_10169_sizeHintForRow() +{ + QtTestTableView tableView; + QStandardItemModel model(1, 3); + model.setData(model.index(0, 0), "Word wrapping text goes here."); + tableView.setModel(&model); + tableView.verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); + const int orderedHeight = tableView.sizeHintForRow(0); + tableView.horizontalHeader()->moveSection(2, 0); + const int reorderedHeight = tableView.sizeHintForRow(0); + + //the order of the columns shouldn't matter. + QCOMPARE(orderedHeight, reorderedHeight); +} + QTEST_MAIN(tst_QTableView) #include "tst_qtableview.moc" diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index b7cbdb8..fa42adc 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -1632,6 +1632,10 @@ void tst_QUrl::toString_data() QTest::newRow("nopath_task31320") << QString::fromLatin1("host://protocol") << uint(QUrl::None) << QString::fromLatin1("host://protocol"); + + QTest::newRow("underscore_QTBUG-7434") << QString::fromLatin1("http://foo_bar.host.com/rss.php") + << uint(QUrl::None) + << QString::fromLatin1("http://foo_bar.host.com/rss.php"); } void tst_QUrl::toString() @@ -3244,7 +3248,6 @@ void tst_QUrl::std3violations_data() QTest::newRow("question") << "foo?bar" << true; QTest::newRow("at") << "foo@bar" << true; QTest::newRow("backslash") << "foo\\bar" << false; - QTest::newRow("underline") << "foo_bar" << false; // these characters are transformed by NFKC to non-LDH characters QTest::newRow("dot-like") << QString::fromUtf8("foo\342\200\244bar") << false; // U+2024 ONE DOT LEADER @@ -3289,6 +3292,7 @@ void tst_QUrl::std3deviations_data() QTest::newRow("ending-dot") << "example.com."; QTest::newRow("ending-dot3002") << QString("example.com") + QChar(0x3002); + QTest::newRow("underline") << "foo_bar"; //QTBUG-7434 } void tst_QUrl::std3deviations() diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 6b7d350..f5c304e 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -259,6 +259,9 @@ void HtmlGenerator::initializeGenerator(const Config &config) postHeader = config.getString(HtmlGenerator::format() + Config::dot + HTMLGENERATOR_POSTHEADER); + postPostHeader = config.getString(HtmlGenerator::format() + + Config::dot + + HTMLGENERATOR_POSTPOSTHEADER); footer = config.getString(HtmlGenerator::format() + Config::dot + HTMLGENERATOR_FOOTER); @@ -1671,31 +1674,44 @@ QString HtmlGenerator::fileExtension(const Node * /* node */) const return "html"; } -#if 0 -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>Qt Reference Documentation</title> - <link rel="stylesheet" type="text/css" href="style/style.css" /> - <!--[if IE]> - <meta name="MSSmartTagsPreventParsing" content="true"> - <meta http-equiv="imagetoolbar" content="no"> - <![endif]--> - <!--[if lt IE 7]> - <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> - <![endif]--> - <!--[if IE 7]> - <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> - <![endif]--> - <!--[if IE 8]> - <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> - <![endif]--> - - <script src="scripts/jquery.js" type="text/javascript"></script> - -</head> -#endif +void HtmlGenerator::generateBreadCrumbs(const QString& title, + const Node *node, + CodeMarker *marker) +{ + Text breadcrumb; + if (node->type() == Node::Class) { + const ClassNode* cn = static_cast<const ClassNode*>(node); + QString name = node->moduleName(); + if (!name.isEmpty()) { + out() << " <li>"; + breadcrumb << Atom(Atom::AutoLink,name); + generateText(breadcrumb, node, marker); + out() << "</li>\n"; + } + breadcrumb.clear(); + if (!cn->name().isEmpty()) { + out() << " <li>"; + breadcrumb << Atom(Atom::AutoLink,cn->name()); + generateText(breadcrumb, 0, marker); + out() << "</li>\n"; + } + } + else if (node->type() == Node::Fake) { + const FakeNode* fn = static_cast<const FakeNode*>(node); + if (node->subType() == Node::Module) { + } + else if (node->subType() == Node::Page) { + } + else if (node->subType() == Node::QmlClass) { + } + else if (node->subType() == Node::Example) { + } + } + else if (node->type() == Node::Namespace) { + const NamespaceNode* nsn = static_cast<const NamespaceNode*>(node); + } +} + void HtmlGenerator::generateHeader(const QString& title, const Node *node, @@ -1748,9 +1764,13 @@ void HtmlGenerator::generateHeader(const QString& title, else out() << "<body class=\"\">\n"; +#ifdef GENERATE_MAC_REFS if (mainPage) generateMacRef(node, marker); +#endif out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); + generateBreadCrumbs(title,node,marker); + out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version()); #if 0 // Removed for new docf format. MWS if (node && !node->links().empty()) @@ -3687,10 +3707,14 @@ void HtmlGenerator::generateDetailedMember(const Node *node, { const EnumNode *enume; +#ifdef GENERATE_MAC_REFS generateMacRef(node, marker); +#endif if (node->type() == Node::Enum && (enume = static_cast<const EnumNode *>(node))->flagsType()) { +#ifdef GENERATE_MAC_REFS generateMacRef(enume->flagsType(), marker); +#endif out() << "<h3 class=\"flags\">"; out() << "<a name=\"" + refForNode(node) + "\"></a>"; generateSynopsis(enume, relative, marker, CodeMarker::Detailed); @@ -4204,6 +4228,10 @@ void HtmlGenerator::generateStatus(const Node *node, CodeMarker *marker) } } +#ifdef GENERATE_MAC_REFS +/* + No longer valid. + */ void HtmlGenerator::generateMacRef(const Node *node, CodeMarker *marker) { if (!pleaseGenerateMacRef || marker == 0) @@ -4213,6 +4241,7 @@ void HtmlGenerator::generateMacRef(const Node *node, CodeMarker *marker) foreach (const QString &macRef, macRefs) out() << "<a name=\"" << "//apple_ref/" << macRef << "\"></a>\n"; } +#endif void HtmlGenerator::beginLink(const QString &link, const Node *node, @@ -4314,7 +4343,9 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, CodeMarker *marker) { const QmlPropertyNode* qpn = 0; +#ifdef GENERATE_MAC_REFS generateMacRef(node, marker); +#endif out() << "<div class=\"qmlitem\">"; if (node->subType() == Node::QmlPropertyGroup) { const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(node); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 2a365e9..68e620e 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -131,6 +131,9 @@ class HtmlGenerator : public PageGenerator const Node *relative, CodeMarker *marker, const Atom *atom = 0); + void generateBreadCrumbs(const QString& title, + const Node *node, + CodeMarker *marker); void generateHeader(const QString& title, const Node *node = 0, CodeMarker *marker = 0, bool mainPage = true); void generateTitle(const QString& title, @@ -262,7 +265,9 @@ class HtmlGenerator : public PageGenerator virtual void generateIndex(const QString &fileBase, const QString &url, const QString &title); +#ifdef GENERATE_MAC_REFS void generateMacRef(const Node *node, CodeMarker *marker); +#endif void beginLink(const QString &link, const Node *node, const Node *relative, @@ -303,6 +308,7 @@ class HtmlGenerator : public PageGenerator QRegExp funcLeftParen; QString style; QString postHeader; + QString postPostHeader; QString footer; QString address; bool pleaseGenerateMacRef; @@ -337,8 +343,9 @@ class HtmlGenerator : public PageGenerator #define HTMLGENERATOR_ADDRESS "address" #define HTMLGENERATOR_FOOTER "footer" -#define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me +#define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me #define HTMLGENERATOR_POSTHEADER "postheader" +#define HTMLGENERATOR_POSTPOSTHEADER "postpostheader" #define HTMLGENERATOR_STYLE "style" #define HTMLGENERATOR_STYLESHEETS "stylesheets" #define HTMLGENERATOR_CUSTOMHEADELEMENTS "customheadelements" diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 8253c45..944a32c 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -87,8 +87,9 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <div class=\"breadcrumb toolblock\">\n" \ " <ul>\n" \ " <li class=\"first\"><a href=\"index.html\">Home</a></li>\n" \ - " <!-- Bread crumbs goes here -->\n" \ - " </ul>\n" \ + " <!-- Bread crumbs goes here -->\n" + +HTML.postpostheader = " </ul>\n" \ " </div>\n" \ " <div class=\"toolbuttons toolblock\">\n" \ " <ul>\n" \ diff --git a/tools/qdoc3/text.h b/tools/qdoc3/text.h index fa3ecda..879f6da 100644 --- a/tools/qdoc3/text.h +++ b/tools/qdoc3/text.h @@ -75,6 +75,7 @@ class Text const Atom *lastAtom() const { return last; } Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0) const; void dump() const; + void clear(); static Text subText(const Atom *begin, const Atom *end = 0); static Text sectionHeading(const Atom *sectionBegin); @@ -82,7 +83,6 @@ class Text static int compare(const Text &text1, const Text &text2); private: - void clear(); Atom *first; Atom *last; diff --git a/translations/qt_pl.ts b/translations/qt_pl.ts index dd8a160..ef5e9a2 100644 --- a/translations/qt_pl.ts +++ b/translations/qt_pl.ts @@ -115,7 +115,7 @@ <message> <location line="-3"/> <source><html>Switching to the audio playback device <b>%1</b><br/>which has higher preference or is specifically configured for this stream.</html></source> - <translation type="unfinished"></translation> + <translation><html>Przełączanie na urządzenie dźwiękowe <b>%1</b><br/>które ma wyższy priorytet lub jest specjalnie skonfigurowane dla tego strumienia.</html></translation> </message> </context> <context> @@ -441,7 +441,7 @@ zainstalowałeś libgstreamer-plugins-base.</translation> <location line="+22"/> <location line="+22"/> <source>Video display error</source> - <translation type="unfinished">Błąd wyświetlacza wideo</translation> + <translation>Błąd wyświetlacza wideo</translation> </message> </context> <context> @@ -542,7 +542,7 @@ zainstalowałeś libgstreamer-plugins-base.</translation> <location filename="../src/3rdparty/phonon/mmf/videoplayer_surface.cpp" line="+126"/> <location line="+16"/> <source>Video display error</source> - <translation type="unfinished">Błąd wyświetlacza wideo</translation> + <translation>Błąd wyświetlacza wideo</translation> </message> </context> <context> @@ -1600,17 +1600,17 @@ na <message> <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="+165"/> <source>Cannot animate non-existent property "%1"</source> - <translation type="unfinished"></translation> + <translation>Nie można animować nieistniejącej właściwości "%1"</translation> </message> <message> <location line="+3"/> <source>Cannot animate read-only property "%1"</source> - <translation type="unfinished"></translation> + <translation>Nie można animować właściwości (tylko do odczytu): "%1"</translation> </message> <message> <location filename="../src/declarative/util/qdeclarativeutilmodule.cpp" line="+122"/> <source>Animation is an abstract class</source> - <translation type="unfinished"></translation> + <translation>"Animation" jest klasą abstrakcyjną</translation> </message> </context> <context> @@ -1618,7 +1618,7 @@ na <message> <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="+2540"/> <source>Cannot set a duration of < 0</source> - <translation type="unfinished"></translation> + <translation>Nie można ustawić ujemnego czasu trwania</translation> </message> </context> <context> @@ -1626,12 +1626,12 @@ na <message> <location filename="../src/declarative/graphicsitems/qdeclarativeanchors.cpp" line="+181"/> <source>Possible anchor loop detected on fill.</source> - <translation type="unfinished"></translation> + <translation>Wykryto możliwe zapętlenie dla kotwicy "fill".</translation> </message> <message> <location line="+29"/> <source>Possible anchor loop detected on centerIn.</source> - <translation type="unfinished"></translation> + <translation>Wykryto możliwe zapętlenie dla kotwicy "centerIn".</translation> </message> <message> <location line="+201"/> @@ -1639,54 +1639,54 @@ na <location line="+610"/> <location line="+37"/> <source>Cannot anchor to an item that isn't a parent or sibling.</source> - <translation type="unfinished"></translation> + <translation>Nie można doczepić kotwicy do elementu który nie jest rodzicem ani rodzeństwem.</translation> </message> <message> <location line="-534"/> <source>Possible anchor loop detected on vertical anchor.</source> - <translation type="unfinished"></translation> + <translation>Wykryto możliwe zapętlenie dla pionowej kotwicy.</translation> </message> <message> <location line="+59"/> <source>Possible anchor loop detected on horizontal anchor.</source> - <translation type="unfinished"></translation> + <translation>Wykryto możliwe zapętlenie dla poziomej kotwicy.</translation> </message> <message> <location line="+422"/> <source>Cannot specify left, right, and hcenter anchors.</source> - <translation type="unfinished"></translation> + <translation>Nie można jednocześnie podać lewej, prawej i centralnej poziomej kotwicy.</translation> </message> <message> <location line="+10"/> <location line="+37"/> <source>Cannot anchor to a null item.</source> - <translation type="unfinished"></translation> + <translation>Nie można doczepić kotwicy do zerowego elementu.</translation> </message> <message> <location line="-34"/> <source>Cannot anchor a horizontal edge to a vertical edge.</source> - <translation type="unfinished"></translation> + <translation>Nie można doczepić poziomej krawędzi do pionowej.</translation> </message> <message> <location line="+6"/> <location line="+37"/> <source>Cannot anchor item to self.</source> - <translation type="unfinished"></translation> + <translation>Nie można doczepić kotwicy do tego samego elementu.</translation> </message> <message> <location line="-25"/> <source>Cannot specify top, bottom, and vcenter anchors.</source> - <translation type="unfinished"></translation> + <translation>Nie można jednocześnie podać górnej, dolnej i centralnej pionowej kotwicy.</translation> </message> <message> <location line="+6"/> <source>Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors.</source> - <translation type="unfinished"></translation> + <translation>Bazowa kotwica nie może być użyta w połączeniu z górną, dolną lub centralną pionową kotwicą.</translation> </message> <message> <location line="+13"/> <source>Cannot anchor a vertical edge to a horizontal edge.</source> - <translation type="unfinished"></translation> + <translation>Nie można doczepić pionowej krawędzi do poziomej.</translation> </message> </context> <context> @@ -1694,7 +1694,7 @@ na <message> <location filename="../src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp" line="+86"/> <source>Qt was built without support for QMovie</source> - <translation type="unfinished"></translation> + <translation>Qt zostało zbudowane bez obsługi QMovie</translation> </message> </context> <context> @@ -1702,7 +1702,7 @@ na <message> <location filename="../src/declarative/util/qdeclarativebehavior.cpp" line="+122"/> <source>Cannot change the animation assigned to a Behavior.</source> - <translation type="unfinished"></translation> + <translation>Nie można zmienić animacji przypisanej do "Zachowania".</translation> </message> </context> <context> @@ -1710,7 +1710,7 @@ na <message> <location filename="../src/declarative/qml/qdeclarativebinding.cpp" line="+225"/> <source>Binding loop detected for property "%1"</source> - <translation type="unfinished"></translation> + <translation>Zapętlenie powiązania dla właściwości "%1"</translation> </message> </context> <context> @@ -1718,7 +1718,7 @@ na <message> <location filename="../src/declarative/qml/qdeclarativecompiledbindings.cpp" line="+305"/> <source>Binding loop detected for property "%1"</source> - <translation type="unfinished"></translation> + <translation>Zapętlenie powiązania dla właściwości "%1"</translation> </message> </context> <context> @@ -1731,92 +1731,92 @@ na <location line="+75"/> <location line="+488"/> <source>Invalid property assignment: "%1" is a read-only property</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: "%1" jest właściwością tylko do odczytu</translation> </message> <message> <location line="-2384"/> <source>Invalid property assignment: unknown enumeration</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: nieznana wartość wyliczeniowa</translation> </message> <message> <location line="+8"/> <source>Invalid property assignment: string expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano ciągu</translation> </message> <message> <location line="+3"/> <source>Invalid property assignment: url expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano url</translation> </message> <message> <location line="+6"/> <source>Invalid property assignment: unsigned int expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano liczby naturalnej</translation> </message> <message> <location line="+7"/> <source>Invalid property assignment: int expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano liczby całkowitej</translation> </message> <message> <location line="+7"/> <source>Invalid property assignment: float expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano liczby zmiennoprzecinkowej</translation> </message> <message> <location line="+7"/> <source>Invalid property assignment: double expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano liczby zmiennoprzecinkowej podwójnej precyzji</translation> </message> <message> <location line="+7"/> <source>Invalid property assignment: color expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano koloru</translation> </message> <message> <location line="+7"/> <source>Invalid property assignment: date expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano daty</translation> </message> <message> <location line="+7"/> <source>Invalid property assignment: time expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano czasu</translation> </message> <message> <location line="+7"/> <source>Invalid property assignment: datetime expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano daty i czasu</translation> </message> <message> <location line="+8"/> <source>Invalid property assignment: point expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano punktu</translation> </message> <message> <location line="+8"/> <source>Invalid property assignment: size expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano rozmiaru</translation> </message> <message> <location line="+8"/> <source>Invalid property assignment: rect expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano prostokąta</translation> </message> <message> <location line="+5"/> <source>Invalid property assignment: boolean expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano wartości boolowskiej</translation> </message> <message> <location line="+7"/> <source>Invalid property assignment: 3D vector expected</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: oczekiwano wektoru 3D</translation> </message> <message> <location line="+9"/> <source>Invalid property assignment: unsupported type "%1"</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne przypisanie wartości: nieobsługiwany typ "%1"</translation> </message> <message> <location line="+271"/> @@ -1831,13 +1831,13 @@ na <message> <location line="+7"/> <source>Invalid component id specification</source> - <translation type="unfinished"></translation> + <translation>Niepoprawna specyfikacja "id" componentu</translation> </message> <message> <location line="+6"/> <location line="+477"/> <source>id is not unique</source> - <translation type="unfinished"></translation> + <translation>Wartość "id" nie jest unikatowa</translation> </message> <message> <location line="-467"/> @@ -1910,7 +1910,7 @@ na <message> <location line="-324"/> <source>Invalid use of namespace</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne użycie przestrzeni nazw</translation> </message> <message> <location line="+5"/> @@ -1920,7 +1920,7 @@ na <message> <location line="+183"/> <source>Invalid use of id property</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne użycie właściwości "id"</translation> </message> <message> <location line="+89"/> @@ -1942,27 +1942,27 @@ na <message> <location line="+16"/> <source>Invalid property use</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne użycie właściwości</translation> </message> <message> <location line="+13"/> <source>Property assignment expected</source> - <translation type="unfinished"></translation> + <translation>Oczekiwano przypisania wartości</translation> </message> <message> <location line="+3"/> <source>Single property assignment expected</source> - <translation type="unfinished"></translation> + <translation>Oczekiwano przypisania pojedynczej wartości</translation> </message> <message> <location line="+5"/> <source>Unexpected object assignment</source> - <translation type="unfinished"></translation> + <translation>Nieoczekiwane przypisanie obiektu</translation> </message> <message> <location line="+57"/> <source>Cannot assign object to list</source> - <translation type="unfinished"></translation> + <translation>Nie można przypisać obiektu do listy</translation> </message> <message> <location line="+6"/> @@ -1987,7 +1987,7 @@ na <message> <location line="+106"/> <source>Cannot assign object to property</source> - <translation type="unfinished"></translation> + <translation>Nie można przypisać obiektu dla właściwości</translation> </message> <message> <location line="+50"/> @@ -1997,77 +1997,77 @@ na <message> <location line="+117"/> <source>Duplicate default property</source> - <translation type="unfinished"></translation> + <translation>Powielona domyślna właściwość</translation> </message> <message> <location line="+5"/> <source>Duplicate property name</source> - <translation type="unfinished"></translation> + <translation>Powielona nazwa właściwości</translation> </message> <message> <location line="+3"/> <source>Property names cannot begin with an upper case letter</source> - <translation type="unfinished"></translation> + <translation>Nazwy właściwości nie mogą rozpoczynać się wielką literą</translation> </message> <message> <location line="+7"/> <source>Duplicate signal name</source> - <translation type="unfinished"></translation> + <translation>Powielona nazwa sygnału</translation> </message> <message> <location line="+2"/> <source>Signal names cannot begin with an upper case letter</source> - <translation type="unfinished"></translation> + <translation>Nazwy sygnałów nie mogą rozpoczynać się wielką literą</translation> </message> <message> <location line="+6"/> <source>Duplicate method name</source> - <translation type="unfinished"></translation> + <translation>Powielona nazwa medoty</translation> </message> <message> <location line="+2"/> <source>Method names cannot begin with an upper case letter</source> - <translation type="unfinished"></translation> + <translation>Nazwy metod nie mogą rozpoczynać się wielką literą</translation> </message> <message> <location line="+21"/> <source>Property value set multiple times</source> - <translation type="unfinished"></translation> + <translation>Wartość właściwości ustawiona wielokrotnie</translation> </message> <message> <location line="+4"/> <source>Invalid property nesting</source> - <translation type="unfinished"></translation> + <translation>Niepoprawne zagnieżdżenie właściwości</translation> </message> <message> <location line="+53"/> <source>Cannot override FINAL property</source> - <translation type="unfinished"></translation> + <translation>Nie można nadpisać właściwości "FINAL"</translation> </message> <message> <location line="+25"/> <source>Invalid property type</source> - <translation type="unfinished"></translation> + <translation>Niepoprawny typ właściwości</translation> </message> <message> <location line="+159"/> <source>Invalid empty ID</source> - <translation type="unfinished"></translation> + <translation>Niepoprawny pusty identyfikator</translation> </message> <message> <location line="+3"/> <source>IDs cannot start with an uppercase letter</source> - <translation type="unfinished"></translation> + <translation>Identyfikatory nie mogą rozpoczynać się wielką literą</translation> </message> <message> <location line="+6"/> <source>IDs must start with a letter or underscore</source> - <translation type="unfinished"></translation> + <translation>Identyfikatory muszą rozpoczynać się literą lub znakiem podkreślenia</translation> </message> <message> <location line="+2"/> <source>IDs must contain only letters, numbers, and underscores</source> - <translation type="unfinished"></translation> + <translation>Identyfikatory mogą zawierać jedynie litery, cyfry i znaki podkreślenia</translation> </message> <message> <location line="+6"/> @@ -2102,7 +2102,7 @@ na <message> <location filename="../src/declarative/qml/qdeclarativecomponent.cpp" line="+454"/> <source>Invalid empty URL</source> - <translation type="unfinished"></translation> + <translation>Niepoprawny pusty URL</translation> </message> </context> <context> @@ -2111,22 +2111,22 @@ na <location filename="../src/declarative/qml/qdeclarativecompositetypemanager.cpp" line="+482"/> <location line="+268"/> <source>Resource %1 unavailable</source> - <translation type="unfinished"></translation> + <translation>Zasób %1 nie jest dostępny</translation> </message> <message> <location line="-119"/> <source>Namespace %1 cannot be used as a type</source> - <translation type="unfinished"></translation> + <translation>Przestrzeń nazw %1 nie może być użyta jako typ</translation> </message> <message> <location line="+2"/> <source>%1 is not a type</source> - <translation type="unfinished"></translation> + <translation>%1 nie jest typem</translation> </message> <message> <location line="+46"/> <source>Type %1 unavailable</source> - <translation type="unfinished"></translation> + <translation>Typ %1 nie jest dostępny</translation> </message> </context> <context> @@ -2136,22 +2136,22 @@ na <location line="+54"/> <location line="+7"/> <source>Cannot assign to non-existent property "%1"</source> - <translation type="unfinished"></translation> + <translation>Nie można przypisać wartości do nieistniejącej właściwości "%1"</translation> </message> <message> <location line="-51"/> <source>Connections: nested objects not allowed</source> - <translation type="unfinished"></translation> + <translation>Połączenia: zagnieżdżone obiekty nie są dozwolone</translation> </message> <message> <location line="+3"/> <source>Connections: syntax error</source> - <translation type="unfinished"></translation> + <translation>Połączenia: błąd składni</translation> </message> <message> <location line="+8"/> <source>Connections: script expected</source> - <translation type="unfinished"></translation> + <translation>Połączenia: oczekiwano skryptu</translation> </message> </context> <context> @@ -2159,34 +2159,34 @@ na <message> <location filename="../src/declarative/qml/qdeclarativeengine.cpp" line="+1633"/> <source>module "%1" definition "%2" not readable</source> - <translation type="unfinished"></translation> + <translation>definicja "%2" modułu "%1" nie może zostać odczytana</translation> </message> <message> <location line="+23"/> <source>plugin cannot be loaded for module "%1": %2</source> - <translation type="unfinished"></translation> + <translation>wtyczka nie może zostać załadowana dla modułu "%1": %2</translation> </message> <message> <location line="+5"/> <source>module "%1" plugin "%2" not found</source> - <translation type="unfinished"></translation> + <translation>wtyczka "%2" modułu "%1" nie została odnaleziona</translation> </message> <message> <location line="+82"/> <location line="+55"/> <source>module "%1" version %2.%3 is not installed</source> - <translation type="unfinished"></translation> + <translation>wersja %2.%3 modułu %1 nie jest zainstalowana</translation> </message> <message> <location line="-53"/> <source>module "%1" is not installed</source> - <translation type="unfinished"></translation> + <translation>moduł "%1" nie jest zainstalowany</translation> </message> <message> <location line="+14"/> <location line="+19"/> <source>"%1": no such directory</source> - <translation type="unfinished"></translation> + <translation>"%1": brak katalogu</translation> </message> <message> <location line="-2"/> @@ -2196,22 +2196,22 @@ na <message> <location filename="../src/declarative/qml/qdeclarativesqldatabase.cpp" line="+204"/> <source>executeSql called outside transaction()</source> - <translation type="unfinished"></translation> + <translation>"executeSql" zawołane na zewnątrz "transation()"</translation> </message> <message> <location line="+58"/> <source>Read-only Transaction</source> - <translation type="unfinished"></translation> + <translation>Transakcja tylko do odczytu</translation> </message> <message> <location line="+20"/> <source>Version mismatch: expected %1, found %2</source> - <translation type="unfinished"></translation> + <translation>Niezgodność wersji: oczekiwano %1, znaleziono %2</translation> </message> <message> <location line="+14"/> <source>SQL transaction failed</source> - <translation type="unfinished"></translation> + <translation>Transakcja SQL zakończona błędem</translation> </message> <message> <location line="+21"/> @@ -2230,12 +2230,12 @@ na <message> <location filename="../src/declarative/graphicsitems/qdeclarativeflipable.cpp" line="+129"/> <source>front is a write-once property</source> - <translation type="unfinished"></translation> + <translation>"front" jest właściwością tylko do odczytu</translation> </message> <message> <location line="+19"/> <source>back is a write-once property</source> - <translation type="unfinished"></translation> + <translation>"back" jest właściwością tylko do odczytu</translation> </message> </context> <context> @@ -2243,7 +2243,7 @@ na <message> <location filename="../src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp" line="+62"/> <source>KeyNavigation is only available via attached properties</source> - <translation type="unfinished"></translation> + <translation>"KeyNavigation" jest dostępny jedynie poprzez właściwości dołączone</translation> </message> </context> <context> @@ -2251,7 +2251,7 @@ na <message> <location line="+1"/> <source>Keys is only available via attached properties</source> - <translation type="unfinished"></translation> + <translation>"Keys" jest dostępny jedynie poprzez właściwości dołączone</translation> </message> </context> <context> @@ -2259,64 +2259,64 @@ na <message> <location filename="../src/declarative/util/qdeclarativelistmodel.cpp" line="+399"/> <source>remove: index %1 out of range</source> - <translation type="unfinished"></translation> + <translation>remove: indeks %1 poza zakresem</translation> </message> <message> <location line="+33"/> <source>insert: value is not an object</source> - <translation type="unfinished"></translation> + <translation>insert: wartość nie jest obiektem</translation> </message> <message> <location line="+5"/> <source>insert: index %1 out of range</source> - <translation type="unfinished"></translation> + <translation>insert: indeks %1 poza zakresem</translation> </message> <message> <location line="+30"/> <source>move: out of range</source> - <translation type="unfinished"></translation> + <translation>move: poza zakresem</translation> </message> <message> <location line="+40"/> <source>append: value is not an object</source> - <translation type="unfinished"></translation> + <translation>append: wartość nie jest obiektem</translation> </message> <message> <location line="+34"/> <source>get: index %1 out of range</source> - <translation type="unfinished"></translation> + <translation>get: indeks %1 poza zakresem</translation> </message> <message> <location line="+25"/> <source>set: value is not an object</source> - <translation type="unfinished"></translation> + <translation>set: wartość nie jest obiektem</translation> </message> <message> <location line="+4"/> <location line="+34"/> <source>set: index %1 out of range</source> - <translation type="unfinished"></translation> + <translation>set: indeks %1 poza zakresem</translation> </message> <message> <location line="+39"/> <location line="+15"/> <source>ListElement: cannot contain nested elements</source> - <translation type="unfinished"></translation> + <translation>ListElement: nie może zawierać zagnieżdżonych elementów</translation> </message> <message> <location line="+4"/> <source>ListElement: cannot use reserved "id" property</source> - <translation type="unfinished"></translation> + <translation>ListElement: nie można używać zarezerwowanej właściwości "id"</translation> </message> <message> <location line="+49"/> <source>ListElement: cannot use script for property value</source> - <translation type="unfinished"></translation> + <translation>ListElement: nie można używać skryptu jako wartości właściwości</translation> </message> <message> <location line="+29"/> <source>ListModel: undefined property '%1'</source> - <translation type="unfinished"></translation> + <translation>ListModel: niezdefiniowana właściwość "%1"</translation> </message> </context> <context> @@ -2377,12 +2377,12 @@ na <message> <location line="-140"/> <source>Illegal character</source> - <translation type="unfinished"></translation> + <translation>Niepoprawny znak</translation> </message> <message> <location line="+14"/> <source>Unclosed string at end of line</source> - <translation type="unfinished"></translation> + <translation>Niedomknięty ciąg na końcu linii</translation> </message> <message> <location line="+26"/> @@ -2392,7 +2392,7 @@ na <message> <location line="+72"/> <source>Unclosed comment at end of file</source> - <translation type="unfinished"></translation> + <translation>Niedomknięty komentarz na końcu linii</translation> </message> <message> <location line="+102"/> @@ -2434,25 +2434,25 @@ na <message> <location line="-65"/> <source>Unexpected token `%1'</source> - <translation type="unfinished"></translation> + <translation>Nieoczekiwany znak "%1"</translation> </message> <message> <location line="+28"/> <location line="+24"/> <source>Expected token `%1'</source> - <translation type="unfinished"></translation> + <translation>Oczekiwano znaku "%1"</translation> </message> <message> <location filename="../src/declarative/qml/qdeclarativescriptparser.cpp" line="+264"/> <location line="+456"/> <location line="+59"/> <source>Property value set multiple times</source> - <translation type="unfinished"></translation> + <translation>Wartość właściwości ustawiona wielokrotnie</translation> </message> <message> <location line="-504"/> <source>Expected type name</source> - <translation type="unfinished"></translation> + <translation>Oczekiwano nazwy typu</translation> </message> <message> <location line="+171"/> @@ -2510,7 +2510,7 @@ na <message> <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="-1973"/> <source>Cannot set a duration of < 0</source> - <translation type="unfinished"></translation> + <translation>Nie można ustawić ujemnego czasu trwania</translation> </message> </context> <context> @@ -2518,23 +2518,23 @@ na <message> <location filename="../src/declarative/util/qdeclarativepixmapcache.cpp" line="+197"/> <source>Error decoding: %1: %2</source> - <translation type="unfinished"></translation> + <translation>Błąd dekodowania: %1: %2</translation> </message> <message> <location line="+70"/> <source>Failed to get image from provider: %1</source> - <translation type="unfinished"></translation> + <translation>Pobieranie obrazka od dostawcy zakończone błędem: %1</translation> </message> <message> <location line="+19"/> <location line="+342"/> <source>Cannot open: %1</source> - <translation type="unfinished"></translation> + <translation>Nie można otworzyć: %1</translation> </message> <message> <location line="+37"/> <source>Unknown Error loading %1</source> - <translation type="unfinished"></translation> + <translation>Nieznany błąd ładowania %1</translation> </message> </context> <context> @@ -2542,7 +2542,7 @@ na <message> <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="+1100"/> <source>Cannot set a duration of < 0</source> - <translation type="unfinished"></translation> + <translation>Nie można ustawić ujemnego czasu trwania</translation> </message> </context> <context> @@ -2550,17 +2550,17 @@ na <message> <location filename="../src/declarative/util/qdeclarativepropertychanges.cpp" line="+231"/> <source>PropertyChanges does not support creating state-specific objects.</source> - <translation type="unfinished"></translation> + <translation>"PropertyChanges" nie obsługuje tworzenia obiektów charakterystycznych dla stanów.</translation> </message> <message> <location line="+151"/> <source>Cannot assign to non-existent property "%1"</source> - <translation type="unfinished"></translation> + <translation>Nie można przypisać wartości do nieistniejącej właściwości "%1"</translation> </message> <message> <location line="+3"/> <source>Cannot assign to read-only property "%1"</source> - <translation type="unfinished"></translation> + <translation>Nie można przypisać wartości do właściwości (tylko do odczytu): "%1"</translation> </message> </context> <context> @@ -2582,22 +2582,22 @@ na <message> <location filename="../src/declarative/qml/qdeclarativevme.cpp" line="+194"/> <source>Unable to create object of type %1</source> - <translation type="unfinished"></translation> + <translation>Nie można utworzyć obiektu typu %1</translation> </message> <message> <location line="+380"/> <source>Cannot assign value %1 to property %2</source> - <translation type="unfinished"></translation> + <translation>Nie można przypisać wartości %1 do właściwości %2</translation> </message> <message> <location line="+22"/> <source>Cannot assign object type %1 with no default method</source> - <translation type="unfinished"></translation> + <translation>Nie można przypisać obiektu typu %1 który nie posiada domyślnej metody</translation> </message> <message> <location line="+3"/> <source>Cannot connect mismatched signal/slot %1 %vs. %2</source> - <translation type="unfinished"></translation> + <translation>Nie można podłączyć niepasujących sygnałów / slotów (%1 i %2)</translation> </message> <message> <location line="+5"/> @@ -2607,7 +2607,7 @@ na <message> <location line="+146"/> <source>Cannot assign object to list</source> - <translation type="unfinished"></translation> + <translation>Nie można przypisać obiektu do listy</translation> </message> <message> <location line="+41"/> @@ -2617,7 +2617,7 @@ na <message> <location line="+11"/> <source>Unable to create attached object</source> - <translation type="unfinished"></translation> + <translation>Nie można utworzyć dołączonego obiektu</translation> </message> <message> <location line="+32"/> @@ -2639,7 +2639,7 @@ na <location filename="../src/declarative/util/qdeclarativeutilmodule.cpp" line="-12"/> <location line="+2"/> <source>Qt was built without support for xmlpatterns</source> - <translation type="unfinished"></translation> + <translation>Qt zostało zbudowane bez obsługi xmlpatterns</translation> </message> </context> <context> @@ -2647,7 +2647,7 @@ na <message> <location filename="../src/declarative/util/qdeclarativexmllistmodel_p.h" line="+168"/> <source>An XmlRole query must not start with '/'</source> - <translation type="unfinished"></translation> + <translation>Zapytanie XmlRole nie może rozpoczynać się od "/"</translation> </message> </context> <context> @@ -2655,7 +2655,7 @@ na <message> <location filename="../src/declarative/util/qdeclarativexmllistmodel.cpp" line="+638"/> <source>An XmlListModel query must start with '/' or "//"</source> - <translation type="unfinished"></translation> + <translation>Zapytanie XmlListModel nie może rozpoczynać się od "/" ani od "//"</translation> </message> </context> <context> @@ -3185,32 +3185,32 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <message> <location/> <source>Go back</source> - <translation type="unfinished"></translation> + <translation>Wróć</translation> </message> <message> <location/> <source>Go forward</source> - <translation type="unfinished"></translation> + <translation>Przejdź dalej</translation> </message> <message> <location/> <source>Go to the parent directory</source> - <translation type="unfinished"></translation> + <translation>Przejdź do katalogu wyżej</translation> </message> <message> <location/> <source>Create a New Folder</source> - <translation type="unfinished"></translation> + <translation>Utwórz nowy katalog</translation> </message> <message> <location/> <source>Change to list view mode</source> - <translation type="unfinished"></translation> + <translation>Pokaż listę</translation> </message> <message> <location/> <source>Change to detail view mode</source> - <translation type="unfinished"></translation> + <translation>Pokaż szczegóły</translation> </message> </context> <context> @@ -3721,7 +3721,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <location filename="../src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp" line="+423"/> <location line="+16"/> <source>Unable to play %1</source> - <translation type="unfinished"></translation> + <translation>Nie można odtworzyć %1</translation> </message> </context> <context> @@ -4564,23 +4564,23 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <location filename="../src/multimedia/base/qmediaplaylist.cpp" line="+455"/> <location line="+46"/> <source>Could not add items to read only playlist.</source> - <translation type="unfinished"></translation> + <translation>Nie można dodać elementów do listy odtwarzania (tylko do odczytu).</translation> </message> <message> <location line="-27"/> <location line="+46"/> <source>Playlist format is not supported</source> - <translation type="unfinished"></translation> + <translation>Format listy odtwarzania nie jest obsługiwany</translation> </message> <message> <location line="+26"/> <source>The file could not be accessed.</source> - <translation type="unfinished"></translation> + <translation>Brak dostępu do pliku.</translation> </message> <message> <location line="+35"/> <source>Playlist format is not supported.</source> - <translation type="unfinished"></translation> + <translation>Format listy odtwarzania nie jest obsługiwany.</translation> </message> </context> <context> @@ -4821,12 +4821,12 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <message> <location filename="../src/network/access/qnetworkaccessdatabackend.cpp" line="+76"/> <source>Operation not supported on %1</source> - <translation type="unfinished">Operacja nieobsługiwana na %1</translation> + <translation>Operacja nieobsługiwana na %1</translation> </message> <message> <location line="+25"/> <source>Invalid URI: %1</source> - <translation type="unfinished">Niepoprawny URI: %1</translation> + <translation>Niepoprawny URI: %1</translation> </message> </context> <context> @@ -4839,12 +4839,12 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <message> <location line="+60"/> <source>Socket error on %1: %2</source> - <translation type="unfinished">Błąd gniazda na %1: %2</translation> + <translation>Błąd gniazda na %1: %2</translation> </message> <message> <location line="+15"/> <source>Remote host closed the connection prematurely on %1</source> - <translation type="unfinished">Zdalny host przedwcześnie zakończył połączenie na %1</translation> + <translation>Zdalny host przedwcześnie zakończył połączenie na %1</translation> </message> </context> <context> @@ -4919,7 +4919,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <message> <location filename="../src/network/access/qnetworkreplyimpl.cpp" line="+910"/> <source>Network access is disabled.</source> - <translation type="unfinished"></translation> + <translation>Dostęp do sieci wyłączony.</translation> </message> </context> <context> @@ -4942,7 +4942,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <message> <location line="+329"/> <source>Temporary network failure.</source> - <translation type="unfinished"></translation> + <translation>Chwilowy błąd w sieci.</translation> </message> </context> <context> @@ -4959,7 +4959,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <message> <location filename="../src/network/bearer/qnetworksession.cpp" line="+449"/> <source>Invalid configuration.</source> - <translation type="unfinished"></translation> + <translation>Niepoprawna konfiguracja.</translation> </message> </context> <context> @@ -4972,7 +4972,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <message> <location line="+3"/> <source>Session aborted by user or system</source> - <translation type="unfinished"></translation> + <translation>Sesja przerwana przez użytkownika lub system</translation> </message> <message> <location line="+4"/> @@ -4989,25 +4989,25 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <location line="+2"/> <location filename="../src/plugins/bearer/symbian/qnetworksession_impl.cpp" line="+2"/> <source>The session was aborted by the user or system.</source> - <translation type="unfinished"></translation> + <translation>Sesja została przerwana przez użytkownika lub system.</translation> </message> <message> <location line="+2"/> <location filename="../src/plugins/bearer/symbian/qnetworksession_impl.cpp" line="+2"/> <source>The requested operation is not supported by the system.</source> - <translation type="unfinished"></translation> + <translation>Zażądana operacja nie jest obsługiwana przez system.</translation> </message> <message> <location line="+2"/> <location filename="../src/plugins/bearer/symbian/qnetworksession_impl.cpp" line="+2"/> <source>The specified configuration cannot be used.</source> - <translation type="unfinished"></translation> + <translation>Podana konfiguracja nie może być użyta.</translation> </message> <message> <location line="+2"/> <location filename="../src/plugins/bearer/symbian/qnetworksession_impl.cpp" line="+2"/> <source>Roaming was aborted or is not possible.</source> - <translation type="unfinished"></translation> + <translation>Roaming przerwany albo niemożliwy.</translation> </message> </context> <context> @@ -5413,7 +5413,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation> <message> <location line="+40"/> <source>Print current page</source> - <translation type="unfinished"></translation> + <translation>Wydrukuj bieżącą stronę</translation> </message> <message> <location filename="../src/gui/painting/qprinterinfo_unix.cpp" line="+133"/> @@ -6019,7 +6019,7 @@ Proszę wybrać inną nazwę pliku.</translation> <message> <location/> <source>Current Page</source> - <translation type="unfinished"></translation> + <translation>Bieżąca strona</translation> </message> </context> <context> @@ -8663,7 +8663,7 @@ Proszę wybrać inną nazwę pliku.</translation> <location line="+5"/> <source>Go Forward</source> <comment>Forward context menu item</comment> - <translation>Idź dalej</translation> + <translation>Przejdź dalej</translation> </message> <message> <location line="+5"/> @@ -8819,7 +8819,7 @@ Proszę wybrać inną nazwę pliku.</translation> <location line="+110"/> <source>Missing Plug-in</source> <comment>Label text to be used when a plug-in is missing</comment> - <translation type="unfinished"></translation> + <translation>Brakująca wtyczka</translation> </message> <message> <location line="+20"/> @@ -11944,32 +11944,32 @@ Proszę wybrać inną nazwę pliku.</translation> <message> <location line="+15"/> <source>Duration content does not match the maxInclusive facet.</source> - <translation>Wartość długości okresu czasu koliduje z aspektem "maxInclusive".</translation> + <translation>Wartość czasu trwania koliduje z aspektem "maxInclusive".</translation> </message> <message> <location line="+9"/> <source>Duration content does not match the maxExclusive facet.</source> - <translation>Wartość długości okresu czasu koliduje z aspektem "maxExclusive".</translation> + <translation>Wartość czasu trwania koliduje z aspektem "maxExclusive".</translation> </message> <message> <location line="+9"/> <source>Duration content does not match the minInclusive facet.</source> - <translation>Wartość długości okresu czasu koliduje z aspektem "minInclusive".</translation> + <translation>Wartość czasu trwania koliduje z aspektem "minInclusive".</translation> </message> <message> <location line="+9"/> <source>Duration content does not match the minExclusive facet.</source> - <translation>Wartość długości okresu czasu koliduje z aspektem "minExclusive".</translation> + <translation>Wartość czasu trwania koliduje z aspektem "minExclusive".</translation> </message> <message> <location line="+18"/> <source>Duration content is not listed in the enumeration facet.</source> - <translation>Wartość długości okresu czasu nie widnieje na liście aspektu "enumeration".</translation> + <translation>Wartość czasu trwania nie widnieje na liście aspektu "enumeration".</translation> </message> <message> <location line="+18"/> <source>Duration content does not match pattern facet.</source> - <translation>Wartość długości okresu czasu koliduje z aspektem "pattern".</translation> + <translation>Wartość czasu trwania koliduje z aspektem "pattern".</translation> </message> <message> <location line="+27"/> @@ -12280,7 +12280,7 @@ Proszę wybrać inną nazwę pliku.</translation> <message> <location filename="../src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui"/> <source>about:blank</source> - <translation type="unfinished"></translation> + <translation>o:puste</translation> </message> </context> </TS> |