expand tabs and related whitespace fixes in *.{cpp,h,qdoc}

the diff -w for this commit is empty.

Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Oswald Buddenhagen 2014-01-13 15:48:44 +01:00 committed by The Qt Project
parent 81157d2374
commit 882bf3475c
240 changed files with 5972 additions and 5972 deletions

View File

@ -1,4 +1,4 @@
/****************************************************************************
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal

View File

@ -79,7 +79,7 @@ bool MyModel::setData(const QModelIndex & index, const QVariant & value, int rol
m_gridData[index.row()][index.column()] = value.toString();
//for presentation purposes only: build and emit a joined string
QString result;
for(int row= 0; row < ROWS; row++)
for (int row= 0; row < ROWS; row++)
{
for(int col= 0; col < COLS; col++)
{

View File

@ -101,7 +101,7 @@ bool MingwMakefileGenerator::findLibraries()
}
if (!out.isEmpty()) // We assume if it never finds it that its correct
(*it) = out;
} else if((*it).startsWith("-L")) {
} else if ((*it).startsWith("-L")) {
dirs.append(QMakeLocalFileName((*it).mid(2).toQString()));
}

View File

@ -2285,9 +2285,9 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
}
// Dependency for the output
if(!tmp_dep.isEmpty())
if (!tmp_dep.isEmpty())
deps = tmp_dep;
if(!tmp_dep_cmd.isEmpty()) {
if (!tmp_dep_cmd.isEmpty()) {
// Execute dependency command, and add every line as a dep
char buff[256];
QString dep_cmd = Project->replaceExtraCompilerVariables(tmp_dep_cmd,
@ -2347,15 +2347,15 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
out);
}
// Name for command
if(!tmp_cmd_name.isEmpty()) {
if (!tmp_cmd_name.isEmpty()) {
cmd_name = Project->replaceExtraCompilerVariables(tmp_cmd_name, inFile, out);
} else {
int space = cmd.indexOf(' ');
if(space != -1)
if (space != -1)
cmd_name = cmd.left(space);
else
cmd_name = cmd;
if((cmd_name[0] == '\'' || cmd_name[0] == '"') &&
if ((cmd_name[0] == '\'' || cmd_name[0] == '"') &&
cmd_name[0] == cmd_name[cmd_name.length()-1])
cmd_name = cmd_name.mid(1,cmd_name.length()-2);
}

View File

@ -1093,7 +1093,7 @@ QResource::unregisterResource(const QString &rccFilename, const QString &resourc
QResourceRoot *res = list->at(i);
if(res->type() == QResourceRoot::Resource_File) {
QDynamicFileResourceRoot *root = reinterpret_cast<QDynamicFileResourceRoot*>(res);
if(root->mappingFile() == rccFilename && root->mappingRoot() == r) {
if (root->mappingFile() == rccFilename && root->mappingRoot() == r) {
resourceList()->removeAt(i);
if(!root->ref.deref()) {
delete root;
@ -1164,7 +1164,7 @@ QResource::unregisterResource(const uchar *rccData, const QString &resourceRoot)
QResourceRoot *res = list->at(i);
if(res->type() == QResourceRoot::Resource_Buffer) {
QDynamicBufferResourceRoot *root = reinterpret_cast<QDynamicBufferResourceRoot*>(res);
if(root->mappingBuffer() == rccData && root->mappingRoot() == r) {
if (root->mappingBuffer() == rccData && root->mappingRoot() == r) {
resourceList()->removeAt(i);
if(!root->ref.deref()) {
delete root;

View File

@ -672,11 +672,11 @@ void QStateMachinePrivate::addStatesToEnter(QAbstractState *s, QState *root,
QAbstractState *s0 = hconf.at(k);
addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry);
}
#ifdef QSTATEMACHINE_DEBUG
qDebug() <<q_func() << ": restoring"
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": restoring"
<< ((QHistoryStatePrivate::get(h)->historyType == QHistoryState::DeepHistory) ? "deep" : "shallow")
<< "history from" << s << ':' << hconf;
#endif
#endif
} else {
QList<QAbstractState*> hlst;
if (QHistoryStatePrivate::get(h)->defaultState)
@ -689,9 +689,9 @@ void QStateMachinePrivate::addStatesToEnter(QAbstractState *s, QState *root,
QAbstractState *s0 = hlst.at(k);
addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry);
}
#ifdef QSTATEMACHINE_DEBUG
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": initial history targets for" << s << ':' << hlst;
#endif
#endif
}
}
} else {

View File

@ -664,7 +664,7 @@ QBitmap tst_QPainter::getBitmap( const QString &dir, const QString &filename, bo
if ( mask ) {
QBitmap mask;
QString maskFilename = dir + QString( "/%1-mask.xbm" ).arg( filename );
if ( !mask.load( maskFilename ) ) {
if (!mask.load(maskFilename)) {
QWARN(QString("Could not load mask '%1'").arg(maskFilename).toLatin1());
return QBitmap();
}
@ -698,15 +698,15 @@ static QRect getPaintedSize(const QImage &image, const QColor &background)
uint color = background.rgba();
for ( int y = 0; y < image.height(); ++y ) {
for ( int x = 0; x < image.width(); ++x ) {
for (int x = 0; x < image.width(); ++x) {
QRgb pixel = image.pixel( x, y );
if ( pixel != color && x < xmin )
if (pixel != color && x < xmin)
xmin = x;
if ( pixel != color && x > xmax )
if (pixel != color && x > xmax)
xmax = x;
if ( pixel != color && y < ymin )
if (pixel != color && y < ymin)
ymin = y;
if ( pixel != color && y > ymax )
if (pixel != color && y > ymax)
ymax = y;
}
}

View File

@ -61,13 +61,13 @@ static QPixmap createDestPixmap()
QPainter painter;
painter.begin( &pm );
for ( int i=0; i<colorbands; i++ ) {
for ( int j=0; j<intensities; j++ ) {
for (int j = 0; j < intensities; j++) {
int intensity = 255 * (j+1) / intensities; // 25%, 50%, 75% and 100%
for ( int k=0; k<8; k++ ) {
QColor col = baseColor( k, intensity );
painter.setPen( QPen( col, 1 ) );
painter.setBrush( col );
painter.drawRect( k*4, j*4 + i*intensities*4, 4, 4 );
for (int k = 0; k < 8; k++) {
QColor col = baseColor(k, intensity);
painter.setPen(QPen(col, 1));
painter.setBrush(col);
painter.drawRect(k*4, j*4 + i*intensities*4, 4, 4);
}
}
}
@ -127,14 +127,14 @@ static QBitmap createSrcBitmap( int size, int border )
painter.drawRect( border, border, size, size2 );
painter.end();
if ( border > 0 ) {
QBitmap mask( totalSize, totalSize, true );
QBitmap mask(totalSize, totalSize, true);
QPainter painter;
painter.begin( &mask );
painter.setPen( QPen( Qt::color1, 1 ) );
painter.setBrush( Qt::color1 );
painter.drawRect( border, border, size, size );
painter.begin(&mask);
painter.setPen(QPen(Qt::color1, 1));
painter.setBrush(Qt::color1);
painter.drawRect(border, border, size, size);
painter.end();
bm.setMask( mask );
bm.setMask(mask);
}
return bm;
}
@ -147,48 +147,48 @@ int main( int argc, char **argv )
// input for tst_QPainter::drawLine_rop_bitmap()
{
QBitmap dst = createDestBitmap();
dst.save( "../../drawLine_rop_bitmap/dst.xbm", "XBM" );
dst.save("../../drawLine_rop_bitmap/dst.xbm", "XBM");
}
// input for tst_QPainter::drawPixmap_rop_bitmap()
{
QBitmap dst = createDestBitmap();
QBitmap src1 = createSrcBitmap( 4, 2 );
QBitmap src2 = createSrcBitmap( 4, 0 );
dst.save( "../../drawPixmap_rop_bitmap/dst.xbm", "XBM" );
src1.save( "../../drawPixmap_rop_bitmap/src1.xbm", "XBM" );
src1.mask()->save( "../../drawPixmap_rop_bitmap/src1-mask.xbm", "XBM" );
src2.save( "../../drawPixmap_rop_bitmap/src2.xbm", "XBM" );
QBitmap src1 = createSrcBitmap(4, 2);
QBitmap src2 = createSrcBitmap(4, 0);
dst.save("../../drawPixmap_rop_bitmap/dst.xbm", "XBM");
src1.save("../../drawPixmap_rop_bitmap/src1.xbm", "XBM");
src1.mask()->save("../../drawPixmap_rop_bitmap/src1-mask.xbm", "XBM");
src2.save("../../drawPixmap_rop_bitmap/src2.xbm", "XBM");
}
// input for tst_QPainter::drawPixmap_rop()
{
QPixmap dst1 = createDestPixmap();
QPixmap dst2 = createDestPixmap();
dst2.resize( 32, 32 );
QBitmap src1 = createSrcBitmap( 32, 0 );
dst2.resize(32, 32);
QBitmap src1 = createSrcBitmap(32, 0);
QBitmap src_tmp = createSrcBitmap( 32, 0 ).xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) );
src_tmp.resize( 32, 48 );
QBitmap src2 = src_tmp.xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) );
QBitmap mask( 32, 48, true );
QBitmap src_tmp = createSrcBitmap(32, 0).xForm(QWMatrix(1, 0, 0, -1, 0, 0));
src_tmp.resize(32, 48);
QBitmap src2 = src_tmp.xForm(QWMatrix(1, 0, 0, -1, 0, 0));
QBitmap mask(32, 48, true);
{
QPainter painter;
painter.begin( &mask );
painter.setPen( QPen( Qt::color1, 1 ) );
painter.setBrush( Qt::color1 );
painter.drawRect( 0, 16, 32, 32 );
painter.begin(&mask);
painter.setPen(QPen(Qt::color1, 1));
painter.setBrush(Qt::color1);
painter.drawRect(0, 16, 32, 32);
painter.end();
}
src2.setMask( mask );
src2.setMask(mask);
QBitmap src3 = createSrcBitmap( 32, 0 ).xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) );
QBitmap src3 = createSrcBitmap(32, 0).xForm(QWMatrix(1, 0, 0, -1, 0, 0));
dst1.save( "../../drawPixmap_rop/dst1.png", "PNG" );
dst2.save( "../../drawPixmap_rop/dst2.png", "PNG" );
src1.save( "../../drawPixmap_rop/src1.xbm", "XBM" );
src2.save( "../../drawPixmap_rop/src2.xbm", "XBM" );
src2.mask()->save( "../../drawPixmap_rop/src2-mask.xbm", "XBM" );
src3.save( "../../drawPixmap_rop/src3.xbm", "XBM" );
dst1.save("../../drawPixmap_rop/dst1.png", "PNG");
dst2.save("../../drawPixmap_rop/dst2.png", "PNG");
src1.save("../../drawPixmap_rop/src1.xbm", "XBM");
src2.save("../../drawPixmap_rop/src2.xbm", "XBM");
src2.mask()->save("../../drawPixmap_rop/src2-mask.xbm", "XBM");
src3.save("../../drawPixmap_rop/src3.xbm", "XBM");
}
}

View File

@ -77,11 +77,11 @@ void tst_QPolygon::makeEllipse()
// make sure that all points are R+-1 away from the center
bool err = false;
for (i = 1; i < pa.size(); i++) {
QPoint p = pa.at( i );
double r = sqrt( pow( double(p.x() - R), 2.0 ) + pow( double(p.y() - R), 2.0 ) );
QPoint p = pa.at(i);
double r = sqrt(pow(double(p.x() - R), 2.0) + pow(double(p.y() - R), 2.0));
// ### too strict ? at least from visual inspection it looks
// quite odd around the main axes. 2.0 passes easily.
err |= ( qAbs( r - double(R) ) > 2.0 );
err |= (qAbs(r - double(R)) > 2.0);
}
QVERIFY( !err );
}

View File

@ -110,18 +110,18 @@ void tst_QRegion::boundingRect()
{
{
QRect rect;
QRegion region( rect );
QCOMPARE( region.boundingRect(), rect );
QRegion region(rect);
QCOMPARE(region.boundingRect(), rect);
}
{
QRect rect( 10, -20, 30, 40 );
QRegion region( rect );
QCOMPARE( region.boundingRect(), rect );
QRect rect(10, -20, 30, 40);
QRegion region(rect);
QCOMPARE(region.boundingRect(), rect);
}
{
QRect rect(15,25,10,10);
QRegion region( rect );
QCOMPARE( region.boundingRect(), rect );
QRegion region(rect);
QCOMPARE(region.boundingRect(), rect);
}
}
@ -130,56 +130,56 @@ void tst_QRegion::rects()
{
{
QRect rect;
QRegion region( rect );
QVERIFY( region.isEmpty() );
QVERIFY( region.rects().isEmpty() );
QRegion region(rect);
QVERIFY(region.isEmpty());
QVERIFY(region.rects().isEmpty());
}
{
QRect rect( 10, -20, 30, 40 );
QRegion region( rect );
QCOMPARE( region.rects().count(), 1 );
QCOMPARE( region.rects()[0], rect );
QRect rect(10, -20, 30, 40);
QRegion region(rect);
QCOMPARE(region.rects().count(), 1);
QCOMPARE(region.rects()[0], rect);
}
{
QRect r( QPoint(10, 10), QPoint(40, 40) );
QRegion region( r );
QVERIFY( region.contains( QPoint(10,10) ) );
QVERIFY( region.contains( QPoint(20,40) ) );
QVERIFY( region.contains( QPoint(40,20) ) );
QVERIFY( !region.contains( QPoint(20,41) ) );
QVERIFY( !region.contains( QPoint(41,20) ) );
QRect r(QPoint(10, 10), QPoint(40, 40));
QRegion region(r);
QVERIFY(region.contains(QPoint(10,10)));
QVERIFY(region.contains(QPoint(20,40)));
QVERIFY(region.contains(QPoint(40,20)));
QVERIFY(!region.contains(QPoint(20,41)));
QVERIFY(!region.contains(QPoint(41,20)));
}
{
QRect r( 10, 10, 30, 30 );
QRegion region( r );
QVERIFY( region.contains( QPoint(10,10) ) );
QVERIFY( region.contains( QPoint(20,39) ) );
QVERIFY( region.contains( QPoint(39,20) ) );
QVERIFY( !region.contains( QPoint(20,40) ) );
QVERIFY( !region.contains( QPoint(40,20) ) );
QRect r(10, 10, 30, 30);
QRegion region(r);
QVERIFY(region.contains(QPoint(10,10)));
QVERIFY(region.contains(QPoint(20,39)));
QVERIFY(region.contains(QPoint(39,20)));
QVERIFY(!region.contains(QPoint(20,40)));
QVERIFY(!region.contains(QPoint(40,20)));
}
}
void tst_QRegion::swap()
{
QRegion r1(QRect( 0, 0,10,10));
QRegion r1(QRect(0, 0,10,10));
QRegion r2(QRect(10,10,10,10));
r1.swap(r2);
QCOMPARE(r1.rects().front(), QRect(10,10,10,10));
QCOMPARE(r2.rects().front(), QRect( 0, 0,10,10));
QCOMPARE(r2.rects().front(), QRect(0, 0,10,10));
}
void tst_QRegion::setRects()
{
{
QRegion region;
region.setRects( 0, 0 );
QVERIFY( region.rects().isEmpty() );
region.setRects(0, 0);
QVERIFY(region.rects().isEmpty());
}
{
QRegion region;
QRect rect;
region.setRects( &rect, 0 );
region.setRects(&rect, 0);
QVERIFY(region.isEmpty());
QVERIFY(region == QRegion());
QVERIFY(!region.boundingRect().isValid());
@ -188,16 +188,16 @@ void tst_QRegion::setRects()
{
QRegion region;
QRect rect;
region.setRects( &rect, 1 );
QVERIFY( !region.boundingRect().isValid() );
QVERIFY( region.rects().isEmpty() );
region.setRects(&rect, 1);
QVERIFY(!region.boundingRect().isValid());
QVERIFY(region.rects().isEmpty());
}
{
QRegion region;
QRect rect( 10, -20, 30, 40 );
region.setRects( &rect, 1 );
QCOMPARE( region.rects().count(), 1 );
QCOMPARE( region.rects()[0], rect );
QRect rect(10, -20, 30, 40);
region.setRects(&rect, 1);
QCOMPARE(region.rects().count(), 1);
QCOMPARE(region.rects()[0], rect);
}
}
@ -242,30 +242,30 @@ void tst_QRegion::polygonRegion()
{
QPolygon pa;
{
QRegion region ( pa );
QVERIFY( region.isEmpty() );
QRegion region (pa);
QVERIFY(region.isEmpty());
}
{
pa.setPoints( 8, 10, 10, // a____________b
pa.setPoints(8, 10, 10, // a____________b
40, 10, // | |
40, 20, // |___ ___|
30, 20, // | |
30, 40, // | |
20, 40, // | |
20, 20, // |____c
10, 20 );
10, 20);
QRegion region ( pa );
QVERIFY( !region.isEmpty() );
QRegion region (pa);
QVERIFY(!region.isEmpty());
// These should not be inside the circle
QVERIFY( !region.contains( QPoint( 9, 9 ) ) );
QVERIFY( !region.contains( QPoint( 30, 41 ) ) );
QVERIFY( !region.contains( QPoint( 41, 10 ) ) );
QVERIFY( !region.contains( QPoint( 31, 21 ) ) );
QVERIFY(!region.contains(QPoint( 9, 9)));
QVERIFY(!region.contains(QPoint(30, 41)));
QVERIFY(!region.contains(QPoint(41, 10)));
QVERIFY(!region.contains(QPoint(31, 21)));
// These should be inside
QVERIFY( region.contains( QPoint( 10, 10 ) ) ); // Upper-left (a)
QVERIFY(region.contains(QPoint(10, 10))); // Upper-left (a)
}
}
@ -345,29 +345,29 @@ void tst_QRegion::bitmapRegion()
{
QBitmap circle;
{
QRegion region( circle );
QVERIFY( region.isEmpty() );
QRegion region(circle);
QVERIFY(region.isEmpty());
}
{
circle = QPixmap( circle_xpm );
QRegion region( circle );
circle = QPixmap(circle_xpm);
QRegion region(circle);
//// These should not be inside the circe
QVERIFY( !region.contains( QPoint( 2, 2 ) ) );
QVERIFY( !region.contains( QPoint( 2, 17 ) ) );
QVERIFY( !region.contains( QPoint( 17, 2 ) ) );
QVERIFY( !region.contains( QPoint( 17, 17 ) ) );
QVERIFY(!region.contains(QPoint(2, 2)));
QVERIFY(!region.contains(QPoint(2, 17)));
QVERIFY(!region.contains(QPoint(17, 2)));
QVERIFY(!region.contains(QPoint(17, 17)));
//// These should be inside
QVERIFY( region.contains( QPoint( 3, 3 ) ) );
QVERIFY( region.contains( QPoint( 3, 16 ) ) );
QVERIFY( region.contains( QPoint( 16, 3 ) ) );
QVERIFY( region.contains( QPoint( 16, 16 ) ) );
QVERIFY(region.contains(QPoint(3, 3)));
QVERIFY(region.contains(QPoint(3, 16)));
QVERIFY(region.contains(QPoint(16, 3)));
QVERIFY(region.contains(QPoint(16, 16)));
QVERIFY( region.contains( QPoint( 0, 10 ) ) ); // Mid-left
QVERIFY( region.contains( QPoint( 10, 0 ) ) ); // Mid-top
QVERIFY( region.contains( QPoint( 19, 10 ) ) ); // Mid-right
QVERIFY( region.contains( QPoint( 10, 19 ) ) ); // Mid-bottom
QVERIFY(region.contains(QPoint(0, 10))); // Mid-left
QVERIFY(region.contains(QPoint(10, 0))); // Mid-top
QVERIFY(region.contains(QPoint(19, 10))); // Mid-right
QVERIFY(region.contains(QPoint(10, 19))); // Mid-bottom
}
}

View File

@ -343,14 +343,14 @@ void tst_QFont::compare()
QFont font;
{
QFont font2 = font;
font2.setPointSize( 24 );
QVERIFY( font != font2 );
font2.setPointSize(24);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
}
{
QFont font2 = font;
font2.setPixelSize( 24 );
QVERIFY( font != font2 );
font2.setPixelSize(24);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
}
@ -362,59 +362,59 @@ void tst_QFont::compare()
font.setOverline(false);
{
QFont font2 = font;
font2.setPointSize( 24 );
QVERIFY( font != font2 );
font2.setPointSize(24);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
}
{
QFont font2 = font;
font2.setPixelSize( 24 );
QVERIFY( font != font2 );
font2.setPixelSize(24);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
}
{
QFont font2 = font;
font2.setItalic(true);
QVERIFY( font != font2 );
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font2.setItalic(false);
QVERIFY( font == font2 );
QVERIFY(font == font2);
QVERIFY(!(font < font2));
font2.setWeight(QFont::Bold);
QVERIFY( font != font2 );
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font2.setWeight(QFont::Normal);
QVERIFY( font == font2 );
QVERIFY(font == font2);
QVERIFY(!(font < font2));
font.setUnderline(true);
QVERIFY( font != font2 );
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setUnderline(false);
QVERIFY( font == font2 );
QVERIFY(font == font2);
QVERIFY(!(font < font2));
font.setStrikeOut(true);
QVERIFY( font != font2 );
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setStrikeOut(false);
QVERIFY( font == font2 );
QVERIFY(font == font2);
QVERIFY(!(font < font2));
font.setOverline(true);
QVERIFY( font != font2 );
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setOverline(false);
QVERIFY( font == font2 );
QVERIFY(font == font2);
QVERIFY(!(font < font2));
font.setCapitalization(QFont::SmallCaps);
QVERIFY( font != font2 );
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setCapitalization(QFont::MixedCase);
QVERIFY( font == font2 );
QVERIFY(font == font2);
QVERIFY(!(font < font2));
}

View File

@ -128,7 +128,7 @@ void tst_QFontDatabase::styles()
QString trimmed = style.trimmed();
++it;
QCOMPARE( style, trimmed );
QCOMPARE(style, trimmed);
}
}
@ -160,7 +160,7 @@ void tst_QFontDatabase::fixedPitch()
QFontDatabase fdb;
if (!fdb.families().contains(font))
QSKIP( "Font not installed");
QSKIP("Font not installed");
QCOMPARE(fdb.isFixedPitch(font), fixedPitch);

View File

@ -179,10 +179,10 @@ void tst_QTextPieceTable::insertion4()
str += c;
table->insert(pos, str, charFormatIndex);
compare.insert(pos, str);
// if (table->text() != compare) {
// qDebug("compare failed: i=%d (current char=%c) insert at %d\nexpected '%s'\ngot '%s'", i, (i % 26) + (i>25?'A':'a'), pos, compare.latin1(), table->text().latin1());
// exit(12);
// }
// if (table->text() != compare) {
// qDebug("compare failed: i=%d (current char=%c) insert at %d\nexpected '%s'\ngot '%s'", i, (i % 26) + (i>25?'A':'a'), pos, compare.latin1(), table->text().latin1());
// exit(12);
// }
}
QVERIFY(table->plainText() == compare);
}
@ -263,10 +263,10 @@ void tst_QTextPieceTable::removal3()
table->insert(pos, str, charFormatIndex);
}
l += remove ? -1 : 2;
// if (table->text() != compare) {
// qDebug("compare failed: i=%d (current char=%c) insert at %d\nexpected '%s'\ngot '%s'", i, (i % 26) + (i>25?'A':'a'), pos, compare.latin1(), table->text().latin1());
// exit(12);
// }
// if (table->text() != compare) {
// qDebug("compare failed: i=%d (current char=%c) insert at %d\nexpected '%s'\ngot '%s'", i, (i % 26) + (i>25?'A':'a'), pos, compare.latin1(), table->text().latin1());
// exit(12);
// }
}
QVERIFY(table->plainText() == compare);
}

View File

@ -1836,11 +1836,11 @@ void tst_Collections::map()
map[3] = 8;
int sum = 0;
QMutableMapIterator<int,int> i = map;
while(i.hasNext())
while (i.hasNext())
if (i.next().key() == 2)
i.remove();
i.toFront();
while(i.hasNext()) {
while (i.hasNext()) {
sum += i.next().value();
i.setValue(10);
i.value() += 22;

View File

@ -902,7 +902,7 @@ void tst_QSqlDatabase::recordMySQL()
FieldDef("bigint unsigned", QVariant::ULongLong, Q_UINT64_C(18446744073709551615)),
FieldDef("float", QVariant::Double, 1.12345),
FieldDef("double", QVariant::Double, 1.123456789),
FieldDef("decimal(10, 9)", QVariant::Double,1.123456789),
FieldDef("decimal(10, 9)", QVariant::Double, 1.123456789),
FieldDef("numeric(5, 2)", QVariant::Double, 123.67),
FieldDef("date", QVariant::Date, QDate::currentDate()),
FieldDef("datetime", QVariant::DateTime, dt),

View File

@ -338,20 +338,20 @@ void tst_QApplication::multiple()
int i = 0;
int argc = 0;
while ( i++ < 5 ) {
TestApplication app( argc, 0 );
while (i++ < 5) {
TestApplication app(argc, 0);
if ( features.contains( "QFont" ) ) {
if (features.contains("QFont")) {
// create font and force loading
QFont font( "Arial", 12 );
QFontInfo finfo( font );
QFont font("Arial", 12);
QFontInfo finfo(font);
finfo.exactMatch();
}
if ( features.contains( "QPixmap" ) ) {
QPixmap pix( 100, 100 );
pix.fill( Qt::black );
if (features.contains("QPixmap")) {
QPixmap pix(100, 100);
pix.fill(Qt::black);
}
if ( features.contains( "QWidget" ) ) {
if (features.contains("QWidget")) {
QWidget widget;
}

View File

@ -330,7 +330,7 @@ void tst_QShortcut::number_data()
*/
QTest::newRow("N004 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N004:Shift+F1 - [Shift+F1]")<< TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N004:Shift+F1 - [Shift+F1]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N004:F1 - [Shift+F1]") << TestAccel << NoWidget << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N004 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
@ -340,7 +340,7 @@ void tst_QShortcut::number_data()
Qt::Key_Backtab on Qt::Key_Tab
Shift + Qt::Key_Backtab on Qt::Key_Tab
*/
QTest::newRow("N005a - slot1") << SetupAccel << TriggerSlot1 << QString("")<< int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N005a - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N005a:Tab - [Tab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
//commented out because the behaviour changed, those tests should be updated
//QTest::newRow("N005a:Shift+Tab - [Tab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
@ -355,11 +355,11 @@ void tst_QShortcut::number_data()
Qt::Key_Backtab on Shift + Qt::Key_Tab
Shift + Qt::Key_Backtab on Shift + Qt::Key_Tab
*/
QTest::newRow("N005b - slot1") << SetupAccel << TriggerSlot1 << QString("")<< int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N005b - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N005b:Tab - [Shift+Tab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N005b:Shift+Tab - [Shift+Tab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N005b:BackTab - [Shift+Tab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N005b:Shift+BackTab - [Shift+Tab]")<< TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N005b:Shift+BackTab - [Shift+Tab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N005b - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
@ -368,7 +368,7 @@ void tst_QShortcut::number_data()
Qt::Key_Backtab on Qt::Key_Backtab
Shift + Qt::Key_Backtab on Qt::Key_Backtab
*/
QTest::newRow("N006a - slot1") << SetupAccel << TriggerSlot1 << QString("")<< int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N006a - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N006a:Tab - [BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
// This should work, since platform dependent code will transform the
// Shift+Tab into a Shift+BackTab, which should trigger the shortcut
@ -384,11 +384,11 @@ void tst_QShortcut::number_data()
Qt::Key_Backtab on Shift + Qt::Key_Backtab
Shift + Qt::Key_Backtab on Shift + Qt::Key_Backtab
*/
QTest::newRow("N006b - slot1") << SetupAccel << TriggerSlot1 << QString("")<< int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N006b - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N006b:Tab - [Shift+BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N006b:Shift+Tab - [Shift+BackTab]")<< TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N006b:Shift+Tab - [Shift+BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N006b:BackTab - [Shift+BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("N006b:Shift+BackTab - [Shift+BackTab]")<< TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered; //XFAIL
QTest::newRow("N006b:Shift+BackTab - [Shift+BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered; //XFAIL
QTest::newRow("N006b - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
//===========================================
@ -441,7 +441,7 @@ void tst_QShortcut::number_data()
QTest::newRow("N:Qt::Key_Aring") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT+Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
QTest::newRow("N:Qt::Key_aring - Text Form") << TestAccel << NoWidget << QString("") << 0 << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N:Qt::Key_Aring - Text Form") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT+0) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
QTest::newRow("N:Qt::UNICODE_ACCEL + Qt::Key_K") << TestAccel << NoWidget << QString("") << int(Qt::UNICODE_ACCEL + Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N:Qt::UNICODE_ACCEL + Qt::Key_K")<< TestAccel << NoWidget << QString("") << int(Qt::UNICODE_ACCEL + Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("N09 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Multiple Sequences
@ -531,7 +531,7 @@ void tst_QShortcut::text_data()
Qt::Key_F1 on Shift + Qt::Key_F1
*/
QTest::newRow("T004 - slot1") << SetupAccel << TriggerSlot1 << QString("Shift+F1") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("T004:Shift+F1 - [Shift+F1]")<< TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("T004:Shift+F1 - [Shift+F1]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("T004:F1 - [Shift+F1]") << TestAccel << NoWidget << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("T004 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
@ -586,7 +586,7 @@ void tst_QShortcut::text_data()
QTest::newRow("T:Qt::Key_Aring") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT+Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
QTest::newRow("T:Qt::Key_aring - Text Form") << TestAccel << NoWidget << QString("") << 0 << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("T:Qt::Key_Aring - Text Form") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT+0) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
QTest::newRow("T:Qt::UNICODE_ACCEL + Qt::Key_K") << TestAccel << NoWidget << QString("") << int(Qt::UNICODE_ACCEL + Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("T:Qt::UNICODE_ACCEL + Qt::Key_K")<< TestAccel << NoWidget << QString("") << int(Qt::UNICODE_ACCEL + Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("T09 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Multiple Sequences

View File

@ -669,7 +669,7 @@ void tst_QWidget::cleanup()
// Helper class...
BezierViewer::BezierViewer( QWidget* parent)
: QWidget( parent )
: QWidget(parent)
{
setObjectName(QLatin1String("TestWidget"));
setWindowTitle(objectName());

View File

@ -961,8 +961,8 @@ void tst_QMenuBar::allowActiveAndDisabled()
void tst_QMenuBar::check_altPress()
{
if ( !qApp->style()->styleHint(QStyle::SH_MenuBar_AltKeyNavigation) ) {
QSKIP( QString( "this is not supposed to work in the %1 style. Skipping." ).
arg( qApp->style()->objectName() ).toLatin1());
QSKIP(QString( "this is not supposed to work in the %1 style. Skipping." ).
arg(qApp->style()->objectName()).toLatin1());
}
QMainWindow w;

View File

@ -47,7 +47,7 @@
class ContentHandler : public QXmlDefaultHandler
{
public:
public:
ContentHandler();
// QXmlContentHandler methods
@ -56,55 +56,55 @@ class ContentHandler : public QXmlDefaultHandler
bool startElement(const QString &namespaceURI,
const QString &localName,
const QString &qName,
const QXmlAttributes & atts);
const QXmlAttributes &atts);
bool endElement(const QString &namespaceURI,
const QString &localName,
const QString &qName);
bool characters(const QString &ch);
void setDocumentLocator(QXmlLocator *locator);
bool startPrefixMapping (const QString &prefix, const QString & uri);
bool startPrefixMapping(const QString &prefix, const QString &uri);
bool endPrefixMapping(const QString &prefix);
bool ignorableWhitespace (const QString & ch);
bool ignorableWhitespace(const QString &ch);
bool processingInstruction(const QString &target, const QString &data);
bool skippedEntity (const QString & name);
bool skippedEntity(const QString &name);
// QXmlErrorHandler methods
bool warning (const QXmlParseException & exception);
bool error (const QXmlParseException & exception);
bool fatalError (const QXmlParseException & exception);
bool warning(const QXmlParseException &exception);
bool error(const QXmlParseException &exception);
bool fatalError(const QXmlParseException &exception);
// QXmlDTDHandler methods
bool notationDecl ( const QString & name, const QString & publicId,
const QString & systemId );
bool unparsedEntityDecl ( const QString & name,
const QString & publicId,
const QString & systemId,
const QString & notationName );
bool notationDecl(const QString &name, const QString &publicId,
const QString &systemId);
bool unparsedEntityDecl(const QString &name,
const QString &publicId,
const QString &systemId,
const QString &notationName);
// QXmlEntityResolver methods
bool resolveEntity ( const QString & publicId,
const QString & systemId,
bool resolveEntity(const QString &publicId,
const QString &systemId,
QXmlInputSource *&);
// QXmlLexicalHandler methods
bool startDTD ( const QString & name, const QString & publicId, const QString & systemId );
bool endDTD ();
bool startEntity ( const QString & name );
bool endEntity ( const QString & name );
bool startCDATA ();
bool endCDATA ();
bool comment ( const QString & ch );
bool startDTD (const QString &name, const QString &publicId, const QString &systemId);
bool endDTD();
bool startEntity(const QString &name);
bool endEntity(const QString &name);
bool startCDATA();
bool endCDATA();
bool comment(const QString &ch);
// QXmlDeclHandler methods
bool attributeDecl ( const QString & eName, const QString & aName, const QString & type, const QString & valueDefault, const QString & value );
bool internalEntityDecl ( const QString & name, const QString & value );
bool externalEntityDecl ( const QString & name, const QString & publicId, const QString & systemId );
bool attributeDecl(const QString &eName, const QString &aName, const QString &type, const QString &valueDefault, const QString &value);
bool internalEntityDecl(const QString &name, const QString &value);
bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId);
const QString &result() const { return m_result; }
const QString &errorMsg() const { return m_error_msg; }
private:
private:
QString nestPrefix() const { return QString().fill(' ', 3*m_nest); }
QString formatAttributes(const QXmlAttributes & atts);
QString escapeStr(const QString &s);
@ -138,7 +138,7 @@ bool ContentHandler::endDocument()
bool ContentHandler::startElement(const QString &namespaceURI,
const QString &localName,
const QString &qName,
const QXmlAttributes & atts)
const QXmlAttributes &atts)
{
m_result += nestPrefix();
m_result += "startElement(namespaceURI=\"" + escapeStr(namespaceURI)
@ -295,9 +295,9 @@ bool ContentHandler::fatalError(const QXmlParseException & exception)
return true;
}
bool ContentHandler::notationDecl ( const QString & name,
const QString & publicId,
const QString & systemId )
bool ContentHandler::notationDecl(const QString &name,
const QString &publicId,
const QString &systemId )
{
m_result += nestPrefix();
m_result += "notationDecl(name=\"" + escapeStr(name) + "\", publicId=\""
@ -306,10 +306,10 @@ bool ContentHandler::notationDecl ( const QString & name,
return true;
}
bool ContentHandler::unparsedEntityDecl ( const QString & name,
const QString & publicId,
const QString & systemId,
const QString & notationName )
bool ContentHandler::unparsedEntityDecl(const QString &name,
const QString &publicId,
const QString &systemId,
const QString &notationName )
{
m_result += nestPrefix();
m_result += "unparsedEntityDecl(name=\"" + escapeStr(name)
@ -320,8 +320,8 @@ bool ContentHandler::unparsedEntityDecl ( const QString & name,
return true;
}
bool ContentHandler::resolveEntity(const QString & publicId,
const QString & systemId,
bool ContentHandler::resolveEntity(const QString &publicId,
const QString &systemId,
QXmlInputSource *&)
{
m_result += nestPrefix();
@ -388,11 +388,11 @@ bool ContentHandler::comment ( const QString & ch )
return true;
}
bool ContentHandler::attributeDecl ( const QString & eName,
const QString & aName,
const QString & type,
const QString & valueDefault,
const QString & value )
bool ContentHandler::attributeDecl(const QString &eName,
const QString &aName,
const QString &type,
const QString &valueDefault,
const QString &value)
{
m_result += nestPrefix();
m_result += "attributeDecl(eName=\"" + escapeStr(eName) + "\", aName=\""
@ -402,8 +402,8 @@ bool ContentHandler::attributeDecl ( const QString & eName,
return true;
}
bool ContentHandler::internalEntityDecl ( const QString & name,
const QString & value )
bool ContentHandler::internalEntityDecl(const QString &name,
const QString &value)
{
m_result += nestPrefix();
m_result += "internatlEntityDecl(name=\"" + escapeStr(name)
@ -411,9 +411,9 @@ bool ContentHandler::internalEntityDecl ( const QString & name,
return true;
}
bool ContentHandler::externalEntityDecl ( const QString & name,
const QString & publicId,
const QString & systemId )
bool ContentHandler::externalEntityDecl(const QString &name,
const QString &publicId,
const QString &systemId)
{
m_result += nestPrefix();
m_result += "externalEntityDecl(name=\"" + escapeStr(name)

View File

@ -49,7 +49,7 @@ class ContentHandler;
class Parser : public QXmlSimpleReader
{
public:
public:
Parser();
~Parser();
@ -57,7 +57,7 @@ class Parser : public QXmlSimpleReader
QString result() const;
QString errorMsg() const;
private:
private:
ContentHandler *handler;
};

View File

@ -489,7 +489,7 @@ bool Environment::cpdir(const QString &srcDir, const QString &destDir)
intermediate = QFile::copy(entry.absoluteFilePath(), destFile);
SetFileAttributes((wchar_t*)destFile.utf16(), FILE_ATTRIBUTE_NORMAL);
}
if(!intermediate) {
if (!intermediate) {
qDebug() << "cpdir: Failure for " << entry.fileName() << entry.isDir();
result = false;
}