Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
clients
python
sakia
Commits
3ba8941c
Commit
3ba8941c
authored
Feb 17, 2017
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Resize tree view height
parent
b65213ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sakia/models/generic_tree.py
+6
-8
6 additions, 8 deletions
src/sakia/models/generic_tree.py
with
6 additions
and
8 deletions
src/sakia/models/generic_tree.py
+
6
−
8
View file @
3ba8941c
"""
from
PyQt5.QtCore
import
QAbstractItemModel
,
QModelIndex
,
Qt
,
QSize
Created on 5 févr. 2014
from
PyQt5.QtGui
import
QIcon
,
QTextDocument
@author: inso
"""
from
PyQt5.QtCore
import
QAbstractItemModel
,
QModelIndex
,
Qt
from
PyQt5.QtGui
import
QIcon
import
logging
import
logging
...
@@ -48,6 +42,9 @@ class NodeItem(QAbstractItemModel):
...
@@ -48,6 +42,9 @@ class NodeItem(QAbstractItemModel):
if
role
==
Qt
.
DecorationRole
and
'
icon
'
in
self
.
node
:
if
role
==
Qt
.
DecorationRole
and
'
icon
'
in
self
.
node
:
return
QIcon
(
self
.
node
[
'
icon
'
])
return
QIcon
(
self
.
node
[
'
icon
'
])
if
role
==
Qt
.
SizeHintRole
:
return
QSize
(
1
,
22
)
if
role
==
GenericTreeModel
.
ROLE_RAW_DATA
:
if
role
==
GenericTreeModel
.
ROLE_RAW_DATA
:
return
self
.
node
return
self
.
node
...
@@ -105,6 +102,7 @@ class GenericTreeModel(QAbstractItemModel):
...
@@ -105,6 +102,7 @@ class GenericTreeModel(QAbstractItemModel):
if
role
in
(
Qt
.
DisplayRole
,
if
role
in
(
Qt
.
DisplayRole
,
Qt
.
DecorationRole
,
Qt
.
DecorationRole
,
Qt
.
ToolTipRole
,
Qt
.
ToolTipRole
,
Qt
.
SizeHintRole
,
GenericTreeModel
.
ROLE_RAW_DATA
)
\
GenericTreeModel
.
ROLE_RAW_DATA
)
\
and
index
.
column
()
==
0
:
and
index
.
column
()
==
0
:
return
item
.
data
(
0
,
role
)
return
item
.
data
(
0
,
role
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment