Changeset View
Changeset View
Standalone View
Standalone View
qtests/QLayout/main.cpp
Show All 38 Lines | 35 | public: | |||
---|---|---|---|---|---|
39 | void makeSizeFixed() { | 39 | void makeSizeFixed() { | ||
40 | setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); // like Legend | 40 | setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); // like Legend | ||
41 | setFixedSize( 50, 50 ); // hmm Legend has a layout instead. | 41 | setFixedSize( 50, 50 ); // hmm Legend has a layout instead. | ||
42 | //QGridLayout* layout = new QGridLayout( this ); | 42 | //QGridLayout* layout = new QGridLayout( this ); | ||
43 | // ... | 43 | // ... | ||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | protected: | 46 | protected: | ||
47 | KDAB_REIMP void resizeEvent( QResizeEvent* ) Q_DECL_OVERRIDE { | 47 | KDAB_REIMP void resizeEvent( QResizeEvent* ) override { | ||
48 | // Note that this is never called unless the widget is shown. | 48 | // Note that this is never called unless the widget is shown. | ||
49 | qDebug() << "resizeEvent " << size(); | 49 | qDebug() << "resizeEvent " << size(); | ||
50 | } | 50 | } | ||
51 | }; | 51 | }; | ||
52 | 52 | | |||
53 | class MyWidgetItem : public QWidgetItem | 53 | class MyWidgetItem : public QWidgetItem | ||
54 | { | 54 | { | ||
55 | public: | 55 | public: | ||
56 | explicit MyWidgetItem(QWidget *w) : QWidgetItem(w) { } | 56 | explicit MyWidgetItem(QWidget *w) : QWidgetItem(w) { } | ||
57 | 57 | | |||
58 | KDAB_REIMP bool isEmpty() const Q_DECL_OVERRIDE { return false; } | 58 | KDAB_REIMP bool isEmpty() const override { return false; } | ||
59 | }; | 59 | }; | ||
60 | 60 | | |||
61 | class TestQLayout : public QObject | 61 | class TestQLayout : public QObject | ||
62 | { | 62 | { | ||
63 | Q_OBJECT | 63 | Q_OBJECT | ||
64 | 64 | | |||
65 | private slots: | 65 | private slots: | ||
66 | 66 | | |||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |