vdocument.cpp 402 B

123456789101112131415161718192021222324252627
  1. #include "vdocument.h"
  2. #include <QtDebug>
  3. VDocument::VDocument(QObject *parent) : QObject(parent)
  4. {
  5. }
  6. VDocument::VDocument(const QString &text, QObject *parent)
  7. : QObject(parent)
  8. {
  9. m_text = text;
  10. }
  11. void VDocument::setText(const QString &text)
  12. {
  13. if (text == m_text)
  14. return;
  15. m_text = text;
  16. emit textChanged(m_text);
  17. }
  18. QString VDocument::getText()
  19. {
  20. return m_text;
  21. }