Results 1 to 2 of 2

Thread: Empty QBitArray problem

  1. #1
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Angry Empty QBitArray problem

    Hi to all!

    I have following method:
    Qt Code:
    1. void CentralWidget::routerInfoWordBreakDown(const short& routerinfoword)
    2. {
    3. QBitArray bit_array(QVariant(routerinfoword).toBitArray());
    4.  
    5. for(quint64 iIndex=0; iIndex<bit_array.size(); iIndex++)
    6. {
    7. this->gbLog()->teLog()->append(QString("Bit %1:").arg(iIndex));
    8. }
    9. }
    To copy to clipboard, switch view to plain text mode 

    Why is bit_array empty?

    Sincerely,
    Marko
    Qt 5.3 Opensource & Creator 3.1.2

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Empty QBitArray problem

    Why is bit_array empty?
    Does your QVarian::type() return 'BitArray'?

    QBitArray QVariant::toBitArray () const

    Returns the variant as a QBitArray if the variant has type() BitArray; otherwise returns an empty bit array.

    See also canConvert() and convert().
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. How to put empty value in QDateEdit?
    By sawerset in forum Qt Programming
    Replies: 5
    Last Post: 14th October 2019, 22:06
  2. QTreeView is empty
    By t0bias in forum Qt Programming
    Replies: 2
    Last Post: 31st August 2008, 12:22
  3. [QDevelop] Problem with empty project
    By dreamer in forum Qt-based Software
    Replies: 2
    Last Post: 29th February 2008, 08:40
  4. QBitArray (the smallest unit of them all)
    By baray98 in forum Qt Programming
    Replies: 3
    Last Post: 29th September 2007, 15:16
  5. remove directory empty or not empty
    By raphaelf in forum Newbie
    Replies: 12
    Last Post: 27th October 2006, 08:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.