}
// Conversion functions - these MUST match the QtScript expression path
-inline static qreal toReal(Register *reg, int type, bool *ok = 0)
-{
- if (ok) *ok = true;
-
- if (type == QMetaType::QReal) {
- return reg->getqreal();
- } else if (type == qMetaTypeId<QVariant>()) {
- return reg->getvariantptr()->toReal();
- } else {
- if (ok) *ok = false;
- return 0;
- }
-}
-
-inline static QString toString(Register *reg, int type, bool *ok = 0)
-{
- if (ok) *ok = true;
-
- if (type == QMetaType::QReal) {
- return QString::number(reg->getqreal());
- } else if (type == QMetaType::Int) {
- return QString::number(reg->getint());
- } else if (type == qMetaTypeId<QVariant>()) {
- return reg->getvariantptr()->toString();
- } else if (type == QMetaType::QString) {
- return *reg->getstringptr();
- } else {
- if (ok) *ok = false;
- return QString();
- }
-}
-
-inline static bool toBool(Register *reg, int type, bool *ok = 0)
-{
- if (ok) *ok = true;
-
- if (type == QMetaType::Bool) {
- return reg->getbool();
- } else if (type == qMetaTypeId<QVariant>()) {
- return reg->getvariantptr()->toBool();
- } else {
- if (ok) *ok = false;
- return false;
- }
-}
-
-inline static QUrl toUrl(Register *reg, int type, QDeclarativeContextData *context, bool *ok = 0)
-{
- if (ok) *ok = true;
-
- QUrl base;
- if (type == qMetaTypeId<QVariant>()) {
- QVariant *var = reg->getvariantptr();
- int vt = var->type();
- if (vt == QVariant::Url) {
- base = var->toUrl();
- } else if (vt == QVariant::ByteArray) {
- base = QUrl(QString::fromUtf8(var->toByteArray()));
- } else if (vt == QVariant::String) {
- base = QUrl(var->toString());
- } else {
- if (ok) *ok = false;
- return QUrl();
- }
- } else if (type == QMetaType::QString) {
- base = QUrl(*reg->getstringptr());
- } else {
- if (ok) *ok = false;
- return QUrl();
- }
-
- if (!base.isEmpty() && base.isRelative())
- return context->url.resolved(base);
- else
- return base;
-}
-
static QObject *variantToQObject(const QVariant &value, bool *ok)
{
if (ok) *ok = true;
QDeclarativeContextData *context, QDeclarativeDelayedError *error,
QObject *scope, QObject *output, QDeclarativePropertyPrivate::WriteFlags storeFlags)
{
- Q_Q(QDeclarativeCompiledBindings);
-
error->removeError();
Register registers[32];
QDeclarativeInclude::QDeclarativeInclude(const QUrl &url,
QDeclarativeEngine *engine,
QScriptContext *ctxt)
- : QObject(engine), m_engine(engine), m_url(url)
+ : QObject(engine), m_url(url)
{
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
m_context = ep->contextClass->contextFromValue(QScriptDeclarativeClass::scopeChainValue(ctxt, -3));
static QScriptValue worker_include(QScriptContext *ctxt, QScriptEngine *engine);
private:
- QDeclarativeEngine *m_engine;
QScriptEngine *m_scriptEngine;
QUrl m_url;
*/
QDeclarativeDataBlob::QDeclarativeDataBlob(const QUrl &url, Type type)
: m_type(type), m_status(Null), m_progress(0), m_url(url), m_finalUrl(url), m_manager(0),
- m_redirectCount(0), m_inCallback(false), m_isDone(false)
+ m_inCallback(false), m_isDone(false)
{
}
// Manager that is currently fetching data for me
QDeclarativeDataLoader *m_manager;
- int m_redirectCount:30;
- bool m_inCallback:1;
- bool m_isDone:1;
+ bool m_inCallback;
+ bool m_isDone;
QList<QDeclarativeError> m_errors;
};
if (dx == 0 && dy == 0)
return *this;
#ifndef QT_NO_DEBUG
- if (qIsNaN(dx) | qIsNaN(dy)) {
+ if (qIsNaN(dx) || qIsNaN(dy)) {
qWarning() << "QTransform::translate with NaN called";
return *this;
}
QTransform QTransform::fromTranslate(qreal dx, qreal dy)
{
#ifndef QT_NO_DEBUG
- if (qIsNaN(dx) | qIsNaN(dy)) {
+ if (qIsNaN(dx) || qIsNaN(dy)) {
qWarning() << "QTransform::fromTranslate with NaN called";
return QTransform();
}
if (sx == 1 && sy == 1)
return *this;
#ifndef QT_NO_DEBUG
- if (qIsNaN(sx) | qIsNaN(sy)) {
+ if (qIsNaN(sx) || qIsNaN(sy)) {
qWarning() << "QTransform::scale with NaN called";
return *this;
}
QTransform QTransform::fromScale(qreal sx, qreal sy)
{
#ifndef QT_NO_DEBUG
- if (qIsNaN(sx) | qIsNaN(sy)) {
+ if (qIsNaN(sx) || qIsNaN(sy)) {
qWarning() << "QTransform::fromScale with NaN called";
return QTransform();
}
if (sh == 0 && sv == 0)
return *this;
#ifndef QT_NO_DEBUG
- if (qIsNaN(sh) | qIsNaN(sv)) {
+ if (qIsNaN(sh) || qIsNaN(sv)) {
qWarning() << "QTransform::shear with NaN called";
return *this;
}
const QColor &gradientMid, const QColor &gradientStop, QBrush bgBrush)
{
int x = rect.center().x();
- int y = rect.center().y();
QLinearGradient *gradient = new QLinearGradient(x, rect.top(), x, rect.bottom());
if (bgBrush.gradient())
gradient->setStops(bgBrush.gradient()->stops());
uint press_count;
uint release_count;
int cur_state;
- uint tmp;
QCheckBox *testWidget;
- uint tmp2;
};
tst_QCheckBox::tst_QCheckBox()
QColumnView::setSelection(rect, command);
}
- QRegion visualRegionForSelection(QItemSelection selection){
+ QRegion visualRegionForSelection(const QItemSelection &selection) const {
return QColumnView::visualRegionForSelection(selection);
}
protected:
// the default is determined by the style
const int metric = mw.style()->pixelMetric(QStyle::PM_ToolBarIconSize);
- const QSize defaultIconSize = QSize(metric, metric);
const QSize smallIconSize = QSize(metric / 2, metric / 2);
const QSize largeIconSize = QSize(metric * 2, metric * 2);
connect(s, signal2, r2, slot2);
connect(s, signal3, r1, slot3);
connect(s, signal3, r2, slot3);
+ connect(s, signal4, r1, slot4);
+ connect(s, signal4, r2, slot4);
// disconnect signal1() from all receivers
QObject::disconnect(s, signal1, 0, QMetaMethod());