Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
3a8b64c7
Commit
3a8b64c7
authored
Mar 27, 2016
by
Hahn, Steven
Browse files
Start removing Qt3 compatibility members.
parent
81d0af62
Changes
48
Hide whitespace changes
Inline
Side-by-side
MantidQt/API/src/AlgorithmDialog.cpp
View file @
3a8b64c7
...
...
@@ -741,7 +741,7 @@ void AlgorithmDialog::helpClicked() {
* A slot to handle the keep open button click
*/
void
AlgorithmDialog
::
keepOpenChanged
(
int
state
)
{
m_keepOpen
=
(
state
==
QCheck
Box
::
On
);
m_keepOpen
=
(
state
==
Q
t
::
Check
ed
);
}
//-------------------------------------------------------------------------------------------------
...
...
MantidQt/API/src/AlgorithmPropertiesWidget.cpp
View file @
3a8b64c7
...
...
@@ -460,7 +460,7 @@ namespace API
widget
->
setVisible
(
visible
);
}
// for each property
this
->
repaint
(
true
);
this
->
repaint
();
}
//-------------------------------------------------------------------------------------------------
...
...
MantidQt/API/src/MdPlottingCmapsProvider.cpp
View file @
3a8b64c7
...
...
@@ -96,7 +96,7 @@ namespace MantidQt{
for
(
QFileInfoList
::
iterator
it
=
info
.
begin
();
it
!=
info
.
end
();
++
it
)
{
colorMapNames
.
append
(
it
->
baseName
());
colorMapFiles
.
append
(
it
->
absFilePath
());
colorMapFiles
.
append
(
it
->
abs
olute
FilePath
());
}
}
...
...
MantidQt/API/src/MdSettings.cpp
View file @
3a8b64c7
...
...
@@ -161,7 +161,7 @@ bool MdSettings::getUsageGeneralMdColorMap()
QSettings
settings
;
settings
.
beginGroup
(
m_generalMdGroup
);
bool
flag
=
settings
.
value
(
m_lblUseGeneralMdColorMap
,
false
).
as
Bool
();
bool
flag
=
settings
.
value
(
m_lblUseGeneralMdColorMap
,
false
).
to
Bool
();
settings
.
endGroup
();
return
flag
;
...
...
@@ -181,7 +181,7 @@ bool MdSettings::getUsageLastSession()
QSettings
settings
;
settings
.
beginGroup
(
m_vsiGroup
);
bool
flag
=
settings
.
value
(
m_lblUseLastSessionColorMap
,
false
).
as
Bool
();
bool
flag
=
settings
.
value
(
m_lblUseLastSessionColorMap
,
false
).
to
Bool
();
settings
.
endGroup
();
return
flag
;
...
...
@@ -201,7 +201,10 @@ QString MdSettings::getUserSettingInitialView()
QSettings
settings
;
settings
.
beginGroup
(
m_vsiGroup
);
QString
initialView
=
settings
.
value
(
m_lblUserSettingInitialView
,
m_mdConstants
.
getTechniqueDependence
()).
asString
();
QString
initialView
=
settings
.
value
(
m_lblUserSettingInitialView
,
m_mdConstants
.
getTechniqueDependence
())
.
toString
();
settings
.
endGroup
();
return
initialView
;
...
...
@@ -212,7 +215,7 @@ bool MdSettings::getLastSessionLogScale()
QSettings
settings
;
settings
.
beginGroup
(
m_vsiGroup
);
bool
logScale
=
settings
.
value
(
m_lblLastSessionLogScale
,
false
).
as
Bool
();
bool
logScale
=
settings
.
value
(
m_lblLastSessionLogScale
,
false
).
to
Bool
();
settings
.
endGroup
();
return
logScale
;
...
...
MantidQt/API/src/PropertyWidget.cpp
View file @
3a8b64c7
...
...
@@ -199,7 +199,7 @@ PropertyWidget::PropertyWidget(Mantid::Kernel::Property *prop, QWidget *parent,
if
(
!
m_gridLayout
)
{
// Create a LOCAL grid layout
m_gridLayout
=
new
QGridLayout
(
this
,
1
,
5
);
m_gridLayout
=
new
QGridLayout
(
this
);
m_gridLayout
->
setSpacing
(
5
);
this
->
setLayout
(
m_gridLayout
);
m_row
=
0
;
...
...
MantidQt/API/src/RepoModel.cpp
View file @
3a8b64c7
...
...
@@ -1009,9 +1009,7 @@ QString RepoModel::UploadForm::email(){
QString
RepoModel
::
UploadForm
::
author
(){
return
author_le
->
text
();
}
QString
RepoModel
::
UploadForm
::
comment
(){
return
comment_te
->
text
();
}
QString
RepoModel
::
UploadForm
::
comment
()
{
return
comment_te
->
toPlainText
();
}
bool
RepoModel
::
UploadForm
::
saveInfo
(){
return
save_ck
->
isChecked
();
}
...
...
@@ -1057,7 +1055,7 @@ RepoModel::DeleteQueryBox::~DeleteQueryBox(){
}
QString
RepoModel
::
DeleteQueryBox
::
comment
(){
if
(
comment_te
)
return
comment_te
->
text
();
return
comment_te
->
t
oPlainT
ext
();
else
return
QString
();
...
...
MantidQt/CustomDialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp
View file @
3a8b64c7
...
...
@@ -54,7 +54,7 @@ namespace MantidQt
Mantid
::
API
::
AnalysisDataService
::
Instance
().
retrieve
(
wsName
)
);
if
(
!
tws
)
return
;
// just in case
m_form
.
cbColumnE
->
insertItem
(
""
);
// the default value
m_form
.
cbColumnE
->
insertItem
(
-
1
,
""
);
// the default value
std
::
vector
<
std
::
string
>
columns
=
tws
->
getColumnNames
();
if
(
columns
.
empty
())
return
;
QString
defaultXColumn
;
...
...
@@ -63,9 +63,9 @@ namespace MantidQt
for
(
std
::
vector
<
std
::
string
>::
const_iterator
column
=
columns
.
begin
();
column
!=
columns
.
end
();
++
column
)
{
QString
qName
=
QString
::
fromStdString
(
*
column
);
m_form
.
cbColumnX
->
insertItem
(
qName
);
m_form
.
cbColumnY
->
insertItem
(
qName
);
m_form
.
cbColumnE
->
insertItem
(
qName
);
m_form
.
cbColumnX
->
insertItem
(
-
1
,
qName
);
m_form
.
cbColumnY
->
insertItem
(
-
1
,
qName
);
m_form
.
cbColumnE
->
insertItem
(
-
1
,
qName
);
Mantid
::
API
::
Column_sptr
col
=
tws
->
getColumn
(
*
column
);
if
(
col
->
getPlotType
()
==
1
&&
defaultXColumn
.
isEmpty
())
// type X
{
...
...
MantidQt/CustomDialogs/src/FitDialog.cpp
View file @
3a8b64c7
...
...
@@ -381,15 +381,15 @@ void FitDialog::tieStaticWidgets(const bool readHistory) {
QStringList
allowedDomainTypes
=
getAllowedPropertyValues
(
"DomainType"
);
// Disable some domain types in the GUI until their imlpementations have been
// finished
allowedDomainTypes
.
remove
(
"Sequential"
);
allowedDomainTypes
.
remove
(
"Parallel"
);
allowedDomainTypes
.
remove
All
(
"Sequential"
);
allowedDomainTypes
.
remove
All
(
"Parallel"
);
m_form
.
cbDomainType
->
addItems
(
allowedDomainTypes
);
// tie(m_form.cbDomainType, "DomainType", m_form.staticLayout, readHistory);
connect
(
m_form
.
cbDomainType
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
domainTypeChanged
()));
QString
domainTypeValue
=
getStoredPropertyValue
(
"DomainType"
);
if
(
!
domainTypeValue
.
isEmpty
())
{
m_form
.
cbDomainType
->
set
Current
Text
(
domainTypeValue
);
m_form
.
cbDomainType
->
set
Item
Text
(
-
1
,
domainTypeValue
);
}
// this creates input workspace widgets and adjusts minimizers list
...
...
@@ -411,14 +411,14 @@ void FitDialog::domainTypeChanged() {
getDomainTypeString
().
toStdString
());
auto
minimizerList
=
getAllowedPropertyValues
(
"Minimizer"
);
if
(
getDomainType
()
!=
0
)
{
minimizerList
.
remove
(
"Levenberg-Marquardt"
);
minimizerList
.
remove
All
(
"Levenberg-Marquardt"
);
}
QString
currentMinimizer
=
m_form
.
cbMinimizer
->
currentText
();
m_form
.
cbMinimizer
->
clear
();
m_form
.
cbMinimizer
->
addItems
(
minimizerList
);
int
index
=
m_form
.
cbMinimizer
->
findText
(
currentMinimizer
);
if
(
index
>=
0
)
{
m_form
.
cbMinimizer
->
set
Current
Text
(
currentMinimizer
);
m_form
.
cbMinimizer
->
set
Item
Text
(
-
1
,
currentMinimizer
);
}
createInputWorkspaceWidgets
();
}
...
...
MantidQt/CustomDialogs/src/LoadDialog.cpp
View file @
3a8b64c7
...
...
@@ -253,7 +253,7 @@ namespace MantidQt
if
(
!
m_form
.
fileWidget
->
isValid
()
)
return
;
// First step is the get the specific loader that is responsible
auto
loadAlg
=
getAlgorithm
();
const
QString
filenames
=
m_form
.
fileWidget
->
getUserInput
().
as
String
();
const
QString
filenames
=
m_form
.
fileWidget
->
getUserInput
().
to
String
();
if
(
filenames
==
m_currentFiles
)
return
;
m_currentFiles
=
filenames
;
removeOldInputWidgets
(
m_form
.
propertyLayout
);
// The new file might be invalid
...
...
MantidQt/CustomDialogs/src/SortTableWorkspaceDialog.cpp
View file @
3a8b64c7
...
...
@@ -207,7 +207,7 @@ void SortTableWorkspaceDialog::addColumn()
{
if
(
!
m_sortColumns
.
contains
(
name
)
)
{
columnName
->
set
Current
Text
(
name
);
columnName
->
set
Item
Text
(
-
1
,
name
);
break
;
}
}
...
...
MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp
View file @
3a8b64c7
...
...
@@ -327,7 +327,7 @@ void StartLiveDataDialog::setDefaultAccumulationMethod(const QString& inst)
// If 'Add' is currently selected, select 'Replace' instead
if
(
ui
.
cmbAccumulationMethod
->
currentIndex
()
==
addIndex
)
{
ui
.
cmbAccumulationMethod
->
set
Current
Text
(
"Replace"
);
ui
.
cmbAccumulationMethod
->
set
Item
Text
(
-
1
,
"Replace"
);
}
// Disable the 'Add' option in the combobox. It just wouldn't make sense.
ui
.
cmbAccumulationMethod
->
setItemData
(
addIndex
,
false
,
Qt
::
UserRole
-
1
);
...
...
@@ -389,7 +389,7 @@ void StartLiveDataDialog::initListenerPropLayout(const QString& inst)
QString
propName
=
QString
::
fromStdString
((
**
prop
).
name
());
if
(
m_algProperties
.
contains
(
propName
)
)
{
m_algProperties
.
remove
(
propName
);
m_algProperties
.
remove
All
(
propName
);
}
}
...
...
MantidQt/CustomInterfaces/src/DataComparison.cpp
View file @
3a8b64c7
...
...
@@ -158,7 +158,7 @@ void DataComparison::addDataItem(Workspace_const_sptr ws)
return
;
}
QS
tring
wsName
=
QString
::
fromStdString
(
matrixWs
->
name
()
)
;
std
::
s
tring
wsName
=
matrixWs
->
name
();
// Append a new row to the data table
int
currentRows
=
m_uiForm
.
twCurrentData
->
rowCount
();
...
...
@@ -191,7 +191,7 @@ void DataComparison::addDataItem(Workspace_const_sptr ws)
m_uiForm
.
twCurrentData
->
setCellWidget
(
currentRows
,
COLOUR
,
colourCombo
);
// Insert the workspace name
QTableWidgetItem
*
wsNameItem
=
new
QTableWidgetItem
(
tr
(
wsName
));
QTableWidgetItem
*
wsNameItem
=
new
QTableWidgetItem
(
tr
(
wsName
.
c_str
()
));
wsNameItem
->
setFlags
(
Qt
::
ItemIsEnabled
|
Qt
::
ItemIsSelectable
);
m_uiForm
.
twCurrentData
->
setItem
(
currentRows
,
WORKSPACE_NAME
,
wsNameItem
);
...
...
@@ -373,7 +373,8 @@ void DataComparison::plotWorkspaces()
}
// Update current spectrum display
m_uiForm
.
twCurrentData
->
item
(
row
,
CURRENT_SPEC
)
->
setText
(
tr
(
QString
::
number
(
wsIndex
)));
m_uiForm
.
twCurrentData
->
item
(
row
,
CURRENT_SPEC
)
->
setText
(
tr
(
std
::
to_string
(
wsIndex
).
c_str
()));
// Create the curve data
const
bool
logScale
(
false
),
distribution
(
false
);
...
...
MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp
View file @
3a8b64c7
...
...
@@ -128,7 +128,7 @@ void ApplyPaalmanPings::run() {
}
else
{
// Check for same binning across sample and container
if
(
!
checkWorkspaceBinningMatches
(
sampleWs
,
canCloneWs
))
{
QString
text
=
const
char
*
text
=
"Binning on sample and container does not match."
"Would you like to rebin the container to match the sample?"
;
...
...
@@ -165,15 +165,14 @@ void ApplyPaalmanPings::run() {
if
(
interpolateAll
)
{
result
=
QMessageBox
::
Yes
;
}
else
{
QString
text
=
"Number of bins on sample and "
+
QString
::
fromStdString
(
factorWs
->
name
())
+
" workspace does not match.
\n
"
+
"Would you like to interpolate this workspace to "
"match the sample?"
;
result
=
QMessageBox
::
question
(
NULL
,
tr
(
"Interpolate corrections?"
),
tr
(
text
),
QMessageBox
::
YesToAll
,
QMessageBox
::
Yes
,
QMessageBox
::
No
);
std
::
string
text
=
"Number of bins on sample and "
+
factorWs
->
name
()
+
" workspace does not match.
\n
"
+
"Would you like to interpolate this workspace to "
"match the sample?"
;
result
=
QMessageBox
::
question
(
NULL
,
tr
(
"Interpolate corrections?"
),
tr
(
text
.
c_str
()),
QMessageBox
::
YesToAll
,
QMessageBox
::
Yes
,
QMessageBox
::
No
);
}
switch
(
result
)
{
...
...
MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
View file @
3a8b64c7
...
...
@@ -95,23 +95,23 @@ void ContainerSubtraction::run() {
}
else
{
if
(
!
checkWorkspaceBinningMatches
(
sampleWs
,
canCloneWs
))
{
QString
text
=
"Binning on sample and container does not match."
"Would you like to rebin the container to match the sample?"
;
int
result
=
QMessageBox
::
question
(
NULL
,
tr
(
"Rebin sample?"
),
tr
(
text
),
QMessageBox
::
Yes
,
QMessageBox
::
No
,
QMessageBox
::
NoButton
);
if
(
result
==
QMessageBox
::
Yes
)
{
IAlgorithm_sptr
rebin
=
AlgorithmManager
::
Instance
().
create
(
"RebinToWorkspace"
);
rebin
->
initialize
();
rebin
->
setProperty
(
"WorkspaceToRebin"
,
canCloneWs
);
rebin
->
setProperty
(
"WorkspaceToMatch"
,
sampleWs
);
rebin
->
setProperty
(
"OutputWorkspace"
,
canCloneName
.
toStdString
());
rebin
->
execute
();
}
const
char
*
text
=
"Binning on sample and container does not match."
"Would you like to rebin the container to match the sample?"
;
int
result
=
QMessageBox
::
question
(
NULL
,
tr
(
"Rebin sample?"
),
tr
(
text
)
,
QMessageBox
::
Yes
,
QMessageBox
::
No
,
QMessageBox
::
NoButton
);
if
(
result
==
QMessageBox
::
Yes
)
{
IAlgorithm_sptr
rebin
=
AlgorithmManager
::
Instance
().
create
(
"RebinToWorkspace"
);
rebin
->
initialize
();
rebin
->
setProperty
(
"WorkspaceToRebin"
,
canCloneWs
);
rebin
->
setProperty
(
"WorkspaceToMatch"
,
sampleWs
);
rebin
->
setProperty
(
"OutputWorkspace"
,
canCloneName
.
toStdString
());
rebin
->
execute
();
}
else
{
m_batchAlgoRunner
->
clearQueue
();
g_log
.
error
(
"Cannot apply absorption corrections using a sample and "
...
...
MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
View file @
3a8b64c7
...
...
@@ -1721,7 +1721,7 @@ QString ConvFit::convertFuncToShort(const QString &original) {
}
else
{
return
"SFT"
;
}
auto
pos
=
original
.
f
ind
(
"Circle"
);
auto
pos
=
original
.
ind
exOf
(
"Circle"
);
if
(
pos
!=
-
1
)
{
result
+=
"DC"
;
}
else
{
...
...
MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp
View file @
3a8b64c7
...
...
@@ -82,9 +82,10 @@ bool ISISEnergyTransfer::validate() {
double
rebinWidth
=
m_uiForm
.
spRebinWidth
->
value
();
if
(
rebinWidth
<
0
)
{
// Ensure negative bin width is intentionally logarithmic
QString
text
=
"The Binning width is currently negative, this suggests "
"you wish to use logarithmic binning.
\n
"
" Do you want to use Logarithmic Binning?"
;
const
char
*
text
=
"The Binning width is currently negative, this suggests "
"you wish to use logarithmic binning.
\n
"
" Do you want to use Logarithmic Binning?"
;
int
result
=
QMessageBox
::
question
(
NULL
,
tr
(
"Logarithmic Binning"
),
tr
(
text
),
QMessageBox
::
Yes
,
QMessageBox
::
No
,
QMessageBox
::
NoButton
);
...
...
MantidQt/CustomInterfaces/src/Indirect/IndirectLoadILL.cpp
View file @
3a8b64c7
...
...
@@ -31,7 +31,7 @@ void IndirectLoadILL::setup() {}
bool
IndirectLoadILL
::
validate
()
{
QString
filename
=
m_uiForm
.
mwRun
->
getFirstFilename
();
QFileInfo
finfo
(
filename
);
QString
ext
=
finfo
.
extension
().
toLower
();
QString
ext
=
finfo
.
suffix
().
toLower
();
bool
invalidExt
=
(
ext
!=
"asc"
&&
ext
!=
"inx"
&&
ext
!=
"nxs"
);
...
...
@@ -56,7 +56,7 @@ void IndirectLoadILL::run() {
QString
filename
=
m_uiForm
.
mwRun
->
getFirstFilename
();
QFileInfo
finfo
(
filename
);
QString
ext
=
finfo
.
extension
().
toLower
();
QString
ext
=
finfo
.
suffix
().
toLower
();
QString
instrument
=
m_uiForm
.
iicInstrumentConfiguration
->
getInstrumentName
();
QString
analyser
=
m_uiForm
.
iicInstrumentConfiguration
->
getAnalyserName
();
...
...
MantidQt/CustomInterfaces/src/Indirect/IndirectMolDyn.cpp
View file @
3a8b64c7
...
...
@@ -35,7 +35,7 @@ bool IndirectMolDyn::validate() {
QString
filename
=
m_uiForm
.
mwRun
->
getFirstFilename
();
QString
version
=
m_uiForm
.
cbVersion
->
currentText
();
QFileInfo
finfo
(
filename
);
QString
ext
=
finfo
.
extension
().
toLower
();
QString
ext
=
finfo
.
suffix
().
toLower
();
if
(
version
==
"3"
)
{
if
(
ext
!=
"dat"
&&
ext
!=
"cdl"
)
...
...
MantidQt/CustomInterfaces/src/Indirect/Quasi.cpp
View file @
3a8b64c7
...
...
@@ -134,11 +134,12 @@ void Quasi::run() {
auto
saveDirectory
=
Mantid
::
Kernel
::
ConfigService
::
Instance
().
getString
(
"defaultsave.directory"
);
if
(
saveDirectory
.
compare
(
""
)
==
0
)
{
QString
textMessage
=
"BayesQuasi requires a default save directory and "
"one is not currently set."
" If run, the algorithm will default to saving files "
"to the current working directory."
" Would you still like to run the algorithm?"
;
const
char
*
textMessage
=
"BayesQuasi requires a default save directory and "
"one is not currently set."
" If run, the algorithm will default to saving files "
"to the current working directory."
" Would you still like to run the algorithm?"
;
int
result
=
QMessageBox
::
question
(
NULL
,
tr
(
"Save Directory"
),
tr
(
textMessage
),
QMessageBox
::
Yes
,
QMessageBox
::
No
,
QMessageBox
::
NoButton
);
...
...
MantidQt/CustomInterfaces/src/MantidEV.cpp
View file @
3a8b64c7
...
...
@@ -2419,7 +2419,7 @@ void MantidEV::restore( QSettings *state, QString name, QComboBox *cmbx )
int
val
=
state
->
value
(
name
,
-
1
).
toInt
();
if
(
val
>
0
)
{
cmbx
->
setCurrentI
tem
(
val
);
cmbx
->
setCurrentI
ndex
(
val
);
}
}
...
...
Prev
1
2
3
Next
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