简体   繁体   中英

QT Custom Layout Example For Overlappig Widgets Doesn't Compile

Using QT 5.11, I am attempting to overlap a series of widgets. Using Google, I found this , which references Layout Management . I've copied the source code, but it doesn't compile. The problem is that the header file attempts to initialize QLayout with 3 different signatures, none of which exist.

CardLayout(QWidget *parent, int dist): QLayout(parent, 0, dist) {}
CardLayout(QLayout *parent, int dist): QLayout(parent, dist) {}
CardLayout(int dist): QLayout(dist) {}

None of these signatures appear in either the 4.8 or 5.12 documentation for QLayout, and I have been unable to find any reference to this usage. What am I missing?

The card example comes from Qt3 (Stone Age). QLayout used to have the following interface in Qt3:

QLayout ( QWidget * parent, int margin = 0, int spacing = -1, const char * name = 0 );
QLayout ( QLayout * parentLayout, int spacing = -1, const char * name = 0 );
QLayout ( int spacing = -1, const char * name = 0 );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM