QPushButton *button = new QPushButton("Click me", parent); button->move(100, 50); // Move button 100 pixels to the right and 50 pixels down
QPushButton *button1 = new QPushButton("Move button", parent); QPushButton *button2 = new QPushButton("button", parent); QObject::connect(button1, &QPushButton::clicked, [=]() { button2->move(200, 100); // Move button2 to a new position when button1 is clicked });These examples use the Qt library for GUI programming in C++. Specifically, the `QPushButton` class is part of the `QtWidgets` module.