mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-30 15:50:52 +01:00
make user text for folio report none editable
Add signal mapper for radiobutton in the folio report dialog git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2679 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -37,6 +37,7 @@ DiagramTextItem::DiagramTextItem(QGraphicsItem *parent, Diagram *parent_diagram)
|
||||
setDefaultTextColor(Qt::black);
|
||||
setFont(QETApp::diagramTextsFont());
|
||||
setFlags(QGraphicsItem::ItemIsSelectable|QGraphicsItem::ItemIsMovable);
|
||||
setNoEditable(false);
|
||||
#if QT_VERSION >= 0x040600
|
||||
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
#endif
|
||||
@@ -59,6 +60,7 @@ DiagramTextItem::DiagramTextItem(const QString &text, QGraphicsItem *parent, Dia
|
||||
setDefaultTextColor(Qt::black);
|
||||
setFont(QETApp::diagramTextsFont());
|
||||
setFlags(QGraphicsItem::ItemIsSelectable|QGraphicsItem::ItemIsMovable);
|
||||
setNoEditable(false);
|
||||
#if QT_VERSION >= 0x040600
|
||||
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
#endif
|
||||
@@ -247,7 +249,7 @@ void DiagramTextItem::focusOutEvent(QFocusEvent *e) {
|
||||
@param event un QGraphicsSceneMouseEvent decrivant le double-clic
|
||||
*/
|
||||
void DiagramTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (!(textInteractionFlags() & Qt::TextEditable)) {
|
||||
if (!(textInteractionFlags() & Qt::TextEditable) && !no_editable) {
|
||||
// rend le champ de texte editable
|
||||
setTextInteractionFlags(Qt::TextEditorInteraction);
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ class DiagramTextItem : public QGraphicsTextItem {
|
||||
QPointF mapMovementToParent(const QPointF &) const;
|
||||
QPointF mapMovementFromParent(const QPointF &) const;
|
||||
void setFontSize(int &s);
|
||||
void setNoEditable(bool e = true) {no_editable = e;}
|
||||
|
||||
protected:
|
||||
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
|
||||
@@ -82,5 +83,6 @@ class DiagramTextItem : public QGraphicsTextItem {
|
||||
QString previous_text_;
|
||||
/// angle of rotation of the text field
|
||||
qreal rotation_angle_;
|
||||
bool no_editable;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -16,10 +16,13 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "reportelement.h"
|
||||
#include "elementtextitem.h"
|
||||
|
||||
ReportElement::ReportElement(const ElementsLocation &location, QGraphicsItem *qgi, Diagram *s, int *state) :
|
||||
CustomElement(location, qgi, s, state)
|
||||
{}
|
||||
{
|
||||
texts().at(0)->setNoEditable();
|
||||
}
|
||||
|
||||
int ReportElement::linkType() const {
|
||||
return REPORT;
|
||||
|
||||
Reference in New Issue
Block a user