Commit graph

7858 commits

Author SHA1 Message Date
Ivailo Monev
f644e07423 remove most of the QTextStream manipulators and the ambiguous void pointer operator
most of them are unused since QTextStream is used mostly for streaming to
QFile, besides that the streaming of void pointer could result in streaming
in std::endl function pointer address or some other non-sense

I will not gut-out QTextStream yet (not in this release cycle) because I
know for a fact such change will break things that use the declarative
component (such as plasma and its applets due to nan/inf compat code in
QTextStream)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-24 00:17:33 +02:00
Ivailo Monev
1681ba3f1e test QTextConverter::hasFailure() in QTextCodec test
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 19:08:52 +02:00
Ivailo Monev
b0949ee6c5 call UCNV_FROM_U_CALLBACK_SUBSTITUTE() and UCNV_TO_U_CALLBACK_SUBSTITUTE() with NULL as context
what a surprise it is to learn that both function replace characters only
in some cases (when context is NULL or some internally set context)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 19:01:45 +02:00
Ivailo Monev
c5ef2e33dd someone's typo
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 04:36:08 +02:00
Ivailo Monev
7063791884 copy the other object position from QTextBoundaryFinder copy-constructor
as done by the assignment operator

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 02:15:21 +02:00
Ivailo Monev
ad9656b27c QTextBoundaryFinder documentation review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 02:12:23 +02:00
Ivailo Monev
9d4033f0d7 remove unused HB_MIN(), HB_MAX() and HB_FIXED_CONSTANT() macros defined in qharfbuz_p header
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 01:44:55 +02:00
Ivailo Monev
c97ba32a27 QEasingCurve::valueForProgress() optimization
doing qreal (either float or double) math on demand is much more optimal,
also reducing the switches to one is a bonus

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 01:12:29 +02:00
Ivailo Monev
e62b8d4fdf QEasingCurve::InCurve, QEasingCurve::OutCurve, QEasingCurve::SineCurve and QEasingCurve::CosineCurve are deffinetly not internal
used by plasma system-monitor applet for example

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 00:54:18 +02:00
Ivailo Monev
791e945fa4 QEasingCurve documentation review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 00:49:24 +02:00
Ivailo Monev
915fcec751 call FatalSignalHandler constructor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 00:34:53 +02:00
Ivailo Monev
2991e926c7 QOpacityEffect review
by starting the elapsed timer just before the fade timer the opacity
transition will be smoother at the start of the effect

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-23 00:24:22 +02:00
Ivailo Monev
69f22fa639 explicitly convert the elapsed time to double
QElapsedTimer::elapsed() returns qint64 btw

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 20:42:18 +02:00
Ivailo Monev
628f139f18 do not send move and resize events to the widget from qFadeEffect()
the position and size of the widget matter not to the effect

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 20:37:06 +02:00
Ivailo Monev
be2a5463e1 drop effects other than fade
QComboBox animation was essentially non-operational (see
5b5fbca2ed), UI_AnimateToolBox was just
reserved and unused . there is fade effect for QMenu and QToolTip so
the relevant effect is there

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 19:41:25 +02:00
Ivailo Monev
07beadf0c6 QOpacityEffect optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 19:02:50 +02:00
Ivailo Monev
62ce7f100c set the global static variables before deleting the effect instances in qScrollEffect() and qFadeEffect()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 16:16:53 +02:00
Ivailo Monev
fe5c3dd679 snapshot the widget as QImage from QRollEffect
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 16:15:52 +02:00
Ivailo Monev
01949644ea remove declaration of now non-existing QRollEffect::run() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 16:15:03 +02:00
Ivailo Monev
5b5fbca2ed actually animate QComboBox
for some reason the code for it was Q_WS_WIN && !QT_NO_EFFECTS guarded and
I purged Q_WS_WIN code programatically

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 16:00:31 +02:00
Ivailo Monev
ca9b9f0f48 merge QRollEffect::run() into QRollEffect constructor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 15:28:10 +02:00
Ivailo Monev
1a9e2e3c36 cancel the opacity/fade effect when the widget is destroyed
widgets are supposed to call qFadeEffect(0) to cancel the effect but just
in case

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 03:07:43 +02:00
Ivailo Monev
f7ca08a3ef fade effect class rewrite to not use QWidget and event filter
since the effect sets a X11 window property the only thing it has to care
about is if the widget pointer is valid and the elapsed time. moving,
resizing the widget, etc. do not matter

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 01:57:29 +02:00
Ivailo Monev
427396074d remove unused graphics effects feature
doubles as performance optimzation

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-22 00:46:40 +02:00
Ivailo Monev
edfe07176e trc man page correction
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-21 23:19:08 +02:00
Ivailo Monev
a324f5a0a7 apply style from settings only if it is not empty and the style override is empty from QApplicationPrivate::x11_apply_settings()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-21 20:49:50 +02:00
Ivailo Monev
084254903c QApplication::setStyle() documentation update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-21 20:40:20 +02:00
Ivailo Monev
ff44266b32 optimize QAlphaWidget (fade effect) further by using window opacity
relies solely on the compositor for it and assumes window opacity is not
set by the user, Katana has animation override
(_KDE_NET_WM_SKIP_CLOSE_ANIMATION X11 atom) and the Katie fade effect
should probably have such (or just check if the opacity value is not 1.0
before running the effect) because effects may overlap with window manager
/compositor effects resulting in all sort of bad things

for that reason I am considering dropping the effects that alter the way
windows/widgets show, hide, are moved, etc. altogether and leaving that
to the window manager/compositor. effects such as colorization of pixmap
and grayscaling (used in QIcon) however are unlikely to be removed

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-21 03:29:52 +02:00
Ivailo Monev
578ce10db0 optimize QAlphaWidget by avoiding QImage to QPixmap conversion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-21 02:49:32 +02:00
Ivailo Monev
4f8d95dc5a use icons from the system in scripttools component
less static data in the library and better looks - can't go wrong with that

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-21 00:27:55 +02:00
Ivailo Monev
a9eb15290e remove unused scripttools component images
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-21 00:04:36 +02:00
Ivailo Monev
11c9b31c4a remove unused qicon header inclusion in qscriptbreakpointsmodel source file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 23:44:48 +02:00
Ivailo Monev
33e1d3acb3 correct indendation in QKeyMapper::translateKeyEvent()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 23:44:23 +02:00
Ivailo Monev
12cdb0eb8f fix ODR-violation in md5c and sha2 source files
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 23:35:48 +02:00
Ivailo Monev
2fbec65fcb remove qbitmap source file from the unity exclude list
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 23:34:46 +02:00
Ivailo Monev
431e81946b simplify QKeyMapper::clearMappings() and do not use the cached locale codec
since it is known what locale the X11 input method uses it is redundant to
verify that via XLocaleOfIM() (unless X11 fails to detect what locale is
set for some strange reason).

also not using the cached codec returned by QTextCodec::codecForLocale()
because the locale may change at any time (either environment variable
change or just plain setlocale() call as was done by KCatalog as gettext
workaround) and QKeyMapper has to reflect such changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 23:03:07 +02:00
Ivailo Monev
d7676fe5a8 QFontDatabase optimizations
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 21:24:55 +02:00
Ivailo Monev
7fa87f98e0 do not set the internal QApplicationPrivate::styleOverride from QApplicationPrivate::x11_apply_settings()
the style name is either from the settings or the platform plugin, not from
-style argument

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 18:55:27 +02:00
Ivailo Monev
abb9e71280 show preview even of the desktop style
the desktop style is now determined by QT_PLATFORM_PLUGIN and
DESKTOP_SESSION environment variables with fallback to cleanlooks style so
even if it is the fallback style there is something to show but if it is
not the fallback the user will be able to preview the style chosen by
QGuiPlatformPlugin

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 18:51:12 +02:00
Ivailo Monev
07d438624a lock QSettings files via flock()
now QSettings will behave much like opening a file via open() and the like,
see the QFile hijack test case

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 17:51:00 +02:00
Ivailo Monev
71e7c743d8 add QSidebar test
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 16:29:29 +02:00
Ivailo Monev
39ca7d62e0 effectively revert c3c697ea5b
it being static means its destruction will be delayed until exit and it
holds shared data references the meta types of which may be unregistered by
the time it is destroyed

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 15:57:36 +02:00
Ivailo Monev
0bf1b3d2cf use patternForFont() in getFcPattern() and rename getFcPattern()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 14:30:34 +02:00
Ivailo Monev
0b1c43e52b fix regression since 81cc260944
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 03:10:27 +02:00
Ivailo Monev
4e1d48fa13 build fix for the case when QT_NO_TEMPORARYFILE is defined
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 00:34:47 +02:00
Ivailo Monev
73133d024b QT_NO_WIZARD config option is no longer broken
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-19 23:19:16 +02:00
Ivailo Monev
392f9eabf8 adjust expected result in QFontDatabase test case
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-19 22:55:07 +02:00
Ivailo Monev
f0e7d43b37 query all fonts to get the styles for font family from QFontDatabase::styles()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-20 00:37:33 +02:00
Ivailo Monev
d83fe65a52 check if qt_x11Data pointer is valid before using its members from QFontDatabase
qt_x11Data pointer is valid only if QApplication instance is created, fixes
possible crashes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-19 23:49:13 +02:00
Ivailo Monev
51bb046646 remove now unused QFontFamily struct
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-19 21:29:08 +02:00