Results 1 to 5 of 5

Thread: Trying to add a scrollArea to contain a long sequence of QLineEdits

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    122
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Trying to add a scrollArea to contain a long sequence of QLineEdits

    Hi
    I developped a window with lots of entry fields, so many that the whole thing doesnt fit onto my screen. So I thought one way out would be to create a scroll area and let the user scroll though this.
    Trouble is, all my trials have come to nothing. I was hoping to have a minimal change
    Here is the constructor for my window:
    Qt Code:
    1. MyWindow::MyWindow(QMainWindow *parent)
    2. {
    3.  
    4. this->m_scrollArea = new QScrollArea;
    5. m_scrollArea->setBackgroundRole(QPalette::Light);
    6. setCentralWidget(m_scrollArea);
    7. this->m_frame = new QFrame(this);
    8. this->m_vLayout = new QVBoxLayout(m_frame);
    9. m_scrollArea->setWidget(m_vLayout);
    10. // add entry fields and labels to m_vLayout below.
    11.  
    12.  
    13. }
    To copy to clipboard, switch view to plain text mode 
    I have of course defined some fields called m_scrollArea, m_frame, etc of the types that you would guess.
    When I display my window I just get one big blank area.
    Please tell me if you want more detail.
    I should add that my window derived from QDialog initially, and then I tried to derive it from QMainWindow in the above code.
    Last edited by feraudyh; 26th August 2010 at 20:13. Reason: more info

Similar Threads

  1. ItemViews in ScrollArea
    By SElsner in forum Newbie
    Replies: 3
    Last Post: 5th June 2010, 00:59
  2. paint in the viewport of a scrollarea
    By franco.amato in forum Qt Programming
    Replies: 14
    Last Post: 30th March 2010, 04:22
  3. Autoscroll in ScrollArea
    By BalaQT in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2009, 06:37
  4. scrollArea not updating
    By user in forum Qt Programming
    Replies: 9
    Last Post: 3rd October 2007, 09:17
  5. QTreeWidget without the ScrollArea?
    By Paalrammer in forum Newbie
    Replies: 5
    Last Post: 13th February 2007, 20:06

Tags for this Thread

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.