Commit f7d12ac4 authored by Claudio Valerio's avatar Claudio Valerio

MacOsX >= 10.8 fixed issue on text widget creation

parent dabaca53
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
#include "core/memcheck.h" #include "core/memcheck.h"
QColor UBGraphicsTextItem::lastUsedTextColor; QColor UBGraphicsTextItem::lastUsedTextColor;
UBGraphicsTextItem::UBGraphicsTextItem(QGraphicsItem * parent) : UBGraphicsTextItem::UBGraphicsTextItem(QGraphicsItem * parent)
QGraphicsTextItem(parent) : QGraphicsTextItem(parent)
, UBGraphicsItem() , UBGraphicsItem()
, mMultiClickState(0) , mMultiClickState(0)
, mLastMousePressTime(QTime::currentTime()) , mLastMousePressTime(QTime::currentTime())
...@@ -344,9 +344,15 @@ UBGraphicsScene* UBGraphicsTextItem::scene() ...@@ -344,9 +344,15 @@ UBGraphicsScene* UBGraphicsTextItem::scene()
void UBGraphicsTextItem::resize(qreal w, qreal h) void UBGraphicsTextItem::resize(qreal w, qreal h)
{ {
#ifdef Q_WS_MACX
// Claudio Mac os x >= 10.8.
// on text widget creation sometimes the computed height is completely wrong (more than 10^10)
setTextWidth(w > 10000 ? 250 : w);
setTextHeight(h > 10000 ? 80 : h);
#else
setTextWidth(w); setTextWidth(w);
setTextHeight(h); setTextHeight(h);
#endif
if (Delegate()) if (Delegate())
Delegate()->positionHandles(); Delegate()->positionHandles();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment