making clazy happier
This commit is contained in:
parent
b754afbc87
commit
3504525840
@ -123,7 +123,7 @@ public:
|
||||
|
||||
const QFontMetricsF fm( effectiveFont( Text ) );
|
||||
|
||||
for ( auto entry : m_values )
|
||||
for ( const auto& entry : m_values )
|
||||
m_maxWidth = qMax( m_maxWidth, fm.width( entry.first ) );
|
||||
|
||||
const QMarginsF padding = marginsHint( Cell | Padding );
|
||||
|
@ -15,14 +15,12 @@ RCC_DIR = rcc
|
||||
|
||||
QSK_CONFIG += QskDll
|
||||
|
||||
linux-g++ | linux-g++-64 {
|
||||
|
||||
# CONFIG += separate_debug_info
|
||||
|
||||
# --- optional warnings
|
||||
linux {
|
||||
|
||||
pedantic {
|
||||
|
||||
DEFINES += QT_STRICT_ITERATORS
|
||||
|
||||
# Qt headers do not stand pedantic checks, so it's better
|
||||
# to exclude them by declaring them as system includes
|
||||
|
||||
@ -30,8 +28,20 @@ linux-g++ | linux-g++-64 {
|
||||
-isystem $$[QT_INSTALL_HEADERS] \
|
||||
-isystem $$[QT_INSTALL_HEADERS]/QtCore \
|
||||
-isystem $$[QT_INSTALL_HEADERS]/QtGui \
|
||||
-isystem $$[QT_INSTALL_HEADERS]/QtGui/$$[QT_VERSION]/QtGui/private \
|
||||
-isystem $$[QT_INSTALL_HEADERS]/QtQuick \
|
||||
-isystem $$[QT_INSTALL_HEADERS]/QtQuick/$$[QT_VERSION]/QtQuick/private \
|
||||
-isystem $$[QT_INSTALL_HEADERS]/QtQml
|
||||
}
|
||||
}
|
||||
|
||||
linux-g++ | linux-g++-64 {
|
||||
|
||||
# CONFIG += separate_debug_info
|
||||
|
||||
# --- optional warnings
|
||||
|
||||
pedantic {
|
||||
|
||||
QMAKE_CXXFLAGS *= -pedantic-errors
|
||||
QMAKE_CXXFLAGS *= -Wextra
|
||||
@ -55,8 +65,6 @@ linux-g++ | linux-g++-64 {
|
||||
}
|
||||
}
|
||||
|
||||
DEFINES += QT_STRICT_ITERATORS
|
||||
|
||||
# --- optional debug options
|
||||
|
||||
QMAKE_CXXFLAGS_DEBUG *= -fsanitize=address -fno-omit-frame-pointer
|
||||
|
@ -622,19 +622,13 @@ void QskControl::setBackground( const QskGradient& gradient )
|
||||
using namespace QskAspect;
|
||||
const Aspect aspect = Control | Color;
|
||||
|
||||
if ( autoFillBackground() )
|
||||
{
|
||||
if ( hintTable().gradient( aspect ) != gradient )
|
||||
{
|
||||
setGradientHint( aspect, gradient );
|
||||
|
||||
// might be wrong, when the effective gradient was from the skin
|
||||
update();
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( hintTable().gradient( aspect ) != gradient )
|
||||
{
|
||||
setGradientHint( aspect, gradient );
|
||||
if ( autoFillBackground() )
|
||||
update();
|
||||
|
||||
Q_EMIT backgroundChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@ -645,20 +639,12 @@ void QskControl::resetBackground()
|
||||
|
||||
auto& table = hintTable();
|
||||
|
||||
if ( autoFillBackground() )
|
||||
{
|
||||
const auto oldGradient = gradientHint( aspect );
|
||||
|
||||
if ( table.hint( aspect ).isValid() )
|
||||
{
|
||||
table.removeHint( aspect );
|
||||
if ( gradientHint( aspect ) != oldGradient )
|
||||
update();
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( table.hint( aspect ).isValid() )
|
||||
{
|
||||
table.removeHint( aspect );
|
||||
|
||||
update();
|
||||
Q_EMIT backgroundChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1198,7 +1184,8 @@ void QskControl::updatePolish()
|
||||
{
|
||||
const QRectF rect = layoutRect();
|
||||
|
||||
for ( auto child : childItems() )
|
||||
const auto children = childItems();
|
||||
for ( auto child : children )
|
||||
{
|
||||
if ( !QQuickItemPrivate::get( child )->isTransparentForPositioner() )
|
||||
{
|
||||
@ -1334,7 +1321,8 @@ QSizeF QskControl::contentsSizeHint() const
|
||||
|
||||
if ( d_func()->autoLayoutChildren )
|
||||
{
|
||||
for ( const auto child : childItems() )
|
||||
const auto children = childItems();
|
||||
for ( const auto child : children )
|
||||
{
|
||||
if ( auto* control = qobject_cast< const QskControl* >( child ) )
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ class QSK_EXPORT QskControl : public QQuickItem, public QskResizable, public Qsk
|
||||
WRITE setMargins RESET resetMargins NOTIFY marginsChanged )
|
||||
|
||||
Q_PROPERTY( QskGradient background READ background
|
||||
WRITE setBackground RESET resetBackground )
|
||||
WRITE setBackground RESET resetBackground NOTIFY backgroundChanged )
|
||||
|
||||
Q_PROPERTY( QskSizePolicy sizePolicy READ sizePolicy WRITE setSizePolicy )
|
||||
Q_PROPERTY( QSizeF minimumSize READ minimumSize WRITE setMinimumSize )
|
||||
@ -166,6 +166,7 @@ public:
|
||||
QVector< QskAspect::Subcontrol > subControls() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void backgroundChanged();
|
||||
void marginsChanged();
|
||||
void localeChanged( const QLocale& );
|
||||
void controlFlagsChanged();
|
||||
|
@ -29,7 +29,8 @@ static inline void qskBlockDirty( QQuickItem* item, bool on )
|
||||
if ( qskIsUpdateBlocked( item ) )
|
||||
QQuickItemPrivate::get( item )->componentComplete = !on;
|
||||
|
||||
for ( auto child : item->childItems() )
|
||||
const auto children = item->childItems();
|
||||
for ( auto child : children )
|
||||
qskBlockDirty( child, on );
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,8 @@ QObjectList QskObjectTree::childNodes( const QObject* object )
|
||||
|
||||
if ( object == nullptr )
|
||||
{
|
||||
for ( QWindow* window : QGuiApplication::topLevelWindows() )
|
||||
const auto windows = QGuiApplication::topLevelWindows();
|
||||
for ( QWindow* window : windows )
|
||||
children += window;
|
||||
}
|
||||
else if ( object->isWindowType() )
|
||||
|
@ -81,7 +81,8 @@ QStringList Qsk::skinNames()
|
||||
{
|
||||
QStringList names;
|
||||
|
||||
for ( const auto& factory : qskGetFactoryTable() )
|
||||
const auto& factoryTable = qskGetFactoryTable();
|
||||
for ( const auto& factory : factoryTable )
|
||||
{
|
||||
if ( factory )
|
||||
names += factory->skinNames();
|
||||
@ -94,7 +95,8 @@ QskSkin* Qsk::createSkin( const QString& skinName )
|
||||
{
|
||||
if ( !skinName.isEmpty() )
|
||||
{
|
||||
for ( const auto& factory : qskGetFactoryTable() )
|
||||
const auto& factoryTable = qskGetFactoryTable();
|
||||
for ( const auto& factory : factoryTable )
|
||||
{
|
||||
QskSkin* skin = factory->createSkin( skinName );
|
||||
if ( skin )
|
||||
|
@ -755,7 +755,8 @@ void QskSkinnable::setSkinStateFlag( QskAspect::State state, bool on )
|
||||
{
|
||||
const auto placement = effectivePlacement();
|
||||
|
||||
for ( const auto subControl : control->subControls() )
|
||||
const auto subControls = control->subControls();
|
||||
for ( const auto subControl : subControls )
|
||||
{
|
||||
using namespace QskAspect;
|
||||
|
||||
|
@ -149,7 +149,8 @@ QSizeF QskSubWindow::contentsSizeHint() const
|
||||
qreal w = -1;
|
||||
qreal h = -1;
|
||||
|
||||
for ( auto child : childItems() )
|
||||
const auto children = childItems();
|
||||
for ( auto child : children )
|
||||
{
|
||||
if ( isTransparentForPositioner( child ) )
|
||||
continue;
|
||||
|
@ -15,11 +15,11 @@ namespace
|
||||
{
|
||||
setObjectName( QStringLiteral( "QskSelectionSubWindowListBox" ) );
|
||||
|
||||
connect( this, SIGNAL( selectedRowChanged( int ) ),
|
||||
window, SIGNAL( selectedRowChanged( int ) ) );
|
||||
connect( this, SIGNAL( selectedRowChanged(int) ),
|
||||
window, SIGNAL( selectedRowChanged(int) ) );
|
||||
|
||||
connect( this, SIGNAL( selectedEntryChanged( const QString& ) ),
|
||||
window, SIGNAL( selectedEntryChanged( const QString& ) ) );
|
||||
connect( this, SIGNAL( selectedEntryChanged(const QString&) ),
|
||||
window, SIGNAL( selectedEntryChanged(const QString&) ) );
|
||||
|
||||
connect( this, SIGNAL( entriesChanged() ),
|
||||
window, SIGNAL( entriesChanged() ) );
|
||||
|
@ -120,7 +120,8 @@ void SkinnyShortcut::showBackground()
|
||||
|
||||
qskSetup->setControlFlag( QskSetup::DebugForceBackground, forceBackground );
|
||||
|
||||
for ( auto window : QGuiApplication::topLevelWindows() )
|
||||
const auto windows = QGuiApplication::topLevelWindows();
|
||||
for ( auto window : windows )
|
||||
{
|
||||
if ( QskWindow* w = qobject_cast< QskWindow* >( window ) )
|
||||
{
|
||||
@ -188,14 +189,16 @@ static void countItems( const QQuickItem* item, int counter[4] )
|
||||
counter[3] += nodeCounter;
|
||||
}
|
||||
|
||||
for ( const auto* child : item->childItems() )
|
||||
const auto children = item->childItems();
|
||||
for ( const auto* child : children )
|
||||
countItems( child, counter );
|
||||
}
|
||||
}
|
||||
|
||||
void SkinnyShortcut::debugStatistics()
|
||||
{
|
||||
for ( auto window : QGuiApplication::topLevelWindows() )
|
||||
const auto windows = QGuiApplication::topLevelWindows();
|
||||
for ( auto window : windows )
|
||||
{
|
||||
const auto w = qobject_cast< const QQuickWindow* >( window );
|
||||
if ( w == nullptr )
|
||||
|
Loading…
x
Reference in New Issue
Block a user