Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
grapa_alisa
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alisa Jung
grapa_alisa
Commits
00286a48
Commit
00286a48
authored
Nov 23, 2015
by
Alisa Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display changed name in status bar
parent
bdc74ec5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
controller.cpp
helloqube/controller.cpp
+4
-3
controller.h
helloqube/controller.h
+1
-1
mainwindow.cpp
helloqube/mainwindow.cpp
+3
-4
No files found.
helloqube/controller.cpp
View file @
00286a48
...
@@ -292,15 +292,16 @@ void Controller::itemSelected(QModelIndex q){
...
@@ -292,15 +292,16 @@ void Controller::itemSelected(QModelIndex q){
void
Controller
::
itemDoubleClicked
(
QModelIndex
q
){
void
Controller
::
itemDoubleClicked
(
QModelIndex
q
){
qDebug
()
<<
"item Double clicked. Row: "
<<
q
.
row
()
<<
", column: "
<<
q
.
column
();
qDebug
()
<<
"item Double clicked. Row: "
<<
q
.
row
()
<<
", column: "
<<
q
.
column
();
selectedItem
=
scene
->
getItem
(
q
)
;
selectedItem
Index
=
q
;
}
}
QString
Controller
::
getCurrentName
(){
QString
Controller
::
getCurrentName
(){
return
s
electedItem
->
getName
();
return
s
cene
->
getItem
(
selectedItemIndex
)
->
getName
();
}
}
void
Controller
::
changeItemName
(
QString
q
){
void
Controller
::
changeItemName
(
QString
q
){
//TODO this is not working.
//TODO this is not working.
qDebug
()
<<
"Name entered: "
<<
q
;
qDebug
()
<<
"Name entered: "
<<
q
;
selectedItem
->
setName
(
q
);
scene
->
getItem
(
selectedItemIndex
)
->
setName
(
q
);
itemSelected
(
selectedItemIndex
);
}
}
helloqube/controller.h
View file @
00286a48
...
@@ -79,7 +79,7 @@ private:
...
@@ -79,7 +79,7 @@ private:
RigidBodyTransformation
*
currentTransform
;
RigidBodyTransformation
*
currentTransform
;
TreeItem
*
selectedItem
;
//might equal currentTransform. Or not.
QModelIndex
selectedItemIndex
;
//might equal currentTransform. Or not.
SceneGraph
*
scene
;
SceneGraph
*
scene
;
...
...
helloqube/mainwindow.cpp
View file @
00286a48
...
@@ -257,14 +257,13 @@ MainWindow::MainWindow(QWidget *parent)
...
@@ -257,14 +257,13 @@ MainWindow::MainWindow(QWidget *parent)
connect
(
treeView
,
SIGNAL
(
clicked
(
QModelIndex
)),
controller
,
SLOT
(
itemSelected
(
QModelIndex
)));
connect
(
treeView
,
SIGNAL
(
clicked
(
QModelIndex
)),
controller
,
SLOT
(
itemSelected
(
QModelIndex
)));
connect
(
treeView
,
SIGNAL
(
doubleClicked
(
QModelIndex
)),
controller
,
SLOT
(
itemDoubleClicked
(
QModelIndex
)));
connect
(
treeView
,
SIGNAL
(
doubleClicked
(
QModelIndex
)),
controller
,
SLOT
(
itemDoubleClicked
(
QModelIndex
)));
connect
(
treeView
,
SIGNAL
(
objectNameChanged
(
QString
)),
controller
,
SLOT
(
changeItemName
(
QString
)));
connect
(
treeView
,
SIGNAL
(
doubleClicked
(
QModelIndex
)),
this
,
SLOT
(
showTextEditBox
()));
connect
(
treeView
,
SIGNAL
(
doubleClicked
(
QModelIndex
)),
this
,
SLOT
(
showTextEditBox
()));
controller
->
initTreeView
(
treeView
);
controller
->
initTreeView
(
treeView
);
textInput
=
new
QLineEdit
(
toolBar
);
//
textInput = new QLineEdit(toolBar);
textInput
->
setText
(
"Test"
);
//
textInput->setText("Test");
toolBar
->
addWidget
(
textInput
);
//
toolBar->addWidget(textInput);
}
}
...
...
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