Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/sublime/ideallayout.h
Show All 16 Lines | 1 | /* | |||
---|---|---|---|---|---|
17 | KDEVELOP TEAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | 17 | KDEVELOP TEAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | ||
18 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | 18 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef KDEVPLATFORM_SUBLIME_IDEALLAYOUT_H | 22 | #ifndef KDEVPLATFORM_SUBLIME_IDEALLAYOUT_H | ||
23 | #define KDEVPLATFORM_SUBLIME_IDEALLAYOUT_H | 23 | #define KDEVPLATFORM_SUBLIME_IDEALLAYOUT_H | ||
24 | 24 | | |||
25 | #include <QLayout> | 25 | #include <QBoxLayout> | ||
26 | 26 | | |||
27 | #include "sublimedefs.h" | 27 | #include "sublimedefs.h" | ||
28 | 28 | | |||
29 | namespace Sublime { | 29 | namespace Sublime { | ||
30 | 30 | | |||
31 | class IdealButtonBarLayout: public QLayout | 31 | class IdealButtonBarLayout: public QBoxLayout | ||
32 | { | 32 | { | ||
33 | Q_OBJECT | 33 | Q_OBJECT | ||
34 | 34 | | |||
35 | public: | 35 | public: | ||
36 | explicit IdealButtonBarLayout(Qt::Orientation orientation, QWidget *parent = nullptr); | 36 | IdealButtonBarLayout(Qt::Orientation orientation, QWidget* styleParent); | ||
kossebau: Please move the * to the type, while you touch the line/argument :) | |||||
37 | 37 | | |||
38 | ~IdealButtonBarLayout() override; | 38 | ~IdealButtonBarLayout() override; | ||
39 | 39 | | |||
40 | void setHeight(int height); | | |||
41 | | ||||
42 | inline Qt::Orientation orientation() const; | 40 | inline Qt::Orientation orientation() const; | ||
43 | 41 | | |||
44 | Qt::Orientations expandingDirections() const override; | 42 | Qt::Orientations expandingDirections() const override; | ||
45 | 43 | | |||
46 | QSize minimumSize() const override; | | |||
47 | | ||||
48 | QSize sizeHint() const override; | | |||
49 | | ||||
50 | void setGeometry(const QRect &rect) override; | | |||
51 | | ||||
52 | void addItem(QLayoutItem *item) override; | | |||
53 | | ||||
54 | QLayoutItem* itemAt(int index) const override; | | |||
55 | | ||||
56 | QLayoutItem* takeAt(int index) override; | | |||
57 | | ||||
58 | int count() const override; | | |||
59 | | ||||
60 | void invalidate() override; | | |||
61 | | ||||
62 | protected: | 44 | protected: | ||
63 | int doVerticalLayout(const QRect &rect, bool updateGeometry = true) const; | | |||
64 | 45 | | |||
65 | int doHorizontalLayout(const QRect &rect, bool updateGeometry = true) const; | 46 | bool eventFilter(QObject* watched, QEvent* event) override; | ||
66 | 47 | | |||
67 | int buttonSpacing() const; | 48 | int buttonSpacing() const; | ||
68 | 49 | | |||
69 | private: | 50 | private: | ||
70 | QList<QLayoutItem *> _items; | 51 | QWidget* const m_styleParentWidget; | ||
71 | const Qt::Orientation _orientation; | 52 | const Qt::Orientation _orientation; | ||
72 | int _height; | | |||
73 | mutable bool m_minSizeDirty : 1; | | |||
74 | mutable bool m_sizeHintDirty : 1; | | |||
75 | mutable bool m_layoutDirty : 1; | | |||
76 | mutable QSize m_min; | | |||
77 | mutable QSize m_hint; | | |||
78 | }; | 53 | }; | ||
79 | 54 | | |||
80 | } | 55 | } | ||
81 | 56 | | |||
82 | #endif | 57 | #endif |
Please move the * to the type, while you touch the line/argument :)