Skip to content

Commit

Permalink
Fix export symbols for QtDeclarative and QtQuick1.
Browse files Browse the repository at this point in the history
Fix build on Windows and compiler warnings.

Requires 090ee21eac7257644422e35395194e5fd7fb8efa in qtbase.

Change-Id: Ief8da504ccd3e2c2e78644cc9943d685c4302019
Reviewed-on: http://codereview.qt.nokia.com/3988
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
  • Loading branch information
Friedemann Kleint authored and Friedemann Kleint committed Aug 31, 2011
1 parent 20c3575 commit 01335ed
Show file tree
Hide file tree
Showing 67 changed files with 161 additions and 138 deletions.
6 changes: 3 additions & 3 deletions examples/declarative/cppextensions/qwidgets/qwidgets.cpp
Expand Up @@ -40,9 +40,9 @@

#include <QtDeclarative/QDeclarativeExtensionPlugin>
#include <QtDeclarative/qdeclarative.h>
#include <QtGui/QGraphicsProxyWidget>
#include <QtGui/QPushButton>
#include <QDebug>
#include <QtWidgets/QGraphicsProxyWidget>
#include <QtWidgets/QPushButton>
#include <QtCore/QDebug>

class MyPushButton : public QGraphicsProxyWidget
{
Expand Down
2 changes: 1 addition & 1 deletion examples/declarative/cppextensions/qwidgets/qwidgets.pro
@@ -1,6 +1,6 @@
TEMPLATE = lib
CONFIG += qt plugin
QT += declarative
QT += widgets declarative

DESTDIR = QWidgets
TARGET = qmlqwidgetsplugin
Expand Down
2 changes: 1 addition & 1 deletion examples/declarative/minehunt/main.cpp
Expand Up @@ -39,7 +39,7 @@
**
****************************************************************************/

#include <QtGui/QApplication>
#include <QtWidgets/QApplication>
#include <QtQuick1/QDeclarativeView>
#include <QtDeclarative/QDeclarativeContext>
#include <QtDeclarative/QDeclarativeEngine>
Expand Down
2 changes: 1 addition & 1 deletion examples/declarative/minehunt/minehunt.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = minehunt
QT += declarative qtquick1
QT += declarative qtquick1 widgets

# Input
HEADERS += minehunt.h
Expand Down
4 changes: 2 additions & 2 deletions examples/declarative/script/shell/main.cpp
Expand Up @@ -44,7 +44,7 @@
#include <QtCore/qstringlist.h>
#include <QtCore/qscopedpointer.h>

#include <QtGui/qapplication.h>
#include <QtGui/QGuiApplication>

#include <QtDeclarative/qjsengine.h>

Expand Down Expand Up @@ -95,7 +95,7 @@ static void interactive(QJSEngine *eng)

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QGuiApplication app(argc, argv);
QScopedPointer<QJSEngine> eng(new QJSEngine());
{
QJSValue globalObject = eng->globalObject();
Expand Down
2 changes: 1 addition & 1 deletion modules/qt_qmltest.pri
Expand Up @@ -12,6 +12,6 @@ QT.qmltest.libs = $$QT_MODULE_LIB_BASE
QT.qmltest.plugins = $$QT_MODULE_PLUGIN_BASE
QT.qmltest.imports = $$QT_MODULE_IMPORT_BASE
QT.qmltest.depends = declarative testlib
QT.qmltest.DEFINES = QT_DECLARATIVE_LIB
QT.qmltest.DEFINES = QT_QMLTEST_LIB

QT_CONFIG += qmltest
2 changes: 1 addition & 1 deletion modules/qt_qtquick1.pri
Expand Up @@ -12,6 +12,6 @@ QT.qtquick1.libs = $$QT_MODULE_LIB_BASE
QT.qtquick1.plugins = $$QT_MODULE_PLUGIN_BASE
QT.qtquick1.imports = $$QT_MODULE_IMPORT_BASE
QT.qtquick1.depends = declarative
QT.qtquick1.DEFINES = QT_DECLARATIVE_LIB
QT.qtquick1.DEFINES = QT_QTQUICK1_LIB

QT_CONFIG += qtquick1
9 changes: 7 additions & 2 deletions src/3rdparty/javascriptcore/DateMath.cpp
Expand Up @@ -75,6 +75,7 @@
#include <limits>
#include <stdint.h>
#include <time.h>
#include <math.h>

//#if HAVE(SYS_TIME_H)
#if defined(EXISTS_SYS_TIME)
Expand Down Expand Up @@ -340,11 +341,15 @@ static const struct KnownZone {

double timeClip(double t)
{
if (!isfinite(t))
#if defined(_MSC_VER)
if (!_finite(t) || fabs(t) > maxECMAScriptTime)
return NaN;
if (fabs(t) > maxECMAScriptTime)
return t >= 0 ? floor(t) : ceil(t);
#else
if (!isfinite(t) || fabs(t) > maxECMAScriptTime)
return NaN;
return trunc(t);
#endif
}
} // namespace WTF

Expand Down
2 changes: 1 addition & 1 deletion src/declarative/items/context2d/qsgcanvasitem.cpp
Expand Up @@ -264,7 +264,7 @@ QString QSGCanvasItem::toDataURL(const QString& mimeType) const
image.save(&buffer, type.toAscii());
buffer.close();
QString dataUrl = QLatin1String("data:%1;base64,%2");
return dataUrl.arg(mime).arg(ba.toBase64().constData());
return dataUrl.arg(mime).arg(QString::fromAscii(ba.toBase64()));
}
return QLatin1String("data:,");
}
Expand Down
1 change: 1 addition & 0 deletions src/declarative/items/context2d/qsgcontext2d.cpp
Expand Up @@ -546,6 +546,7 @@ static v8::Handle<v8::Value> ctx2d_valid(v8::Local<v8::String>, const v8::Access


QV8Engine *engine = V8ENGINE_ACCESSOR();
Q_UNUSED(engine)

return v8::Boolean::New(r->context->valid());
}
Expand Down
3 changes: 2 additions & 1 deletion src/declarative/items/context2d/qsgcontext2d_p_p.h
Expand Up @@ -58,7 +58,8 @@

QT_BEGIN_NAMESPACE
class QSGCanvasItem;
struct QSGContext2DWorkerAgent {
class QSGContext2DWorkerAgent {
public:
QSGContext2DWorkerAgent()
:ref(1)
, orig(0)
Expand Down
6 changes: 3 additions & 3 deletions src/declarative/items/qsgcanvas.cpp
Expand Up @@ -252,7 +252,7 @@ void QSGCanvas::exposeEvent(QExposeEvent *)
d->thread->paint();
}

void QSGCanvas::resizeEvent(QResizeEvent *e)
void QSGCanvas::resizeEvent(QResizeEvent *)
{
Q_D(QSGCanvas);
d->thread->resize(size());
Expand All @@ -268,7 +268,7 @@ void QSGCanvas::animationStopped()
d_func()->thread->animationStopped();
}

void QSGCanvas::showEvent(QShowEvent *e)
void QSGCanvas::showEvent(QShowEvent *)
{
Q_D(QSGCanvas);
if (d->vsyncAnimations) {
Expand All @@ -286,7 +286,7 @@ void QSGCanvas::showEvent(QShowEvent *e)
}
}

void QSGCanvas::hideEvent(QHideEvent *e)
void QSGCanvas::hideEvent(QHideEvent *)
{
Q_D(QSGCanvas);
d->thread->stopRendering();
Expand Down
3 changes: 2 additions & 1 deletion src/declarative/items/qsgitemsmodule.cpp
Expand Up @@ -126,7 +126,8 @@ static void qt_sgitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QDeclarativePathPercent>(uri,major,minor,"PathPercent");
qmlRegisterType<QDeclarativePathQuad>(uri,major,minor,"PathQuad");
qmlRegisterType<QSGPathView>(uri,major,minor,"PathView");
qmlRegisterUncreatableType<QSGBasePositioner>(uri,major,minor,"Positioner","Positioner is an abstract type that is only available as an attached property.");
qmlRegisterUncreatableType<QSGBasePositioner>(uri,major,minor,"Positioner",
QStringLiteral("Positioner is an abstract type that is only available as an attached property."));
#ifndef QT_NO_VALIDATOR
qmlRegisterType<QIntValidator>(uri,major,minor,"IntValidator");
qmlRegisterType<QDoubleValidator>(uri,major,minor,"DoubleValidator");
Expand Down
2 changes: 1 addition & 1 deletion src/declarative/items/qsgshadereffect.cpp
Expand Up @@ -417,7 +417,7 @@ void QSGShaderEffect::setSource(const QVariant &var, int index)
QSGItem *item = qobject_cast<QSGItem *>(obj);
if (!item || !item->isTextureProvider()) {
qWarning("ShaderEffect: source uniform [%s] is not assigned a valid texture provider: %s [%s]",
qPrintable(source.name), qPrintable(obj->objectName()), obj->metaObject()->className());
source.name.constData(), qPrintable(obj->objectName()), obj->metaObject()->className());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/declarative/items/qsgtextedit.cpp
Expand Up @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE

DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)

QWidgetPrivate *qt_widget_private(QWidget *widget);
Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget);
/*!
\qmlclass TextEdit QSGTextEdit
\inqmlmodule QtQuick 2
Expand Down
2 changes: 1 addition & 1 deletion src/declarative/items/qsgtextinput.cpp
Expand Up @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE

DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)

QWidgetPrivate *qt_widget_private(QWidget *widget);
Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget);

/*!
\qmlclass TextInput QSGTextInput
Expand Down
2 changes: 1 addition & 1 deletion src/declarative/particles/qsgangleddirection.cpp
Expand Up @@ -102,7 +102,7 @@ QSGAngledDirection::QSGAngledDirection(QObject *parent) :

}

const QPointF &QSGAngledDirection::sample(const QPointF &from)
const QPointF &QSGAngledDirection::sample(const QPointF &)
{
//TODO: Faster
qreal theta = m_angle*CONV - m_angleVariation*CONV + rand()/float(RAND_MAX) * m_angleVariation*CONV * 2;
Expand Down
6 changes: 3 additions & 3 deletions src/declarative/particles/qsgcumulativedirection.cpp
Expand Up @@ -61,10 +61,10 @@ QDeclarativeListProperty<QSGStochasticDirection> QSGCumulativeDirection::directi

const QPointF &QSGCumulativeDirection::sample(const QPointF &from)
{
QPointF ret;
m_ret = QPointF();
foreach (QSGStochasticDirection* dir, m_directions)
ret += dir->sample(from);
return ret;
m_ret += dir->sample(from);
return m_ret;
}

QT_END_NAMESPACE
1 change: 1 addition & 0 deletions src/declarative/particles/qsgcumulativedirection_p.h
Expand Up @@ -60,5 +60,6 @@ class QSGCumulativeDirection : public QSGStochasticDirection
const QPointF &sample(const QPointF &from);
private:
QList<QSGStochasticDirection*> m_directions;
QPointF m_ret;
};
#endif // QSGCUMULATIVEDIRECTION_P_H
2 changes: 1 addition & 1 deletion src/declarative/particles/qsgcustomparticle.cpp
Expand Up @@ -281,7 +281,7 @@ void QSGCustomParticle::setSource(const QVariant &var, int index)
source.item = qobject_cast<QSGItem *>(obj);
if (!source.item || !source.item->isTextureProvider()) {
qWarning("ShaderEffect: source uniform [%s] is not assigned a valid texture provider: %s [%s]",
qPrintable(source.name), qPrintable(obj->objectName()), obj->metaObject()->className());
source.name.constData(), qPrintable(obj->objectName()), obj->metaObject()->className());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/declarative/particles/qsgfollowemitter.cpp
Expand Up @@ -209,7 +209,7 @@ void QSGFollowEmitter::emitWindow(int timeStamp)
const QPointF &speed = m_speed->sample(newPos);
datum->vx = speed.x()
+ m_speed_from_movement * d->vx;
datum->vy = speed.y();
datum->vy = speed.y()
+ m_speed_from_movement * d->vy;

// Particle acceleration
Expand Down
32 changes: 16 additions & 16 deletions src/declarative/particles/qsgimageparticle.cpp
Expand Up @@ -66,7 +66,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlParticlesDebug, QML_PARTICLES_DEBUG)
//TODO: Make it larger on desktop? Requires fixing up shader code with the same define
#define UNIFORM_ARRAY_SIZE 64

const float CONV = 0.017453292519943295;
const qreal CONV = 0.017453292519943295;
class ImageMaterialData
{
public:
Expand Down Expand Up @@ -99,13 +99,13 @@ class TabledMaterial : public QSGSimpleMaterialShader<TabledMaterialData>
public:
TabledMaterial()
{
QFile vf(":defaultshaders/imagevertex.shader");
QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n")
+ vf.readAll();

QFile ff(":defaultshaders/imagefragment.shader");
QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define TABLE\n#define DEFORM\n#define COLOR\n")
Expand Down Expand Up @@ -167,13 +167,13 @@ class DeformableMaterial : public QSGSimpleMaterialShader<DeformableMaterialData
public:
DeformableMaterial()
{
QFile vf(":defaultshaders/imagevertex.shader");
QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define DEFORM\n#define COLOR\n")
+ vf.readAll();

QFile ff(":defaultshaders/imagefragment.shader");
QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define DEFORM\n#define COLOR\n")
Expand Down Expand Up @@ -223,13 +223,13 @@ class SpriteMaterial : public QSGSimpleMaterialShader<SpriteMaterialData>
public:
SpriteMaterial()
{
QFile vf(":defaultshaders/imagevertex.shader");
QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define SPRITE\n#define TABLE\n#define DEFORM\n#define COLOR\n")
+ vf.readAll();

QFile ff(":defaultshaders/imagefragment.shader");
QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define SPRITE\n#define TABLE\n#define DEFORM\n#define COLOR\n")
Expand Down Expand Up @@ -296,13 +296,13 @@ class ColoredMaterial : public QSGSimpleMaterialShader<ColoredMaterialData>
public:
ColoredMaterial()
{
QFile vf(":defaultshaders/imagevertex.shader");
QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define COLOR\n")
+ vf.readAll();

QFile ff(":defaultshaders/imagefragment.shader");
QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ QByteArray("#define COLOR\n")
Expand All @@ -317,15 +317,15 @@ class ColoredMaterial : public QSGSimpleMaterialShader<ColoredMaterialData>

void activate() {
QSGSimpleMaterialShader<ColoredMaterialData>::activate();
#ifndef QT_OPENGL_ES_2
#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN)
glEnable(GL_POINT_SPRITE);
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
}

void deactivate() {
QSGSimpleMaterialShader<ColoredMaterialData>::deactivate();
#ifndef QT_OPENGL_ES_2
#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN)
glDisable(GL_POINT_SPRITE);
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
Expand Down Expand Up @@ -367,12 +367,12 @@ class SimpleMaterial : public QSGSimpleMaterialShader<SimpleMaterialData>
public:
SimpleMaterial()
{
QFile vf(":defaultshaders/imagevertex.shader");
QFile vf(QStringLiteral(":defaultshaders/imagevertex.shader"));
vf.open(QFile::ReadOnly);
m_vertex_code = QByteArray(SHADER_DEFINES)
+ vf.readAll();

QFile ff(":defaultshaders/imagefragment.shader");
QFile ff(QStringLiteral(":defaultshaders/imagefragment.shader"));
ff.open(QFile::ReadOnly);
m_fragment_code = QByteArray(SHADER_DEFINES)
+ ff.readAll();
Expand All @@ -386,15 +386,15 @@ class SimpleMaterial : public QSGSimpleMaterialShader<SimpleMaterialData>

void activate() {
QSGSimpleMaterialShader<SimpleMaterialData>::activate();
#ifndef QT_OPENGL_ES_2
#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN)
glEnable(GL_POINT_SPRITE);
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
}

void deactivate() {
QSGSimpleMaterialShader<SimpleMaterialData>::deactivate();
#ifndef QT_OPENGL_ES_2
#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN)
glDisable(GL_POINT_SPRITE);
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
Expand Down Expand Up @@ -913,7 +913,7 @@ QSGGeometryNode* QSGImageParticle::buildParticleNodes()
sizetable = QImage(m_sizetable_name.toLocalFile());
opacitytable = QImage(m_opacitytable_name.toLocalFile());
if (colortable.isNull())
colortable = QImage(":defaultshaders/identitytable.png");
colortable = QImage(QStringLiteral(":defaultshaders/identitytable.png"));
Q_ASSERT(!colortable.isNull());
getState<ImageMaterialData>(m_material)->colorTable = sceneGraphEngine()->createTextureFromImage(colortable);
fillUniformArrayFromImage(getState<ImageMaterialData>(m_material)->sizeTable, sizetable, UNIFORM_ARRAY_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion src/declarative/particles/qsgmodelparticle.cpp
Expand Up @@ -213,7 +213,7 @@ void QSGModelParticle::processPending()
m_requests.clear();
}

void QSGModelParticle::commit(int gIdx, int pIdx)
void QSGModelParticle::commit(int /* gIdx */, int /* pIdx */)
{
//No-op unless we start copying the data.
}
Expand Down
4 changes: 2 additions & 2 deletions src/declarative/particles/qsgparticlesystem.cpp
Expand Up @@ -493,7 +493,7 @@ QSGParticleSystem::QSGParticleSystem(QSGItem *parent) :
{
QSGParticleGroupData* gd = new QSGParticleGroupData(0, this);//Default group
m_groupData.insert(0,gd);
m_groupIds.insert("",0);
m_groupIds.insert(QString(),0);
m_nextGroupId = 1;

connect(&m_painterMapper, SIGNAL(mapped(QObject*)),
Expand Down Expand Up @@ -549,7 +549,7 @@ void QSGParticleSystem::loadPainter(QObject *p)
int particleCount = 0;
if (painter->particles().isEmpty()){//Uses default particle
QStringList def;
def << "";
def << QString();
painter->setParticles(def);
particleCount += m_groupData[0]->size();
m_groupData[0]->painters << painter;
Expand Down

0 comments on commit 01335ed

Please sign in to comment.