Add the HTML Editor !

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2081 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
cfdev
2013-04-01 13:49:34 +00:00
parent 1a2d82186b
commit b10c83f8fe
46 changed files with 2472 additions and 6 deletions

View File

@@ -38,6 +38,8 @@
#include "qetmessagebox.h"
#include "qtextorientationspinboxwidget.h"
#include "htmleditor/htmleditor.h"
/**
Constructeur
@param diagram Schema a afficher ; si diagram vaut 0, un nouveau Diagram est utilise
@@ -1133,6 +1135,29 @@ void DiagramView::addText() {
is_adding_text = true;
}
/**
To edit the text through the htmlEditor
*/
void DiagramView::editText() {
if (scene -> isReadOnly()) return;
// Get text to edit
QList<DiagramTextItem *> texts_to_edit;
foreach (QGraphicsItem *item, scene -> selectedItems()) {
if (ConductorTextItem *cti = qgraphicsitem_cast<ConductorTextItem *>(item)) {
texts_to_edit << cti;
} else if (IndependentTextItem *iti = qgraphicsitem_cast<IndependentTextItem *>(item)) {
texts_to_edit << iti;
} else if (ElementTextItem *eti = qgraphicsitem_cast<ElementTextItem *>(item)) {
// here...
texts_to_edit << eti;
}
}
// Test if any text existe..
if (texts_to_edit.isEmpty()) return;
else texts_to_edit.at(0)->edit();
}
/**
Cree un nouveau champ de texte et le place a la position pos
en gerant l'annulation ; enfin, le signal textAdded est emis.