Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
KCalc
Commits
76b445dd
Commit
76b445dd
authored
Dec 22, 2021
by
Laurent Montel
😁
Browse files
Fix some compile error against qt6
parent
c4f231b1
Pipeline
#113286
passed with stage
in 47 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bitbutton.cpp
View file @
76b445dd
...
...
@@ -112,9 +112,16 @@ const QSize& BitButton::renderSize() const
// Name: enterEvent
// Desc: sets to true the "over" variable on Enter event
//------------------------------------------------------------------------------
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void
BitButton
::
enterEvent
(
QEnterEvent
*
event
)
#else
void
BitButton
::
enterEvent
(
QEvent
*
event
)
#endif
{
if
(
event
->
type
()
==
QEvent
::
Enter
)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if
(
event
->
type
()
==
QEvent
::
Enter
)
#endif
{
over_
=
true
;
update
();
}
...
...
bitbutton.h
View file @
76b445dd
...
...
@@ -24,7 +24,11 @@ protected:
void
paintEvent
(
QPaintEvent
*
event
)
override
;
private:
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void
enterEvent
(
QEnterEvent
*
event
)
override
;
#else
void
enterEvent
(
QEvent
*
event
)
override
;
#endif
void
leaveEvent
(
QEvent
*
event
)
override
;
bool
on_
=
false
;
bool
over_
=
false
;
...
...
kcalc.cpp
View file @
76b445dd
...
...
@@ -21,7 +21,6 @@
#include <QShortcut>
#include <QStyle>
#include <kxmlgui_version.h>
#include <KAboutData>
#include <KAcceleratorManager>
#include <KActionCollection>
...
...
@@ -2214,7 +2213,11 @@ void KCalculator::showLogicButtons(bool toggled)
}
// Hide Hex-Buttons, but first switch back to decimal
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
decRadio
->
animateClick
();
#else
decRadio
->
animateClick
(
0
);
#endif
const
auto
buttons
=
base_choose_group_
->
buttons
();
for
(
QAbstractButton
*
btn
:
buttons
)
{
...
...
@@ -2677,7 +2680,11 @@ void KCalculator::setPrecision()
void
KCalculator
::
setAngle
()
{
if
(
QAbstractButton
*
const
btn
=
angle_choose_group_
->
button
(
KCalcSettings
::
angleMode
()))
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
btn
->
animateClick
();
#else
btn
->
animateClick
(
0
);
#endif
}
}
...
...
@@ -2688,7 +2695,11 @@ void KCalculator::setAngle()
void
KCalculator
::
setBase
()
{
if
(
QAbstractButton
*
const
btn
=
base_choose_group_
->
button
(
KCalcSettings
::
baseMode
()))
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
btn
->
animateClick
();
#else
btn
->
animateClick
(
0
);
#endif
}
}
...
...
@@ -2807,17 +2818,17 @@ int main(int argc, char *argv[])
QApplication
app
(
argc
,
argv
);
KLocalizedString
::
setApplicationDomain
(
"kcalc"
);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/**
* enable high dpi support
*/
app
.
setAttribute
(
Qt
::
AA_UseHighDpiPixmaps
,
true
);
KCrash
::
initialize
();
Kdelibs4ConfigMigrator
migrate
(
QStringLiteral
(
"kcalc"
));
migrate
.
setConfigFiles
(
QStringList
()
<<
QStringLiteral
(
"kcalcrc"
));
migrate
.
setUiFiles
(
QStringList
()
<<
QStringLiteral
(
"kcalcui.rc"
));
migrate
.
migrate
();
#endif
KCrash
::
initialize
();
KAboutData
aboutData
(
QStringLiteral
(
"kcalc"
),
i18n
(
"KCalc"
),
QStringLiteral
(
KCALC_VERSION_STRING
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment