Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor fareenafatima's Avatar
    Join Date
    Dec 2010
    Posts
    64
    hi,
    i want to build a screen for my application that displays a label " Continue" and two push buttons "Yes" and "No".
    now yes and no buttons are in horizontal layout.
    n i want to make then continue and the horizontal layout (containing push buttons) in a vertical layout.

    i am facing following problems

    1. i am nt getting how to make the label and horizontalbox layout in a verticalbox layout.
    2. i cant set geometry of horizontal layout by placing 4 int values in the parameters like layout->setgeometry(int,int,int,int). it says to put (const qrect &). i m nt getting wat "const qrect & "means.


    i am putting my code




    Code:
    //------------i have added the two push buttons in the horizontal layout------------------//
       QHBoxLayout *layout= new QHBoxLayout;
        layout->setGeometry();//-----------------set geometry aint wrking fr me
        layout->addWidget(button1);
        layout->addWidget(button2);
    
    //------------------here i want to put the label and layout in vertical layout but it aint wrking fr me
        QVBoxLayout *layout1 = new QVBoxLayout;
          layout1->addWidget(label);
          layout->addLayout(QHBoxLayout:: );
    
    
        setLayout(layout);
        layout->setSpacing(200);

  2. #2
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    You have to pass object of QRect class as a parameter. Like QRect(1, 2, 3, 4);

  3. #3
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Code:
    QHBoxLayout *layout= new QHBoxLayout;
    layout->addWidget(button1);
    layout->addWidget(button2);
    layout->setSpacing(200);
    
    QVBoxLayout *layout1 = new QVBoxLayout;
    layout1->addWidget(label);
    layout1->addLayout(layout);
    
    setLayout(layout1);
    as layout1 is parent layout of layout it might be good that you add layout1 to widget
    Last edited by divanov; 2011-02-01 at 09:07. Reason: fixing typos

  4. #4
    Regular Contributor fareenafatima's Avatar
    Join Date
    Dec 2010
    Posts
    64
    thanks rao and divanov..

Similar Threads

  1. How to resize the Widgets inside the Layout
    By deepak6raji in forum Qt
    Replies: 8
    Last Post: 2010-10-08, 13:35
  2. issue in deleting a layout and setting a new layout..
    By sathyanarayanan.se in forum Qt
    Replies: 8
    Last Post: 2010-10-05, 13:24
  3. Replies: 6
    Last Post: 2010-08-04, 13:33
  4. How to use LAYOUT Feature?
    By sagars in forum Python
    Replies: 4
    Last Post: 2008-06-17, 08:07
  5. Detecting Keypad Layout and Screen Layout
    By chonada in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-02-01, 03:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved