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
Marco Bubke
flatpak-qt-creator
Commits
bb44837d
Commit
bb44837d
authored
Jul 16, 2009
by
con
Browse files
Remove usage of QToolBar from debugger tool bar.
parent
cb1cd84c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/libs/utils/styledbar.cpp
View file @
bb44837d
...
...
@@ -5,6 +5,7 @@
#include
<QtCore/QVariant>
#include
<QtGui/QPainter>
#include
<QtGui/QPixmapCache>
#include
<QtGui/QStyle>
using
namespace
Core
::
Utils
;
...
...
@@ -27,8 +28,6 @@ bool StyledBar::isSingleRow() const
void
StyledBar
::
paintEvent
(
QPaintEvent
*
event
)
{
// Currently from the style
// Goal should be to migrate that into a Utils::StyledWidget class
Q_UNUSED
(
event
)
QPainter
painter
(
this
);
...
...
@@ -74,3 +73,26 @@ void StyledBar::paintEvent(QPaintEvent *event)
QPixmapCache
::
insert
(
key
,
pixmap
);
}
}
StyledSeparator
::
StyledSeparator
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
setFixedWidth
(
10
);
}
void
StyledSeparator
::
paintEvent
(
QPaintEvent
*
event
)
{
Q_UNUSED
(
event
)
QPainter
painter
(
this
);
QRect
selfRect
=
rect
();
QColor
separatorColor
=
StyleHelper
::
borderColor
();
separatorColor
.
setAlpha
(
100
);
painter
.
setPen
(
separatorColor
);
const
int
margin
=
6
;
const
int
offset
=
selfRect
.
width
()
/
2
;
painter
.
drawLine
(
selfRect
.
bottomLeft
().
x
()
+
offset
,
selfRect
.
bottomLeft
().
y
()
-
margin
,
selfRect
.
topLeft
().
x
()
+
offset
,
selfRect
.
topLeft
().
y
()
+
margin
);
}
src/libs/utils/styledbar.h
View file @
bb44837d
...
...
@@ -18,6 +18,14 @@ protected:
void
paintEvent
(
QPaintEvent
*
event
);
};
class
QTCREATOR_UTILS_EXPORT
StyledSeparator
:
public
QWidget
{
public:
StyledSeparator
(
QWidget
*
parent
=
0
);
protected:
void
paintEvent
(
QPaintEvent
*
event
);
};
}
// Utils
}
// Core
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
bb44837d
...
...
@@ -70,6 +70,7 @@
#include
<texteditor/texteditorconstants.h>
#include
<utils/qtcassert.h>
#include
<utils/styledbar.h>
#include
<QtCore/QDebug>
#include
<QtCore/QObject>
...
...
@@ -162,6 +163,13 @@ static QSettings *settings()
return
ICore
::
instance
()
->
settings
();
}
static
QToolButton
*
toolButton
(
QAction
*
action
)
{
QToolButton
*
button
=
new
QToolButton
;
button
->
setDefaultAction
(
action
);
return
button
;
}
///////////////////////////////////////////////////////////////////////
//
// DebugMode
...
...
@@ -821,33 +829,32 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
m_debugMode
->
setWidget
(
splitter2
);
QTool
Bar
*
debugToolBar
=
new
QTool
Bar
;
Core
::
Utils
::
Styled
Bar
*
debugToolBar
=
new
Core
::
Utils
::
Styled
Bar
;
debugToolBar
->
setProperty
(
"topBorder"
,
true
);
debugToolBar
->
addAction
(
am
->
command
(
ProjectExplorer
::
Constants
::
DEBUG
)
->
action
());
debugToolBar
->
addAction
(
am
->
command
(
Constants
::
INTERRUPT
)
->
action
());
debugToolBar
->
addAction
(
am
->
command
(
Constants
::
NEXT
)
->
action
());
debugToolBar
->
addAction
(
am
->
command
(
Constants
::
STEP
)
->
action
());
debugToolBar
->
addAction
(
am
->
command
(
Constants
::
STEPOUT
)
->
action
());
debugToolBar
->
addSeparator
();
debugToolBar
->
addAction
(
am
->
command
(
Constants
::
STEPI
)
->
action
());
debugToolBar
->
addAction
(
am
->
command
(
Constants
::
NEXTI
)
->
action
());
QHBoxLayout
*
debugToolBarLayout
=
new
QHBoxLayout
(
debugToolBar
);
debugToolBarLayout
->
setMargin
(
0
);
debugToolBarLayout
->
setSpacing
(
0
);
debugToolBarLayout
->
addWidget
(
toolButton
(
am
->
command
(
ProjectExplorer
::
Constants
::
DEBUG
)
->
action
()));
debugToolBarLayout
->
addWidget
(
toolButton
(
am
->
command
(
Constants
::
INTERRUPT
)
->
action
()));
debugToolBarLayout
->
addWidget
(
toolButton
(
am
->
command
(
Constants
::
NEXT
)
->
action
()));
debugToolBarLayout
->
addWidget
(
toolButton
(
am
->
command
(
Constants
::
STEP
)
->
action
()));
debugToolBarLayout
->
addWidget
(
toolButton
(
am
->
command
(
Constants
::
STEPOUT
)
->
action
()));
debugToolBarLayout
->
addWidget
(
new
Core
::
Utils
::
StyledSeparator
);
debugToolBarLayout
->
addWidget
(
toolButton
(
am
->
command
(
Constants
::
STEPI
)
->
action
()));
debugToolBarLayout
->
addWidget
(
toolButton
(
am
->
command
(
Constants
::
NEXTI
)
->
action
()));
#ifdef USE_REVERSE_DEBUGGING
debugToolBar
->
ad
dSeparator
(
);
debugToolBar
->
addActi
on
(
am
->
command
(
Constants
::
REVERSE
)
->
action
());
debugToolBar
Layout
->
addWidget
(
new
Core
::
Utils
::
Style
dSeparator
);
debugToolBar
Layout
->
addWidget
(
toolButt
on
(
am
->
command
(
Constants
::
REVERSE
)
->
action
())
)
;
#endif
debugToolBar
->
ad
dSeparator
(
);
debugToolBar
->
addWidget
(
new
QLabel
(
tr
(
"Threads:"
)));
debugToolBar
Layout
->
addWidget
(
new
Core
::
Utils
::
Style
dSeparator
);
debugToolBar
Layout
->
addWidget
(
new
QLabel
(
tr
(
"Threads:"
)));
QComboBox
*
threadBox
=
new
QComboBox
;
threadBox
->
setModel
(
m_manager
->
threadsModel
());
connect
(
threadBox
,
SIGNAL
(
activated
(
int
)),
m_manager
->
threadsWindow
(),
SIGNAL
(
threadSelected
(
int
)));
debugToolBar
->
addWidget
(
threadBox
);
debugToolBar
->
addWidget
(
m_manager
->
statusLabel
());
QWidget
*
stretch
=
new
QWidget
;
stretch
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Minimum
);
debugToolBar
->
addWidget
(
stretch
);
debugToolBarLayout
->
addWidget
(
threadBox
);
debugToolBarLayout
->
addWidget
(
m_manager
->
statusLabel
(),
10
);
QBoxLayout
*
toolBarAddingLayout
=
new
QVBoxLayout
(
centralWidget
);
toolBarAddingLayout
->
setMargin
(
0
);
...
...
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