Skip to content

Instantly share code, notes, and snippets.

@brcontainer
Created October 4, 2016 20:02
Show Gist options
  • Save brcontainer/38aa64dc161ef768dfeaca8a40682998 to your computer and use it in GitHub Desktop.
Save brcontainer/38aa64dc161ef768dfeaca8a40682998 to your computer and use it in GitHub Desktop.
QT example for Wallace
#include "wallacewindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
WallaceWindow w;
w.show();
return a.exec();
}
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = wallace
TEMPLATE = app
SOURCES += main.cpp\
wallacewindow.cpp
HEADERS += wallacewindow.h
FORMS += wallacewindow.ui
#include "wallacewindow.h"
#include "ui_wallacewindow.h"
/*
ui_wallacewindow.h é gerado automaticamente
*/
WallaceWindow::WallaceWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::WallaceWindow)
{
ui->setupUi(this);
}
WallaceWindow::~WallaceWindow()
{
delete ui;
}
#ifndef WALLACEWINDOW_H
#define WALLACEWINDOW_H
#include <QMainWindow>
namespace Ui {
class WallaceWindow;
}
class WallaceWindow : public QMainWindow
{
Q_OBJECT
public:
explicit WallaceWindow(QWidget *parent = 0);
~WallaceWindow();
private:
Ui::WallaceWindow *ui;
};
#endif // WALLACEWINDOW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WallaceWindow</class>
<widget class="QMainWindow" name="WallaceWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>140</x>
<y>120</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment