- beautify dark theme
- feature: toggle breakpoint - feature: clear all breakpoint - feature: breakpoint condition
This commit is contained in:
parent
56ff4a6c35
commit
9cf43026ba
|
@ -193,6 +193,24 @@ void Debugger::removeBreakpoint(int index)
|
||||||
mBreakpointModel->removeBreakpoint(index);
|
mBreakpointModel->removeBreakpoint(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PBreakpoint Debugger::breakpointAt(int line, const QString& filename, int &index)
|
||||||
|
{
|
||||||
|
const QList<PBreakpoint>& breakpoints=mBreakpointModel->breakpoints();
|
||||||
|
for (index=0;index<breakpoints.count();index++){
|
||||||
|
PBreakpoint breakpoint = breakpoints[index];
|
||||||
|
if (breakpoint->line == line
|
||||||
|
&& breakpoint->filename == filename)
|
||||||
|
return breakpoint;
|
||||||
|
}
|
||||||
|
index=-1;
|
||||||
|
return PBreakpoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
PBreakpoint Debugger::breakpointAt(int line, const Editor *editor, int &index)
|
||||||
|
{
|
||||||
|
return breakpointAt(line,editor->filename(),index);
|
||||||
|
}
|
||||||
|
|
||||||
void Debugger::setBreakPointCondition(int index, const QString &condition)
|
void Debugger::setBreakPointCondition(int index, const QString &condition)
|
||||||
{
|
{
|
||||||
PBreakpoint breakpoint=mBreakpointModel->setBreakPointCondition(index,condition);
|
PBreakpoint breakpoint=mBreakpointModel->setBreakPointCondition(index,condition);
|
||||||
|
@ -1441,6 +1459,21 @@ QVariant BreakpointModel::data(const QModelIndex &index, int role) const
|
||||||
return QVariant();
|
return QVariant();
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
|
switch (index.column()) {
|
||||||
|
case 0: {
|
||||||
|
return baseFileName(breakpoint->filename);
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
if (breakpoint->line>0)
|
||||||
|
return breakpoint->line;
|
||||||
|
else
|
||||||
|
return "";
|
||||||
|
case 2:
|
||||||
|
return breakpoint->condition;
|
||||||
|
default:
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
case Qt::ToolTipRole:
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 0:
|
case 0:
|
||||||
return breakpoint->filename;
|
return breakpoint->filename;
|
||||||
|
|
|
@ -183,6 +183,8 @@ public:
|
||||||
void removeBreakpoint(int line, const Editor* editor);
|
void removeBreakpoint(int line, const Editor* editor);
|
||||||
void removeBreakpoint(int line, const QString& filename);
|
void removeBreakpoint(int line, const QString& filename);
|
||||||
void removeBreakpoint(int index);
|
void removeBreakpoint(int index);
|
||||||
|
PBreakpoint breakpointAt(int line, const QString& filename, int &index);
|
||||||
|
PBreakpoint breakpointAt(int line, const Editor* editor, int &index);
|
||||||
void setBreakPointCondition(int index, const QString& condition);
|
void setBreakPointCondition(int index, const QString& condition);
|
||||||
void sendAllBreakpointsToDebugger();
|
void sendAllBreakpointsToDebugger();
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QInputDialog>
|
||||||
#include "iconsmanager.h"
|
#include "iconsmanager.h"
|
||||||
#include "debugger.h"
|
#include "debugger.h"
|
||||||
#include "editorlist.h"
|
#include "editorlist.h"
|
||||||
|
@ -2550,6 +2551,13 @@ void Editor::toggleBreakpoint(int line)
|
||||||
invalidateLine(line);
|
invalidateLine(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Editor::clearBreakpoints()
|
||||||
|
{
|
||||||
|
pMainWindow->debugger()->deleteBreakpoints(this);
|
||||||
|
mBreakpointLines.clear();
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
bool Editor::hasBreakpoint(int line)
|
bool Editor::hasBreakpoint(int line)
|
||||||
{
|
{
|
||||||
return mBreakpointLines.contains(line);
|
return mBreakpointLines.contains(line);
|
||||||
|
@ -2565,6 +2573,23 @@ void Editor::removeBreakpointFocus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Editor::modifyBreakpointProperty(int line)
|
||||||
|
{
|
||||||
|
int index;
|
||||||
|
PBreakpoint breakpoint = pMainWindow->debugger()->breakpointAt(line,this,index);
|
||||||
|
if (!breakpoint)
|
||||||
|
return;
|
||||||
|
bool isOk;
|
||||||
|
QString s=QInputDialog::getText(this,
|
||||||
|
tr("Break point condition"),
|
||||||
|
tr("Enter the condition of the breakpoint:"),
|
||||||
|
QLineEdit::Normal,
|
||||||
|
breakpoint->condition,&isOk);
|
||||||
|
if (isOk) {
|
||||||
|
pMainWindow->debugger()->setBreakPointCondition(index,s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Editor::setActiveBreakpointFocus(int Line, bool setFocus)
|
void Editor::setActiveBreakpointFocus(int Line, bool setFocus)
|
||||||
{
|
{
|
||||||
if (Line != mActiveBreakpointLine) {
|
if (Line != mActiveBreakpointLine) {
|
||||||
|
|
|
@ -132,8 +132,10 @@ public:
|
||||||
PSyntaxIssue getSyntaxIssueAtPosition(const BufferCoord& pos);
|
PSyntaxIssue getSyntaxIssueAtPosition(const BufferCoord& pos);
|
||||||
int gutterClickedLine() const;
|
int gutterClickedLine() const;
|
||||||
void toggleBreakpoint(int line);
|
void toggleBreakpoint(int line);
|
||||||
|
void clearBreakpoints();
|
||||||
bool hasBreakpoint(int line);
|
bool hasBreakpoint(int line);
|
||||||
void removeBreakpointFocus();
|
void removeBreakpointFocus();
|
||||||
|
void modifyBreakpointProperty(int line);
|
||||||
void setActiveBreakpointFocus(int Line, bool setFocus=true);
|
void setActiveBreakpointFocus(int Line, bool setFocus=true);
|
||||||
QString getWordAtPosition(const BufferCoord& p,
|
QString getWordAtPosition(const BufferCoord& p,
|
||||||
BufferCoord& pWordBegin,
|
BufferCoord& pWordBegin,
|
||||||
|
|
|
@ -1144,14 +1144,23 @@ void MainWindow::onEditorContextMenu(const QPoint &pos)
|
||||||
if (!editor)
|
if (!editor)
|
||||||
return;
|
return;
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
|
BufferCoord p;
|
||||||
|
mContextMenuPos = pos;
|
||||||
|
if (editor->GetPositionOfMouse(p)) {
|
||||||
|
//mouse on editing area
|
||||||
menu.addAction(ui->actionCompile_Run);
|
menu.addAction(ui->actionCompile_Run);
|
||||||
menu.addAction(ui->actionDebug);
|
menu.addAction(ui->actionDebug);
|
||||||
int line = editor->caretY();
|
menu.addSeparator();
|
||||||
if (editor->hasBreakpoint(line)) {
|
} else {
|
||||||
//todo: breakpoint property
|
//mouse on gutter
|
||||||
|
int line;
|
||||||
|
if (!editor->GetLineOfMouse(line))
|
||||||
|
line=-1;
|
||||||
|
menu.addAction(ui->actionToggle_Breakpoint);
|
||||||
|
menu.addAction(ui->actionBreakpoint_property);
|
||||||
|
menu.addAction(ui->actionClear_all_breakpoints);
|
||||||
|
ui->actionBreakpoint_property->setEnabled(editor->hasBreakpoint(line));
|
||||||
}
|
}
|
||||||
//todo: goto declaretion
|
|
||||||
//todo: goto definition
|
|
||||||
menu.exec(editor->viewport()->mapToGlobal(pos));
|
menu.exec(editor->viewport()->mapToGlobal(pos));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2138,3 +2147,39 @@ void MainWindow::on_actionPrevious_Editor_triggered()
|
||||||
mEditorList->selectPreviousPage();
|
mEditorList->selectPreviousPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionToggle_Breakpoint_triggered()
|
||||||
|
{
|
||||||
|
Editor * editor = mEditorList->getEditor();
|
||||||
|
int line;
|
||||||
|
if (editor && editor->PointToLine(mContextMenuPos,line))
|
||||||
|
editor->toggleBreakpoint(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionClear_all_breakpoints_triggered()
|
||||||
|
{
|
||||||
|
Editor *e=mEditorList->getEditor();
|
||||||
|
if (!e)
|
||||||
|
return;
|
||||||
|
if (QMessageBox::question(this,
|
||||||
|
tr("Clear all breakpoints"),
|
||||||
|
tr("Do you really want to clear all breakpoints in this file?"),
|
||||||
|
QMessageBox::Yes | QMessageBox::No,
|
||||||
|
QMessageBox::No) == QMessageBox::Yes) {
|
||||||
|
e->clearBreakpoints();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionBreakpoint_property_triggered()
|
||||||
|
{
|
||||||
|
Editor * editor = mEditorList->getEditor();
|
||||||
|
int line;
|
||||||
|
if (editor && editor->PointToLine(mContextMenuPos,line)) {
|
||||||
|
if (editor->hasBreakpoint(line))
|
||||||
|
editor->modifyBreakpointProperty(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -264,6 +264,12 @@ private slots:
|
||||||
|
|
||||||
void on_actionPrevious_Editor_triggered();
|
void on_actionPrevious_Editor_triggered();
|
||||||
|
|
||||||
|
void on_actionToggle_Breakpoint_triggered();
|
||||||
|
|
||||||
|
void on_actionClear_all_breakpoints_triggered();
|
||||||
|
|
||||||
|
void on_actionBreakpoint_property_triggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
EditorList *mEditorList;
|
EditorList *mEditorList;
|
||||||
|
@ -307,6 +313,7 @@ private:
|
||||||
|
|
||||||
bool mClosing;
|
bool mClosing;
|
||||||
bool mSystemTurnedOff;
|
bool mSystemTurnedOff;
|
||||||
|
QPoint mContextMenuPos;
|
||||||
|
|
||||||
|
|
||||||
// QWidget interface
|
// QWidget interface
|
||||||
|
|
|
@ -255,7 +255,7 @@
|
||||||
<enum>QTabWidget::South</enum>
|
<enum>QTabWidget::South</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>4</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabIssues">
|
<widget class="QWidget" name="tabIssues">
|
||||||
<attribute name="icon">
|
<attribute name="icon">
|
||||||
|
@ -302,6 +302,9 @@
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<attribute name="horizontalHeaderStretchLastSection">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -464,7 +467,7 @@
|
||||||
<enum>QTabWidget::North</enum>
|
<enum>QTabWidget::North</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabDebugConsole">
|
<widget class="QWidget" name="tabDebugConsole">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
@ -517,6 +520,9 @@
|
||||||
<property name="textElideMode">
|
<property name="textElideMode">
|
||||||
<enum>Qt::ElideNone</enum>
|
<enum>Qt::ElideNone</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<attribute name="horizontalHeaderStretchLastSection">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -543,6 +549,9 @@
|
||||||
<property name="textElideMode">
|
<property name="textElideMode">
|
||||||
<enum>Qt::ElideNone</enum>
|
<enum>Qt::ElideNone</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<attribute name="horizontalHeaderStretchLastSection">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -1505,6 +1514,29 @@
|
||||||
<string>Ctrl+Shift+Tab</string>
|
<string>Ctrl+Shift+Tab</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionToggle_Breakpoint">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normalon>:/icons/images/editor/breakpoint.png</normalon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Toggle breakpoint</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+F4</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionClear_all_breakpoints">
|
||||||
|
<property name="text">
|
||||||
|
<string>Clear all breakpoints</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionBreakpoint_property">
|
||||||
|
<property name="text">
|
||||||
|
<string>Breakpoint property...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
|
@ -401,7 +401,7 @@ QMenu::separator {
|
||||||
|
|
||||||
QMenu::item {
|
QMenu::item {
|
||||||
background-color: #37414F;
|
background-color: #37414F;
|
||||||
padding: 4px 24px 4px 28px;
|
padding: 4px 8px 4px 8px;
|
||||||
/* Reserve space for selection border */
|
/* Reserve space for selection border */
|
||||||
border: 1px transparent #455364;
|
border: 1px transparent #455364;
|
||||||
}
|
}
|
||||||
|
@ -1574,7 +1574,7 @@ QTabBar::tab:right:!selected, QDockWidget QTabBar::tab:right:!selected {
|
||||||
QTabBar::tab:top, QDockWidget QTabBar::tab:top {
|
QTabBar::tab:top, QDockWidget QTabBar::tab:top {
|
||||||
background-color: #455364;
|
background-color: #455364;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
padding: 0.1em 0.5em 0.1em 0.5em;
|
padding: 4px 10px 4px 10px;
|
||||||
min-width: 5px;
|
min-width: 5px;
|
||||||
border-bottom: 3px solid #455364;
|
border-bottom: 3px solid #455364;
|
||||||
border-top-left-radius: 4px;
|
border-top-left-radius: 4px;
|
||||||
|
@ -1600,7 +1600,7 @@ QTabBar::tab:bottom, QDockWidget QTabBar::tab:bottom {
|
||||||
border-top: 3px solid #455364;
|
border-top: 3px solid #455364;
|
||||||
background-color: #455364;
|
background-color: #455364;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
padding: 0.1em 0.5em 0.1em 0.5em;
|
padding: 4px 10px 4px 10px;
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
min-width: 5px;
|
min-width: 5px;
|
||||||
|
@ -1624,7 +1624,7 @@ QTabBar::tab:bottom:!selected:hover, QDockWidget QTabBar::tab:bottom:!selected:h
|
||||||
QTabBar::tab:left, QDockWidget QTabBar::tab:left {
|
QTabBar::tab:left, QDockWidget QTabBar::tab:left {
|
||||||
background-color: #455364;
|
background-color: #455364;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
padding: 0.5em 0.1em 0.5em 0.1em;
|
padding: 10px 4px 10px 4px;
|
||||||
border-top-left-radius: 4px;
|
border-top-left-radius: 4px;
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
min-height: 5px;
|
min-height: 5px;
|
||||||
|
@ -1646,7 +1646,7 @@ QTabBar::tab:left:!selected:hover, QDockWidget QTabBar::tab:left:!selected:hover
|
||||||
QTabBar::tab:right, QDockWidget QTabBar::tab:right {
|
QTabBar::tab:right, QDockWidget QTabBar::tab:right {
|
||||||
background-color: #455364;
|
background-color: #455364;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
padding: 0.5em 0.1em 0.5em 0.1em;
|
padding: 10px 4px 10px 4px;
|
||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
min-height: 5px;
|
min-height: 5px;
|
||||||
|
@ -1949,7 +1949,7 @@ QHeaderView::section {
|
||||||
color: #E0E1E3;
|
color: #E0E1E3;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 13px;
|
/* font-size: 13px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
QHeaderView::section::horizontal {
|
QHeaderView::section::horizontal {
|
||||||
|
|
|
@ -1575,10 +1575,7 @@ QTabBar::tab:right:!selected, QDockWidget QTabBar::tab:right:!selected {
|
||||||
QTabBar::tab:top, QDockWidget QTabBar::tab:top {
|
QTabBar::tab:top, QDockWidget QTabBar::tab:top {
|
||||||
background-color: #C9CDD0;
|
background-color: #C9CDD0;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
padding-left: 4px;
|
padding: 4px 10px 4px 10px;
|
||||||
padding-right: 4px;
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
min-width: 5px;
|
min-width: 5px;
|
||||||
border-bottom: 3px solid #C9CDD0;
|
border-bottom: 3px solid #C9CDD0;
|
||||||
border-top-left-radius: 4px;
|
border-top-left-radius: 4px;
|
||||||
|
@ -1596,18 +1593,15 @@ QTabBar::tab:top:!selected:hover, QDockWidget QTabBar::tab:top:!selected:hover {
|
||||||
border: 1px solid #73C7FF;
|
border: 1px solid #73C7FF;
|
||||||
border-bottom: 3px solid #73C7FF;
|
border-bottom: 3px solid #73C7FF;
|
||||||
/* Fixes spyder-ide/spyder#9766 and #243 */
|
/* Fixes spyder-ide/spyder#9766 and #243 */
|
||||||
padding-left: 3px;
|
/*padding-left: 3px*/;
|
||||||
padding-right: 3px;
|
/*padding-right: 3px*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab:bottom, QDockWidget QTabBar::tab:bottom {
|
QTabBar::tab:bottom, QDockWidget QTabBar::tab:bottom {
|
||||||
border-top: 3px solid #C9CDD0;
|
border-top: 3px solid #C9CDD0;
|
||||||
background-color: #C9CDD0;
|
background-color: #C9CDD0;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
padding-left: 4px;
|
padding: 4px 10px 4px 10px;
|
||||||
padding-right: 4px;
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
min-width: 5px;
|
min-width: 5px;
|
||||||
|
@ -1631,10 +1625,7 @@ QTabBar::tab:bottom:!selected:hover, QDockWidget QTabBar::tab:bottom:!selected:h
|
||||||
QTabBar::tab:left, QDockWidget QTabBar::tab:left {
|
QTabBar::tab:left, QDockWidget QTabBar::tab:left {
|
||||||
background-color: #C9CDD0;
|
background-color: #C9CDD0;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
padding-left: 2px;
|
padding: 10px 4px 10px 4px;
|
||||||
padding-right: 2px;
|
|
||||||
padding-top: 4px;
|
|
||||||
padding-bottom: 4px;
|
|
||||||
border-top-left-radius: 4px;
|
border-top-left-radius: 4px;
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
min-height: 5px;
|
min-height: 5px;
|
||||||
|
@ -1656,10 +1647,7 @@ QTabBar::tab:left:!selected:hover, QDockWidget QTabBar::tab:left:!selected:hover
|
||||||
QTabBar::tab:right, QDockWidget QTabBar::tab:right {
|
QTabBar::tab:right, QDockWidget QTabBar::tab:right {
|
||||||
background-color: #C9CDD0;
|
background-color: #C9CDD0;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
padding-left: 2px;
|
padding: 10px 4px 10px 4px;
|
||||||
padding-right: 2px;
|
|
||||||
padding-top: 4px;
|
|
||||||
padding-bottom: 4px;
|
|
||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
min-height: 5px;
|
min-height: 5px;
|
||||||
|
@ -1962,7 +1950,7 @@ QHeaderView::section {
|
||||||
color: #19232D;
|
color: #19232D;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 13px;
|
/* font-size: 13px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
QHeaderView::section::horizontal {
|
QHeaderView::section::horizontal {
|
||||||
|
|
|
@ -603,3 +603,9 @@ void logToFile(const QString &s, const QString &filename, bool append)
|
||||||
ts<<s<<Qt::endl;
|
ts<<s<<Qt::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString baseFileName(const QString &fileName)
|
||||||
|
{
|
||||||
|
QFileInfo fileInfo(fileName);
|
||||||
|
return fileInfo.fileName();
|
||||||
|
}
|
||||||
|
|
|
@ -158,6 +158,8 @@ bool findComplement(const QString& s,
|
||||||
int increment);
|
int increment);
|
||||||
void logToFile(const QString& s, const QString& filename, bool append=true);
|
void logToFile(const QString& s, const QString& filename, bool append=true);
|
||||||
|
|
||||||
|
QString baseFileName(const QString& fileName);
|
||||||
|
|
||||||
class CppParser;
|
class CppParser;
|
||||||
void resetCppParser(std::shared_ptr<CppParser> parser);
|
void resetCppParser(std::shared_ptr<CppParser> parser);
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,9 @@
|
||||||
<property name="textElideMode">
|
<property name="textElideMode">
|
||||||
<enum>Qt::ElideNone</enum>
|
<enum>Qt::ElideNone</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<attribute name="horizontalHeaderStretchLastSection">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "issuestable.h"
|
#include "issuestable.h"
|
||||||
|
#include "../utils.h"
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
#include "../settings.h"
|
||||||
|
|
||||||
|
|
||||||
IssuesTable::IssuesTable(QWidget *parent):
|
IssuesTable::IssuesTable(QWidget *parent):
|
||||||
|
@ -7,7 +9,6 @@ IssuesTable::IssuesTable(QWidget *parent):
|
||||||
{
|
{
|
||||||
mModel = new IssuesModel(this);
|
mModel = new IssuesModel(this);
|
||||||
this->setModel(mModel);
|
this->setModel(mModel);
|
||||||
this->horizontalHeader()->setSectionResizeMode(3,QHeaderView::Stretch);
|
|
||||||
this->setColumnWidth(0,200);
|
this->setColumnWidth(0,200);
|
||||||
this->setColumnWidth(1,45);
|
this->setColumnWidth(1,45);
|
||||||
this->setColumnWidth(2,45);
|
this->setColumnWidth(2,45);
|
||||||
|
@ -120,9 +121,14 @@ QVariant IssuesModel::data(const QModelIndex &index, int role) const
|
||||||
return QVariant();
|
return QVariant();
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
|
case Qt::ToolTipRole:
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 0:
|
case 0: {
|
||||||
|
if (role == Qt::DisplayRole)
|
||||||
|
return baseFileName(issue->filename);
|
||||||
|
else
|
||||||
return issue->filename;
|
return issue->filename;
|
||||||
|
}
|
||||||
case 1:
|
case 1:
|
||||||
if (issue->line>0)
|
if (issue->line>0)
|
||||||
return issue->line;
|
return issue->line;
|
||||||
|
@ -168,7 +174,9 @@ QVariant IssuesModel::data(const QModelIndex &index, int role) const
|
||||||
|
|
||||||
QVariant IssuesModel::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant IssuesModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
if (orientation == Qt::Horizontal ) {
|
||||||
|
switch(role) {
|
||||||
|
case Qt::DisplayRole:
|
||||||
switch(section) {
|
switch(section) {
|
||||||
case 0:
|
case 0:
|
||||||
return tr("Filename");
|
return tr("Filename");
|
||||||
|
@ -179,6 +187,8 @@ QVariant IssuesModel::headerData(int section, Qt::Orientation orientation, int r
|
||||||
case 3:
|
case 3:
|
||||||
return tr("Description");
|
return tr("Description");
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue