Use QPageSize and QPageMargins to get/set values in the print engines,
add api to directly set the values, and rewrite the docs to make the
paper-based api obsolete instead of the page-based api.
Add new PPK keys to pass QPageSize, QPageMargins and QPageLayout to the
print engines to ensure no level of detail is lost, e.g. for custom
sizes passed to QPrinter.
[ChangeLog][QtPrintSupport][QPrinter] QPrinter can now use QPageSize
and QPageLayout in the public api to control the page layout for a
print job.
Change-Id: Iee39a4042bcd6141d29b0a82b49066d7a7a78120
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Switch the Windows QPrintEngine to use QPageLayout.
Change-Id: I2b617fe103980c4efbb0ed367547e436f2d8a5e2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Change the Windows QPrintEngine implementation to use the
QPlatformPrintDevice to obtain device information, and use QPageSize to
obtain page size conversions. A following change will use QPageLayout
to store that page size.
Change-Id: I990943e2b62ab6dab2c4d4a292c7ed7261beadf2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Change the Mac QPrintEngine to use QPlatformPrintDevice and QPageSize
for all device and page size related requirements.
Change-Id: Ie0e598eceaf1a657a1554c0f56078fd857ef2e06
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Use QPlatformPrintDevice in the Cups print engine for all device
specific code.
Change-Id: Ic1f5f8b4010a9958c320f3c0c727cf1bd1a70c65
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add support to QPdfWriter for QPageSize, QPageLayout, and resolution.
[ChangeLog][QtGui][QPdfWriter] The QPdfWriter now supports setting
the PDF orientation, layout and resolution by using QPageSize and
QPageLayout.
Change-Id: I9c269f997ec540dac1989f355c6a2e7488947966
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Switch internals of QPdfPageEngine and derived classes to use
QPageLayout and QPageSize to make handling of page layout and size
more consistent by removing multiple implementations. In particular
remove all use of the QPdf namespace version of page size.
Change-Id: Ie820340015e8812c8162bd1a257dd0f51f4f0b85
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Use new QPageLayout and QPageSize class to store and convert page sizes
and layouts consistently. Extend the PageSize enum to match
QPage::PageSize.
Note that public setters/getters cannot be added as virtuals would break
BIC, but without virtuals the derived classes would break. Instead an
internal api is provided and the derived classes will need to
implement identical api to manipulate it.
[ChangeLog][QtGui][QPagedPaintDevice] Paged paint devices such as
QPrinter and QPdfWriter now support all Postscript standard page sizes.
Task-number: QTBUG-27685
Task-number: QTBUG-25744
Change-Id: I62e96ab94194ab4ac8bed8fa804e0ce1c3233313
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Change the QPrinterInfo implementation to use QPlatformPrintDevice as
the backend. Remove all the old QPrinterInfo related code from the
QPA plugin. Add public api to QPrinterInfo to support some features
from QPlatformPrintDevice.
[ChangeLog][QtPrintSupport][QPrinterInfo] Added new public api for
isRemote(), state(), defaultPageSize(), supportedPageSizes(),
supportsCustomPageSizes(), minimumPhysicalPageSize(),
maximumPhysicalPageSize(), supportedResolutions(),
availablePrinterNames(), and defaultPrinterName(). The use of
availablePrinters() is discouraged due to performance concerns.
Task-number: QTBUG-35248
Change-Id: Ic38323a930549ad67bf04a1a6bb43d623dfe6a33
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add Windows implementation of QPlatformPrintDevice.
Change-Id: I007678cd6d2bdae0728b61cc2796a5c5e5d1578f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add support to the CUPS print plugin for the new QPlatformPrintDevice
class. Note this is called QPpdPrintDevicePrivate as it uses the CUPS
PPD support which is deprecated from CUPS 1.6 onwards. A different
plugin will be implemented for the CUPS 1.6 support.
Change-Id: I26d005f90842d9c6262341171ef157536d28cc5d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Change the minimum required version of CUPS to be 1.4, which has been
available in most distros since 2009. Note this is only available in
RHEL 6 and later, RHEL 5 will no longer be supported for printing.
[ChangeLog][QtPrintSupport] CUPS 1.4 is now required for print support
on Linux and other *nix platforms.
Change-Id: Id9c4c748be6436ccc995da08ff6bb3eeef08c35a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add a new QPA class to abstract Print Devices. Each platform instance
will encapsulate all required details about a print device instead of
the code being distributed throughout the print engine and print
plugin.
Change-Id: I7f6a537ad55a6e7f599d83f461b1e2ee62b15094
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
New QPageLayout to encapsulate page layout details including page size,
orientation and margins. Scale may be added later.
Subsequent changes will use this class in the paged paint devices,
paint engines, print engines, and print plugins to replace multiple
inconsistent local implementations.
[ChangeLog][QtGui] Added class QPageLayout to support handling page
layouts including the page size, orientation and margins.
Change-Id: Ife1ddd6c2a8d1516542be2eb37425111f41cd5c7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
New QPageSize class to encapsulate paper sizes and names to ensure all
sizes and conversions are consistent and match the Postscript standard
sizes.
Subsequent changes will use this class in the paged paint devices,
paint engines, print engines, and print plugins to replace multiple
inconsistent local implementations.
[ChangeLog][QtGui][QPageSize] Added new QPageSize class to implement
Adobe Postscript PPD standard page sizes. This class supports the
standard page sizes, names and keys from the PPD standard, and provides
convenient size and rect conversion methods.
Change-Id: Ie2c8be0c3df0d29ac5da4cd9877ad41d0982633c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add more page metrics tests to expose the many bugs and inconsistencies
in the page layout handling. No platform or pdf backend passes all
these tests so they are skipped for now, but following commits will use
the tests to ensure the re-write of the page layout handling fixes the
many problems in a consistent way for all backends.
Change-Id: Ic5b16aa08dfe2bd9a9191662fd2bbe6b913e15c9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This reverts commit f78661b03c.
The reverted patch was working around that QFontEngineFT was using
the poor QFontEngine fall back. That issue was fixed in commit
0b7beaaaf2, and the work around
is no longer needed.
This also fixes a rare problem with the workaround when the fontengine
and the glyph-cache do not share the same default glyph format which
can happen with QRawFonts.
Change-Id: I150f70a003b137c1d145f6f70cda568c85633e5c
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Disable eglfs and similar plugins when opengl is not enabled.
(but egl is present)
GL-dependent parts of eglconvenience need to be skipped too.
Task-number: QTBUG-37457
Change-Id: I44d49495241551bc7b1f565aa0b5ace9f310628e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
The macro should stringify value of the given token not the token
itself.
Task-number: QTBUG-37547
Change-Id: I90f4fa613bd13d5a581828ab13f620b40dfd3593
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QGraphicsPixmapItem did not take the pixmaps
devicePixelRatio into account when calculating the
bounding rect. As a consequence, a 512x512@2x pixmap
would get a 512x512 bounding size instead of the
correct 256x256 bounding size.
Task-number: QTBUG-37008
Change-Id: I266e418b7e5d92bf1d4c96bd9380a27708dc2b4a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
QFontEngineFT::alphaMapForGlyph and QFontEngineFT::alphaRGBMapForGlyph
has been broken since change#65694. They always fall back to using
the path rendering of QFontEngine because we zero the scoped pointer
just before testing it.
To fix it we need to release the scope pointer after we are done using
it.
Change-Id: I8811c1f5261f286f2f3dd3c0f93c988ba0909669
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
When the window manager sets new workarea using the _NET_WORKAREA xcb
atom, QScreen::availableGeometry() does not react to that and returns an
invalid available geometry. This patch reacts to that change and updates
the QScreen property properly on xcb platform.
Change-Id: I8f0b4a27bab0ce450fb7393f4d9a56f3ce9a4ea1
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
For pixmaps with devicePixelRatio greater than 1,
create a native cursor that has a normal and a high-dpi
representation.
Task-number: QTBUG-34116
Change-Id: I1c014d65749add25f2b828837555a1844ede97c1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Disable the zoom (maximize) button for fixed-size
windows and customized windows with the MaximizeButton
flag not set.
Task-number: QTBUG-37078
Change-Id: I6da88496474713de37b48aa65742203632ba99d6
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
The assets file engine is created before main() is called, thus
prepopulate was called before main(). In this function, we created
a QDataStream which internally created a QBuffer which inherits
from QObject. This caused the main thread pointer to be initialized
early, and the old "QApplication is not on the main() thread" warning
and crash returned. The fix is to prepopulate the first time the
file engine is used instead.
Task-number: QTBUG-37444
Change-Id: I2c6e5f1a8ca88b5dc7d8e145fffeb7587dc0e623
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
When we scroll, the keyboard will change position relative
to QScreen, even if it appears to stay put. For that
reason we also need to update the keyboard rect after
doing a scroll.
Change-Id: I9bda2ab5b5e4970f488d3e69e44cf58e273f8fcd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
The variant taking x, y, z has been broken in all Qt 5.x releases.
This is now corrected by making the GL2 paint engine capable of applying
a Z translation.
Task-number: QTBUG-31156
Change-Id: I119566e9e9577f6cdf7e8bae56cac1e34995e622
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Implement PdmDevicePixelRatio.
Task-number: QTBUG-36419
Change-Id: I4d2822d01e08c80e9b829d5f524e8e761e694fba
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
The POINTBLOCK struct in qregion.cpp is badly defined. By using ints
as the base storage of the internal array it forces not only bad casting
from int to QPoint, but also allocates an array four times too big.
This patch changes to char, since a char pointer may alias anything and
this gives the right size of the array.
Change-Id: I608eaf39ac7306c71314a139bed6e2352249c0ab
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
As soon as we receive an event not related to dragging
a QDockWidget out of its area (or a similar use case),
we no longer need the forward window.
Task-number: QTBUG-37265
Change-Id: I310e9cc2cf099c76e7a88427826d4b97ca0cd9b9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
These internal and obsolete hooks are no longer used. The correct way
to provide platform dialogs in Qt 5.x is to implement a platform theme
plugin, as was done for GTK+ 2.x.
Change-Id: I3f1474fbf760130106b3c47173eaedd2f1a919bf
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Show how use QCommandLineParser with additional
parameter checking for custom options and positional
arguments.
Also explain how to display help in GUI applications.
Change-Id: I03513e09b7dd5b150259593da0af2ef2a281cab2
Reviewed-by: David Faure <david.faure@kdab.com>
it's QT_INSTALL_CONFIGURATION, not QT_INSTALL_SETTINGS.
probably the most useless of all properties, but anyway.
Change-Id: Ia1e739ab4ed59e2bcd3199914caed2b3db9070ee
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
It could be that the channel has its reply already reset to 0, while
the protocol handler thinks the reply is still active, which might
lead to weird behavior including hard to reproduce crashes.
Task-number: QTBUG-37424
Change-Id: I89b65d34caaa546a343edc2ee205aa76425de88f
Reviewed-by: Richard J. Moore <rich@kde.org>
The 4.8 compiler in the Android NDK sometimes produces uncompilable
code for armv5. In change b4252802b3
we reintroduced thumb instructions on armv5 with a work-around for
a particular case of this bug. However, the compiler now breaks
for Qt Script. There's no time to try to find a work-around for
this case, so we need to disable thumb again. It actually also
seems that this is completely broken with this compiler, so it would
probably be best to keep this disabled until the compiler is fixed.
Especially since armv5 will become part of the CI builds now, so the
compiler bug can end up blocking critical changes in the future if it's
re-enabled :/
Task-number: QTBUG-37376
Change-Id: I9e1b050ce596717ba1fa7ec2f5e8a3ce3581a3af
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Change-Id: Ia2b34e3ee6954342501a805f9e047cb90078e9d5
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
The old code tried to check the 2nd parent for inheritance from
QAbstractItemView. This also triggers for line edits on a QDialog parented
on the item view. Introduce convenience function that checks for
top levels in the chain.
Task-number: QTBUG-37504
Change-Id: I932f8efdb4764e9b1eea84c802bf7e8718338e1d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
By placing debug messages in shared memory, the application can share
debug messages with winrtrunner (or any utility which passes -qdevel
to the app and opens the corresponding shared memory area).
Task-number: QTBUG-37308
Change-Id: Id0e04cfd5f0f701d552a448f780788c7cbf9b438
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>