enum { Layer = 1 };
int type() const {return Layer;}
{
return int(static_cast<T>(0)->Layer) == int(AbsoluteLayer::Layer)
|| (item && int(static_cast<T>(0)->Type) == item->type()) ? static_cast<T>(item) : 0;
}
template <class T>
inline T layer_cast
(const QGraphicsItem *item
) {
return int(static_cast<T>(0)->Layer) == int(AbsoluteLayer::Layer)
|| (item && int(static_cast<T>(0)->Type) == item->type()) ? static_cast<T>(item) : 0;
}
AbsText::AbsText()
: device(0)
{
}
/* only one connect */
LayerText *AbsText::txtControl() const
{
if (!device) {
AbsoluteLayer *that = layer_cast<AbsoluteLayer *>(q);
device = new LayerText(); /* text-api all event */
connect(device, SIGNAL(q_cursor_newPos() ),q, SLOT(cursor_wake_up()));
connect(device,
SIGNAL(q_update
(QRect) ),q,
SLOT(updatearea
(QRect)));
connect(device,
SIGNAL(q_visible
(QRectF) ),q,
SLOT(ensureVisible
(QRectF)));
///////connect(device, SIGNAL(q_update_scene()),q, SLOT(SceneReload()));
}
return device;
}
enum { Layer = 1 };
int type() const {return Layer;}
template <class T> inline T layer_cast(QGraphicsItem *item)
{
return int(static_cast<T>(0)->Layer) == int(AbsoluteLayer::Layer)
|| (item && int(static_cast<T>(0)->Type) == item->type()) ? static_cast<T>(item) : 0;
}
template <class T> inline T layer_cast(const QGraphicsItem *item)
{
return int(static_cast<T>(0)->Layer) == int(AbsoluteLayer::Layer)
|| (item && int(static_cast<T>(0)->Type) == item->type()) ? static_cast<T>(item) : 0;
}
AbsText::AbsText()
: device(0)
{
}
/* only one connect */
LayerText *AbsText::txtControl() const
{
if (!device) {
AbsoluteLayer *that = layer_cast<AbsoluteLayer *>(q);
device = new LayerText(); /* text-api all event */
connect(device, SIGNAL(q_cursor_newPos() ),q, SLOT(cursor_wake_up()));
connect(device, SIGNAL(q_update(QRect) ),q, SLOT(updatearea(QRect)));
connect(device, SIGNAL(q_visible(QRectF) ),q, SLOT(ensureVisible(QRectF)));
///////connect(device, SIGNAL(q_update_scene()),q, SLOT(SceneReload()));
}
return device;
}
To copy to clipboard, switch view to plain text mode
Bookmarks