mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user