Skip to main content
JReed.1856
Associate II
Nov 25, 2019 5:30 PM UTC
Question

Set Text without designer

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
Dec 2, 2019 9:00 AM UTC

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
Dec 2, 2019 10:08 AM UTC

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
Dec 2, 2019 10:20 AM UTC

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

/Martin