Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ImageINSA_Tanguy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tanguy.Raufflet
ImageINSA_Tanguy
Commits
0609f6a1
Commit
0609f6a1
authored
6 years ago
by
Provot Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
update filter part2: user can now take filters wherever he wants
parent
ce1efbf3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Widgets/FilterChoice.cpp
+20
-20
20 additions, 20 deletions
app/Widgets/FilterChoice.cpp
app/Widgets/FilterChoice.h
+3
-0
3 additions, 0 deletions
app/Widgets/FilterChoice.h
with
23 additions
and
20 deletions
app/Widgets/FilterChoice.cpp
+
20
−
20
View file @
0609f6a1
...
...
@@ -84,30 +84,29 @@ void FilterChoice::initUI()
QGroupBox
*
stdOrCustomBox
=
new
QGroupBox
(
tr
(
"Select custom or standard filter"
));
_stdButton
=
new
QRadioButton
(
tr
(
"Standard filter"
));
_customButton
=
new
QRadioButton
(
tr
(
"Custom filter"
));
QHBoxLayout
*
hbox
=
new
QHBoxLayout
();
QHBoxLayout
*
hbox
=
new
QHBoxLayout
(
stdOrCustomBox
);
_stdButton
->
setChecked
(
true
);
hbox
->
addWidget
(
_stdButton
);
hbox
->
addWidget
(
_customButton
);
stdOrCustomBox
->
setLayout
(
hbox
);
QGroupBox
*
confBox
=
new
QGroupBox
(
tr
(
"Filter configuration"
));
QFormLayout
*
confLayout
=
new
QFormLayout
(
confBox
);
/* CUSTOM FILTER */
//gère l'appel du custom filter
//TODO
_labelCustom
=
new
QLabel
(
this
);
_labelCustom
->
setText
(
tr
(
"Path to custom filter:"
));
_filterPath
=
new
QTextEdit
(
"/"
);
_filterPath
->
setMaximumWidth
(
200
);
//
_filterPath->setMaximumWidth(200);
_filterPath
->
setReadOnly
(
true
);
// _filterPath->setMaximumHeight(25);
_filterPath
->
setLineWrapMode
(
QTextEdit
::
FixedColumnWidth
);
_filterPath
->
setLineWrapColumnOrWidth
(
190
);
_filterPathSelect
=
new
QPushButton
(
"..."
);
_filterPathSelect
->
setFixedWidth
(
40
);
_filterPath
->
setMaximumHeight
(
25
);
_pathLayout
=
new
QHBoxLayout
();
_pathLayout
->
addWidget
(
_filterPath
);
_pathLayout
->
addWidget
(
_filterPathSelect
);
...
...
@@ -173,6 +172,8 @@ void FilterChoice::initUI()
QObject
::
connect
(
_customButton
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
showCustom
(
bool
)));
QObject
::
connect
(
_number
,
SIGNAL
(
valueChanged
(
const
QString
&
)),
this
,
SLOT
(
dataChanged
(
const
QString
&
)));
QObject
::
connect
(
_stdDevBox
,
SIGNAL
(
valueChanged
(
const
QString
&
)),
this
,
SLOT
(
dataChanged
(
const
QString
&
)));
QObject
::
connect
(
_filterPathSelect
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
openFile
()));
QObject
::
connect
(
_filterPath
,
SIGNAL
(
textChanged
()),
this
,
SLOT
(
updatePath
()));
QWidget
*
rightWidget
=
new
QWidget
();
...
...
@@ -239,9 +240,8 @@ QStringList FilterChoice::initFilters() {
std
::
cout
<<
"filters size : "
<<
_filters
.
size
()
<<
"
\n
"
;
}
else
{
std
::
cout
<<
"definitely checked
\n
"
;
//Personal filters
QFile
file
(
"filters.xml"
);
QFile
file
(
_path
.
toUtf8
()
);
if
(
file
.
exists
())
{
QDomDocument
doc
(
""
);
...
...
@@ -310,17 +310,6 @@ void FilterChoice::updateBlur(bool){
_filters
.
clear
();
std
::
cout
<<
"filters size after clearance:"
<<
_filters
.
size
()
<<
"
\n
"
;
std
::
cout
<<
"blur choices count:"
<<
_blurChoices
->
count
()
<<
"
\n
"
;
/* while(_blurChoices->count()!=0){
std::cout << "inwhile\n";
_blurChoices->removeItem((_blurChoices->count()));
std::cout << "blur choice count:" << _blurChoices->count() << "\n";
std::cout << "outwhile\n";
}*/
/* if(_blurChoices->count()!=0){
_blurChoices = new QComboBox(this);
}*/
if
(
_blurChoices
->
count
()
!=
0
){
_blurChoices
->
clear
();
}
...
...
@@ -591,3 +580,14 @@ void FilterChoice::updateDisplay()
_filterView
->
resizeColumnsToContents
();
_filterView
->
resizeRowsToContents
();
}
void
FilterChoice
::
openFile
()
{
QString
file
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Open a file"
),
QString
(),
tr
(
"XML Documents (*.xml)"
));
if
(
file
.
size
()
==
0
)
return
;
_filterPath
->
setText
(
file
);
}
void
FilterChoice
::
updatePath
(){
_path
=
_filterPath
->
toPlainText
();
updateBlur
(
true
);
}
This diff is collapsed.
Click to expand it.
app/Widgets/FilterChoice.h
+
3
−
0
View file @
0609f6a1
...
...
@@ -66,6 +66,8 @@ namespace filtrme
void
deleteFilter
();
void
showCustom
(
bool
);
void
updateBlur
(
bool
);
void
openFile
();
void
updatePath
();
private
:
bool
_a
=
true
;
...
...
@@ -85,6 +87,7 @@ namespace filtrme
QRadioButton
*
_stdButton
;
QRadioButton
*
_customButton
;
QHBoxLayout
*
_pathLayout
;
QString
_path
;
QLabel
*
_labelNumber
;
QSpinBox
*
_number
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment