X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatlinemodelitem.cpp;h=7e9522813003054ca8eaf5d161903219a69a2c01;hb=82204e5856c5f257107813afe5f9bafac2333cc2;hp=1897e3e1b495dd246db6b853907879804c997a72;hpb=e2953de106e68e72486e294405f4bdcd33c60fba;p=quassel.git diff --git a/src/qtui/chatlinemodelitem.cpp b/src/qtui/chatlinemodelitem.cpp index 1897e3e1..7e952281 100644 --- a/src/qtui/chatlinemodelitem.cpp +++ b/src/qtui/chatlinemodelitem.cpp @@ -59,6 +59,10 @@ ChatLineModelItem::ChatLineModelItem(const Message &msg) _contents.formatList = m.contents.formatList; } +ChatLineModelItem::~ChatLineModelItem() { + delete _data; +} + QVariant ChatLineModelItem::data(int column, int role) const { const ChatLinePart *part = 0; @@ -107,7 +111,7 @@ void ChatLineModelItem::computeWrapList() const { Mode mode = SearchEnd; ChatLineModel::Word word; word.start = 0; - int wordstartx = 0; + qreal wordstartx = 0; QTextLayout layout(_contents.plainText); QTextOption option; @@ -140,8 +144,8 @@ void ChatLineModelItem::computeWrapList() const { mode = SearchStart; continue; } - int wordendx = line.cursorToX(oldidx); - int trailingendx = line.cursorToX(idx); + qreal wordendx = line.cursorToX(oldidx); + qreal trailingendx = line.cursorToX(idx); word.width = wordendx - wordstartx; word.trailing = trailingendx - wordendx; wordstartx = trailingendx;