Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
82b7e9be
Commit
82b7e9be
authored
Mar 16, 2011
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: persist 'AlwaysAdjust*ColumnWidths' settings
Task-number: QTCREATORBUG-2836
parent
429ed63f
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
168 additions
and
136 deletions
+168
-136
src/plugins/debugger/breakwindow.cpp
src/plugins/debugger/breakwindow.cpp
+5
-13
src/plugins/debugger/breakwindow.h
src/plugins/debugger/breakwindow.h
+0
-2
src/plugins/debugger/commonoptionspage.cpp
src/plugins/debugger/commonoptionspage.cpp
+39
-28
src/plugins/debugger/debuggeractions.cpp
src/plugins/debugger/debuggeractions.cpp
+53
-3
src/plugins/debugger/debuggeractions.h
src/plugins/debugger/debuggeractions.h
+16
-3
src/plugins/debugger/moduleswindow.cpp
src/plugins/debugger/moduleswindow.cpp
+12
-15
src/plugins/debugger/moduleswindow.h
src/plugins/debugger/moduleswindow.h
+0
-2
src/plugins/debugger/registerwindow.cpp
src/plugins/debugger/registerwindow.cpp
+5
-8
src/plugins/debugger/registerwindow.h
src/plugins/debugger/registerwindow.h
+0
-2
src/plugins/debugger/snapshotwindow.cpp
src/plugins/debugger/snapshotwindow.cpp
+4
-12
src/plugins/debugger/snapshotwindow.h
src/plugins/debugger/snapshotwindow.h
+0
-1
src/plugins/debugger/stackwindow.cpp
src/plugins/debugger/stackwindow.cpp
+5
-10
src/plugins/debugger/stackwindow.h
src/plugins/debugger/stackwindow.h
+0
-2
src/plugins/debugger/threadswindow.cpp
src/plugins/debugger/threadswindow.cpp
+8
-12
src/plugins/debugger/threadswindow.h
src/plugins/debugger/threadswindow.h
+0
-2
src/plugins/debugger/watchwindow.cpp
src/plugins/debugger/watchwindow.cpp
+20
-19
src/plugins/debugger/watchwindow.h
src/plugins/debugger/watchwindow.h
+1
-2
No files found.
src/plugins/debugger/breakwindow.cpp
View file @
82b7e9be
...
...
@@ -442,10 +442,8 @@ MultiBreakPointsDialog::MultiBreakPointsDialog(unsigned engineCapabilities, QWid
///////////////////////////////////////////////////////////////////////
BreakWindow
::
BreakWindow
(
QWidget
*
parent
)
:
QTreeView
(
parent
)
:
QTreeView
(
parent
)
{
m_alwaysResizeColumnsToContents
=
false
;
QAction
*
act
=
debuggerCore
()
->
action
(
UseAlternatingRowColors
);
setFrameStyle
(
QFrame
::
NoFrame
);
setAttribute
(
Qt
::
WA_MacShowFocusRect
,
false
);
...
...
@@ -463,6 +461,9 @@ BreakWindow::BreakWindow(QWidget *parent)
connect
(
debuggerCore
()
->
action
(
UseAddressInBreakpointsView
),
SIGNAL
(
toggled
(
bool
)),
SLOT
(
showAddressColumn
(
bool
)));
connect
(
debuggerCore
()
->
action
(
AlwaysAdjustBreakpointsColumnWidths
),
SIGNAL
(
toggled
(
bool
)),
SLOT
(
setAlwaysResizeColumnsToContents
(
bool
)));
}
void
BreakWindow
::
showAddressColumn
(
bool
on
)
...
...
@@ -559,12 +560,6 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction
*
adjustColumnAction
=
new
QAction
(
tr
(
"Adjust Column Widths to Contents"
),
&
menu
);
QAction
*
alwaysAdjustAction
=
new
QAction
(
tr
(
"Always Adjust Column Widths to Contents"
),
&
menu
);
alwaysAdjustAction
->
setCheckable
(
true
);
alwaysAdjustAction
->
setChecked
(
m_alwaysResizeColumnsToContents
);
QAction
*
editBreakpointAction
=
new
QAction
(
tr
(
"Edit Breakpoint..."
),
&
menu
);
editBreakpointAction
->
setEnabled
(
!
selectedIds
.
isEmpty
());
...
...
@@ -610,7 +605,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
menu
.
addAction
(
debuggerCore
()
->
action
(
UseToolTipsInBreakpointsView
));
menu
.
addAction
(
debuggerCore
()
->
action
(
UseAddressInBreakpointsView
));
menu
.
addAction
(
adjustColumnAction
);
menu
.
addAction
(
alwaysAdjustAction
);
menu
.
addAction
(
debuggerCore
()
->
action
(
AlwaysAdjustBreakpointsColumnWidths
)
);
menu
.
addSeparator
();
menu
.
addAction
(
debuggerCore
()
->
action
(
SettingsDialog
));
...
...
@@ -624,8 +619,6 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
deleteBreakpoints
(
breakpointsInFile
);
else
if
(
act
==
adjustColumnAction
)
resizeColumnsToContents
();
else
if
(
act
==
alwaysAdjustAction
)
setAlwaysResizeColumnsToContents
(
!
m_alwaysResizeColumnsToContents
);
else
if
(
act
==
editBreakpointAction
)
editBreakpoints
(
selectedIds
);
else
if
(
act
==
associateBreakpointAction
)
...
...
@@ -729,7 +722,6 @@ void BreakWindow::resizeColumnsToContents()
void
BreakWindow
::
setAlwaysResizeColumnsToContents
(
bool
on
)
{
m_alwaysResizeColumnsToContents
=
on
;
QHeaderView
::
ResizeMode
mode
=
on
?
QHeaderView
::
ResizeToContents
:
QHeaderView
::
Interactive
;
for
(
int
i
=
model
()
->
columnCount
();
--
i
>=
0
;
)
...
...
src/plugins/debugger/breakwindow.h
View file @
82b7e9be
...
...
@@ -70,8 +70,6 @@ private:
void
editBreakpoints
(
const
BreakpointIds
&
ids
);
void
associateBreakpoint
(
const
BreakpointIds
&
ids
,
int
thread
);
void
setBreakpointsEnabled
(
const
BreakpointIds
&
ids
,
bool
enabled
);
bool
m_alwaysResizeColumnsToContents
;
};
}
// namespace Internal
...
...
src/plugins/debugger/commonoptionspage.cpp
View file @
82b7e9be
...
...
@@ -54,38 +54,47 @@ using namespace ProjectExplorer;
namespace
Debugger
{
namespace
Internal
{
CommonOptionsPageWidget
::
CommonOptionsPageWidget
(
const
QSharedPointer
<
Utils
::
SavedActionSet
>
&
group
,
QWidget
*
parent
)
:
QWidget
(
parent
),
m_group
(
group
)
CommonOptionsPageWidget
::
CommonOptionsPageWidget
(
const
QSharedPointer
<
Utils
::
SavedActionSet
>
&
group
,
QWidget
*
parent
)
:
QWidget
(
parent
),
m_group
(
group
)
{
m_ui
.
setupUi
(
this
);
DebuggerCore
*
dc
=
debuggerCore
();
m_group
->
clear
();
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
ListSourceFiles
),
m_group
->
insert
(
d
c
->
action
(
ListSourceFiles
),
m_ui
.
checkBoxListSourceFiles
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
UseAlternatingRowColors
),
m_group
->
insert
(
d
c
->
action
(
UseAlternatingRowColors
),
m_ui
.
checkBoxUseAlternatingRowColors
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
UseToolTipsInMainEditor
),
m_group
->
insert
(
d
c
->
action
(
UseToolTipsInMainEditor
),
m_ui
.
checkBoxUseToolTipsInMainEditor
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
CloseBuffersOnExit
),
m_group
->
insert
(
d
c
->
action
(
CloseBuffersOnExit
),
m_ui
.
checkBoxCloseBuffersOnExit
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
SwitchModeOnExit
),
m_group
->
insert
(
d
c
->
action
(
SwitchModeOnExit
),
m_ui
.
checkBoxSwitchModeOnExit
);
m_group
->
insert
(
debuggerCore
()
->
action
(
AutoDerefPointers
),
0
);
m_group
->
insert
(
debuggerCore
()
->
action
(
UseToolTipsInLocalsView
),
0
);
m_group
->
insert
(
debuggerCore
()
->
action
(
UseToolTipsInBreakpointsView
),
0
);
m_group
->
insert
(
debuggerCore
()
->
action
(
UseAddressInBreakpointsView
),
0
);
m_group
->
insert
(
debuggerCore
()
->
action
(
UseAddressInStackView
),
0
);
m_group
->
insert
(
debuggerCore
()
->
action
(
MaximalStackDepth
),
m_group
->
insert
(
dc
->
action
(
AutoDerefPointers
),
0
);
m_group
->
insert
(
dc
->
action
(
UseToolTipsInLocalsView
),
0
);
m_group
->
insert
(
dc
->
action
(
AlwaysAdjustLocalsColumnWidths
),
0
);
m_group
->
insert
(
dc
->
action
(
AlwaysAdjustThreadsColumnWidths
),
0
);
m_group
->
insert
(
dc
->
action
(
AlwaysAdjustSnapshotsColumnWidths
),
0
);
m_group
->
insert
(
dc
->
action
(
AlwaysAdjustBreakpointsColumnWidths
),
0
);
m_group
->
insert
(
dc
->
action
(
AlwaysAdjustModulesColumnWidths
),
0
);
m_group
->
insert
(
dc
->
action
(
UseToolTipsInBreakpointsView
),
0
);
m_group
->
insert
(
dc
->
action
(
UseAddressInBreakpointsView
),
0
);
m_group
->
insert
(
dc
->
action
(
UseAddressInStackView
),
0
);
m_group
->
insert
(
dc
->
action
(
AlwaysAdjustStackColumnWidths
),
0
);
m_group
->
insert
(
dc
->
action
(
MaximalStackDepth
),
m_ui
.
spinBoxMaximalStackDepth
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
ShowStdNamespace
),
0
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
ShowQtNamespace
),
0
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
SortStructMembers
),
0
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
LogTimeStamps
),
0
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
VerboseLog
),
0
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
BreakOnThrow
),
0
);
m_group
->
insert
(
d
ebuggerCore
()
->
action
(
BreakOnCatch
),
0
);
m_group
->
insert
(
d
c
->
action
(
ShowStdNamespace
),
0
);
m_group
->
insert
(
d
c
->
action
(
ShowQtNamespace
),
0
);
m_group
->
insert
(
d
c
->
action
(
SortStructMembers
),
0
);
m_group
->
insert
(
d
c
->
action
(
LogTimeStamps
),
0
);
m_group
->
insert
(
d
c
->
action
(
VerboseLog
),
0
);
m_group
->
insert
(
d
c
->
action
(
BreakOnThrow
),
0
);
m_group
->
insert
(
d
c
->
action
(
BreakOnCatch
),
0
);
#ifdef Q_OS_WIN
Utils
::
SavedAction
*
registerAction
=
d
ebuggerCore
()
->
action
(
RegisterForPostMortem
);
Utils
::
SavedAction
*
registerAction
=
d
c
->
action
(
RegisterForPostMortem
);
m_group
->
insert
(
registerAction
,
m_ui
.
checkBoxRegisterForPostMortem
);
connect
(
registerAction
,
SIGNAL
(
toggled
(
bool
)),
...
...
@@ -253,26 +262,28 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
m_ui
.
setupUi
(
w
);
m_ui
.
dumperLocationChooser
->
setExpectedKind
(
Utils
::
PathChooser
::
Command
);
m_ui
.
dumperLocationChooser
->
setPromptDialogTitle
(
QCoreApplication
::
translate
(
"Debugger"
,
"Choose DebuggingHelper Location"
));
m_ui
.
dumperLocationChooser
->
setPromptDialogTitle
(
QCoreApplication
::
translate
(
"Debugger"
,
"Choose DebuggingHelper Location"
));
m_ui
.
dumperLocationChooser
->
setInitialBrowsePathBackup
(
ICore
::
instance
()
->
resourcePath
()
+
"../../lib"
);
m_group
.
clear
();
m_group
.
insert
(
debuggerCore
()
->
action
(
UseDebuggingHelpers
),
DebuggerCore
*
dc
=
debuggerCore
();
m_group
.
insert
(
dc
->
action
(
UseDebuggingHelpers
),
m_ui
.
debuggingHelperGroupBox
);
m_group
.
insert
(
d
ebuggerCore
()
->
action
(
UseCustomDebuggingHelperLocation
),
m_group
.
insert
(
d
c
->
action
(
UseCustomDebuggingHelperLocation
),
m_ui
.
customLocationGroupBox
);
// Suppress Oxygen style's giving flat group boxes bold titles.
if
(
oxygenStyle
())
m_ui
.
customLocationGroupBox
->
setStyleSheet
(
_
(
"QGroupBox::title { font: ; }"
));
m_group
.
insert
(
d
ebuggerCore
()
->
action
(
CustomDebuggingHelperLocation
),
m_group
.
insert
(
d
c
->
action
(
CustomDebuggingHelperLocation
),
m_ui
.
dumperLocationChooser
);
m_group
.
insert
(
d
ebuggerCore
()
->
action
(
UseCodeModel
),
m_group
.
insert
(
d
c
->
action
(
UseCodeModel
),
m_ui
.
checkBoxUseCodeModel
);
m_group
.
insert
(
d
ebuggerCore
()
->
action
(
ShowThreadNames
),
m_group
.
insert
(
d
c
->
action
(
ShowThreadNames
),
m_ui
.
checkBoxShowThreadNames
);
...
...
src/plugins/debugger/debuggeractions.cpp
View file @
82b7e9be
...
...
@@ -107,14 +107,64 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
// View
//
item
=
new
SavedAction
(
this
);
item
->
setText
(
tr
(
"Adjust Column Widths to Contents"
));
insertItem
(
AdjustColumnWidths
,
item
);
item
->
setText
(
tr
(
"Always Adjust Column Widths to Contents"
));
item
->
setCheckable
(
true
);
item
->
setValue
(
false
);
item
->
setDefaultValue
(
false
);
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"AlwaysAdjustLocalsColumnWidths"
));
insertItem
(
AlwaysAdjustLocalsColumnWidths
,
item
);
item
=
new
SavedAction
(
this
);
item
->
setText
(
tr
(
"Always Adjust Column Widths to Contents"
));
item
->
setCheckable
(
true
);
item
->
setValue
(
false
);
item
->
setDefaultValue
(
false
);
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"AlwaysAdjustStackColumnWidths"
));
insertItem
(
AlwaysAdjustStackColumnWidths
,
item
);
item
=
new
SavedAction
(
this
);
item
->
setText
(
tr
(
"Always Adjust Column Widths to Contents"
));
item
->
setCheckable
(
true
);
item
->
setValue
(
false
);
item
->
setDefaultValue
(
false
);
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"AlwaysAdjustThreadsColumnWidths"
));
item
=
new
SavedAction
(
this
);
item
->
setText
(
tr
(
"Always Adjust Column Widths to Contents"
));
item
->
setCheckable
(
true
);
item
->
setValue
(
false
);
item
->
setDefaultValue
(
false
);
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"AlwaysAdjustRegistersColumnWidths"
));
item
=
new
SavedAction
(
this
);
item
->
setText
(
tr
(
"Always Adjust Column Widths to Contents"
));
item
->
setCheckable
(
true
);
item
->
setValue
(
false
);
item
->
setDefaultValue
(
false
);
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"AlwaysAdjustSnapshotsColumnWidths"
));
item
=
new
SavedAction
(
this
);
item
->
setText
(
tr
(
"Always Adjust Column Widths to Contents"
));
item
->
setCheckable
(
true
);
insertItem
(
AlwaysAdjustColumnWidths
,
item
);
item
->
setValue
(
false
);
item
->
setDefaultValue
(
false
);
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"AlwaysAdjustBreakpointsColumnWidths"
));
item
=
new
SavedAction
(
this
);
item
->
setText
(
tr
(
"Always Adjust Column Widths to Contents"
));
item
->
setCheckable
(
true
);
item
->
setValue
(
false
);
item
->
setDefaultValue
(
false
);
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"AlwaysAdjustModulesColumnWidths"
));
insertItem
(
AlwaysAdjustStackColumnWidths
,
item
);
item
=
new
SavedAction
(
this
);
item
->
setText
(
tr
(
"Use Alternating Row Colors"
));
item
->
setSettingsKey
(
debugModeGroup
,
QLatin1String
(
"UseAlternatingRowColours"
));
...
...
src/plugins/debugger/debuggeractions.h
View file @
82b7e9be
...
...
@@ -90,8 +90,6 @@ enum DebuggerActionCode
{
// General
SettingsDialog
,
AdjustColumnWidths
,
AlwaysAdjustColumnWidths
,
UseAlternatingRowColors
,
UseMessageBoxForSignals
,
AutoQuit
,
...
...
@@ -128,12 +126,14 @@ enum DebuggerActionCode
MaximalStackDepth
,
ExpandStack
,
CreateFullBacktrace
,
AlwaysAdjustStackColumnWidths
,
// Watchers & Locals
ShowStdNamespace
,
ShowQtNamespace
,
SortStructMembers
,
AutoDerefPointers
,
AlwaysAdjustLocalsColumnWidths
,
// Source List
ListSourceFiles
,
...
...
@@ -147,10 +147,23 @@ enum DebuggerActionCode
AllPluginBreakpoints
,
SelectedPluginBreakpoints
,
AdjustBreakpointLocations
,
AlwaysAdjustBreakpointsColumnWidths
,
NoPluginBreakpoints
,
SelectedPluginBreakpointsPattern
,
BreakOnThrow
,
BreakOnCatch
BreakOnCatch
,
// Registers
AlwaysAdjustRegistersColumnWidths
,
// Snapshots
AlwaysAdjustSnapshotsColumnWidths
,
// Threads
AlwaysAdjustThreadsColumnWidths
,
// Modules
AlwaysAdjustModulesColumnWidths
};
}
// namespace Internal
...
...
src/plugins/debugger/moduleswindow.cpp
View file @
82b7e9be
...
...
@@ -59,7 +59,7 @@ namespace Debugger {
namespace
Internal
{
ModulesWindow
::
ModulesWindow
(
QWidget
*
parent
)
:
QTreeView
(
parent
)
,
m_alwaysResizeColumnsToContents
(
false
)
:
QTreeView
(
parent
)
{
QAction
*
act
=
debuggerCore
()
->
action
(
UseAlternatingRowColors
);
setWindowTitle
(
tr
(
"Modules"
));
...
...
@@ -73,6 +73,9 @@ ModulesWindow::ModulesWindow(QWidget *parent)
SLOT
(
moduleActivated
(
QModelIndex
)));
connect
(
act
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
setAlternatingRowColorsHelper
(
bool
)));
connect
(
debuggerCore
()
->
action
(
AlwaysAdjustModulesColumnWidths
),
SIGNAL
(
toggled
(
bool
)),
SLOT
(
setAlwaysResizeColumnsToContents
(
bool
)));
}
void
ModulesWindow
::
moduleActivated
(
const
QModelIndex
&
index
)
...
...
@@ -165,10 +168,7 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
menu
.
addSeparator
();
QAction
*
actAdjustColumnWidths
=
menu
.
addAction
(
tr
(
"Adjust Column Widths to Contents"
));
QAction
*
actAlwaysAdjustColumnWidth
=
menu
.
addAction
(
tr
(
"Always Adjust Column Widths to Contents"
));
actAlwaysAdjustColumnWidth
->
setCheckable
(
true
);
actAlwaysAdjustColumnWidth
->
setChecked
(
m_alwaysResizeColumnsToContents
);
menu
.
addAction
(
debuggerCore
()
->
action
(
AlwaysAdjustModulesColumnWidths
));
menu
.
addSeparator
();
menu
.
addAction
(
debuggerCore
()
->
action
(
SettingsDialog
));
...
...
@@ -177,21 +177,19 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
if
(
act
==
actUpdateModuleList
)
engine
->
reloadModules
();
else
if
(
act
==
actAdjustColumnWidths
)
resizeColumnsToContents
();
else
if
(
act
==
actAlwaysAdjustColumnWidth
)
setAlwaysResizeColumnsToContents
(
!
m_alwaysResizeColumnsToContents
);
resizeColumnsToContents
();
else
if
(
act
==
actShowModuleSources
)
engine
->
loadSymbols
(
name
);
engine
->
loadSymbols
(
name
);
else
if
(
act
==
actLoadSymbolsForAllModules
)
engine
->
loadAllSymbols
();
engine
->
loadAllSymbols
();
else
if
(
act
==
actExamineAllModules
)
engine
->
examineModules
();
engine
->
examineModules
();
else
if
(
act
==
actLoadSymbolsForModule
)
engine
->
loadSymbols
(
name
);
engine
->
loadSymbols
(
name
);
else
if
(
act
==
actEditFile
)
engine
->
gotoLocation
(
name
);
engine
->
gotoLocation
(
name
);
else
if
(
act
==
actShowModuleSymbols
)
engine
->
requestModuleSymbols
(
name
);
engine
->
requestModuleSymbols
(
name
);
else
if
(
actShowDependencies
&&
act
==
actShowDependencies
)
QProcess
::
startDetached
(
QLatin1String
(
"depends"
),
QStringList
(
fileName
));
}
...
...
@@ -206,7 +204,6 @@ void ModulesWindow::resizeColumnsToContents()
void
ModulesWindow
::
setAlwaysResizeColumnsToContents
(
bool
on
)
{
m_alwaysResizeColumnsToContents
=
on
;
QHeaderView
::
ResizeMode
mode
=
on
?
QHeaderView
::
ResizeToContents
:
QHeaderView
::
Interactive
;
header
()
->
setResizeMode
(
0
,
mode
);
...
...
src/plugins/debugger/moduleswindow.h
View file @
82b7e9be
...
...
@@ -55,8 +55,6 @@ private slots:
private:
void
contextMenuEvent
(
QContextMenuEvent
*
ev
);
void
setModel
(
QAbstractItemModel
*
model
);
bool
m_alwaysResizeColumnsToContents
;
};
}
// namespace Internal
...
...
src/plugins/debugger/registerwindow.cpp
View file @
82b7e9be
...
...
@@ -158,7 +158,7 @@ public:
///////////////////////////////////////////////////////////////////////
RegisterWindow
::
RegisterWindow
(
QWidget
*
parent
)
:
QTreeView
(
parent
)
,
m_alwaysResizeColumnsToContents
(
true
)
:
QTreeView
(
parent
)
{
QAction
*
act
=
debuggerCore
()
->
action
(
UseAlternatingRowColors
);
setFrameStyle
(
QFrame
::
NoFrame
);
...
...
@@ -170,6 +170,9 @@ RegisterWindow::RegisterWindow(QWidget *parent)
connect
(
act
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
setAlternatingRowColorsHelper
(
bool
)));
connect
(
debuggerCore
()
->
action
(
AlwaysAdjustRegistersColumnWidths
),
SIGNAL
(
toggled
(
bool
)),
SLOT
(
setAlwaysResizeColumnsToContents
(
bool
)));
}
void
RegisterWindow
::
resizeEvent
(
QResizeEvent
*
ev
)
...
...
@@ -223,10 +226,7 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
menu
.
addSeparator
();
QAction
*
actAdjust
=
menu
.
addAction
(
tr
(
"Adjust Column Widths to Contents"
));
QAction
*
actAlwaysAdjust
=
menu
.
addAction
(
tr
(
"Always Adjust Column Widths to Contents"
));
actAlwaysAdjust
->
setCheckable
(
true
);
actAlwaysAdjust
->
setChecked
(
m_alwaysResizeColumnsToContents
);
menu
.
addAction
(
debuggerCore
()
->
action
(
AlwaysAdjustRegistersColumnWidths
));
menu
.
addSeparator
();
menu
.
addAction
(
debuggerCore
()
->
action
(
SettingsDialog
));
...
...
@@ -235,8 +235,6 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
if
(
act
==
actAdjust
)
resizeColumnsToContents
();
else
if
(
act
==
actAlwaysAdjust
)
setAlwaysResizeColumnsToContents
(
!
m_alwaysResizeColumnsToContents
);
else
if
(
act
==
actReload
)
engine
->
reloadRegisters
();
else
if
(
act
==
actShowMemory
)
...
...
@@ -259,7 +257,6 @@ void RegisterWindow::resizeColumnsToContents()
void
RegisterWindow
::
setAlwaysResizeColumnsToContents
(
bool
on
)
{
m_alwaysResizeColumnsToContents
=
on
;
QHeaderView
::
ResizeMode
mode
=
on
?
QHeaderView
::
ResizeToContents
:
QHeaderView
::
Interactive
;
header
()
->
setResizeMode
(
0
,
mode
);
...
...
src/plugins/debugger/registerwindow.h
View file @
82b7e9be
...
...
@@ -56,8 +56,6 @@ public slots:
private:
void
resizeEvent
(
QResizeEvent
*
ev
);
void
contextMenuEvent
(
QContextMenuEvent
*
ev
);
bool
m_alwaysResizeColumnsToContents
;
};
}
// namespace Internal
...
...
src/plugins/debugger/snapshotwindow.cpp
View file @
82b7e9be
...
...
@@ -58,7 +58,6 @@ namespace Internal {
///////////////////////////////////////////////////////////////////////
SnapshotWindow
::
SnapshotWindow
(
SnapshotHandler
*
handler
)
:
m_alwaysResizeColumnsToContents
(
false
)
{
m_snapshotHandler
=
handler
;
...
...
@@ -76,6 +75,9 @@ SnapshotWindow::SnapshotWindow(SnapshotHandler *handler)
SLOT
(
rowActivated
(
QModelIndex
)));
connect
(
act
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
setAlternatingRowColorsHelper
(
bool
)));
connect
(
debuggerCore
()
->
action
(
AlwaysAdjustSnapshotsColumnWidths
),
SIGNAL
(
toggled
(
bool
)),
SLOT
(
setAlwaysResizeColumnsToContents
(
bool
)));
}
void
SnapshotWindow
::
rowActivated
(
const
QModelIndex
&
index
)
...
...
@@ -107,21 +109,14 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction
*
actCreate
=
menu
.
addAction
(
tr
(
"Create Snapshot"
));
actCreate
->
setEnabled
(
idx
.
data
(
SnapshotCapabilityRole
).
toBool
());
menu
.
addSeparator
();
QAction
*
actRemove
=
menu
.
addAction
(
tr
(
"Remove Snapshot"
));
actRemove
->
setEnabled
(
idx
.
isValid
());
menu
.
addSeparator
();
QAction
*
actAdjust
=
menu
.
addAction
(
tr
(
"Adjust Column Widths to Contents"
));
QAction
*
actAlwaysAdjust
=
menu
.
addAction
(
tr
(
"Always Adjust Column Widths to Contents"
));
actAlwaysAdjust
->
setCheckable
(
true
);
actAlwaysAdjust
->
setChecked
(
m_alwaysResizeColumnsToContents
);
menu
.
addAction
(
debuggerCore
()
->
action
(
AlwaysAdjustSnapshotsColumnWidths
));
menu
.
addSeparator
();
menu
.
addAction
(
debuggerCore
()
->
action
(
SettingsDialog
));
...
...
@@ -134,8 +129,6 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev)
removeSnapshot
(
idx
.
row
());
else
if
(
act
==
actAdjust
)
resizeColumnsToContents
();
else
if
(
act
==
actAlwaysAdjust
)
setAlwaysResizeColumnsToContents
(
!
m_alwaysResizeColumnsToContents
);
}
void
SnapshotWindow
::
removeSnapshot
(
int
i
)
...
...
@@ -151,7 +144,6 @@ void SnapshotWindow::resizeColumnsToContents()
void
SnapshotWindow
::
setAlwaysResizeColumnsToContents
(
bool
on
)
{
m_alwaysResizeColumnsToContents
=
on
;
QHeaderView
::
ResizeMode
mode
=
on
?
QHeaderView
::
ResizeToContents
:
QHeaderView
::
Interactive
;
for
(
int
i
=
model
()
->
columnCount
();
--
i
>=
0
;
)
...
...
src/plugins/debugger/snapshotwindow.h
View file @
82b7e9be
...
...
@@ -61,7 +61,6 @@ private:
void
keyPressEvent
(
QKeyEvent
*
ev
);
void
contextMenuEvent
(
QContextMenuEvent
*
ev
);
bool
m_alwaysResizeColumnsToContents
;
SnapshotHandler
*
m_snapshotHandler
;
};
...
...
src/plugins/debugger/stackwindow.cpp
View file @
82b7e9be
...
...
@@ -59,7 +59,7 @@ static DebuggerEngine *currentEngine()
}
StackWindow
::
StackWindow
(
QWidget
*
parent
)
:
QTreeView
(
parent
)
,
m_alwaysResizeColumnsToContents
(
false
)
:
QTreeView
(
parent
)
{
setAttribute
(
Qt
::
WA_MacShowFocusRect
,
false
);
setFrameStyle
(
QFrame
::
NoFrame
);
...
...
@@ -83,6 +83,9 @@ StackWindow::StackWindow(QWidget *parent)
SLOT
(
reloadFullStack
()));
connect
(
debuggerCore
()
->
action
(
MaximalStackDepth
),
SIGNAL
(
triggered
()),
SLOT
(
reloadFullStack
()));
connect
(
debuggerCore
()
->
action
(
AlwaysAdjustStackColumnWidths
),
SIGNAL
(
triggered
(
bool
)),
SLOT
(
setAlwaysResizeColumnsToContents
(
bool
)));
showAddressColumn
(
false
);
}
...
...
@@ -154,12 +157,7 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
menu
.
addAction
(
debuggerCore
()
->
action
(
UseAddressInStackView
));
QAction
*
actAdjust
=
menu
.
addAction
(
tr
(
"Adjust Column Widths to Contents"
));
QAction
*
actAlwaysAdjust
=
menu
.
addAction
(
tr
(
"Always Adjust Column Widths to Contents"
));
actAlwaysAdjust
->
setCheckable
(
true
);
actAlwaysAdjust
->
setChecked
(
m_alwaysResizeColumnsToContents
);
menu
.
addAction
(
debuggerCore
()
->
action
(
AlwaysAdjustStackColumnWidths
));
menu
.
addSeparator
();
menu
.
addAction
(
debuggerCore
()
->
action
(
SettingsDialog
));
...
...
@@ -172,8 +170,6 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
copyContentsToClipboard
();
else
if
(
act
==
actAdjust
)
resizeColumnsToContents
();
else
if
(
act
==
actAlwaysAdjust
)
setAlwaysResizeColumnsToContents
(
!
m_alwaysResizeColumnsToContents
);
else
if
(
act
==
actShowMemory
)
engine
->
openMemoryView
(
address
);
else
if
(
act
==
actShowDisassembler
)
...
...
@@ -215,7 +211,6 @@ void StackWindow::resizeColumnsToContents()
void
StackWindow
::
setAlwaysResizeColumnsToContents
(
bool
on
)
{
m_alwaysResizeColumnsToContents
=
on
;
QHeaderView
::
ResizeMode
mode
=
on
?
QHeaderView
::
ResizeToContents
:
QHeaderView
::
Interactive
;
for
(
int
i
=
model
()
->
columnCount
();
--
i
>=
0
;
)
...
...
src/plugins/debugger/stackwindow.h
View file @
82b7e9be
...
...
@@ -60,8 +60,6 @@ private:
void
setModel
(
QAbstractItemModel
*
model
);
void
contextMenuEvent
(
QContextMenuEvent
*
ev
);
void
copyContentsToClipboard
();
bool
m_alwaysResizeColumnsToContents
;
};
}
// namespace Internal
...
...
src/plugins/debugger/threadswindow.cpp
View file @
82b7e9be
...
...
@@ -50,7 +50,7 @@ namespace Debugger {
namespace
Internal
{
ThreadsWindow
::
ThreadsWindow
(
QWidget
*
parent
)
:
QTreeView
(
parent
)
,
m_alwaysResizeColumnsToContents
(
false
)
:
QTreeView
(
parent
)
{
QAction
*
act
=
debuggerCore
()
->
action
(
UseAlternatingRowColors
);
...
...
@@ -64,9 +64,12 @@ ThreadsWindow::ThreadsWindow(QWidget *parent)
header
()
->
setDefaultAlignment
(
Qt
::
AlignLeft
);
connect
(
this
,
SIGNAL
(
activated
(
QModelIndex
)),
this
,
SLOT
(
rowActivated
(
QModelIndex
)));
SLOT
(
rowActivated
(
QModelIndex
)));
connect
(
act
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
setAlternatingRowColorsHelper
(
bool
)));
SLOT
(
setAlternatingRowColorsHelper
(
bool
)));
connect
(
debuggerCore
()
->
action
(
AlwaysAdjustThreadsColumnWidths
),
SIGNAL
(
toggled
(
bool
)),
SLOT
(
setAlwaysResizeColumnsToContents
(
bool
)));
}
void
ThreadsWindow
::
rowActivated
(
const
QModelIndex
&
index
)
...
...
@@ -87,10 +90,7 @@ void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
QMenu
menu
;
QAction
*
adjustColumnAction
=
menu
.
addAction
(
tr
(
"Adjust Column Widths to Contents"
));
QAction
*
alwaysAdjustColumnAction
=
menu
.
addAction
(
tr
(
"Always Adjust Column Widths to Contents"
));
alwaysAdjustColumnAction
->
setCheckable
(
true
);
alwaysAdjustColumnAction
->
setChecked
(
m_alwaysResizeColumnsToContents
);
menu
.
addAction
(
debuggerCore
()
->
action
(
AlwaysAdjustThreadsColumnWidths
));
menu
.
addSeparator
();
menu
.
addAction
(
debuggerCore
()
->
action
(
SettingsDialog
));
...
...
@@ -99,11 +99,8 @@ void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
if
(
!
act
)
return
;
if
(
act
==
adjustColumnAction
)
{
if
(
act
==
adjustColumnAction
)
resizeColumnsToContents
();
}
else
if
(
act
==
alwaysAdjustColumnAction
)
{
setAlwaysResizeColumnsToContents
(
!
m_alwaysResizeColumnsToContents
);
}
}
void
ThreadsWindow
::
resizeColumnsToContents
()
...
...
@@ -115,7 +112,6 @@ void ThreadsWindow::resizeColumnsToContents()