Hello, I've been having a really difficult time trying to figure out how to make the following cast work properly and haven't been able to. I want to assign one class into another class that is different, and yet has an identical definition. The two classes are QAbstractTextDocumentLayout::Selection and QTextEdit::ExtraSelection. They are identical structs so I should be able to assign one into the other with a proper cast, but I cannot figure it out. Here's what I want to do with all the cast operators I've tried taken out... I was able to get it to work by simply copying the QList into a QVector item by item, but it was bugging me that I couldn't figure out how to do it this way which is a lot cleaner

Qt Code:
  1. QAbstractTextDocumentLayout::PaintContext ctx;
  2. ctx.selections = QVector<QAbstractTextDocumentLayout::Selection>::fromList(textEdit.extraSelections());
To copy to clipboard, switch view to plain text mode 

Thanks!

Josh