Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GraPa
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
GraPa
Commits
57112c5e
Commit
57112c5e
authored
Oct 21, 2015
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added cubewidget.cpp
parent
d9772752
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
4 deletions
+84
-4
cubewidget.cpp
A1/hellocube/cubewidget.cpp
+41
-0
cubewidget.h
A1/hellocube/cubewidget.h
+27
-0
hellocube.pro
A1/hellocube/hellocube.pro
+5
-3
hellocube.pro.user
A1/hellocube/hellocube.pro.user
+1
-1
main.cpp
A1/hellocube/main.cpp
+1
-0
mainwindow.cpp
A1/hellocube/mainwindow.cpp
+5
-0
mainwindow.h
A1/hellocube/mainwindow.h
+4
-0
No files found.
A1/hellocube/cubewidget.cpp
0 → 100644
View file @
57112c5e
#include "cubewidget.h"
#include <QOpenGLFunctions>
CubeWidget
::
CubeWidget
(
QWidget
*
parent
)
:
QGLWidget
(
QGLFormat
(
QGL
::
SampleBuffers
),
parent
)
{
}
QSize
CubeWidget
::
minimumSizeHint
()
const
{
return
QSize
(
50
,
50
);
}
QSize
CubeWidget
::
sizeHint
()
const
{
return
QSize
(
600
,
400
);
}
void
CubeWidget
::
initializeGL
()
{
glEnable
(
GL_DEPTH_TEST
);
/* glEnable(GL_CULL_FACE);
glShadeModel(GL_SMOOTH);
glEnable(GL_MULTISAMPLE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
static GLfloat lightPosition[4] = { 0.5, 0.0, 2.0, 1.0 };
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
*/
}
void
CubeWidget
::
paintGL
(
)
{}
void
CubeWidget
::
resizeGL
(
int
width
,
int
height
)
{}
void
CubeWidget
::
mousePressEvent
(
QMouseEvent
*
event
)
{}
void
CubeWidget
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{}
void
CubeWidget
::
wheelEvent
(
QWheelEvent
*
event
)
{}
A1/hellocube/cubewidget.h
0 → 100644
View file @
57112c5e
#ifndef CUBEWIDGET_H
#define CUBEWIDGET_H
#include <QtGui>
#include <QtOpenGL>
#include <QOpenGLFunctions>
class
CubeWidget
:
public
QGLWidget
{
protected
:
void
initializeGL
(
)
;
void
paintGL
(
)
;
void
resizeGL
(
int
width
,
int
height
)
;
void
mousePressEvent
(
QMouseEvent
*
event
)
;
void
mouseMoveEvent
(
QMouseEvent
*
event
)
;
void
wheelEvent
(
QWheelEvent
*
event
)
;
public
:
CubeWidget
(
QWidget
*
parent
=
0
);
QSize
minimumSizeHint
()
const
;
QSize
sizeHint
()
const
;
};
#endif // CUBEWIDGET_H
A1/hellocube/hellocube.pro
View file @
57112c5e
...
...
@@ -4,7 +4,7 @@
#
#-------------------------------------------------
QT
+=
core
gui
QT
+=
core
gui
opengl
greaterThan
(
QT_MAJOR_VERSION
,
4
)
:
QT
+=
widgets
...
...
@@ -12,9 +12,11 @@ TARGET = hellocube
TEMPLATE
=
app
SOURCES
+=
main
.
cpp
\
mainwindow
.
cpp
mainwindow
.
cpp
\
cubewidget
.
cpp
HEADERS
+=
mainwindow
.
h
HEADERS
+=
mainwindow
.
h
\
cubewidget
.
h
RESOURCES
+=
\
hellocube
.
qrc
A1/hellocube/hellocube.pro.user
View file @
57112c5e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2015-10-21T
15:50:15
. -->
<!-- Written by QtCreator 3.5.1, 2015-10-21T
20:58:23
. -->
<qtcreator>
<data>
<variable>
EnvironmentId
</variable>
...
...
A1/hellocube/main.cpp
View file @
57112c5e
#include "mainwindow.h"
#include <QApplication>
int
main
(
int
argc
,
char
*
argv
[])
{
QApplication
a
(
argc
,
argv
);
...
...
A1/hellocube/mainwindow.cpp
View file @
57112c5e
...
...
@@ -78,6 +78,11 @@ MainWindow::MainWindow(QWidget *parent)
statusBar
->
showMessage
(
"Hello"
);
setStatusBar
(
statusBar
);
//Main Widget
mainWidget
=
new
CubeWidget
(
this
);
setCentralWidget
(
mainWidget
);
}
...
...
A1/hellocube/mainwindow.h
View file @
57112c5e
...
...
@@ -11,6 +11,8 @@
#include <QToolBar>
#include <QStatusBar>
#include <cubewidget.h>
class
MainWindow
:
public
QMainWindow
{
...
...
@@ -36,6 +38,8 @@ private:
QToolBar
*
toolBar
;
QStatusBar
*
statusBar
;
CubeWidget
*
mainWidget
;
public
:
MainWindow
(
QWidget
*
parent
=
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment