Hey guys,
at first: thanks a lot for the good work, I fully support the step to build up a new site - looks awesome
I posted this message a few hours ago at qtforum.org, when i hadn't read what was going on. So i hope this cross-post is ok
I've got a strange problem with drag 'n drop in my app. It works if you drag the label for the first time, but afterwoods that "drag symbol"(little rect) just remains at the starting position, no matter where you move the mouse. The mouse cursor shows then that a drop isn't permitted (everywhere). The TemplateWidget then also doesn't get any dropevents anymore. I've got the same issue in another Dialog, but I use different Widgets there.
Here's my code (using QT4), i wrote it after after having a look at the QT-Examples. QDragLabel is the Widget where the drag begins, it should end in a QTemplateWidget.
Qt Code:
{ if (!(event->buttons() & Qt::LeftButton)) return; mimeData->setText(m_text); drag.setMimeData(mimeData); drag.start(Qt::CopyAction); event->accept(); } { event->accept(); } { bool ok; QString text; if(!event->mimeData()->hasText()) { event->ignore(); return; } event->acceptProposedAction(); if(event->mimeData()->text()=="Textfeld") { while(true) { "", &ok); if (ok && !text.isEmpty()) break; } int x=event->pos().x()-rect.width()/2; int y=event->pos().y()-rect.height()/2; m_myLabelsX.append(x); m_myLabelsY.append(y); m_myLabelsText.append(text); } update(); }To copy to clipboard, switch view to plain text mode
Thanks in advance,
kiker99
Bookmarks