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
d9772752
Commit
d9772752
authored
Oct 21, 2015
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MAnu and ToolBar
parent
005b6880
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
13 deletions
+36
-13
hellocube.pro
A1/hellocube/hellocube.pro
+0
-1
hellocube.pro.user
A1/hellocube/hellocube.pro.user
+2
-2
mainwindow.cpp
A1/hellocube/mainwindow.cpp
+27
-10
mainwindow.h
A1/hellocube/mainwindow.h
+7
-0
No files found.
A1/hellocube/hellocube.pro
View file @
d9772752
...
@@ -11,7 +11,6 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
...
@@ -11,7 +11,6 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET
=
hellocube
TARGET
=
hellocube
TEMPLATE
=
app
TEMPLATE
=
app
SOURCES
+=
main
.
cpp
\
SOURCES
+=
main
.
cpp
\
mainwindow
.
cpp
mainwindow
.
cpp
...
...
A1/hellocube/hellocube.pro.user
View file @
d9772752
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2015-10-2
0T22:00:43
. -->
<!-- Written by QtCreator 3.5.1, 2015-10-2
1T15:50:15
. -->
<qtcreator>
<qtcreator>
<data>
<data>
<variable>
EnvironmentId
</variable>
<variable>
EnvironmentId
</variable>
...
@@ -413,7 +413,7 @@
...
@@ -413,7 +413,7 @@
<value
type=
"int"
>
13
</value>
<value
type=
"int"
>
13
</value>
<value
type=
"int"
>
14
</value>
<value
type=
"int"
>
14
</value>
</valuelist>
</valuelist>
<value
type=
"int"
key=
"PE.EnvironmentAspect.Base"
>
-1
</value>
<value
type=
"int"
key=
"PE.EnvironmentAspect.Base"
>
2
</value>
<valuelist
type=
"QVariantList"
key=
"PE.EnvironmentAspect.Changes"
/>
<valuelist
type=
"QVariantList"
key=
"PE.EnvironmentAspect.Changes"
/>
<value
type=
"QString"
key=
"ProjectExplorer.CustomExecutableRunConfiguration.Arguments"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.CustomExecutableRunConfiguration.Arguments"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.CustomExecutableRunConfiguration.Executable"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.CustomExecutableRunConfiguration.Executable"
></value>
...
...
A1/hellocube/mainwindow.cpp
View file @
d9772752
...
@@ -9,43 +9,51 @@ MainWindow::MainWindow(QWidget *parent)
...
@@ -9,43 +9,51 @@ MainWindow::MainWindow(QWidget *parent)
setWindowTitle
(
"Hello Cube"
);
setWindowTitle
(
"Hello Cube"
);
menuBar
=
new
QMenuBar
();
menuBar
=
new
QMenuBar
();
toolBar
=
new
QToolBar
(
"Shading"
,
this
);
statusBar
=
new
QStatusBar
(
this
);
//File Menu Actions
fileMenu
=
new
QMenu
(
"&File"
);
fileMenu
=
new
QMenu
(
"&File"
);
shadingMenu
=
new
QMenu
(
"Shading"
);
shadingMenu
=
new
QMenu
(
"Shading"
);
shadingGroup
=
new
QActionGroup
(
shadingMenu
);
//Shader Menu Actions
exitAction
=
new
QAction
(
"E&xit"
,
fileMenu
);
exitAction
=
new
QAction
(
"E&xit"
,
fileMenu
);
exitAction
->
setShortcut
(
QKeySequence
::
Quit
);
exitAction
->
setShortcut
(
QKeySequence
::
Quit
);
connect
(
exitAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
close
()));
connect
(
exitAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
close
()));
shadingGroup
=
new
QActionGroup
(
fileMenu
);
noneAction
=
new
QAction
(
"None"
,
shadingMenu
);
noneAction
=
new
QAction
(
"None"
,
shadingMenu
);
noneAction
->
setShortcut
(
QKeySequence
(
"Ctrl+1"
));
noneAction
->
setShortcut
(
QKeySequence
(
"Ctrl+1"
));
noneAction
->
setCheckable
(
true
);
noneAction
->
setCheckable
(
true
);
shadingGroup
->
addAction
(
noneAction
);
noneAction
->
setIcon
(
QIcon
(
":/img/wireframe.png"
));
noneAction
->
setIcon
(
QIcon
(
":/img/wireframe.png"
));
shadingGroup
->
addAction
(
noneAction
);
flatAction
=
new
QAction
(
"Flat"
,
shadingMenu
);
flatAction
=
new
QAction
(
"Flat"
,
shadingMenu
);
flatAction
->
setShortcut
(
QKeySequence
(
"Ctrl+2"
));
flatAction
->
setShortcut
(
QKeySequence
(
"Ctrl+2"
));
flatAction
->
setCheckable
(
true
);
flatAction
->
setCheckable
(
true
);
flatAction
->
setChecked
(
true
);
flatAction
->
setChecked
(
true
);
shadingGroup
->
addAction
(
flatAction
);
flatAction
->
setIcon
(
QIcon
(
":/img/flat.png"
));
flatAction
->
setIcon
(
QIcon
(
":/img/flat.png"
));
shadingGroup
->
addAction
(
flatAction
);
gouraudAction
=
new
QAction
(
"Gouraud"
,
shadingMenu
);
gouraudAction
=
new
QAction
(
"Gouraud"
,
shadingMenu
);
gouraudAction
->
setShortcut
(
QKeySequence
(
"Ctrl+3"
));
gouraudAction
->
setShortcut
(
QKeySequence
(
"Ctrl+3"
));
gouraudAction
->
setCheckable
(
true
);
gouraudAction
->
setCheckable
(
true
);
shadingGroup
->
addAction
(
gouraudAction
);
gouraudAction
->
setIcon
(
QIcon
(
":/img/gouraud.png"
));
gouraudAction
->
setIcon
(
QIcon
(
":/img/gouraud.png"
));
shadingGroup
->
addAction
(
gouraudAction
);
phongAction
=
new
QAction
(
"Phong"
,
shadingMenu
);
phongAction
=
new
QAction
(
"Phong"
,
shadingMenu
);
phongAction
->
setShortcut
(
QKeySequence
(
"Ctrl+4"
));
phongAction
->
setShortcut
(
QKeySequence
(
"Ctrl+4"
));
phongAction
->
setCheckable
(
true
);
phongAction
->
setCheckable
(
true
);
shadingGroup
->
addAction
(
phongAction
);
phongAction
->
setIcon
(
QIcon
(
":/img/phong.png"
));
phongAction
->
setIcon
(
QIcon
(
":/img/phong.png"
));
shadingGroup
->
addAction
(
phongAction
);
//Other Actions
aboutAction
=
new
QAction
(
"About"
,
menuBar
);
connect
(
aboutAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
showAboutBox
()));
camHome
=
new
QAction
(
QIcon
(
":/img/cam_home.png"
),
"Cam Home"
,
toolBar
);
// Assemble Menus
fileMenu
->
addAction
(
exitAction
);
fileMenu
->
addAction
(
exitAction
);
menuBar
->
addMenu
(
fileMenu
);
menuBar
->
addMenu
(
fileMenu
);
...
@@ -55,13 +63,22 @@ MainWindow::MainWindow(QWidget *parent)
...
@@ -55,13 +63,22 @@ MainWindow::MainWindow(QWidget *parent)
shadingMenu
->
addAction
(
phongAction
);
shadingMenu
->
addAction
(
phongAction
);
menuBar
->
addMenu
(
shadingMenu
);
menuBar
->
addMenu
(
shadingMenu
);
aboutAction
=
new
QAction
(
"About"
,
menuBar
);
connect
(
aboutAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
showAboutBox
()));
menuBar
->
addAction
(
aboutAction
);
menuBar
->
addAction
(
aboutAction
);
setMenuBar
(
menuBar
);
setMenuBar
(
menuBar
);
//Assemble Tool Bar
toolBar
->
addAction
(
noneAction
);
toolBar
->
addAction
(
flatAction
);
toolBar
->
addAction
(
gouraudAction
);
toolBar
->
addAction
(
phongAction
);
toolBar
->
addAction
(
camHome
);
addToolBar
(
toolBar
);
statusBar
->
showMessage
(
"Hello"
);
setStatusBar
(
statusBar
);
}
}
MainWindow
::~
MainWindow
()
MainWindow
::~
MainWindow
()
...
...
A1/hellocube/mainwindow.h
View file @
d9772752
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
#include <QActionGroup>
#include <QActionGroup>
#include <QIcon>
#include <QIcon>
#include <QMessageBox>
#include <QMessageBox>
#include <QToolBar>
#include <QStatusBar>
class
MainWindow
:
public
QMainWindow
class
MainWindow
:
public
QMainWindow
...
@@ -29,6 +31,11 @@ private:
...
@@ -29,6 +31,11 @@ private:
QAction
*
aboutAction
;
QAction
*
aboutAction
;
QAction
*
camHome
;
QToolBar
*
toolBar
;
QStatusBar
*
statusBar
;
public
:
public
:
MainWindow
(
QWidget
*
parent
=
0
);
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