Merge integration refs/builds/qtci/dev/1617702467

This commit is contained in:
Qt CI Bot 2021-04-06 14:51:16 +00:00
commit 604087361c
4 changed files with 47 additions and 6 deletions

View File

@ -246,13 +246,13 @@ template <bool IsTimed> bool futexSemaphoreTryAcquire(QBasicAtomicInteger<quintp
// we need to wait
quintptr oneWaiter = quintptr(Q_UINT64_C(1) << 32); // zero on 32-bit
if (futexHasWaiterCount) {
// increase the waiter count
u.fetchAndAddRelaxed(oneWaiter);
// We don't use the fetched value from above so futexWait() fails if
// it changed after the testAndSetOrdered above.
if ((quint64(curValue) >> 32) == 0x7fffffff)
return false; // overflow!
// increase the waiter count
u.fetchAndAddRelaxed(oneWaiter);
curValue += oneWaiter;
// Also adjust nn to subtract oneWaiter when we succeed in acquiring.

View File

@ -132,9 +132,16 @@ public:
class iterator {
T *i = nullptr;
public:
using iterator_category = std::random_access_iterator_tag;
using difference_type = qsizetype;
using value_type = T;
// libstdc++ shipped with gcc < 11 does not have a fix for defect LWG 3346
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
using iterator_category = std::contiguous_iterator_tag;
#else
using iterator_category = std::random_access_iterator_tag;
#endif
using element_type = value_type;
using pointer = T *;
using reference = T &;
@ -167,9 +174,15 @@ public:
class const_iterator {
const T *i = nullptr;
public:
using iterator_category = std::random_access_iterator_tag;
using difference_type = qsizetype;
using value_type = T;
// libstdc++ shipped with gcc < 11 does not have a fix for defect LWG 3346
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
using iterator_category = std::contiguous_iterator_tag;
#else
using iterator_category = std::random_access_iterator_tag;
#endif
using element_type = const value_type;
using pointer = const T *;
using reference = const T &;

View File

@ -3542,7 +3542,8 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
if (btn->features & QStyleOptionButton::HasMenu) {
QRenderRule subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator);
QRect ir = positionRect(w, rule, subRule, PseudoElement_PushButtonMenuIndicator, opt->rect, opt->direction);
QRect ir = positionRect(w, rule, subRule, PseudoElement_PushButtonMenuIndicator,
baseStyle()->subElementRect(SE_PushButtonBevel, btn, w), opt->direction);
if (subRule.hasDrawable()) {
subRule.drawRule(p, ir);
} else {
@ -5855,6 +5856,13 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
case SE_PushButtonBevel:
case SE_PushButtonFocusRect:
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
if (btn->features & QStyleOptionButton::HasMenu
&& hasStyleRule(w, PseudoElement_PushButtonMenuIndicator)) {
QStyleOptionButton btnOpt(*btn);
btnOpt.features &= ~QStyleOptionButton::HasMenu;
return rule.baseStyleCanDraw() ? baseStyle()->subElementRect(se, &btnOpt, w)
: QWindowsStyle::subElementRect(se, &btnOpt, w);
}
if (rule.hasBox() || !rule.hasNativeBorder()) {
return visualRect(opt->direction, opt->rect, se == SE_PushButtonBevel
? rule.borderRect(opt->rect)

View File

@ -33,6 +33,26 @@
#include <QScopedValueRollback>
#include <qlist.h>
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
# if __has_include(<concepts>)
# include <concepts>
# if defined(__cpp_concepts)
static_assert(std::contiguous_iterator<QList<int>::iterator>);
static_assert(std::contiguous_iterator<QList<int>::const_iterator>);
# endif
# endif
# if __has_include(<ranges>)
# include <ranges>
# if defined(__cpp_lib_ranges)
namespace rns = std::ranges;
static_assert(rns::contiguous_range<QList<int>>);
static_assert(rns::contiguous_range<const QList<int>>);
# endif
# endif
#endif
struct Movable {
Movable(char input = 'j')
: i(input)