The disabled state was handled in qapplication_xxx.cpp before.
As the platform integration only knows about windows and
not widgets the state check is now done in qwidget. This commit
just adds key events to the list of events which are ignored
if the widget is disabled. This list also contains mouse events
for example.
Task-number: QTBUG-27417
Change-Id: I55949e1c1aaa992ba71df51c5b5e8177ec6f1e86
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
In WebKit we use moc -E to pre-process various files before throwing at
further build creation tools. The pre-processing is used to filter out
code depending in #ifdef'fed features.
The latest addition to the family of pre-processed files is the CSS grammar,
which is written in Bison. It contains rule lines like
$$ = parser->createFoo()
and when pre-processing this moc stumbles over the dollar sign. Instead
of ignoring un-tokenizable input we should add it to the current token
if we're in preprocessor-only mode, otherwise the $$ gets eaten and we
produce data-loss by printing out less characters than.
Change-Id: Ib32e7c04b38dd2ba3726201e76f27405f7ea6c0d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
If the number of available printers changes, we want
to update the count. Additionally, if that number has
gone to zero, we want to ensure that the number of
available printers in the static object is reset to
zero.
This fixes a crash that occurs if:
* You print
* You kill cupsd (or it crashes because you're porting it and your port is unstable)
* You try to print again before restarting it.
Change-Id: I6c6069db9d800ce7426e75df760829fea278e56e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Change-Id: I7adb2e207cab89fbad9458cd0bcb856ecd2288f0
Reviewed-by: Peter Hartmann <phartmann@rim.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
On Blackberry, select() can actually temporarily wake up to process
mative BPS events. Make sure to emit the aboutToBlock() and awake()
signals in this situation accordingly.
Change-Id: Ib324e702feb1cfebdc6926f80af9c92f291a2b94
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This was a leftover after removing motif style from the repo.
Change-Id: I98d47a9443ffce2be34d73e779a0787c0b68913f
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Cursor dependant auto tests are currently skipped in various ways.
Some are checking PlatformQuirks::haveMouseCursor() that tries to
detect if the desktop environment is MeeGo, using obsolete Q_WS_X11.
Some are skipped if QT_NO_CURSOR or Q_OS_WINCE is defined and
some are actually missing the approriate guards.
=> unify by defining QTEST_NO_CURSOR in qtest-config.h when
appropriate ie. for platforms that have no regular mouse cursor
support or when QT_NO_CURSOR is defined.
Task-number: QTBUG-22551
Change-Id: I9a1e0e3156617945ae46226c79268955454c8a9a
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
The links are from the qt-webpages.qdoc and no longer exist.
Change-Id: I8329032215fa77811117e2767bae745795b209cb
Reviewed-by: Martin Smith <martin.smith@digia.com>
Commit c0893962ef added two
definitions of a variable named gtkToggleButtonStyle in nested
scopes. Because of name lookup rules, the second one wasn't
initialised with the first one, but with itself.
This leaves the second gtkToggleButtonStyle uninit'ed.
Simply remove the surplus declaration, leaving the name to
the original declaration.
Change-Id: I2269e1093f54643ff4dce27b39cc033db6697782
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
The Windows combo animation causes a delay, introduce
QTRY_VERIFY. Fix warnings about being unable to
set geometry on Windows.
Change-Id: I52ca960c06f023ade3afe85f31deaf8e32edff26
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This is the QGL equivalent of commit
602cab9bb2
Without this QGLExtensionMatcher causes stack corruption when using
a core profile GL context due to the call to glGetStringi() with
an incorrect calling convention.
Change-Id: Ibd86645e04df8c650c182fecfc8c481dae8a75b2
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Printer support depends on having Picture support.
If QT_NO_PICTURE is defined, qfeatures.h will define
QT_NO_PRINTER.
Not all code is including qfeatures.h, which causes inconsistency,
some code has QT_NO_PRINTER defined and some has not, which causes
the build to fail.
Change-Id: I10a854244a41d017b921b731ec0e08f90a3326cf
Reviewed-by: Holger Ihrig <holger.ihrig@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Two command line options have been added, -prepare and -generate.
If you run qdoc with -prepare, qdoc reads and parses the source
files but does not generate the documentation. It only creates
the .index file for the module you are running qdoc on.
If you run qdoc with -generate, qdoc reads and parses the source
files as well as the .index files created by running qdoc with
-prepare, and it generates the documentation but no .index file.
If you run without either option, qdoc runs as before, i.e. it
runs both passes as a single pass.
Task number: QTBUG-27539
Change-Id: Idbfe3f0f9dff58283596b504f00dff3f70f6e371
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
qdoc's tokenizer was reporting an error for the
empty character literal ''. Now it allows it.
Apparently it makes sense in .js files.
Task number: QTBUG-25775
Change-Id: If407427fad9b65a035c2c4785d53c9e3d5202e62
Reviewed-by: Martin Smith <martin.smith@digia.com>
Documentation has been updated to reflect changes in Qt5.
Change-Id: I3d54d1875962bd27c43bb360ae7b3fda0b7702ba
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I can't find any failures in the CI logs, as reported by the bug.
Even if there is still an unstable test here, it is not appropriate
to mark the entire test as insignificant, as that hides regressions
in the entire class.
Task-number: QTBUG-23638
Change-Id: I1aeaf6e725bf28e9ac03c9330a67e51241b9272b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Add BoundaryReason::BreakOpportunity flag that will be returned by the
boundaryReasons() when the boundary finder is at the break opportunity
position that might be not an item boundary.
This is the same as (StartWord || EndWord) in Grapheme and Sentence modes;
in Word and Line modes, BreakOpportunity flag might occur between the words
or in between of Line boundaries (e.g. in conjunction with SoftHyphen flag).
In other words, the text boundaries are always break opportunities, but not vice versa.
StartWord and EndWord flags has been deprecated by new StartOfItem and EndOfItem
flags which are not about the word boundaries only. In line breaking,
StartOfItem and EndOfItem are set for the mandatory breaks only.
Change-Id: I79bf297e2b988f5976f30cff0c8ca616385f6552
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Search for the test data files in the test data directory, not in the current dir.
Change-Id: I746e717bae575364102c1bb5c2888332d94c374f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This case has typically required specific work-arounds in other
rendering paths as well.
Task-number: QTBUG-25153
Change-Id: I217e710a30222792ebca3bf297e438d944c32992
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
After allocating memory on the heap it is ATM not possible to use the
memory on the stack again, QVarLengthArray then uses/resizes only
the memory on the heap. But the memory on stack could be used
if it is big enough.
Change-Id: I566003c25dd1093eb6ba8087a1e5378a11712934
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
After a exception is thrown in resize(), QVarLengthArray has an
invalid state with ptr == 0. On the next resize call when malloc
returns a valid pointer, oldPtr is 0 and it could crash in
memcpy because the pointer to the source is 0.
The patch ensures the valid pointer isn't overwritten with NULL.
When exceptions are disabled the user must ensure that malloc will
not fail.
Change-Id: Id12a5e3e1eacc551e4d1b64cba8e8414cfebd6e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Any file including qstringbuilder.h would trigger a warning when
compiled with QT_ASCII_CAST_WARNINGS defined since it implicitely
converts a QString to QByteArray.
Explicitely call toUtf8() to fix the issue.
Change-Id: If20f9d4571c5d1ed789564196c9f1331e1efd1d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This information can get noisy when windows get opened/closed frequently
during auto tests.
Change-Id: I2777b51c97b3108be3d784794e12e20985d4d65b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
-Landing page which lists articles in the module, including:
-Graphics View, Model/View, Style Sheet, and widget galleries
-Renamed some titles and a whitespace fix.
Change-Id: I84be14d9a425ef380162e9a55ce2742c6812f510
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
qdocconf files can now reference $QT_INSTALL_DOCS to pick up e.g. global
includes, instead of using relative paths. Qt modules will automatically
get a doc target that builds and installs into the right place (including
supporting shadow-builds) if they set QMAKE_DOCS before loading(qt_module).
Change-Id: Ia408385199e56e3ead0afa45645a059d1a8b0d48
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This reverts commit 101d04681f.
That change seems to have introduced a few regressions, and
Creator hits an assertion that it introduced because it assumes
the additionalFormats consists of well-formed ranges
(QTCREATORBUG-7995).
Change-Id: Ic4ae761e6e7f6df8a6b5ca565ceb250647420c15
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Q*Validator classes are not in QtWidgets,
so move them where they should stay.
Change-Id: Ie6ea45a026e640fad131002bc9762c575235f3f4
Reviewed-by: David Faure <david.faure@kdab.com>
There are now two different ways to implement synchronous
event processing. The platform plugins can choose which
one to use.
1) flushWindowSystemEvents()
Use to flush the event queue at one point, making
preceding calls synchronous.
2) setSynchronousWindowsSystemEvents(bool enable)
Makes all handle* functions synchronous, bypassing
the event queue completely.
Change-Id: I020b80c731fd13f855a377d7c91d06a4e39b6a0b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Do not access GtkWidget::style directly, it doesn't exist in GTK3.
Change-Id: I947776848f5dd64011a40446fcdb9079f295f182
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
This is a regression because we made QStackedWidget actually
support heightForWidth in 4.8. This was done with change
4780f94e391b5e881497c5228661dead42c821fa.
The problem was that heightForWidth was not calculated correctly
because some of the pages were hidden. The hidden pages were
actually not contributing to the hfw of the QStackedWidget at all.
This again caused the QStackedWidget to change its heightForWidth()
value when the current tab changed, which again could cause "jumps"
in the UI when switching tabs (as demonstrated in the task).
The problem was that the patch relied on calling
QWidgetItem::heightForWidth(), and this function would return -1
if the widget was hidden. However, QWidget::heightForWidth() does
not have this magic and returns the proper hfw value regardless
of its visibility.
One could argue about the correctness of this patch, but since
QStackedLayout::sizeHint() disregards QWidgetItem::sizeHint() (it
asks the widget directly), we do the same in
QStackedLayoutHFW::heightForWidth() for consistency.
In addition, QStackedLayout enforces that only widgets can be added
to it, and you cannot add your own QLayoutItem subclasses to it:
qWarning("QStackedLayout::addItem: Only widgets can be added");
Task-id: QTBUG-24758
Change-Id: I349cf8f4215e4581ea237ef773d53dcdf3db176b
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
that will be returned by boundaryReasons() when the boundary finder
is at the line end position (CR, LF, NewLine Function, End of Text, etc.).
The MandatoryBreak flag, if set, means the text should be wrapped at a given position.
Change-Id: I32d4f570935d2e015bfc5f18915396a15f009fde
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This guarantees one will never get `!img.isNull()` after
load()/loadFromData() has failed, even if the image was
not null before.
Apply the same fix to QPixmap and QPicture.
Change-Id: Ida1ad6a6f0fc830df8e75ada0c163fc2d3360dea
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Added ThemeHint::TabAllWidgets as a mean to access that platform
specific bool. The default implementation returns always true when
querying QPlatformTheme::themeHint().
Several auto-tests had to be updated to reflect for qt_tab_all_widgets'
type change. One XFAIL removed from tst_QApplication::focusChanged().
Task-number: QTBUG-24372
Change-Id: Ie1f0486c19898fe54c53aa4a27e378485075e512
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
The tst_QApplication::args() auto-test sets the style to windows style
but there is no way to reset the style back to the native one. This
makes tst_QApplication::focusChanged() fail on Mac in some cases,
since not all the styles respond the same way to tab vs. strong
focus changes.
Change-Id: I91e39c1dd0fad4d90f3a13ab50a5e9758922ac28
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>