Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
bf9fd7b1
Commit
bf9fd7b1
authored
15 years ago
by
hjk
Browse files
Options
Downloads
Patches
Plain Diff
debugger: small copde cleanup in the debugger tooltip widget
parent
6ea24c6e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/debugger/debuggertooltip.cpp
+25
-49
25 additions, 49 deletions
src/plugins/debugger/debuggertooltip.cpp
with
25 additions
and
49 deletions
src/plugins/debugger/debuggertooltip.cpp
+
25
−
49
View file @
bf9fd7b1
...
...
@@ -45,32 +45,6 @@
namespace
Debugger
{
namespace
Internal
{
///////////////////////////////////////////////////////////////////////
//
// TooltipTreeView
//
///////////////////////////////////////////////////////////////////////
class
ToolTipTreeView
:
public
QTreeView
{
public:
ToolTipTreeView
(
QWidget
*
parent
=
0
)
:
QTreeView
(
parent
)
{}
/*
QSize sizeHint() const {
qDebug() << viewport()->size()
<< viewport()->size().boundedTo(QSize(500, 300));
return viewport()->size().boundedTo(QSize(100, 100));
}
*/
};
///////////////////////////////////////////////////////////////////////
//
// TooltipWidget
//
///////////////////////////////////////////////////////////////////////
class
ToolTipWidget
:
public
QTreeView
{
Q_OBJECT
...
...
@@ -78,33 +52,15 @@ class ToolTipWidget : public QTreeView
public:
ToolTipWidget
(
QWidget
*
parent
);
void
done
();
void
run
(
const
QPoint
&
point
,
QAbstractItemModel
*
model
,
const
QModelIndex
&
index
,
const
QString
&
msg
);
bool
eventFilter
(
QObject
*
ob
,
QEvent
*
ev
);
QSize
sizeHint
()
const
{
return
m_size
;
}
int
computeHeight
(
const
QModelIndex
&
index
)
{
int
s
=
rowHeight
(
index
);
for
(
int
i
=
0
;
i
<
model
()
->
rowCount
(
index
);
++
i
)
s
+=
computeHeight
(
model
()
->
index
(
i
,
0
,
index
));
return
s
;
}
void
done
();
void
run
(
const
QPoint
&
point
,
QAbstractItemModel
*
model
,
const
QModelIndex
&
index
,
const
QString
&
msg
);
int
computeHeight
(
const
QModelIndex
&
index
)
const
;
Q_SLOT
void
computeSize
();
Q_SLOT
void
computeSize
()
{
int
columns
=
0
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
resizeColumnToContents
(
i
);
columns
+=
sizeHintForColumn
(
i
);
}
int
rows
=
computeHeight
(
QModelIndex
());
m_size
=
QSize
(
columns
+
5
,
rows
+
5
);
setMinimumSize
(
m_size
);
setMaximumSize
(
m_size
);
}
private
:
QSize
m_size
;
};
...
...
@@ -161,6 +117,26 @@ bool ToolTipWidget::eventFilter(QObject *ob, QEvent *ev)
return
false
;
}
int
ToolTipWidget
::
computeHeight
(
const
QModelIndex
&
index
)
const
{
int
s
=
rowHeight
(
index
);
for
(
int
i
=
0
;
i
<
model
()
->
rowCount
(
index
);
++
i
)
s
+=
computeHeight
(
model
()
->
index
(
i
,
0
,
index
));
return
s
;
}
Q_SLOT
void
ToolTipWidget
::
computeSize
()
{
int
columns
=
0
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
resizeColumnToContents
(
i
);
columns
+=
sizeHintForColumn
(
i
);
}
int
rows
=
computeHeight
(
QModelIndex
());
m_size
=
QSize
(
columns
+
5
,
rows
+
5
);
setMinimumSize
(
m_size
);
setMaximumSize
(
m_size
);
}
void
ToolTipWidget
::
done
()
{
qApp
->
removeEventFilter
(
this
);
...
...
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
register
or
sign in
to comment