Font size in QGraphicsTextItem
I add QGraphicsTextItem to graphics scene and then change its font family and font size. It works ok, but when I click and/or move my item font size changes to the 12 size. Actually its changed in QGraphicsTextItem::mouseReleaseEvent().
What is needed to force QGraphicsTextItem keep font size? Thanks in advance.
Re: Font size in QGraphicsTextItem
I found where fonts size changes but still cant understand why
Code:
{
MyTW::self()->fillTable(props); //Filling property table for this item when clicked. If I delete this line all works fine.
cout << this << " is selected!" << endl;
}
This is fillTable function, it has nothing to do with QGrpahicsTextItem but still somehow it changes font size.
Code:
void MyTW::fillTable(QMap<QString,QString> map)
{
clear();
setRowCount(map.size());
twi
->setText
(QString::fromLocal8Bit("оБЪЧБОЙЕ"));
setHorizontalHeaderItem(0,twi);
twi_1
->setText
(QString::fromLocal8Bit("ъОБЮЕОЙЕ"));
setHorizontalHeaderItem(1,twi_1);
QMapIterator<QString,QString> i(map);
int j =0;
while (i.hasNext())
{
i.next();
item->setText(i.key());
setItem(j,0,item);
item_1->setText(i.value());
setItem(j,1,item_1);
j++;
}
}