Changeset 561 for trunk/doc/src/snippets/code/doc_src_layout.qdoc
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/doc/src/snippets/code/doc_src_layout.qdoc
r2 r561 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1 42 //! [0] 2 43 #ifndef CARD_H 3 44 #define CARD_H 4 45 5 #include <Q Layout>46 #include <Q> 6 47 #include <QList> 7 48 … … 9 50 { 10 51 public: 11 CardLayout(QWidget *parent, int dist) 12 : QLayout(parent, 0, dist) {} 13 CardLayout(QLayout *parent, int dist) 14 : QLayout(parent, dist) {} 15 CardLayout(int dist) 16 : QLayout(dist) {} 52 CardLayout(QWidget *parent, int dist): QLayout(parent, 0, dist) {} 53 CardLayout(QLayout *parent, int dist): QLayout(parent, dist) {} 54 CardLayout(int dist): QLayout(dist) {} 17 55 ~CardLayout(); 18 56 … … 20 58 QSize sizeHint() const; 21 59 QSize minimumSize() const; 60 22 61 QLayoutItem *itemAt(int) const; 23 62 QLayoutItem *takeAt(int); … … 32 71 33 72 //! [1] 34 #include "card.h"73 #include "card.h" 35 74 //! [1] 36 75 76 77 78 79 80 81 82 37 83 38 //! [ 2]84 //! [] 39 85 QLayoutItem *CardLayout::itemAt(int idx) const 40 86 { … … 49 95 return idx >= 0 && idx < list.size() ? list.takeAt(idx) : 0; 50 96 } 51 //! [2]52 53 54 //! [3]55 void CardLayout::addItem(QLayoutItem *item)56 {57 list.append(item);58 }59 97 //! [3] 60 98 61 99 62 100 //! [4] 63 CardLayout::~CardLayout()101 ) 64 102 { 65 deleteAllItems();103 ); 66 104 } 67 105 //! [4] … … 69 107 70 108 //! [5] 109 110 111 112 113 114 115 116 117 118 71 119 void CardLayout::setGeometry(const QRect &r) 72 120 { … … 86 134 } 87 135 } 88 //! [ 5]136 //! [] 89 137 90 138 91 //! [ 6]139 //! [] 92 140 QSize CardLayout::sizeHint() const 93 141 { … … 117 165 return s + n*QSize(spacing(), spacing()); 118 166 } 119 //! [ 6]167 //! []
Note:
See TracChangeset
for help on using the changeset viewer.