Guest User

Untitled

a guest
Jun 4th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1.    class Widget : public WCompositeWidget {
  2.    
  3.       WVBoxLayout* southLayout;
  4.  
  5.       void Reset () {
  6.          southLayout->clear();
  7.          southLayout->addLayout(new WVBoxLayout);
  8.       }
  9.  
  10.       public:
  11.          Widget (WContainerWidget* parent = nullptr)
  12.          : WCompositeWidget(parent), southLayout(nullptr)
  13.          {
  14.             auto impl = new WContainerWidget;
  15.             auto layout = new WVBoxLayout(impl);
  16.             setImplementation(impl);
  17.  
  18.             auto btnReset = new WPushButton("reset");
  19.             btnReset->clicked().connect(this, &Widget::Reset);
  20.             layout->addWidget(btnReset, 0, AlignCenter);
  21.  
  22.  
  23.             southLayout = new WVBoxLayout;
  24.             layout->addLayout(southLayout);
  25.  
  26.  
  27.             Reset();
  28.          }
  29.    };
Advertisement
Add Comment
Please, Sign In to add comment