Results 1 to 3 of 3

Thread: GraphicsView in Qt Creator

  1. #1
    Join Date
    Jul 2009
    Location
    São Paulo - Brasil
    Posts
    20
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default GraphicsView in Qt Creator

    Hi guys.

    I have problem here.

    I am using qt designer to create my Gui. I put a GraphicsView in the center of my QMainWindow and I´ve tried to change the background but I cant, all the box is still white. What is my mistake?

    Qt Code:
    1. scene.setBackgroundBrush(Qt::blue);
    2. ui.graphicsView->setScene(&scene);
    3. ui.graphicsView->show();
    To copy to clipboard, switch view to plain text mode 

    Thanks in advanced

    Jorge

  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: GraphicsView in Qt Creator

    You have created the scene on the stack so it gets destroyed after running out of scope.
    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:

    ProTonS (22nd July 2009)

  4. #3
    Join Date
    Jul 2009
    Location
    São Paulo - Brasil
    Posts
    20
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: GraphicsView in Qt Creator

    Now it works!

    Thanks a lot, wysota.

Similar Threads

  1. Cannot add custom widget to Qt Creator
    By djogon in forum Qt Tools
    Replies: 5
    Last Post: 30th April 2010, 10:15
  2. Replies: 3
    Last Post: 5th May 2009, 15:46
  3. Replies: 0
    Last Post: 27th March 2009, 14:08
  4. Replies: 0
    Last Post: 18th February 2009, 19:17
  5. Newbie: Circuits and GraphicsView
    By RY in forum Newbie
    Replies: 10
    Last Post: 1st October 2008, 05:12

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.