Skip to main content
JReed.1856
Associate II
November 25, 2019
Question

Set Text without designer

  • November 25, 2019
  • 17 replies
  • 2532 views

Is it possible to create a Text without ueing the Designer first? Seems like everything has to be done through the Text Manager.​

This topic has been closed for replies.

17 replies

Martin KJELDSEN
Principal III
December 2, 2019

getSolidRect() is not what you think, i think. It returns the largest possible rectangle that is guaranteed to be solid.

Please use:

 /**
 * @fn const Rect& Drawable::getRect() const
 *
 * @brief Gets the rectangle this Drawable covers.
 *
 * Gets the rectangle this Drawable covers, in coordinates relative to its parent.
 *
 * @return The rectangle this Drawable covers expressed in coordinates relative to its
 * parent.
 */
 const Rect& getRect() const
 {
 return rect;
 }

JReed.1856
Associate II
December 2, 2019

for some reason I can't call this on xDivText, xDivText.getRect() in the debugger doesn't work, while xDivText.getTypedText() for example works

Martin KJELDSEN
Principal III
December 2, 2019

Just inspect xFivText after calling resizeToCurrentText() and find the rect member.

/Martin