QSize s1(100, 50); QSize s2(80, 70); QSize max = s1.expandedTo(s2); //max is (100, 70)
QSize s1(50, 50); QSize s2(50, 50); QSize max = s1.expandedTo(s2); //max is (50, 50)This example creates two QSize objects with identical widths and heights and uses expandedTo to get the largest possible size by taking the maximum width and height between the two sizes. Since both QSize objects are of equal size, the resulting largest size is still (50, 50). This function is a part of the Qt Core library.