00001 <?php 00002 $rubrique = 65; 00003 $meta_description = "QExtend: Fichier source de imageviewer.hpp"; 00004 $meta_keywords =" QExtend: Fichier source de imageviewer.hpp"; 00005 $titre_page = "QExtend"; 00006 $urlCss = "http://www.developpez.com/template/kit/article.css"; 00007 $xhtml=true; 00008 $Auteur=""; 00009 $Licence="4"; 00010 $Annee="2010"; 00011 $topicType = 'Whitepaper'; 00012 $meta = '<link rel="stylesheet" type="text/css" media="screen" href="https://www.developpez.com/public/css/index2.css" /><link rel="stylesheet" type="text/css" media="screen" href="tabs.css" /><link rel="stylesheet" type="text/css" media="screen" href="doxygen.css" />'; 00013 include($_SERVER["DOCUMENT_ROOT"]."/template/entete.php"); 00014 00015 ob_start(); 00016 ?> 00017 <!-- Généré par Doxygen 1.7.1 --> 00018 <div class="navigation" id="top"> 00019 <div class="tabs"> 00020 <ul class="tablist"> 00021 <li><a href="index.php"><span>Page principale</span></a></li> 00022 <li><a href="namespaces.php"><span>Espaces de nommage</span></a></li> 00023 <li><a href="annotated.php"><span>Classes</span></a></li> 00024 <li class="current"><a href="files.php"><span>Fichiers</span></a></li> 00025 </ul> 00026 </div> 00027 <div class="tabs2"> 00028 <ul class="tablist"> 00029 <li><a href="files.php"><span>Liste des fichiers</span></a></li> 00030 </ul> 00031 </div> 00032 <div class="header"> 00033 <div class="headertitle"> 00034 <h1>imageviewer.hpp</h1> </div> 00035 </div> 00036 <div class="contents"> 00037 <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> 00038 <a name="l00002"></a>00002 <span class="comment">Copyright © 2010 alexandre petitjean</span> 00039 <a name="l00003"></a>00003 <span class="comment"></span> 00040 <a name="l00004"></a>00004 <span class="comment">This file is part of QExtend.</span> 00041 <a name="l00005"></a>00005 <span class="comment"></span> 00042 <a name="l00006"></a>00006 <span class="comment">QExtend is free software: you can redistribute it and/or modify</span> 00043 <a name="l00007"></a>00007 <span class="comment">it under the terms of the GNU General Public License as published by</span> 00044 <a name="l00008"></a>00008 <span class="comment">the Free Software Foundation, either version 3 of the License, or</span> 00045 <a name="l00009"></a>00009 <span class="comment">any later version.</span> 00046 <a name="l00010"></a>00010 <span class="comment"></span> 00047 <a name="l00011"></a>00011 <span class="comment">QExtend is distributed in the hope that it will be useful,</span> 00048 <a name="l00012"></a>00012 <span class="comment">but WITHOUT ANY WARRANTY; without even the implied warranty of</span> 00049 <a name="l00013"></a>00013 <span class="comment">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> 00050 <a name="l00014"></a>00014 <span class="comment">GNU General Public License for more details.</span> 00051 <a name="l00015"></a>00015 <span class="comment"></span> 00052 <a name="l00016"></a>00016 <span class="comment">You should have received a copy of the GNU General Public License</span> 00053 <a name="l00017"></a>00017 <span class="comment">along with QExtend. If not, see <http://www.gnu.org/licenses/>.</span> 00054 <a name="l00018"></a>00018 <span class="comment">*/</span> 00055 <a name="l00019"></a>00019 00056 <a name="l00020"></a>00020 <span class="preprocessor">#ifndef QEXTEND_IMAGEVIEWER_H</span> 00057 <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define QEXTEND_IMAGEVIEWER_H</span> 00058 <a name="l00022"></a>00022 <span class="preprocessor"></span> 00059 <a name="l00023"></a>00023 <span class="preprocessor">#include <QtGui/QImage></span> 00060 <a name="l00024"></a>00024 <span class="preprocessor">#include <QtGui/QLabel></span> 00061 <a name="l00025"></a>00025 <span class="preprocessor">#include <QtGui/QScrollArea></span> 00062 <a name="l00026"></a>00026 <span class="preprocessor">#include <QtGui/QWidget></span> 00063 <a name="l00027"></a>00027 00064 <a name="l00028"></a>00028 <span class="preprocessor">#include <QExtend/Core/qextend_global></span> 00065 <a name="l00029"></a>00029 00066 <a name="l00032"></a>00032 00067 <a name="l00039"></a>00039 <span class="keyword">namespace </span>QExtend { 00068 <a name="l00040"></a><a class="code" href="class_q_extend_1_1_image_viewer.php">00040</a> <span class="keyword">class </span>QEXTEND_EXPORT <a class="code" href="class_q_extend_1_1_image_viewer.php">ImageViewer</a> : <span class="keyword">public</span> QScrollArea 00069 <a name="l00041"></a>00041 { 00070 <a name="l00042"></a>00042 Q_OBJECT 00071 <a name="l00043"></a><a class="code" href="class_q_extend_1_1_image_viewer.php#a6f807bba2448f4f099c88d5b70f994ea">00043</a> Q_PROPERTY(<a class="code" href="class_q_extend_1_1_image_viewer.php#a06b3f5bc67757f5e29ed1e7f27137a07" title="Enumeration des modes d&#39;interaction avec la souris.">MouseInteractionMode</a> mouseInteraction WRITE setMouseInteraction READ mouseInteraction) 00072 <a name="l00044"></a>00044 00073 <a name="l00045"></a>00045 <span class="keyword">public</span>: 00074 <a name="l00048"></a><a class="code" href="class_q_extend_1_1_image_viewer.php#a06b3f5bc67757f5e29ed1e7f27137a07">00048</a> <span class="keyword">enum</span> <a class="code" href="class_q_extend_1_1_image_viewer.php#a06b3f5bc67757f5e29ed1e7f27137a07" title="Enumeration des modes d&#39;interaction avec la souris.">MouseInteractionMode</a> 00075 <a name="l00049"></a>00049 { 00076 <a name="l00050"></a><a class="code" href="class_q_extend_1_1_image_viewer.php#a06b3f5bc67757f5e29ed1e7f27137a07a353d47348411d6041862aaf9eb9db69e">00050</a> NoInteraction, 00077 <a name="l00051"></a><a class="code" href="class_q_extend_1_1_image_viewer.php#a06b3f5bc67757f5e29ed1e7f27137a07a277268224787bb6c2b4913fb8a27cadb">00051</a> DragAndWheelzoom, 00078 <a name="l00052"></a><a class="code" href="class_q_extend_1_1_image_viewer.php#a06b3f5bc67757f5e29ed1e7f27137a07a50fb59c22c4f1632bc6a16b7c0357138">00052</a> DragToZoom 00079 <a name="l00053"></a>00053 }; 00080 <a name="l00054"></a>00054 00081 <a name="l00055"></a>00055 <span class="keyword">private</span>: 00082 <a name="l00056"></a>00056 <span class="comment">// This part from Qt 4.6 Image Viewer example</span> 00083 <a name="l00057"></a>00057 <span class="keywordtype">double</span> m_scaleFactor; 00084 <a name="l00058"></a>00058 <span class="keywordtype">void</span> scaleImage(<span class="keywordtype">double</span> factor); 00085 <a name="l00059"></a>00059 <span class="keywordtype">void</span> adjustScrollBar(QScrollBar *scrollBar, <span class="keywordtype">double</span> factor); 00086 <a name="l00060"></a>00060 00087 <a name="l00061"></a>00061 QLabel m_imageRender; 00088 <a name="l00062"></a>00062 MouseInteractionMode m_mouseInteraction; 00089 <a name="l00063"></a>00063 <span class="keywordtype">bool</span> m_isDragging; 00090 <a name="l00064"></a>00064 QPointF m_previousPos; 00091 <a name="l00065"></a>00065 00092 <a name="l00066"></a>00066 <span class="keyword">protected</span>: 00093 <a name="l00067"></a>00067 <span class="keywordtype">void</span> mouseMoveEvent(QMouseEvent *event); 00094 <a name="l00068"></a>00068 <span class="keywordtype">void</span> mousePressEvent(QMouseEvent *event); 00095 <a name="l00069"></a>00069 <span class="keywordtype">void</span> mouseReleaseEvent(QMouseEvent *event); 00096 <a name="l00070"></a>00070 <span class="keywordtype">void</span> wheelEvent(QWheelEvent *event); 00097 <a name="l00071"></a>00071 00098 <a name="l00072"></a>00072 <span class="keyword">public</span>: 00099 <a name="l00075"></a>00075 00100 <a name="l00082"></a>00082 <a class="code" href="class_q_extend_1_1_image_viewer.php">ImageViewer</a>(QWidget *parent = 0); 00101 <a name="l00083"></a>00083 00102 <a name="l00086"></a>00086 00103 <a name="l00093"></a>00093 <span class="keywordtype">void</span> loadImage(<span class="keyword">const</span> QString &imagePath); 00104 <a name="l00096"></a>00096 00105 <a name="l00103"></a>00103 <span class="keywordtype">void</span> loadImage(<span class="keyword">const</span> QImage &image); 00106 <a name="l00106"></a>00106 00107 <a name="l00113"></a>00113 <span class="keywordtype">void</span> loadImage(<span class="keyword">const</span> QPixmap &pixmap); 00108 <a name="l00114"></a>00114 00109 <a name="l00117"></a>00117 00110 <a name="l00124"></a>00124 <span class="keywordtype">void</span> setMouseInteraction(MouseInteractionMode interaction); 00111 <a name="l00127"></a>00127 00112 <a name="l00134"></a>00134 MouseInteractionMode mouseInteraction() <span class="keyword">const</span>; 00113 <a name="l00135"></a>00135 }; 00114 <a name="l00136"></a>00136 } 00115 <a name="l00137"></a>00137 00116 <a name="l00138"></a>00138 <span class="preprocessor">#endif //QEXTEND_IMAGEVIEWER_H</span> 00117 </pre></div></div> 00118 </div> 00119 <?php 00120 echo utf8_decode(ob_get_clean()); 00121 include($_SERVER["DOCUMENT_ROOT"]."/template/pied.php"); 00122 ?>
Les sources présentées sur cette page sont libres de droits et vous pouvez les utiliser à votre convenance. Par contre, la page de présentation constitue une œuvre intellectuelle protégée par les droits d'auteur. Copyright © 2010 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site ni de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon vous encourez selon la loi jusqu'à trois ans de prison et jusqu'à 300 000 € de dommages et intérêts.