Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: Qt Upgrade Repository..

  1. #21
    Join Date
    Sep 2009
    Location
    Surrey, BC, Canada
    Posts
    110
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt Upgrade Repository..

    I love you man !! hehe...
    Yes, you are right.
    Have to change the scene, instead of the view !
    Still not quite understand the whole theory at the back, but it works now.
    I'm using
    Qt Code:
    1. this->m_QTGraphicsScene->clear();
    2. this->m_QTGraphicsScene->addPixmap(QPixmap::fromImage(*this->m_QTImage));
    3. this->update();
    To copy to clipboard, switch view to plain text mode 
    after I reload a new image !

    And it seems I don't need to overload paintEvent() now.

    Not quite sure whether this is the right solution, but this works for me.
    The reason why I didn't want to use "addPixmap"
    is because it has to do a conversion from QImage to QPixmap,
    which I had guessed would slow down the process speed.


    Thanks wysota.

    Cheers
    JIA



    Quote Originally Posted by wysota View Post
    Yes.



    Because it's much more complex than a simple QWidget and it works in a different fashion.


    If you are so smart then why are you asking the questions and why is your code failing to work?

    BTW. you fail to see the difference between "subclass of" and "type of".

    Please just set the background brush for your scene as I told you if you want an immediate effect and then devote some time to study the documentation of graphics view architecture.
    Welcome to Vision Open
    http://www.visionopen.com

  2. #22
    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: Qt Upgrade Repository..

    If all you want is to show an image then why don't you just use QLabel? Graphics View is surely an overkill here.

    Qt Code:
    1. QLabel *label = new QLabel;
    2. label->setPixmap(QPixmap("myimage.png"));
    3. label->show();
    To copy to clipboard, switch view to plain text mode 
    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. Qt Public Repository Launched!
    By lpotter in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2009, 00:38
  2. svn problem: help me clear the repository
    By magland in forum General Discussion
    Replies: 1
    Last Post: 26th September 2007, 01:54
  3. Up-to-date package repository?
    By sdfisher in forum Installation and Deployment
    Replies: 0
    Last Post: 21st July 2007, 19:25
  4. Icon repository
    By brcain in forum Newbie
    Replies: 2
    Last Post: 23rd February 2006, 18:04
  5. Is there a repository of widgets?
    By Mariane in forum Newbie
    Replies: 3
    Last Post: 20th January 2006, 07:40

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.