Skip to content

Commit

Permalink
Merge pull request #487 from KDAB/revert-486-main
Browse files Browse the repository at this point in the history
Revert merging main into 2.1
  • Loading branch information
iamsergio authored Apr 2, 2024
2 parents f91def7 + f24b636 commit 9b80671
Show file tree
Hide file tree
Showing 28 changed files with 34 additions and 284 deletions.
10 changes: 2 additions & 8 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ Checks: '*, -google-*, -objc-*, -llvmlibc-*, -zircon-*,
-readability-use-anyofallof,
-readability-misleading-indentation,
-readability-make-member-function-const,
-readability-inconsistent-declaration-parameter-name,
-readability-else-after-return,
-readability-avoid-unconditional-preprocessor-if,
-readability-simplify-boolean-expr,
-modernize-use-trailing-return-type,
-modernize-use-auto,
-modernize-use-nodiscard,
Expand All @@ -38,14 +34,13 @@ Checks: '*, -google-*, -objc-*, -llvmlibc-*, -zircon-*,
-llvm-include-order,
-llvm-else-after-return,
-fuchsia-*,
-bugprone-narrowing-conversions,
-bugprone-branch-clone,
-readability-inconsistent-declaration-parameter-name,
-readability-else-after-return,
-misc-const-correctness,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-use-anonymous-namespace,
-misc-include-cleaner,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-owning-memory,
Expand All @@ -62,5 +57,4 @@ Checks: '*, -google-*, -objc-*, -llvmlibc-*, -zircon-*,
-cert-err58-cpp,
-bugprone-suspicious-include,
-bugprone-branch-clone
-bugprone-narrowing-conversions,
'
47 changes: 0 additions & 47 deletions .github/workflows/clangcl.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
include:
- os: ubuntu-22.04
preset:
name: ci-clang-tidy-qt6
qt_version: "6.5.*"
name: ci-clang-tidy-qt5
qt_version: "5.15"

- os: ubuntu-22.04
preset:
Expand Down
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Copyright: Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
License: BSD-3-Clause

