rich_text_handler.cpp 677 B

1234567891011121314151617181920212223242526
  1. /*
  2. #include "client/rich_text_handler.hpp"
  3. QTextCursor RichTextHandler::textCursor() const {
  4. }
  5. RichTextHandler::RichTextHandler(QObject* parent)
  6. : QObject(parent) {}
  7. QQuickItem* RichTextHandler::getTarget() const {return target;}
  8. void RichTextHandler::setTarget(QQuickItem* target) {
  9. if (this->target == target) return;
  10. target_doc = nullptr;
  11. this->target = target;
  12. if(!target) return;
  13. QVariant doc = this->target->property("textDocument");
  14. if(doc.canConvert<QQuickTextDocument*>())
  15. if(auto qqt_doc = doc.value<QQuickTextDocument*>(); qqt_doc)
  16. target_doc = qqt_doc->textDocument();
  17. emit targetChanged(this->target);
  18. }
  19. */