Results 1 to 4 of 4

Thread: Drag and drop QStackedWindow

  1. #1
    Join Date
    Dec 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Drag and drop QStackedWindow

    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
    Qt Code:
    1. QByteArray itemData = event->mimeData()->data("application/x-dnditemdata");
    2. QDataStream dataStream(&itemData, QIODevice::ReadOnly);
    3.  
    4. QStackedWidget widget ;
    5. QPoint offset;
    6. dataStream >> widget >> offset; //error here : no match for 'operator>>' in 'dataStream >> widget'
    To copy to clipboard, switch view to plain text mode 

    Thanks.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Drag and drop QStackedWindow

    Perhaps you should explain what you are trying to achieve rather than how you are trying to achieve it.

  3. #3
    Join Date
    Dec 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drag and drop QStackedWindow

    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

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Drag and drop QStackedWindow

    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.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 2
    Last Post: 13th October 2010, 21:51
  2. Replies: 3
    Last Post: 10th June 2010, 15:13
  3. Replies: 0
    Last Post: 4th May 2010, 10:24
  4. drag and drop
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 11th April 2006, 11:23
  5. Drag and Drop (drop example)
    By din9 in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2006, 18:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.