Results 1 to 4 of 4

Thread: getting rid of border

  1. #1
    Join Date
    Jan 2007
    Posts
    68
    Thanks
    9
    Thanked 8 Times in 8 Posts

    Default getting rid of border

    hi all,

    I'd like to get rid of the border around the QGraphicsView if I setup a QDialog or QWidget as follows:
    Qt Code:
    1. TestDialog::TestDialog(QWidget *parent)
    2. : QDialog(parent)
    3. {
    4. QGraphicsView *view = new QGraphicsView(this);
    5. QHBoxLayout *centerLayout = new QHBoxLayout;
    6. centerLayout->addWidget(view);
    7. setLayout(centerLayout);
    8. }
    To copy to clipboard, switch view to plain text mode 

    this image shows, what I mean:


    regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: getting rid of border

    Qt Code:
    1. view->setFrameShape(QFrame::NoFrame);
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: getting rid of border

    I think he means the layout margin
    Qt Code:
    1. centerLayout->setMargin(0);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

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

    darksaga (17th August 2007)

  5. #4
    Join Date
    Jan 2007
    Posts
    68
    Thanks
    9
    Thanked 8 Times in 8 Posts

    Default Re: getting rid of border

    Quote Originally Posted by jpn View Post
    I think he means the layout margin
    Qt Code:
    1. centerLayout->setMargin(0);
    To copy to clipboard, switch view to plain text mode 
    yupp, margin is, what I was looking for

    what I tried
    Qt Code:
    1. centerLayout->setSpacing(0);
    To copy to clipboard, switch view to plain text mode 
    but this didn't help ...

    thnx again jpn

Similar Threads

  1. QPrinter on QGraphicsScene Border Problem
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2007, 15:49
  2. How draw extra border on QGraphicsTextItem?
    By patrik08 in forum Qt Programming
    Replies: 4
    Last Post: 8th July 2007, 15:11
  3. problem with mouse release on the border, help me!
    By dungsivn in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2007, 08:16
  4. border color is wrong with "plastique" style in Qt4.2.3
    By alfa_wu in forum Qt Programming
    Replies: 2
    Last Post: 30th April 2007, 04:27
  5. How to create a movable border between two widgets?
    By Teuniz in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2007, 08:45

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.