QT y QPainter trazan una línea clara. ¿Se puede arrastrar esta línea con el mouse? ¿Se puede implementar esta función? Si es así, ¿cómo implementarlo?
El siguiente es el método del temporizador:
Draw::Draw(q widget * parent):q widget(parent)
{
m _ timer = new q timer(this);
connect(m_timer, SIGNAL(timeout()), this, SLOT(update SLOT()));
m_timer-& gt; );
}
void Draw::updateSlot()
{
q punto pos = mapFromGlobal(q cursor:: pos ());
m _ inicioX = pos .x();
m _ inicioY = .
actualizar(); /p>
}
void Draw::evento de pintura(QPaintEvent * evento)
{
QPainter pintor (este);
painter.drawLine(m_startX, m_startY, m_startX+20, m_startY+10);
}