PDA

View Full Version : Drag and drop QStackedWindow



seanasl
15th December 2011, 16:27
Hi,

Is ther a way to get the widget in stackedwindow through the datastream used in drag and drop. I tried this but got an error instead


QByteArray itemData = event->mimeData()->data("application/x-dnditemdata");
QDataStream dataStream(&itemData, QIODevice::ReadOnly);

QStackedWidget widget ;
QPoint offset;
dataStream >> widget >> offset; //error here : no match for 'operator>>' in 'dataStream >> widget'


Thanks.

ChrisW67
16th December 2011, 00:55
Perhaps you should explain what you are trying to achieve rather than how you are trying to achieve it.

seanasl
16th December 2011, 05:05
Hi Chris ,

I have multiple stackedwidget on my main window and i would like them to be able to be drag n drop to any location .

Thanks

amleto
18th December 2011, 12:02
doubtful that you can do it like this.

Instead, at the start of your drag you could save a widget pointer somewhere. When the drag is accepted, the acceptee should ask/signal for the widget.