Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
0a636677
Commit
0a636677
authored
Aug 16, 2019
by
Huff, Israel
Browse files
Fortify changes
parent
ad788bbc
Pipeline
#67526
passed with stages
in 16 minutes and 31 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixwidgets/navigationactionmanager.cc
View file @
0a636677
...
...
@@ -20,7 +20,7 @@ NavigationActionManager::PImpl::~PImpl() {}
NavigationActionManager
::
NavigationActionManager
(
QObject
*
parent
)
:
QObject
(
parent
)
,
p
(
new
PImpl
(),
[](
PImpl
*
impl
)
{
delete
impl
;
}
)
,
p
(
new
PImpl
(),
deleter
)
{
}
...
...
radixwidgets/navigationwidget.cc
View file @
0a636677
...
...
@@ -15,12 +15,10 @@
#include
<QLineEdit>
#include
<QMenu>
#include
<QMessageBox>
#include
<QShortcut>
#include
<QStandardItemModel>
#include
<QTextDocument>
#include
<QToolTip>
#include
<QTreeView>
#include
<QVBoxLayout>
#include
<QtDebug>
namespace
radix
...
...
@@ -116,10 +114,9 @@ void NavigationWidget::contextMenuRequested(QPoint point)
void
NavigationWidget
::
initLayout
()
{
auto
vlayout
=
new
QVBoxLayout
(
this
);
vlayout
->
addWidget
(
p
->
filter
);
vlayout
->
addWidget
(
p
->
view
);
mVertLayout
=
new
QVBoxLayout
(
this
);
mVertLayout
->
addWidget
(
p
->
filter
);
mVertLayout
->
addWidget
(
p
->
view
);
}
void
NavigationWidget
::
initMembers
()
...
...
@@ -144,18 +141,18 @@ void NavigationWidget::initMembers()
p
->
proxy
->
setSourceModel
(
p
->
model
);
// shortcuts
auto
a
ctivateEnter
=
new
QShortcut
(
p
->
view
);
auto
a
ctivateReturn
=
new
QShortcut
(
p
->
view
);
auto
c
ollapseBranch
=
new
QShortcut
(
p
->
view
);
mA
ctivateEnter
=
new
QShortcut
(
p
->
view
);
mA
ctivateReturn
=
new
QShortcut
(
p
->
view
);
mC
ollapseBranch
=
new
QShortcut
(
p
->
view
);
a
ctivateEnter
->
setContext
(
Qt
::
WidgetShortcut
);
a
ctivateEnter
->
setKey
(
Qt
::
Key_Enter
);
mA
ctivateEnter
->
setContext
(
Qt
::
WidgetShortcut
);
mA
ctivateEnter
->
setKey
(
Qt
::
Key_Enter
);
a
ctivateReturn
->
setContext
(
Qt
::
WidgetShortcut
);
a
ctivateReturn
->
setKey
(
Qt
::
Key_Return
);
mA
ctivateReturn
->
setContext
(
Qt
::
WidgetShortcut
);
mA
ctivateReturn
->
setKey
(
Qt
::
Key_Return
);
c
ollapseBranch
->
setContext
(
Qt
::
WidgetShortcut
);
c
ollapseBranch
->
setKey
(
Qt
::
Key_Left
);
mC
ollapseBranch
->
setContext
(
Qt
::
WidgetShortcut
);
mC
ollapseBranch
->
setKey
(
Qt
::
Key_Left
);
//
// connect signals/slots
...
...
radixwidgets/navigationwidget.hh
View file @
0a636677
#ifndef RADIX_RADIXWIDGETS_NAVIGATIONWIDGET_HH_
#define RADIX_RADIXWIDGETS_NAVIGATIONWIDGET_HH_
#include
<QShortcut>
#include
<QSortFilterProxyModel>
#include
<QStandardItemModel>
#include
<QStyledItemDelegate>
#include
<QVBoxLayout>
#include
<QWidget>
#include
"radixcore/visibility.hh"
...
...
@@ -69,6 +71,9 @@ class RADIX_PUBLIC NavigationWidget : public QWidget
void
itemUnchecked
(
const
QModelIndex
&
index
);
private:
QVBoxLayout
*
mVertLayout
;
QShortcut
*
mActivateEnter
,
*
mActivateReturn
,
*
mCollapseBranch
;
void
initLayout
();
void
initMembers
();
...
...
radixwidgets/numberpadwidget.cc
View file @
0a636677
...
...
@@ -4,12 +4,9 @@
#include
<QApplication>
#include
<QDesktopWidget>
#include
<QGridLayout>
#include
<QKeyEvent>
#include
<QPoint>
#include
<QPushButton>
#include
<QRect>
#include
<QSignalMapper>
#define NEXT_ROW_MARKER 0
namespace
radix
...
...
@@ -53,12 +50,12 @@ QString keyToCharacter(int key)
NumberPadWidget
::
NumberPadWidget
(
QWidget
*
parent
)
:
QLineEdit
(
parent
)
{
QSignalMapper
*
mapper
=
new
QSignalMapper
(
this
);
connect
(
mapper
,
SIGNAL
(
mapped
(
int
)),
SLOT
(
buttonClicked
(
int
)));
m
M
apper
=
new
QSignalMapper
(
this
);
connect
(
m
M
apper
,
SIGNAL
(
mapped
(
int
)),
SLOT
(
buttonClicked
(
int
)));
// add widget containing
mNumberWidget
=
new
QWidget
(
this
);
QGridLayout
*
n
umLayout
=
new
QGridLayout
(
mNumberWidget
);
mNumberWidget
=
new
QWidget
(
this
);
mN
umLayout
=
new
QGridLayout
(
mNumberWidget
);
mNumberWidget
->
hide
();
mNumberWidget
->
setWindowFlags
(
Qt
::
WindowDoesNotAcceptFocus
|
Qt
::
Tool
|
...
...
@@ -77,12 +74,12 @@ NumberPadWidget::NumberPadWidget(QWidget *parent)
col
=
0
;
continue
;
}
QPushButton
*
b
utton
=
new
QPushButton
(
this
);
b
utton
->
setObjectName
(
"number_pad_button"
);
b
utton
->
setText
(
QString
::
fromLatin1
(
keyboardLayout
[
i
].
label
));
mapper
->
setMapping
(
b
utton
,
keyboardLayout
[
i
].
key
);
connect
(
b
utton
,
SIGNAL
(
clicked
()),
mapper
,
SLOT
(
map
()));
n
umLayout
->
addWidget
(
b
utton
,
row
,
col
);
mB
utton
=
new
QPushButton
(
this
);
mB
utton
->
setObjectName
(
"number_pad_button"
);
mB
utton
->
setText
(
QString
::
fromLatin1
(
keyboardLayout
[
i
].
label
));
m
M
apper
->
setMapping
(
mB
utton
,
keyboardLayout
[
i
].
key
);
connect
(
mB
utton
,
SIGNAL
(
clicked
()),
m
M
apper
,
SLOT
(
map
()));
mN
umLayout
->
addWidget
(
mB
utton
,
row
,
col
);
col
++
;
}
}
...
...
radixwidgets/numberpadwidget.hh
View file @
0a636677
#ifndef RADIX_RADIXWIDGETS_NUMBERPADWIDGET_HH_
#define RADIX_RADIXWIDGETS_NUMBERPADWIDGET_HH_
#include
<QGridLayout>
#include
<QLineEdit>
#include
<QPushButton>
#include
<QSignalMapper>
#include
<QWidget>
#include
"radixcore/visibility.hh"
...
...
@@ -11,10 +14,13 @@ class RADIX_PUBLIC NumberPadWidget : public QLineEdit
{
Q_OBJECT
QSignalMapper
*
mMapper
;
QWidget
*
mNumberWidget
;
QGridLayout
*
mNumLayout
;
QPushButton
*
mButton
;
public:
NumberPadWidget
(
QWidget
*
parent
=
0
);
NumberPadWidget
(
QWidget
*
parent
=
nullptr
);
public
slots
:
void
focusInEvent
(
QFocusEvent
*
)
override
;
...
...
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