Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package;
- import qt.core.Application;
- import qt.layout.HBoxLayout;
- import qt.layout.VBoxLayout;
- import qt.widgets.CheckBox;
- import qt.widgets.MainWindow;
- import qt.widgets.PushButton;
- import qt.widgets.Widget;
- @:buildXml('
- <files id="haxe">
- <compilerflag value="-IC:\\Qt\\5.7\\msvc2015_64\\include"/>
- </files>
- <target id="haxe">
- <lib name="C:/Qt/5.7/msvc2015_64/lib/Qt5Core.lib" />
- <lib name="C:/Qt/5.7/msvc2015_64/lib/Qt5Widgets.lib" />
- <lib name="C:/Qt/5.7/msvc2015_64/lib/Qt5Gui.lib" />
- </target>
- ')
- class Main {
- static function main() {
- var app = new Application();
- var main = new MainWindow();
- main.resize(800, 600);
- main.show();
- var central = new Widget();
- main.centralWindow = central;
- var vbox = new Widget();
- vbox.parent = central;
- var vboxLayout = new VBoxLayout();
- var button = new PushButton(); button.text = "Button 1"; vboxLayout.addWidget(button);
- var button = new PushButton(); button.text = "Button 2"; vboxLayout.addWidget(button);
- var button = new PushButton(); button.text = "Button 3"; vboxLayout.addWidget(button);
- var button = new PushButton(); button.text = "Button 4"; vboxLayout.addWidget(button);
- var button = new PushButton(); button.text = "Button 5"; vboxLayout.addWidget(button);
- vbox.layout = vboxLayout;
- /*
- var button = new PushButton();
- button.parent = central;
- button.text = "&Test1";
- button.x = 10;
- button.y = 10;
- button.connectClicked(clickHandler);
- var checkbox = new CheckBox();
- checkbox.parent = central;
- checkbox.text = "Test2";
- checkbox.x = 10;
- checkbox.y = 40;
- checkbox.connectClicked(function(checked:Bool = false) {
- trace("Checkbox clicked: " + checked);
- });
- */
- central.show();
- app.exec();
- }
- static function clickHandler() {
- trace("Button clicked!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement