×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    1

    Question Setting size of QGraphicsScene-emulator problem or something is wrong in 6-line code?

    I want to create scrollable graphics, not so large, as fullscreen ( N900, Qt Creator 1.3.83). After looking in animated tiles sample, I wrote the code below:

    QGraphicsScene scene(0,0,400,400); //Smaller size
    scene.setBackgroundBrush(Qt::blue); //for the first attempt
    QGraphicsView *view = new QGraphicsView (&scene);
    view->setCacheMode(QGraphicsView::CacheBackground);
    view->show();
    return a.exec();

    In Maemo emulator (once more, Qt Creator 1.3.83 ) it shows blue fullscreen, not 400x400 area.
    When I'm setting 900x900 size during my attempts - scrollbars are visible. This means, that parameters are exactly passing inside constructor and accepted OK.

    I made a try to set

    view->resize(400,400);

    same thing (full blue screen, not area). Emulator, or something is forgotten|not known by me - any advice? (Maybe, I set wrong color, as in BSOD? )
    P.S. How window title area with clock etc. may be hidden?

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Setting size of QGraphicsScene-emulator problem or something is wrong in 6-line c

    Most of the bugs occupy only one line.
    Code:
    #include <QtGui>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QGraphicsScene scene;
        scene.setBackgroundBrush(Qt::blue);
    
        QGraphicsView view(&scene);
        view.setCacheMode(QGraphicsView::CacheBackground);
        view.setMaximumSize(400, 400);
    
        QMainWindow win;
        win.setCentralWidget(&view);
        win.show();
    
        return app.exec();
    }

  3. #3
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Setting size of QGraphicsScene-emulator problem or something is wrong in 6-line c

    Quote Originally Posted by dAlexis_II View Post
    How window title area with clock etc. may be hidden?
    They are not visible if window is in fullscreen mode.

Similar Threads

  1. cannot create .sis file....
    By jebindaniel in forum Themes/Carbide.ui
    Replies: 6
    Last Post: 2010-04-28, 03:22
  2. long keypress When program is run background??
    By arun09 in forum Symbian C++
    Replies: 106
    Last Post: 2009-05-11, 05:53
  3. HELP! Handling Call!!
    By joseph.m in forum Symbian C++
    Replies: 14
    Last Post: 2009-03-09, 09:00
  4. carbide and v2.0 SDK's helloworldbasic?
    By pollyp in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2007-10-02, 00:49
  5. Replies: 9
    Last Post: 2006-03-30, 08:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •