Fix the docs on when setDocument() deletes the previous document

Change-Id: I08d162a1c1e1765213205e63183ed75b2491374d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Doc: corrected description of QTableWidget::clear()

Task-number: QTBUG-36329
Change-Id: I3a78311bcb076b414ecf1ecf866e4ed60c391126
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Fix printing with a custom paper specified.

If DMPAPER_USER is set from the print dialog then it is expected that
the specific member variables to get the custom width and length are
used. The size returned by querying the DC_PAPERSIZE is some random
default and is not the one actually requested by the user.

Also ensure that when it is a custom paper size from the driver
itself that we store the right paper size.

Change-Id: I760b8429ca1b01f5e303f2111b8d7ca1795c8ab8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Small doc fix.

Change-Id: If700cce1b39342ca2b1027e2c10711ea45c3dd9c
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Compose: Fix assert for non-UTF8 locales in table generator

Task-number: QTBUG-35770
Change-Id: I8aaea66e8d70edf7ab401f2c6dfb849d309ff6af
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Fix linuxfb argument 'mmsize' parsing

Parse first for 'mmsize' because the regex for 'size' also fits to 'mmsize'.

Task-number: QTBUG-29133
Change-Id: Idc4950270818e496d5d94a97a172b7c780f069b1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Accessibility Win: handle disabled state

[ChangeLog][QtGui] Windows Accessibility now handles the disabled state
of widgets correctly.

Task-number: QTBUG-36603

Change-Id: Ifebcf44320072089da66e81728de94e8f12a3354
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
QStandardPaths: ensure that paths use '/' on all platforms, as the comment said

Change-Id: Id70b5e92c07f63e71e7a1a8fb229f927d352ebdd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QStandardPaths: remove trailing slash when reading from user-dirs.dirs

For consistency with all other sources of paths, which do not return
a trailing slash, as tested by the unittest. This avoids double slashes
in paths, after apps append something to the path.

Change-Id: Iabcde11eee27df0b185780e2b655fbbb02ed63b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QPA fix: allow setting the initially selected name filter (KDE)

In KDE, without this patch, the Q_ASSERT in the following code fragment
fails:

QFileDialog dialog;
QStringList list = QStringList() << "c (*.cpp)" << "h (*.h)";
dialog.setNameFilters(list);

QString filter("h (*.h)");
dialog.selectNameFilter(filter);

dialog.show();
Q_ASSERT(dialog.selectedNameFilter() == filter);

The reason for the fail is that the selectNameFilter() does not properly
propagate the filter to the QPA plugin. So the first part of this patch
adds d->options->setInitiallySelectedNameFilter(filter); in the function
QFileDialog::selectNameFilter().

The second part of this patch makes sure that the initially set name
filter in the QFileDialogOptions "options" is not overwritten in the
helperPrepareShow() function. This is achieved by adding an if(),
following the if() for the initiallySelectedfiles() the line below.

With this patch, the Q_ASSERT() holds true in KDE Framework 5's
file dialog integration.

Change-Id: I15d8c88a0fa3cdc03e3330f3458bbad139a71212
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Don't deadlock when deleting slot objects in QMetaObject::activate()

The slot object was deleted after the mutex was relocked, which caused
a deadlock in case the functor destructor locked the same mutex again.

Change-Id: I5b4fb22fdb4483f91c89915872bfd548c31b0eea
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QDir::tempPath: make fallback code more readable.

This is a no-op because QDir::cleanPath() already takes care of removing
the trailing slash.

Change-Id: Ic19d9a9dd7e377e04447c3ebc776b025f5f0c43a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QDir::tempPath: clarify trailing-slash situation.

tst_QDir::tempPath already checks that there is no trailing slash.
Except of course when the path is "/" or "C:/", but we can't do much
about that unlikely corner case.

Change-Id: If71d5de1aeebc6720348cecbf659b7fceb83fb0e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QStandardPaths: fix empty path in XDG_DATA_DIRS being treated as '/'.

The basedir xdg spec says:
"All paths set in these environment variables must be absolute.
If an implementation encounters a relative path in any of these variables it
should consider the path invalid and ignore it."
Therefore we ignore relative paths including the empty string.

Change-Id: I8f779b78981018051b16de23b2514f2e62b7ab39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qdoc: fix memory leaks, unchecked open(), hardcoded path - in debugging code

Change-Id: I3b065dd18f60214a858543d062dfb2f0f1dc1b36
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Doc: fix typo in QDebugStateSaver docu

Change-Id: I12e0a725141a570903004c63369c991d383ac82c
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Accessibility: Fix reporting the same name/value twice

NVDA for example reads name and value, so that most of our
accessibles would lead to the same text being read twice in a row.
Instead use Name as that's best supported on all platforms.

[ChangedLog][QtWidgets] Fixed accessibility issues that would lead to
screen readers reading the same text twice.

Task-number: QTBUG-36678

Change-Id: I6c5c9cdcf5392c7135a65bd30f87a590c3c07fb4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Remove useless if

Change-Id: Ide9f06b71159e86fdd2aa178cd3aa0ab2faf5d2c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Make QUrl::isLocalFile fast by storing a flag

The XDG specification for file URIs requires us to use triple slashes in
file:/// for URLs with absolute paths. I don't like special-casing any
particular scheme, but we've done it for file for many years now.

Since we need to test this situation in a couple of places, it's easier
to just cache the result once, in setScheme (both functions).

Change-Id: I078b45b5b6c861f4caee082b4730fd6f67684ae4
Reviewed-by: David Faure <david.faure@kdab.com>
Fix assert when converting RGBx8888 to ARGB32_PM

RGBx8888 to ARGB32_PM is incorrectly using the RGBA8888 to ARGB32_PM
which asserts the input format is RGBA8888. Since the routine also
performs an unnecessy premul, we should be using a the generic rgba2argb
routine.

Change-Id: I7b67328f804f5f2a9664a35c04836679e8c8b8e5
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>