Results 1 to 2 of 2

Thread: QKeyEvent problem 'QbyteArray::operator QNoImplicitBoolCast() const is private

  1. #1

    Default QKeyEvent problem 'QbyteArray::operator QNoImplicitBoolCast() const is private

    Any idea why this error message comes up when I compile. 'QbyteArray:perator QNoImplicitBoolCast() const is private when using QKeyEvent

    void editmode::keyPressEvent(QKeyEvent *k)
    {
    keycode=k->text();
    qDebug() << keycode.toAscii();
    }

    Basically I want to capture the key from keyboard and convert it to ascii.

    Thanks ,
    New Member and New to QT

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QKeyEvent problem 'QbyteArray::operator QNoImplicitBoolCast() const is private

    If you want key() then why are you calling text()?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QByteArray::operator QNoImplicitBoolCast() const' is private
    By saman_artorious in forum Qt Programming
    Replies: 2
    Last Post: 11th June 2012, 23:57
  2. Obtain const QImage from QByteArray
    By mcosta in forum Qt Programming
    Replies: 8
    Last Post: 27th April 2011, 09:46
  3. Replies: 3
    Last Post: 18th November 2010, 17:52
  4. Replies: 1
    Last Post: 29th September 2009, 19:44
  5. Replies: 2
    Last Post: 20th May 2006, 12:45

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.