From f0ad71fb7cd10ca9c9bad174eb2184a6e3633a76 Mon Sep 17 00:00:00 2001 From: Uwe Date: Tue, 26 Feb 2019 22:13:43 +0100 Subject: [PATCH] making buttons resizable --- examples/mycontrols/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/mycontrols/main.cpp b/examples/mycontrols/main.cpp index 7cc727a6..0ed3df0f 100644 --- a/examples/mycontrols/main.cpp +++ b/examples/mycontrols/main.cpp @@ -47,18 +47,20 @@ class ContentBox : public QskBox auto layout = new QskLinearBox( Qt::Horizontal, 2, this ); layout->setMargins( 10 ); - layout->setSpacing( 10 ); + layout->setSpacing( 20 ); layout->setDefaultAlignment( Qt::AlignCenter ); layout->setExtraSpacingAt( Qt::BottomEdge ); { auto button = new MyToggleButton( layout ); + button->setSizePolicy( QskSizePolicy::MinimumExpanding, QskSizePolicy::MinimumExpanding ); button->setTextAt( 0, "On" ); button->setTextAt( 1, "Off" ); } { auto button = new MyToggleButton( layout ); + button->setSizePolicy( QskSizePolicy::MinimumExpanding, QskSizePolicy::MinimumExpanding ); button->setIconAt( 0, "image://shapes/Ring/Khaki" ); button->setIconAt( 1, "image://shapes/Diamond/Khaki" ); }