#artwork
Files: screencap.gif images/* src/img/* docs/api/*.png examples/dockwidgets/assets/*.png src/img/classic_indicators/*.png examples/flutter/assets/*.png src/flutter/dart/assets/classic_indicators/*.png tests/manual/stylesheet/close.png
Files: screencap.gif images/* src/img/* docs/api/*.png examples/dockwidgets/assets/*.png src/img/classic_indicators/*.png examples/flutter/assets/*.png src/flutter/dart/assets/classic_indicators/*.png
Copyright: Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
License: GPL-2.0-only OR GPL-3.0-only

Expand Down
16 changes: 2 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,17 +377,7 @@ macro(set_compiler_flags targetName)
endif()

if(MSVC)
target_compile_options(${targetName} PRIVATE /W4 /WX)
target_link_options(${targetName} PRIVATE /WX)

if(KDDW_FRONTEND_QT AND NOT KDDockWidgets_QT6)
# Silence deprecation warnings in Qt5 headers
target_compile_definitions(${targetName} PUBLIC _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING)
endif()
if(ECM_ENABLE_SANITIZERS)
# Suppresses linker warnings about ASAN being incompatible with incremental linking
target_link_options(${targetName} PUBLIC /INCREMENTAL:NO)
endif()
target_compile_options(${targetName} PRIVATE /W4)
endif()

if(KDDW_FRONTEND_FLUTTER AND NOT MSVC)
Expand All @@ -413,9 +403,7 @@ macro(set_compiler_flags targetName)
endmacro()

if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT APPLE)
OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"
AND NOT APPLE
AND NOT MSVC)
OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT APPLE)
OR (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)
)
# Linker warnings should be treated as errors
Expand Down
7 changes: 3 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,15 +459,14 @@
}
},
{
"name": "ci-clang-tidy-qt6",
"binaryDir": "${sourceDir}/build-clang-tidy-qt6",
"name": "ci-clang-tidy-qt5",
"binaryDir": "${sourceDir}/build-clang-tidy-qt5",
"inherits": [
"release"
],
"cacheVariables": {
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;--warnings-as-errors=*",
"KDDockWidgets_EXAMPLES": "OFF",
"KDDockWidgets_QT6": "ON"
"KDDockWidgets_EXAMPLES": "OFF"
}
},
{
Expand Down
6 changes: 2 additions & 4 deletions cmake/ECM/modules/ECMEnableSanitizers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ macro (enable_sanitizer_flags sanitize_option)
set(XSAN_COMPILE_FLAGS "-fsanitize=leak")
set(XSAN_LINKER_FLAGS "lsan")
elseif (${sanitize_option} MATCHES "undefined")
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
check_compiler_version("4.9" "3.1" "99.99")
set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls")
endif()
check_compiler_version("4.9" "3.1" "99.99")
set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls")
elseif (${sanitize_option} MATCHES "fuzzer")
check_compiler_version("99.99" "6.0" "99.99")
set(XSAN_COMPILE_FLAGS "-fsanitize=fuzzer")
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/misc_impl_details.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We have the following global event filters:
- DockRegistry singleton
Catches expose events to maintain floating window z-order.
Catches clicking on a MDI dock widget, to raise it.
For hiding the auto-hide sidebar overlay when clicking elsewhere.
For hidding the auto-hide sidebar overlay when clicking elsewhere.

- FallbackMouseGrabber
For platforms that don't support grabbing the mouse. Mostly for QtQuick to workaround bugs.
Expand Down
2 changes: 1 addition & 1 deletion examples/dockwidgets/MyViewFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MyTitleBar : public KDDockWidgets::QtWidgets::TitleBar
// Not needed to override. Just here to illustrate setHideDisabledButtons()
void init() override
{
// For demo purposes, we're hiding the close button if it's disabled (non-closable dock widget)
// For demo purposes, we're hidding the close button if it's disabled (non-closable dock widget)
// Affects dock #0 when running: ./bin/qtwidgets_dockwidgets -n -p
m_controller->setHideDisabledButtons(KDDockWidgets::TitleBarButtonType::Close);

Expand Down
1 change: 1 addition & 0 deletions src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static ViewFactory *createDefaultViewFactory()

KDDW_ERROR("No Platform found. Forgot to call KDDockWidgets::initFrontend(<platform>) ?");
std::terminate();
return nullptr;
}

class Config::Private
Expand Down
2 changes: 0 additions & 2 deletions src/core/DragController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,6 @@ bool DragController::onDnDEvent(View *view, Event *e)
if (activeState()->handleDrop(static_cast<DropEvent *>(e), dropArea))
return true;
break;
default:
break;
}
}
} else if (e->type() == Event::DragEnter && isDragging()) {
Expand Down
2 changes: 0 additions & 2 deletions src/core/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ static SideBarLocation sideBarLocationForBorder(Core::LayoutBorderLocations loc)
case Core::LayoutBorderLocation_Horizontals:
case Core::LayoutBorderLocation_None:
break;
default:
break;
}

return SideBarLocation::None;
Expand Down
1 change: 1 addition & 0 deletions src/core/WindowZOrder_x11_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static Core::Window::List orderedWindows(bool &ok)
{
KDDW_UNUSED(ok);
Q_UNREACHABLE();
return {};
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/core/layouting/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2081,10 +2081,10 @@ void ItemBoxContainer::Private::resizeChildren(Size oldSize, Size newSize,

const Vector<double> childPercentages = this->childPercentages();
const auto count = childSizes.count();
const bool widthDidChange = oldSize.width() != newSize.width();
const bool heightDidChange = oldSize.height() != newSize.height();
const bool lengthDidChange =
(q->isVertical() && heightDidChange) || (q->isHorizontal() && widthDidChange);
const bool widthChanged = oldSize.width() != newSize.width();
const bool heightChanged = oldSize.height() != newSize.height();
const bool lengthChanged =
(q->isVertical() && heightChanged) || (q->isHorizontal() && widthChanged);
const int totalNewLength = q->usableLength();

if (strategy == ChildrenResizeStrategy::Percentage) {
Expand All @@ -2099,7 +2099,7 @@ void ItemBoxContainer::Private::resizeChildren(Size oldSize, Size newSize,
SizingInfo &itemSize = childSizes[i];

const double childPercentage = childPercentages.at(i);
const int newItemLength = lengthDidChange
const int newItemLength = lengthChanged
? (isLast ? remaining : int(childPercentage * totalNewLength))
: itemSize.length(m_orientation);

Expand Down
3 changes: 1 addition & 2 deletions src/qtcommon/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ bool Platform_qt::supportsAeroSnap() const
#if defined(Q_OS_WIN)
// Aero-snap requires Windows 10
return QOperatingSystemVersion::current().majorVersion() >= 10;
#else
return false;
#endif
return false;
}
2 changes: 0 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ if(KDDW_FRONTEND_QTWIDGETS)
_add_test(tst_qtwidgets)
add_subdirectory(manual/qtwidgets_leaks)
add_subdirectory(manual/qdockwidget)
add_subdirectory(manual/qmdiarea)
add_subdirectory(manual/stylesheet)
endif()

# tst_qtquick
Expand Down
1 change: 0 additions & 1 deletion tests/includes_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ endif()

add_executable(includes_test main.cpp)
target_link_libraries(includes_test PRIVATE KDAB::kddockwidgets)
set_compiler_flags(includes_test)
4 changes: 2 additions & 2 deletions tests/includes_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// Tests that the includes are installed

#ifdef KDDW_FRONTEND_QTWIDGETS
#if KDDW_FRONTEND_QTWIDGETS
#include <kddockwidgets/qtwidgets/Platform.h>
#include <kddockwidgets/qtwidgets/ViewFactory.h>
#include <kddockwidgets/qtwidgets/views/ClassicIndicatorsWindow.h>
Expand All @@ -30,7 +30,7 @@
#include <kddockwidgets/qtwidgets/views/View.h>
#endif

#ifdef KDDW_FRONTEND_QTQUICK
#if KDDW_FRONTEND_QTQUICK
#include <kddockwidgets/qtquick/Action.h>
#include <kddockwidgets/qtquick/Platform.h>
#include <kddockwidgets/qtquick/ViewFactory.h>
Expand Down
21 changes: 0 additions & 21 deletions tests/manual/qmdiarea/CMakeLists.txt

This file was deleted.

35 changes: 0 additions & 35 deletions tests/manual/qmdiarea/main.cpp

This file was deleted.

31 changes: 0 additions & 31 deletions tests/manual/stylesheet/CMakeLists.txt

This file was deleted.

Binary file removed tests/manual/stylesheet/close.png
Binary file not shown.
Loading

0 comments on commit 9b80671

Please sign in to comment.