Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QBitArray operator| ( const QBitArray a1,
const QBitArray a2 
) [related]

Returns a bit array that is the OR of the bit arrays a1 and a2.

The result has the length of the longest of the two bit arrays, with any missing bits (if one array is shorter than the other) taken to be 0.

Example:

        QBitArray a(3);
        QBitArray b(2);
        QBitArray c;
        a[0] = 1; a[1] = 0; a[2] = 1;   // a: [ 1, 0, 1 ]
        b[0] = 1; b[1] = 0;             // b: [ 1, 1 ]
        c = a | b;                      // c: [ 1, 1, 1 ]

See also:
QBitArray::operator|=(), operator&(), operator^()

Definition at line 667 of file qbitarray.cpp.

{
    QBitArray tmp = a1;
    tmp |= a2;
    return tmp;
}


Generated by  Doxygen 1.6.0   Back to index