Results 1 to 3 of 3

Thread: QTransform method is private within this context error

  1. #1
    Join Date
    Apr 2010
    Posts
    25
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Question QTransform method is private within this context error

    Hello,

    I have
    Qt Code:
    1. phone = new QGraphicsPixmapItem(QPixmap(":/icons/Telefonhoerer.png"));
    2. perspectiveMatrix->reset();
    3. perspectiveMatrix->scale(0,45);
    4. phone->setTransform(perspectiveMatrix);
    To copy to clipboard, switch view to plain text mode 
    I get an error for line 4:
    'QTransform::QTransform(bool)' is private within this context
    Reading other discussions about this problem I figured the error is referring to the copy constructor of QTransform being used.

    I use Nokia SDK 1.2 on Mac OS X Lion.

    Is this probably an error in Qt itself or what's a solution?

    The variables are pointers of their used type (i.e.. phone is a QGraphicsPixmapItem pointer).


    There being more than one Qt resource on the web, what's the best place to ask such questions? Is the developer.nokia.com Forum now recommended?
    Last edited by planetLars; 14th February 2012 at 15:39. Reason: added question about best place for such questions

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

    Default Re: QTransform method is private within this context error

    setTransform() expects an object and not a pointer. Allocate your QTransform object on the stack (aka not using "new") and all will be fine.
    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.


  3. The following user says thank you to wysota for this useful post:

    planetLars (15th February 2012)

  4. #3
    Join Date
    Apr 2010
    Posts
    25
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTransform method is private within this context error

    This solved it. The documentation writes an & before the argument thus I thought it requires a pointer but wait & is the reference operator in arguments in C++, thus an object was expected. & only yields an address. Oh my C++ is rusty.

    Thank you.

Similar Threads

  1. Replies: 3
    Last Post: 17th September 2011, 14:04
  2. Replies: 1
    Last Post: 5th February 2011, 22:14
  3. Replies: 4
    Last Post: 4th January 2011, 13:07
  4. Replies: 2
    Last Post: 20th May 2006, 13:45
  5. Replies: 2
    Last Post: 4th May 2006, 20:17

Tags for this Thread

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.