Logo Search packages:      
Sourcecode: ktechlab version File versions

QRect RectangularOverlay::getSizeRect ( bool *  ok = 0l,
bool *  widthOk = 0l,
bool *  heightOk = 0l 
) const

Get the size rectangle from the position of the handles. If the size is invalid (e.g. the parent Item does not consider it a valid size, then *ok is set to false; otherwise to true.

the sizerect, regardless of whether or not it is valid

Definition at line 334 of file resizeoverlay.cpp.

References Item::minimumSize().

Referenced by isValidXPos(), and isValidYPos().

      bool t1,t2,t3;
      if (!ok)
            ok = &t1;
      if (!widthOk)
            widthOk = &t2;
      if (!heightOk)
            heightOk = &t3;
      int width = int(m_br->x() - m_tl->x());
      int height = int(m_br->y() - m_tl->y());
      QRect sizeRect( int(m_tl->x() - p_item->x()),
                              int(m_tl->y() - p_item->y()),
                              width, height );
      *widthOk = sizeRect.width() >= p_item->minimumSize().width();
      *heightOk = sizeRect.height() >= p_item->minimumSize().height();
      *ok = *widthOk && *heightOk;
      return sizeRect;

Generated by  Doxygen 1.6.0   Back to index