예제 #1
0
void ChannelList::mouseMoveEvent(QMouseEvent* event){  
 if(dragging && event->state() == Qt::LeftButton){
   QDragObject* drag = new QTextDrag(currentText(),this);
   drag->dragMove();
   dragging = FALSE;
 }
}
예제 #2
0
void DragListBox::mouseMoveEvent( QMouseEvent * )
{
	if ( dragging ) {
		QDragObject *drag = new QTextDrag( currentText(), this );
		drag->dragMove();
		dragging = FALSE;
	}
}
예제 #3
0
void Summary::mouseMoveEvent(QMouseEvent *event)
{
    if((event->state() & LeftButton) &&
            (event->pos() - mDragStartPoint).manhattanLength() > 4)
    {

        QDragObject *drag = new QTextDrag("", this, "SummaryWidgetDrag");

        QPixmap pm = QPixmap::grabWidget(this);
        if(pm.width() > 300)
            pm = pm.convertToImage().smoothScale(300, 300, QImage::ScaleMin);

        QPainter painter;
        painter.begin(&pm);
        painter.setPen(Qt::gray);
        painter.drawRect(0, 0, pm.width(), pm.height());
        painter.end();
        drag->setPixmap(pm);
        drag->dragMove();
    }
    else
        QWidget::mouseMoveEvent(event);
}