Results 1 to 8 of 8

Thread: drawing an unfixed line?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: drawing an unfixed line?

    Qt Code:
    1. QVBoxLayout* frameLayout = new QVBoxLayout(hDivider);
    2. frameLayout->addWidget(...);
    3. frameLayout->addWidget(...);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

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

    tommy (26th January 2008)

  3. #2
    Join Date
    Nov 2007
    Posts
    103
    Thanks
    71
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: drawing an unfixed line?

    This compiles fine but program crashes before it gets to graphics
    Qt Code:
    1. MyWidget::MyWidget(QWidget* parent): QWidget(parent)
    2. {
    3. ......
    4. QLabel *box1 = new QLabel;
    5. box1->setFrameStyle(QFrame::Box | QFrame::Sunken); box1->setLineWidth(2);
    6.  
    7. mainLayout = new QVBoxLayout(box1);//mainLayout is declared in my *.h file
    8. mainLayout->addLayout(otherLayout);
    9. ......
    10. }
    To copy to clipboard, switch view to plain text mode 
    What could be the problem?
    Is QLabel the reason? Using "QFrame *box1 = new QFrame;" will crash the program too.

  4. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: drawing an unfixed line?

    Could "otherLayout" be an uninitialized pointer? I'd suggest using a debugger and seeing backtrace/callstack to get an idea which line is causing the crash.
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    tommy (26th January 2008)

Similar Threads

  1. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  2. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  3. Access Violation on Signal Emit
    By khagzan in forum Qt Programming
    Replies: 2
    Last Post: 25th September 2007, 22:51
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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.