hi ppl,
I've got the following small prob:
#include <QtGui>
{
public:
~MyGraphicsItem(void){qDebug("delBand");}
return QRectF(0,
0, _width, _height
);
}
painter->setBrush(Qt::darkRed);
painter->setPen(Qt::black);
painter->drawRoundRect(0, 0, _width, _height);
}
private:
int _width;
int _height;
};
#include <QtGui>
class MyGraphicsItem : public QGraphicsItem
{
public:
MyGraphicsItem(QGraphicsItem *parent = 0) : QGraphicsItem(parent), _width(40), _height(10){}
~MyGraphicsItem(void){qDebug("delBand");}
QRectF boundingRect() const{
return QRectF(0, 0, _width, _height);
}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0){
painter->setBrush(Qt::darkRed);
painter->setPen(Qt::black);
painter->drawRoundRect(0, 0, _width, _height);
}
private:
int _width;
int _height;
};
To copy to clipboard, switch view to plain text mode
using:
setToolTip
(QString("testToolTip"));
setToolTip(QString("testToolTip"));
To copy to clipboard, switch view to plain text mode
in the constructor, works perfectly to enable tooltips for the item
but using:
}
QString toolTip() const {
return QString("testToolTip");
}
To copy to clipboard, switch view to plain text mode
does not work
why???
Bookmarks