Qt 5.6 compatibility
This commit is contained in:
parent
bb1857dac4
commit
3485709ea3
|
@ -48,6 +48,7 @@
|
||||||
#include <QskSetup.h>
|
#include <QskSetup.h>
|
||||||
#include <QskSkin.h>
|
#include <QskSkin.h>
|
||||||
#include <QskTextLabel.h>
|
#include <QskTextLabel.h>
|
||||||
|
#include <QskQuick.h>
|
||||||
|
|
||||||
#include "kirigami/shadowedrectangle.h"
|
#include "kirigami/shadowedrectangle.h"
|
||||||
|
|
||||||
|
@ -101,7 +102,7 @@ void ShadowPositioner::updateLayout()
|
||||||
for( int i = 0; i < m_rectangles.count(); ++i )
|
for( int i = 0; i < m_rectangles.count(); ++i )
|
||||||
{
|
{
|
||||||
auto* item = m_gridBox->itemAtIndex( i );
|
auto* item = m_gridBox->itemAtIndex( i );
|
||||||
m_rectangles[i]->setSize( item->size() );
|
m_rectangles[i]->setSize( qskItemSize( item ) );
|
||||||
m_rectangles[i]->setPosition( mainContent->itemAtIndex( 1 )->position() + item->position() );
|
m_rectangles[i]->setPosition( mainContent->itemAtIndex( 1 )->position() + item->position() );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -95,7 +95,7 @@ MenuBar::MenuBar( QQuickItem* parent ) : QskLinearBox( Qt::Vertical, parent )
|
||||||
|
|
||||||
m_entryStrings = { "Dashboard", "Rooms", "Devices", "Statistics", "Storage", "Members" };
|
m_entryStrings = { "Dashboard", "Rooms", "Devices", "Statistics", "Storage", "Members" };
|
||||||
|
|
||||||
for( const auto& entryString : qAsConst( m_entryStrings ) )
|
for( const auto& entryString : qskAsConst( m_entryStrings ) )
|
||||||
{
|
{
|
||||||
auto* entry = new MenuItem( entryString, this );
|
auto* entry = new MenuItem( entryString, this );
|
||||||
m_entries.append( entry );
|
m_entries.append( entry );
|
||||||
|
|
|
@ -52,18 +52,18 @@ HEADERS += \
|
||||||
nodes/DiagramSegmentsNode.h
|
nodes/DiagramSegmentsNode.h
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
kirigami/shadowedrectangle.h \
|
kirigami/shadowedrectangle.h \
|
||||||
kirigami/scenegraph/paintedrectangleitem.h \
|
kirigami/scenegraph/paintedrectangleitem.h \
|
||||||
kirigami/scenegraph/shadowedborderrectanglematerial.h \
|
kirigami/scenegraph/shadowedborderrectanglematerial.h \
|
||||||
kirigami/scenegraph/shadowedrectanglematerial.h \
|
kirigami/scenegraph/shadowedrectanglematerial.h \
|
||||||
kirigami/scenegraph/shadowedrectanglenode.h
|
kirigami/scenegraph/shadowedrectanglenode.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
kirigami/shadowedrectangle.cpp \
|
kirigami/shadowedrectangle.cpp \
|
||||||
kirigami/scenegraph/paintedrectangleitem.cpp \
|
kirigami/scenegraph/paintedrectangleitem.cpp \
|
||||||
kirigami/scenegraph/shadowedborderrectanglematerial.cpp \
|
kirigami/scenegraph/shadowedborderrectanglematerial.cpp \
|
||||||
kirigami/scenegraph/shadowedrectanglematerial.cpp \
|
kirigami/scenegraph/shadowedrectanglematerial.cpp \
|
||||||
kirigami/scenegraph/shadowedrectanglenode.cpp
|
kirigami/scenegraph/shadowedrectanglenode.cpp
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
images.qrc \
|
images.qrc \
|
||||||
|
|
|
@ -59,7 +59,7 @@ void ShadowedBorderRectangleShader::updateState(const QSGMaterialShader::RenderS
|
||||||
|
|
||||||
auto p = program();
|
auto p = program();
|
||||||
|
|
||||||
if (!oldMaterial || newMaterial->compare(oldMaterial) != 0 || state.isCachedMaterialDataDirty()) {
|
if (!oldMaterial || newMaterial->compare(oldMaterial) != 0 ) {
|
||||||
auto material = static_cast<ShadowedBorderRectangleMaterial *>(newMaterial);
|
auto material = static_cast<ShadowedBorderRectangleMaterial *>(newMaterial);
|
||||||
p->setUniformValue(m_borderWidthLocation, material->borderWidth);
|
p->setUniformValue(m_borderWidthLocation, material->borderWidth);
|
||||||
p->setUniformValue(m_borderColorLocation, material->borderColor);
|
p->setUniformValue(m_borderColorLocation, material->borderColor);
|
||||||
|
|
|
@ -77,7 +77,7 @@ void ShadowedRectangleShader::updateState(const QSGMaterialShader::RenderState&
|
||||||
p->setUniformValue(m_opacityLocation, state.opacity());
|
p->setUniformValue(m_opacityLocation, state.opacity());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!oldMaterial || newMaterial->compare(oldMaterial) != 0 || state.isCachedMaterialDataDirty()) {
|
if (!oldMaterial || newMaterial->compare(oldMaterial) != 0 ) {
|
||||||
auto material = static_cast<ShadowedRectangleMaterial *>(newMaterial);
|
auto material = static_cast<ShadowedRectangleMaterial *>(newMaterial);
|
||||||
p->setUniformValue(m_aspectLocation, material->aspect);
|
p->setUniformValue(m_aspectLocation, material->aspect);
|
||||||
p->setUniformValue(m_sizeLocation, material->size);
|
p->setUniformValue(m_sizeLocation, material->size);
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
#include "shadowedrectangle.h"
|
#include "shadowedrectangle.h"
|
||||||
|
|
||||||
#include <QQuickWindow>
|
#include <QQuickWindow>
|
||||||
#include <QSGRendererInterface>
|
|
||||||
#include <QSGRectangleNode>
|
|
||||||
|
|
||||||
#include "scenegraph/shadowedrectanglenode.h"
|
#include "scenegraph/shadowedrectanglenode.h"
|
||||||
#include "scenegraph/paintedrectangleitem.h"
|
#include "scenegraph/paintedrectangleitem.h"
|
||||||
|
@ -284,7 +282,7 @@ void ShadowedRectangle::componentComplete()
|
||||||
|
|
||||||
bool ShadowedRectangle::isSoftwareRendering() const
|
bool ShadowedRectangle::isSoftwareRendering() const
|
||||||
{
|
{
|
||||||
return window() && window()->rendererInterface()->graphicsApi() == QSGRendererInterface::Software;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PaintedRectangleItem* ShadowedRectangle::softwareItem() const
|
PaintedRectangleItem* ShadowedRectangle::softwareItem() const
|
||||||
|
|
Loading…
Reference in New Issue