Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: Adding item to GridLayout???

  1. #1
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Adding item to GridLayout???

    Hi..

    I have created a canvas and have given it a grid layout... Now i want to add items to it...

    But the addItem() function takes a QLayoutItem to be added..
    I want to add a Q3CanvasLine object to the first row and column but am not able to do so...

    How do i do that.. i tried to create a QLayoutItem with a QCanvasLine object but it wasn't created.. what is the procedure to do it...

    Thanking you,

    with regards,
    Kapil

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding item to GridLayout???

    I don't think you can add a canvas item to a layout.

  3. #3
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    Quote Originally Posted by munna
    I don't think you can add a canvas item to a layout.
    But i was able to sucessfully set up grid layout for the canvas... and its returning the rowCount and columnCount as well...

    can't there be any way in which i can typecast my canvasitem to layoutitem and then add it?????

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding item to GridLayout???

    No. Canvas doesn't work that way. It doesn't use layouts.

  5. #5
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    Quote Originally Posted by wysota
    No. Canvas doesn't work that way. It doesn't use layouts.
    Aaahhhhhh

    Thanks for the reply...

    Is there any way to work like a layout works... i.e. while creating items i want them to specify them in a particular region.. like a rectangular region which would contain set of items independent from the other regions... i can work on these group of items in a particular rectangular region as a whole.. like moving the entire region to other part..
    or like making a copy of the entire region and repeating it multiple times (like normal copy and paste types)...

    is there any way out for this ?????
    All you have to decide is what to do with the time that is given to you

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding item to GridLayout???

    Try with an article on Qt Quarterly -- Canvas Item Groupies.

  7. #7
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    Hey...

    Thanks a lot.. it was able to group similar elements together and now i can act on them as a whole single item...

    One problem is still there.. to perform the copy and paste task, i.e. to create multiple instances of the object and then place them one after another on the canvas... what i did was that i copied the object information into another object and tried to place it.. but now it is just overwriting it on the current location.. now it contains the same pixel information and is overwriting it... How do i change that information to new location information ????

    How do i perform the copy n paste task ???

    Should i put in the code of mine which i wrote to perform the copy n paste to make it more clear????
    All you have to decide is what to do with the time that is given to you

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding item to GridLayout???

    Quote Originally Posted by Kapil
    One problem is still there.. to perform the copy and paste task, i.e. to create multiple instances of the object and then place them one after another on the canvas... what i did was that i copied the object information into another object and tried to place it.. but now it is just overwriting it on the current location.. now it contains the same pixel information and is overwriting it... How do i change that information to new location information ????
    Maybe you should just... move it?

    How do i perform the copy n paste task ???
    I believe this topic is widely described in the documentation.

  9. #9
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    Quote Originally Posted by wysota
    Maybe you should just... move it?
    moving it, shifts the group to some other part of the canvas... but does not replicate it...
    i want to create many copies of it all over the place...

    I went thru the doc carefully.. but it talked abt adding,moving,deleting, merging.... It tells me to create a group by clubbing the elemnts but does not tell me to recreate elements from that group at different location...

    that is the problem which is there...

    sorry, but any function of CanvasGroup class in the doc was not able to give me a bit of info on how to perform copy and paste on a group of elements...

    Thanks,

    Kapil
    All you have to decide is what to do with the time that is given to you

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding item to GridLayout???

    Quote Originally Posted by Kapil
    sorry, but any function of CanvasGroup class in the doc was not able to give me a bit of info on how to perform copy and paste on a group of elements...
    I wasn't talking about canvas group. I was talking about clipboard mechanisms present in Qt. If you paste a group, you naturally have to make a copy of each element in it as new instances, make a new group and insert those elements in the group. All according to the mime information present in the clipboard object.

  11. #11
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    hi..

    i went through the documentation of QClipboard, QMimeData and QByteArray...
    as per what i understood this is what i have to do..

    CanvasGroup *canvasgp = new CanvasGroup;
    //Then i create the entire group
    QByteArray *barr = new QByteArray(1);
    barr[0] = canvasgp;
    QMimeData *mime = new QMimeData;
    mime->setData("Canvas Group",&barr);
    clipboard->setMimeData(mime,mode);

    is this approach correct.. basically this is first time i am dealing with it and as well learning all these concepts as you know.. so i might seem to make disasterous mistakes as well..
    sorry for asking you so many questions..

    Thanks,
    Kapil
    All you have to decide is what to do with the time that is given to you

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding item to GridLayout???

    Not quite correct. You should serialise the group into the byte array, not assign it.

    For example let's assume you have an item CanvasItem which has properties such as its coordinates (x and y), dimensions (w and h) name (name) and colour (c). To serialise it, you could for example create such a function for it:

    Qt Code:
    1. QDataStream & operator<<(QDataStream &ds, CanvasItem &item){
    2. ds << "CanvasItem" << item.x << item.y << item.w << item.h << item.name << item.c;
    3. return ds;
    4. }
    To copy to clipboard, switch view to plain text mode 

    You can then provide a function for deserialisation too:

    Qt Code:
    1. QDataStream & operator>>(QDataStream &ds, CanvasItem &item){
    2. QString type;
    3. ds >> type;
    4. if(type!="CanvasItem"){
    5. qDebug("Not a canvas item");
    6. return;
    7. }
    8. ds >> item.x >> item.y >> item.w >> item.h >> item.name >> item.c;
    9. }
    To copy to clipboard, switch view to plain text mode 

    Serialisation is a way to turn an object into its "text" or binary (stream in general) representation which can then be stored somewhere (for example piped through network). Deserialisation is something opposite -- creates objects out of their serial representation.

    Then you'll be able to fill your QMimeData object:

    Qt Code:
    1. CanvasItem *item;
    2. //...
    3. QDataStream ds(&ba);
    4. ds << *item;
    5. QMimeData *mime = new QMimeData;
    6. mime->setData("Canvas Group",&ba);
    7. clipboard->setMimeData(mime,mode);
    To copy to clipboard, switch view to plain text mode 
    Of course you can do the same with the group. Serialise the whole group by providing some header from the group and then serialising all its elements (and maybe also provide some footer).

  13. #13
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    Hi..

    Thanks a lot for the reply and the code...
    man it would take me ages to code it in such a nice manner

    Small questions before i try out this way...

    Serialise the whole group by providing some header from the group
    header of the group here means the first element of the group or ????? same for footer ie the last element or ?????

    then do i have to serialize each element from the group individually and then include it back in the group or i can send the entire group for getting serialized????

    Also one doubt which was coming up again and again... It might be the stupidest of doubts but somehow was not able to figure it out...

    How does this copy and paste here actually happens.. i went thru the QClipboard doc and the Canvas Group eg... for pasting i would have to make a copy of each element of the existing group into a new group... just like transferring info from one to another.. but that transfers the entire info abt the items ie the x,y coordinates, height and width and name..
    now for pasting it to a new location, all this info for each item would change.. ie it would have a new x,y location in correspond to the pasting.. so will all these info get automatically changed or who will do it as per their new position????

    Thanking you,

    with regards
    Kapil
    Last edited by Kapil; 5th April 2006 at 13:08.
    All you have to decide is what to do with the time that is given to you

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding item to GridLayout???

    Quote Originally Posted by Kapil
    header of the group here means the first element of the group or ????? same for footer ie the last element or ?????
    Header of a group is something which will allow you to identify the group. In the simplest case it could be just a number of items in the group (so that you know how many times should you call the deserialisation). Footer is not necessary but it can help you spot that you reached the end of the group (if you don't provide the number of elements in the header).

    then do i have to serialize each element from the group individually and then include it back in the group or i can send the entire group for getting serialized????
    Group serialiser can call serialisation methods for all objects it contains:

    Qt Code:
    1. QDataStream &operator <<(QDataStream &ds, CanvasGroup &gr){
    2. ds << "CanvasGroup" << itemCount(); // header
    3. for(int i=0;i<itemCount();i++) ds << *item(i); // items
    4. ds << "End of canvas group"; // footer (not needed in this case)
    5. return ds;
    6. }
    To copy to clipboard, switch view to plain text mode 

    How does this copy and paste here actually happens.. i went thru the QClipboard doc and the Canvas Group eg... for pasting i would have to make a copy of each element of the existing group into a new group... just like transferring info from one to another.. but that transfers the entire info abt the items ie the x,y coordinates, height and width and name..
    now for pasting it to a new location, all this info for each item would change.. ie it would have a new x,y location in correspond to the pasting.. so will all these info get automatically changed or who will do it as per their new position????
    The object copied is represented by a block of data associated with some mime-type. It should contain all information about the object that should be transferred. When a drop (paste) happens the data is retrieved from the transfer object and the destination widget has to do something with it (for example create items which have the same attributes as those described by the data retrieved). It is your choice how to actually "insert" those objects to the destination widget. I would just "tilt" all items a little bit so that they don't cover original items -- for example by adding some small constant value to x and y (or just moving the group).

  15. #15
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    Hi..

    I have done as u said...

    I created an object of Canvas Group i.e CanvasGroup *c_gp
    Then i assigned it the canvas items...
    Then i wrote the function of Serialization adn Deserialization as u told me to...

    It then serialized my CanvasGroup object into a mime type...
    After that i placed it on the Clipboard with setMimeData(mime,mode) function..

    then i created another CanvasGroup Object i.e CanvasGroup *c_gp2;
    then i retrieved back the mime data from the clipboard by the mimeData() func that returned me the mime data on clipboard...

    Then i deserialized it and extracted the CanvasGroup object back... then running a loop i extracted each element of the CanvasGroup and created equal number of new Canvas Items with same info... then i assigned them to the new CanvasGroup object...

    Here was where i am finding the problem...
    now do i have to call the show() function of each of the canvasgroup items to paste them and then call the move function to move them at a new position ???????
    All you have to decide is what to do with the time that is given to you

  16. #16
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding item to GridLayout???

    I guess so At least if you want to make them visible. Did you have a look at drag&drop and clipboard examples that come with Qt?

  17. #17
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    Quote Originally Posted by wysota
    Did you have a look at drag&drop and clipboard examples that come with Qt?
    I did have a look at the Drag and Drop example - Draagable Icons and Fridge Magnets ones..

    What it said was that QDrag itself handles the drag and drop events...

    i looked arnd for the ClipBoard example but couldnt get any...
    where can i find it???>
    All you have to decide is what to do with the time that is given to you

  18. #18
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    Hi...

    I got a series of errors (sorry but i culdnt understand few of them )

    Here is what i did:
    Qt Code:
    1. CanvasGroup *m_pCanvasGp;
    2. CanvasGroup *m_pCanvasGp2;
    3. QMimeData *mime;
    4. QMimeData *mime2;
    5. QClipboard *clipboard;
    6.  
    7. void ImageDraw::groupCanvasItems()
    8. {
    9. int i;
    10. //Addition of the CanvasLines
    11. for(i = 0;i<lineNum;i++)
    12. {
    13. m_pCanvasGp->add(m_pCanvasLine[i]);
    14. }
    15.  
    16. //Addition of CanvasRectangles
    17. for(i=0;i<recNum;i++)
    18. {
    19. m_pCanvasGp->add(m_pCanvasRectangle[i]);
    20. }
    21.  
    22. QDataStream ds(*ba);
    23. ds << *m_pCanvasGp;
    24. mime->setData("Canvas Group",&ba);
    25. clipboard->setMimeData(mime,QClipboard::Clipboard);
    26. mime2 = clipboard->mimeData(mode);
    27. ba2 = mime->data("Canvas Group");
    28. QDataStream d2(*ba2);
    29. ds2 >> *mpCanvasGp2;
    30.  
    31. }
    32.  
    33. QDataStream & operator<<(QDataStream &ds, CanvasGroup &cgp)
    34. {
    35. int i;
    36. ds<<"Canvas Group"<<cgp.count();
    37. for(i=0; i<cgp.count();i++)
    38. ds << *(cgp.itemat(i));
    39.  
    40. return ds;
    41. }
    42.  
    43. QDataStream & operator>>(QDataStream &ds, CanvasGroup &cgp)
    44. {
    45. int i;
    46. QString type;
    47. ds >> type;
    48. if(type != "Canvas Group")
    49. {
    50. qDebug("Not a canvas group");
    51. return;
    52. }
    53.  
    54. ds >> *(cgp.itemat(i));
    55. }
    To copy to clipboard, switch view to plain text mode 

    And these are the errors which i got
    [HTML]
    imagedraw.cpp: In member function `void ImageDraw::groupCanvasItems()':
    imagedraw.cpp:80: error: no match for 'operator<<' in 'ds << *((ImageDraw*)this)
    ->ImageDraw::m_pCanvasGp'
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:119: note: candida
    tes are: QDataStream& QDataStream:perator<<(qint8)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:192: note:
    QDataStream& QDataStream:perator<<(quint8)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:121: note:
    QDataStream& QDataStream:perator<<(qint16)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:195: note:
    QDataStream& QDataStream:perator<<(quint16)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:123: note:
    QDataStream& QDataStream:perator<<(qint32)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:198: note:
    QDataStream& QDataStream:perator<<(quint32)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:125: note:
    QDataStream& QDataStream:perator<<(qint64)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:201: note:
    QDataStream& QDataStream:perator<<(quint64)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:127: note:
    QDataStream& QDataStream:perator<<(bool)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:128: note:
    QDataStream& QDataStream:perator<<(float)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:129: note:
    QDataStream& QDataStream:perator<<(double)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qdatastream.h:130: note:
    QDataStream& QDataStream:perator<<(const char*)
    C:/Qt/4.1.1/include/Qt3Support/../../src/qt3support/tools/q3glist.h:191: note:
    QDataStream& operator<<(QDataStream&, const Q3GList&)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qchar.h:291: note:
    QDataStream& operator<<(QDataStream&, const QChar&)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qbytearray.h:497: note:
    QDataStream& operator<<(QDataStream&, const QByteArray&)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qstring.h:824: note:
    QDataStream& operator<<(QDataStream&, const QString&)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qobject.h:401: note:
    QDebug operator<<(QDebug, const QObject*)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qvariant.h:555: note:
    QDataStream& operator<<(QDataStream&, const QVariant&)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qvariant.h:557: note:
    QDataStream& operator<<(QDataStream&, QVariant::Type)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qvariant.h:650: note:
    QDebug operator<<(QDebug, QVariant::Type)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qurl.h:216: note:
    QDataStream& operator<<(QDataStream&, const QUrl&)
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/io/qurl.h:221: note:
    QDebug operator<<(QDebug, const QUrl&)
    C:/Qt/4.1.1/include/QtGui/../../src/gui/widgets/qsplitter.h:127: note:
    QTextStream& operator<<(QTextStream&, const QSplitter&)

    imagedraw.cpp:81: error: no matching function for call to `QMimeData::setData(co
    nst char[13], QByteArray**)'
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qmimedata.h:63: note: candid
    ates are: void QMimeData::setData(const QString&, const QByteArray&)

    imagedraw.cpp:84: error: conversion from `QByteArray' to `QByteArray*' is ambigu
    ous

    C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qbytearray.h:327: note: candi
    dates are: QByteArray:perator const void*() const <near match>
    C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qbytearray.h:294: note:
    QByteArray:perator QNoImplicitBoolCast() const <near match>
    imagedraw.cpp:86: error: `mpCanvasGp2' undeclared (first use this function)
    imagedraw.cpp: In function `QDataStream& operator<<(QDataStream&, CanvasGroup&)'
    :
    imagedraw.cpp: In function `QDataStream& operator>>(QDataStream&, CanvasGroup&)'
    :
    imagedraw.cpp:162: error: return-statement with no value, in function returning
    'QDataStream&'
    imagedraw.cpp:165: error: 'class CanvasGroup' has no member named 'itemat'
    mingw32-make[1]: *** [debug\imagedraw.o] Error 1
    mingw32-make[1]: Leaving directory `D:/Kapil_Folder/ViewChip/mousesetcanvas'
    mingw32-make: *** [debug] Error 2
    [/HTML]

    I am totally blown out and clueless...
    Also checked the QDataStream for the operator functions but culdnt get the solution...

    Kapil
    All you have to decide is what to do with the time that is given to you

  19. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding item to GridLayout???

    Your code doesn't make much sense... where is "copy" and where is "paste" in it? You merged those two operations here... why?

    As for the errors, the operator must be incorrectly defined.

  20. #20
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding item to GridLayout???

    Aaahhh.. Okay... would try to recode the thing again...
    As per the copy part of it then i thought this was the copy part ie setting the mime data in the clipboard copies it...
    [HTML]
    QDataStream ds(*ba);
    ds << *m_pCanvasGp;
    mime->setData("Canvas Group",&ba);
    clipboard->setMimeData(mime,QClipboard::Clipboard);
    [/HTML]

    And for pasting as u said
    Quote Originally Posted by wysota
    When a drop (paste) happens the data is retrieved from the transfer object and the destination widget has to do something with it (for example create items which have the same attributes as those described by the data retrieved).
    I created another CanvasGroup object and tried to extract the data into it with the following set of commands i.e.
    [HTML]
    mime2 = clipboard->mimeData(mode);
    ba2 = mime->data("Canvas Group");
    QDataStream d2(*ba2);
    ds2 >> *mpCanvasGp2;
    [/HTML]
    This was my paste part... now i would have moved the newly created canvasgroup object to a new location to make it happen...

    I exactly didnt merge them..it was just a prototype which i had developed to run the entire copy and paste process in the same function to check its validity... when implementing it in a real sense, i would part the two things...

    For the operator errors, then i checked with the QDataStream class description and its functions... i just exactly did as per the code sample given by you.. i made no changes from my side..

    Would try the thing again afresh... Would try to give it my best shot and disturb you the least.. you have really helped me in coming up with so many solutions.. had this forum not been there, i would have taken ages to do what i have done so far...
    Thanks a lot for your help...

    with regards,
    Kapil
    All you have to decide is what to do with the time that is given to you

Similar Threads

  1. ListWidget positions item
    By talex in forum Qt Programming
    Replies: 3
    Last Post: 21st October 2008, 15:16
  2. View, Scene, Item and thread??
    By dungsivn in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2008, 19:21
  3. Item in a DLL not getting events
    By Benne Gesserit in forum Qt Programming
    Replies: 11
    Last Post: 16th August 2008, 22:30
  4. Item Delegate Painting
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2008, 07:37
  5. Replies: 1
    Last Post: 19th April 2007, 22:23

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.