Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
ece7c9af
Commit
ece7c9af
authored
Mar 26, 2009
by
Thorbjørn Lindeijer
Browse files
Keep the function argument widget on the screen
Done with Roberto Raggi.
parent
760126c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodecompletion.cpp
View file @
ece7c9af
...
...
@@ -61,6 +61,7 @@
#include
<QtCore/QFile>
#include
<QtGui/QAction>
#include
<QtGui/QApplication>
#include
<QtGui/QDesktopWidget>
#include
<QtGui/QKeyEvent>
#include
<QtGui/QLabel>
#include
<QtGui/QToolButton>
...
...
@@ -271,9 +272,6 @@ void FunctionArgumentWidget::showFunctionHint(QList<Function *> functionSymbols,
m_currentarg
=
-
1
;
updateArgumentHighlight
();
QPoint
pos
=
m_editor
->
cursorRect
(
m_startpos
).
topLeft
();
pos
.
setY
(
pos
.
y
()
-
m_popupFrame
->
sizeHint
().
height
()
-
1
);
m_popupFrame
->
move
(
pos
);
m_popupFrame
->
show
();
}
...
...
@@ -382,6 +380,22 @@ void FunctionArgumentWidget::updateHintText()
m_numberLabel
->
setText
(
tr
(
"%1 of %2"
).
arg
(
m_current
+
1
).
arg
(
m_items
.
size
()));
m_popupFrame
->
setFixedWidth
(
m_popupFrame
->
minimumSizeHint
().
width
());
const
QDesktopWidget
*
desktop
=
QApplication
::
desktop
();
#ifdef Q_OS_MAC
const
QRect
screen
=
desktop
->
availableGeometry
(
desktop
->
screenNumber
(
m_popupFrame
));
#else
const
QRect
screen
=
desktop
->
screenGeometry
(
desktop
->
screenNumber
(
m_popupFrame
));
#endif
const
QSize
sz
=
m_popupFrame
->
sizeHint
();
QPoint
pos
=
m_editor
->
cursorRect
(
m_startpos
).
topLeft
();
pos
.
setY
(
pos
.
y
()
-
sz
.
height
()
-
1
);
if
(
pos
.
x
()
+
sz
.
width
()
>
screen
.
right
())
pos
.
setX
(
screen
.
right
()
-
sz
.
width
());
m_popupFrame
->
move
(
pos
);
}
CppCodeCompletion
::
CppCodeCompletion
(
CppModelManager
*
manager
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment