X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_ViewWindow.h;h=77b966d860a0901ba6eeac2250bab8db8f3c3c03;hb=d86c77d1c6210bbe04fbc3e5b00f9e212e1ec930;hp=01fd18ddfb736bad43da235917fcc0bcad3c6f63;hpb=2c7c361d0ab4687935496e4bb6fe2b2e12702fc9;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_ViewWindow.h b/src/XGUI/XGUI_ViewWindow.h index 01fd18ddf..77b966d86 100644 --- a/src/XGUI/XGUI_ViewWindow.h +++ b/src/XGUI/XGUI_ViewWindow.h @@ -87,6 +87,12 @@ public: //! Sets the current view window closable or not void setClosable( const bool isClosable ) { myClosable = isClosable; } + //! Enable/Disable drawing of ribbon line + void enableDrawMode(bool toEnable) { myEnableDrawMode = toEnable; } + + //! Returns true if ribbon line drawing enabled + bool isDrawModeEnabled() const { return myEnableDrawMode; } + signals: //! Emited whien view transformation operation is started void vpTransformationStarted(XGUI_ViewWindow::OperationType type); @@ -180,15 +186,12 @@ public slots: void windowDeactivated(); protected: - virtual void resizeEvent(QResizeEvent* theEvent); - virtual void changeEvent(QEvent* theEvent); - //virtual void enterEvent(QEvent* theEvent); - //virtual void leaveEvent(QEvent* theEvent); - virtual bool eventFilter(QObject *theObj, QEvent *theEvent); + virtual void showEvent(QShowEvent* theEvent); + private slots: void onClose(); void onMinimize(); @@ -269,6 +272,7 @@ private: bool myIsKeyFree; bool myEventStarted; // set when transformation is in process bool myClosable; + bool myIsActive; QCursor myCursor; @@ -295,19 +299,19 @@ class ViewerToolbar: public QToolBar { Q_OBJECT public: - ViewerToolbar(QWidget* theParent, XGUI_ViewPort* thePort) - : QToolBar(theParent), myVPort(thePort) - { - setBackgroundRole(QPalette::NoRole); - setAttribute(Qt::WA_NoSystemBackground); - setAttribute(Qt::WA_PaintOnScreen); - } + ViewerToolbar(QWidget* theParent, XGUI_ViewPort* thePort); + +protected slots: + void onViewPortResized() { myResize = true; } protected: virtual void paintEvent(QPaintEvent* theEvent); + + private: XGUI_ViewPort* myVPort; + bool myResize; }; //****************************************************** @@ -320,19 +324,17 @@ class ViewerLabel: public QLabel { Q_OBJECT public: - ViewerLabel(QWidget* theParent, XGUI_ViewPort* thePort) - : QLabel(theParent), myVPort(thePort) - { - setAttribute(Qt::WA_NoSystemBackground); - } + ViewerLabel(QWidget* theParent, XGUI_ViewPort* thePort); - void repaintBackground(); +protected slots: + void onViewPortResized() { myResize = true; } protected: virtual void paintEvent(QPaintEvent* theEvent); private: XGUI_ViewPort* myVPort; + bool myResize; }; #endif