mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Diagram view : diagram isn't anymore optional in constructor
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3563 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -48,11 +48,14 @@
|
|||||||
@param diagram Schema a afficher ; si diagram vaut 0, un nouveau Diagram est utilise
|
@param diagram Schema a afficher ; si diagram vaut 0, un nouveau Diagram est utilise
|
||||||
@param parent Le QWidget parent de cette vue de schema
|
@param parent Le QWidget parent de cette vue de schema
|
||||||
*/
|
*/
|
||||||
DiagramView::DiagramView(Diagram *diagram, QWidget *parent) : QGraphicsView(parent) {
|
DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
|
||||||
|
QGraphicsView (parent),
|
||||||
|
scene (diagram),
|
||||||
|
m_event_interface (nullptr)
|
||||||
|
{
|
||||||
grabGesture(Qt::PinchGesture);
|
grabGesture(Qt::PinchGesture);
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
setInteractive(true);
|
setInteractive(true);
|
||||||
m_event_interface = nullptr;
|
|
||||||
|
|
||||||
QString whatsthis = tr(
|
QString whatsthis = tr(
|
||||||
"Ceci est la zone dans laquelle vous concevez vos sch\351mas en y ajoutant"
|
"Ceci est la zone dans laquelle vous concevez vos sch\351mas en y ajoutant"
|
||||||
@@ -67,7 +70,6 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) : QGraphicsView(pare
|
|||||||
setRenderHint(QPainter::TextAntialiasing, true);
|
setRenderHint(QPainter::TextAntialiasing, true);
|
||||||
setRenderHint(QPainter::SmoothPixmapTransform, true);
|
setRenderHint(QPainter::SmoothPixmapTransform, true);
|
||||||
|
|
||||||
scene = diagram ? diagram : new Diagram(this);
|
|
||||||
setScene(scene);
|
setScene(scene);
|
||||||
scene -> undoStack().setClean();
|
scene -> undoStack().setClean();
|
||||||
setWindowIcon(QET::Icons::QETLogo);
|
setWindowIcon(QET::Icons::QETLogo);
|
||||||
|
|||||||
@@ -33,28 +33,29 @@ class DVEventInterface;
|
|||||||
class DiagramView : public QGraphicsView {
|
class DiagramView : public QGraphicsView {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
// constructors, destructor
|
// constructors, destructor
|
||||||
public:
|
public:
|
||||||
DiagramView(Diagram * = 0, QWidget * = 0);
|
DiagramView(Diagram *diagram, QWidget * = 0);
|
||||||
virtual ~DiagramView();
|
virtual ~DiagramView();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DiagramView(const DiagramView &);
|
DiagramView(const DiagramView &);
|
||||||
|
|
||||||
// attributes
|
|
||||||
private:
|
|
||||||
Diagram *scene;
|
|
||||||
QMenu *context_menu;
|
|
||||||
QAction *paste_here;
|
|
||||||
QAction *find_element_;
|
|
||||||
QPoint paste_here_pos;
|
|
||||||
bool fresh_focus_in_; ///< Indicate the focus was freshly gained
|
|
||||||
ElementsLocation next_location_;
|
|
||||||
QPoint next_position_;
|
|
||||||
QPointF center_view_;
|
|
||||||
QPointF rubber_band_origin;
|
|
||||||
DVEventInterface *m_event_interface;
|
|
||||||
|
|
||||||
|
// attributes
|
||||||
|
|
||||||
|
Diagram *scene;
|
||||||
|
DVEventInterface *m_event_interface;
|
||||||
|
QMenu *context_menu;
|
||||||
|
QAction *paste_here;
|
||||||
|
QAction *find_element_;
|
||||||
|
QPoint paste_here_pos;
|
||||||
|
QPoint next_position_;
|
||||||
|
QPointF center_view_;
|
||||||
|
QPointF rubber_band_origin;
|
||||||
|
bool fresh_focus_in_; ///< Indicate the focus was freshly gained
|
||||||
|
ElementsLocation next_location_;
|
||||||
|
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
QString title() const;
|
QString title() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user