Commit 4a7c17a9 authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed linebreaks

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5222 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 29fb3ed2
//============================================================================= //=============================================================================
// //
// OpenFlipper // OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen // Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org // www.openflipper.org
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// License // License
// //
// OpenFlipper is free software: you can redistribute it and/or modify // OpenFlipper is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by // it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// OpenFlipper is distributed in the hope that it will be useful, // OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details. // GNU Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>. // along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Revision$ // $Revision$
// $Author$ // $Author$
// $Date$ // $Date$
// //
//============================================================================= //=============================================================================
#ifndef QT_SLIDE_WINDOW_ #ifndef QT_SLIDE_WINDOW_
#define QT_SLIDE_WINDOW_ #define QT_SLIDE_WINDOW_
//============================================================================= //=============================================================================
// //
// CLASS QtSlideWindow // CLASS QtSlideWindow
// //
//============================================================================= //=============================================================================
//== INCLUDES ================================================================= //== INCLUDES =================================================================
#include <QSettings> #include <QSettings>
#include <QGraphicsProxyWidget> #include <QGraphicsProxyWidget>
#include <OpenFlipper/common/GlobalDefines.hh> #include <OpenFlipper/common/GlobalDefines.hh>
//== FORWARDDECLARATIONS ====================================================== //== FORWARDDECLARATIONS ======================================================
class QtGraphicsButton; class QtGraphicsButton;
class QTimeLine; class QTimeLine;
class QGraphicsItemAnimation; class QGraphicsItemAnimation;
//== CLASS DEFINITION ========================================================= //== CLASS DEFINITION =========================================================
/** \class QtSlideWindow QtSlideWindow.hh <OpenFlipper/widgets/glWidget/QtSlideWindow.hh> /** \class QtSlideWindow QtSlideWindow.hh <OpenFlipper/widgets/glWidget/QtSlideWindow.hh>
A graphics scene widget that has a hover slide effect and detach functionality A graphics scene widget that has a hover slide effect and detach functionality
for a child widget for a child widget
**/ **/
class DLLEXPORT QtSlideWindow : public QGraphicsProxyWidget class DLLEXPORT QtSlideWindow : public QGraphicsProxyWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
/** Create a glViewer. /** Create a glViewer.
\param _name displayed titlebar name \param _name displayed titlebar name
\param _parent parent graphics item \param _parent parent graphics item
*/ */
QtSlideWindow (QString _name = 0, QGraphicsItem *_parent = 0); QtSlideWindow (QString _name = 0, QGraphicsItem *_parent = 0);
/// recalculate geometry /// recalculate geometry
void updateGeometry (); void updateGeometry ();
/// attach a child widget /// attach a child widget
void attachWidget (QWidget *_m); void attachWidget (QWidget *_m);
/// detach child widget /// detach child widget
void detachWidget (); void detachWidget ();
/// saves the current state /// saves the current state
void saveState (QSettings &_settings); void saveState (QSettings &_settings);
/// restores the state /// restores the state
void restoreState (QSettings &_settings); void restoreState (QSettings &_settings);
private: private:
/// paints decoration /// paints decoration
virtual void paintWindowFrame(QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget = 0); virtual void paintWindowFrame(QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget = 0);
/// track frame events /// track frame events
virtual bool windowFrameEvent(QEvent *_e); virtual bool windowFrameEvent(QEvent *_e);
/// categorize frame area /// categorize frame area
virtual Qt::WindowFrameSection windowFrameSectionAt(const QPointF &_pos) const; virtual Qt::WindowFrameSection windowFrameSectionAt(const QPointF &_pos) const;
/// hove event tracking /// hove event tracking
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *_event); virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *_event);
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *_event); virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *_event);
/// size & position event tracking /// size & position event tracking
virtual void resizeEvent (QGraphicsSceneResizeEvent *_event); virtual void resizeEvent (QGraphicsSceneResizeEvent *_event);
virtual void moveEvent (QGraphicsSceneMoveEvent *_event); virtual void moveEvent (QGraphicsSceneMoveEvent *_event);
private slots: private slots:
/// detach button pressed /// detach button pressed
void detachPressed (); void detachPressed ();
/// detached dialog closed /// detached dialog closed
void dialogClosed (); void dialogClosed ();
/// autohide button presed /// autohide button presed
void autohidePressed (); void autohidePressed ();
/// Executed if the timeline reches the end of its animation /// Executed if the timeline reches the end of its animation
void timelineFinished (); void timelineFinished ();
private: private:
// name // name
QString name_; QString name_;
// child widget // child widget
QWidget *mainWidget_; QWidget *mainWidget_;
// buttons // buttons
QtGraphicsButton *autohideButton_; QtGraphicsButton *autohideButton_;
QtGraphicsButton *detachButton_; QtGraphicsButton *detachButton_;
// animation // animation
QTimeLine *hideTimeLine_; QTimeLine *hideTimeLine_;
QGraphicsItemAnimation *hideAnimation_; QGraphicsItemAnimation *hideAnimation_;
// detached dialog // detached dialog
QDialog *dialog_; QDialog *dialog_;
// temporary widget // temporary widget
QWidget *tempWidget_; QWidget *tempWidget_;
}; };
//============================================================================= //=============================================================================
//============================================================================= //=============================================================================
#endif // QT_SLIDE_WINDOW_ defined #endif // QT_SLIDE_WINDOW_ defined
//============================================================================= //=============================================================================
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment