Results 1 to 2 of 2

Thread: problem resizing rect

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question problem resizing rect

    I write the code for resizing a QRectItem and it works very well.
    For example, to resize my custom QrectItem from the top-right corner, i calculate the new rect in this manner:
    Qt Code:
    1. QRectF new_rect(QPointF(rect().bottomLeft().x(),event->pos().y()),
    2. QPointF(event->pos().x(),boundingRect().bottomLeft().y()));
    To copy to clipboard, switch view to plain text mode 

    When I use the "same" approach for resizing my custom QPixmapItem, it give me problem and resize doesn't work!!

    Qt Code:
    1. QRect new_rect(QPoint(pixmap().rect().bottomLeft().x(),
    2. event->pos().toPoint().y()),
    3. QPoint(event->pos().toPoint().x(),
    4. pixmap().rect().bottomLeft().y()));
    To copy to clipboard, switch view to plain text mode 

    What's wrong???
    Last edited by dreamer; 5th May 2008 at 18:06. Reason: updated contents

Similar Threads

  1. QGraphicsSvgItem, problem with scaling (invalid bounding rect)
    By Józef Paczenko in forum Qt Programming
    Replies: 3
    Last Post: 8th June 2010, 08:58
  2. Problem on Resizing of QTableView colums ?
    By rajeshs in forum Qt Programming
    Replies: 2
    Last Post: 28th March 2008, 04:03
  3. QTreeWidget, resizing item and widgets problem
    By The Storm in forum Qt Programming
    Replies: 15
    Last Post: 17th March 2008, 21:20
  4. resizing down problem
    By MrGarbage in forum Qt Tools
    Replies: 1
    Last Post: 23rd October 2007, 19:37
  5. QTabWidget - problem with resizing
    By moowy in forum Qt Programming
    Replies: 5
    Last Post: 14th September 2006, 14:06

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.