+ added simple qt project with opengl widget & gitignore
This commit is contained in:
parent
e96aa8ac56
commit
91f32eff4e
8 changed files with 149 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
build*
|
||||
*.user
|
||||
*.autosave
|
22
KKK/KKK.pro
Normal file
22
KKK/KKK.pro
Normal file
|
@ -0,0 +1,22 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2016-07-29T18:45:26
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = KKK
|
||||
TEMPLATE = app
|
||||
|
||||
|
||||
SOURCES += main.cpp\
|
||||
mainwindow.cpp \
|
||||
glwindow.cpp
|
||||
|
||||
HEADERS += mainwindow.h \
|
||||
glwindow.h
|
||||
|
||||
FORMS += mainwindow.ui
|
20
KKK/glwindow.cpp
Normal file
20
KKK/glwindow.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include "glwindow.h"
|
||||
|
||||
void GLWindow::initializeGL()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GLWindow::paintGL()
|
||||
{
|
||||
}
|
||||
|
||||
void GLWindow::resizeGL(int width, int height)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
GLWindow::GLWindow(QWidget* parent)
|
||||
{
|
||||
|
||||
}
|
14
KKK/glwindow.h
Normal file
14
KKK/glwindow.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <QOpenGLWidget>
|
||||
|
||||
class GLWindow : public QOpenGLWidget
|
||||
{
|
||||
private:
|
||||
protected:
|
||||
void initializeGL();
|
||||
void paintGL();
|
||||
void resizeGL(int width, int height);
|
||||
public:
|
||||
explicit GLWindow(QWidget* parent);
|
||||
};
|
11
KKK/main.cpp
Normal file
11
KKK/main.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
11
KKK/mainwindow.cpp
Normal file
11
KKK/mainwindow.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include "mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent)
|
||||
{
|
||||
Ui::MainWindow::setupUi(this);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
}
|
15
KKK/mainwindow.h
Normal file
15
KKK/mainwindow.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <ui_mainwindow.h>
|
||||
|
||||
class MainWindow : public QMainWindow, private Ui::MainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
protected:
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
};
|
53
KKK/mainwindow.ui
Normal file
53
KKK/mainwindow.ui
Normal file
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<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">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="GLWindow" name="openGLWidget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>GLWindow</class>
|
||||
<extends>QOpenGLWidget</extends>
|
||||
<header>glwindow.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in a new issue