Results 1 to 11 of 11

Thread: Size of QGraphicsView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Location
    Bangalore,India
    Posts
    235
    Qt products
    Qt3 Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 25 Times in 24 Posts

    Default Re: Size of QGraphicsView

    Is your problem solved?

    if you doing hand coding then you can use QGridLayout which is easy to set all widget.
    like

    {
    // Title of the window
    setWindowTitle("Browse Images");
    resize(700, 400); // I'm using your old values

    QPushButton *b_search = new QPushButton(tr("SEARCH"));
    QPushButton *b_exit = new QPushButton(tr("Exit"));
    QLabel *l_welcome = new QLabel(tr("--Browse Images--"));
    l_welcome->setFont(QFont("Times", 18, QFont::Bold));
    l_welcome->setAlignment(Qt::AlignCenter);

    QGraphicsView *g_graphics = new QGraphicsView(this);
    g_graphics->scale(50,70);
    QGridLayout *gridLayout = new QGridLayout(this);
    gridLayout->addWidget(l_welcome,0,2,1,4);
    gridLayout->addWidget(g_graphics,1,2,4,5);
    gridLayout->addWidget(b_search,6,3);
    gridLayout->addWidget(b_exit,7,3);
    gridLayout->setColumnMinimumWidth(0,50);
    gridLayout->setColumnMinimumWidth(7,50);
    setLayout(gridLayout);
    connect(b_exit, SIGNAL(clicked()), qApp, SLOT(quit()));
    }

  2. The following user says thank you to rajesh for this useful post:

    IsleWitch (10th October 2007)

  3. #2
    Join Date
    Oct 2007
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    4

    Default Re: Size of QGraphicsView

    Thank You very much Rajesh and Wysota, I'am still working on it. I'm trying your suggestions, and i will get back to you as soon as i ge the desired result.

    Thanks again for your help

Similar Threads

  1. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12
  2. Font size calculation when painting in a QImage
    By Ishark in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2007, 22:22
  3. Speed, transparency, and drop issues with QGraphicsView
    By jefferai in forum Qt Programming
    Replies: 16
    Last Post: 30th June 2007, 16:14
  4. Replies: 1
    Last Post: 24th October 2006, 16:40
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

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
  •  
Qt is a trademark of The Qt Company.