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
rsm
Commits
09160f9c
Commit
09160f9c
authored
Apr 17, 2020
by
Huff, Israel
Browse files
aptens line edit fields now select all when they get focus
parent
af1f38c0
Pipeline
#97631
failed with stages
in 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rsmwidgets/examples/rsmportalexample.cc
View file @
09160f9c
...
...
@@ -9,11 +9,11 @@
#include
<QApplication>
#include
<QGridLayout>
#include
<QHBoxLayout>
#include
<QHeaderView>
#include
<QInputDialog>
#include
<QLabel>
#include
<QMessageBox>
#include
<QTabWidget>
#include
<QTimer>
#include
"radixbug/bug.hh"
using
namespace
rsm
;
...
...
@@ -460,6 +460,25 @@ QGroupBox::title {
)foo"
);
}
// ----------------------------------------------------------------------------
LineEditFocusSelectAll
::
LineEditFocusSelectAll
(
QWidget
*
parent
)
:
QLineEdit
(
parent
)
{
}
LineEditFocusSelectAll
::
LineEditFocusSelectAll
(
const
QString
&
text
,
QWidget
*
parent
)
:
QLineEdit
(
text
,
parent
)
{
}
void
LineEditFocusSelectAll
::
focusInEvent
(
QFocusEvent
*
event
)
{
QLineEdit
::
focusInEvent
(
event
);
QTimer
::
singleShot
(
0
,
this
,
&
QLineEdit
::
selectAll
);
}
// ----------------------------------------------------------------------------
APTEnsWidget
::
APTEnsWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
...
...
@@ -491,9 +510,9 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
mAltLabel
=
new
StyledLabel
(
"Altitude"
,
mEventDefBox
);
mSoilTypeLabel
=
new
StyledLabel
(
"Soil Type"
,
mEventDefBox
);
mFissionIDLabel
=
new
StyledLabel
(
"Fission ID"
,
mEventDefBox
);
mLatLineEdit
=
new
Q
LineEdit
(
mEventDefBox
);
mLonLineEdit
=
new
Q
LineEdit
(
mEventDefBox
);
mAltLineEdit
=
new
Q
LineEdit
(
mEventDefBox
);
mLatLineEdit
=
new
LineEdit
FocusSelectAll
(
mEventDefBox
);
mLonLineEdit
=
new
LineEdit
FocusSelectAll
(
mEventDefBox
);
mAltLineEdit
=
new
LineEdit
FocusSelectAll
(
mEventDefBox
);
mSoilTypeComboBox
=
new
QComboBox
(
mEventDefBox
);
mFissionIDComboBox
=
new
QComboBox
(
mEventDefBox
);
mSoilTypeComboBox
->
setEditable
(
true
);
...
...
@@ -523,14 +542,14 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
// build yield ensemble box
QGridLayout
*
yeLayout
=
new
QGridLayout
(
mYieldEnsBox
);
mTotalYieldLabel
=
new
StyledLabel
(
"Total Yield"
,
mYieldEnsBox
);
mTotalYieldLineEdit
=
new
Q
LineEdit
(
mYieldEnsBox
);
mTotalYieldLineEdit
=
new
LineEdit
FocusSelectAll
(
mYieldEnsBox
);
mYieldDefineEnsCheckBox
=
new
QCheckBox
(
"Define Ensemble"
,
mYieldEnsBox
);
mNumYieldsLabel
=
new
StyledLabel
(
"# of Yields"
,
mYieldEnsBox
);
mNumYieldsLineEdit
=
new
Q
LineEdit
(
mYieldEnsBox
);
mNumYieldsLineEdit
=
new
LineEdit
FocusSelectAll
(
mYieldEnsBox
);
mMinYieldLabel
=
new
StyledLabel
(
"Min Yield"
,
mYieldEnsBox
);
mMinYieldLineEdit
=
new
Q
LineEdit
(
mYieldEnsBox
);
mMinYieldLineEdit
=
new
LineEdit
FocusSelectAll
(
mYieldEnsBox
);
mMaxYieldLabel
=
new
StyledLabel
(
"Max Yield"
,
mYieldEnsBox
);
mMaxYieldLineEdit
=
new
Q
LineEdit
(
mYieldEnsBox
);
mMaxYieldLineEdit
=
new
LineEdit
FocusSelectAll
(
mYieldEnsBox
);
mYieldSamplingLabel
=
new
StyledLabel
(
"Sampling"
,
mYieldEnsBox
);
mYieldSamplingComboBox
=
new
QComboBox
(
mYieldEnsBox
);
mYieldSamplingComboBox
->
addItem
(
"uniform"
);
...
...
@@ -551,15 +570,15 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
// build height of burst ensemble box
QGridLayout
*
hobLayout
=
new
QGridLayout
(
mHeightOfBurstEnsBox
);
mHOBLabel
=
new
StyledLabel
(
"Height of Burst"
,
mHeightOfBurstEnsBox
);
mHOBLineEdit
=
new
Q
LineEdit
(
mHeightOfBurstEnsBox
);
mHOBLineEdit
=
new
LineEdit
FocusSelectAll
(
mHeightOfBurstEnsBox
);
mHOBDefineEnsCheckBox
=
new
QCheckBox
(
"Define Ensemble"
,
mHeightOfBurstEnsBox
);
mNumHOBsLabel
=
new
StyledLabel
(
"# of HoB"
,
mHeightOfBurstEnsBox
);
mNumHOBsLineEdit
=
new
Q
LineEdit
(
mHeightOfBurstEnsBox
);
mNumHOBsLineEdit
=
new
LineEdit
FocusSelectAll
(
mHeightOfBurstEnsBox
);
mMinHOBLabel
=
new
StyledLabel
(
"Min HoB"
,
mHeightOfBurstEnsBox
);
mMinHOBLineEdit
=
new
Q
LineEdit
(
mHeightOfBurstEnsBox
);
mMinHOBLineEdit
=
new
LineEdit
FocusSelectAll
(
mHeightOfBurstEnsBox
);
mMaxHOBLabel
=
new
StyledLabel
(
"Max HoB"
,
mHeightOfBurstEnsBox
);
mMaxHOBLineEdit
=
new
Q
LineEdit
(
mHeightOfBurstEnsBox
);
mMaxHOBLineEdit
=
new
LineEdit
FocusSelectAll
(
mHeightOfBurstEnsBox
);
mHOBSamplingLabel
=
new
StyledLabel
(
"Sampling"
,
mHeightOfBurstEnsBox
);
mHOBSamplingComboBox
=
new
QComboBox
(
mHeightOfBurstEnsBox
);
mHOBSamplingComboBox
->
addItem
(
"uniform"
);
...
...
@@ -616,7 +635,7 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
// turbulence ensemble box
QGridLayout
*
teLayout
=
new
QGridLayout
(
mTurbEnsBox
);
mTurbEnsNumLabel
=
new
StyledLabel
(
"Number"
,
mTurbEnsBox
);
mTurbEnsNumLineEdit
=
new
Q
LineEdit
(
mTurbEnsBox
);
mTurbEnsNumLineEdit
=
new
LineEdit
FocusSelectAll
(
mTurbEnsBox
);
QWidget
*
teSpacer
=
new
QWidget
(
mTurbEnsBox
);
teSpacer
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Preferred
);
teLayout
->
addWidget
(
mTurbEnsNumLabel
,
0
,
0
);
...
...
@@ -626,7 +645,7 @@ APTEnsWidget::APTEnsWidget(QWidget *parent)
// meteorology ensemble box
QGridLayout
*
meLayout
=
new
QGridLayout
(
mMetEnsBox
);
mMetEnsNumLabel
=
new
StyledLabel
(
"Number"
,
mMetEnsBox
);
mMetEnsNumLineEdit
=
new
Q
LineEdit
(
mMetEnsBox
);
mMetEnsNumLineEdit
=
new
LineEdit
FocusSelectAll
(
mMetEnsBox
);
QWidget
*
meSpacer
=
new
QWidget
(
mMetEnsBox
);
meSpacer
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Preferred
);
meLayout
->
addWidget
(
mMetEnsNumLabel
,
0
,
0
);
...
...
@@ -687,7 +706,8 @@ MainWindow::MainWindow(QWidget *parent)
MainWindow
::~
MainWindow
()
{}
/******************************************************************************/
/******************************** MAIN PROGRAM ********************************/
/******************************** MAIN PROGRAM
* ********************************/
/******************************************************************************/
int
main
(
int
argc
,
char
**
argv
)
...
...
rsmwidgets/examples/rsmportalexample.hh
View file @
09160f9c
#ifndef RSM_RSMWIDGETS_EXAMPLE_RSMPORTALEXAMPLE_HH_
#define RSM_RSMWIDGETS_EXAMPLE_RSMPORTALEXAMPLE_HH_
#include
<QAbstractTableModel>
#include
<QButtonGroup>
#include
<QCheckBox>
#include
<QComboBox>
...
...
@@ -114,6 +113,16 @@ class LeftTitleGroupBox : public QGroupBox
LeftTitleGroupBox
(
const
QString
&
title
,
QWidget
*
parent
=
Q_NULLPTR
);
};
class
LineEditFocusSelectAll
:
public
QLineEdit
{
public:
LineEditFocusSelectAll
(
QWidget
*
parent
=
Q_NULLPTR
);
LineEditFocusSelectAll
(
const
QString
&
text
,
QWidget
*
parent
=
Q_NULLPTR
);
protected:
void
focusInEvent
(
QFocusEvent
*
event
)
override
;
};
class
APTEnsDataModel
{
private:
...
...
@@ -221,35 +230,35 @@ class APTEnsWidget : public QWidget
StyledLabel
*
mAltLabel
;
StyledLabel
*
mSoilTypeLabel
;
StyledLabel
*
mFissionIDLabel
;
Q
LineEdit
*
mLatLineEdit
;
Q
LineEdit
*
mLonLineEdit
;
Q
LineEdit
*
mAltLineEdit
;
LineEdit
FocusSelectAll
*
mLatLineEdit
;
LineEdit
FocusSelectAll
*
mLonLineEdit
;
LineEdit
FocusSelectAll
*
mAltLineEdit
;
QComboBox
*
mSoilTypeComboBox
;
QComboBox
*
mFissionIDComboBox
;
StyledLabel
*
mTotalYieldLabel
;
Q
LineEdit
*
mTotalYieldLineEdit
;
LineEdit
FocusSelectAll
*
mTotalYieldLineEdit
;
// TODO: enable/disable all other controls in group box
QCheckBox
*
mYieldDefineEnsCheckBox
;
StyledLabel
*
mNumYieldsLabel
;
Q
LineEdit
*
mNumYieldsLineEdit
;
LineEdit
FocusSelectAll
*
mNumYieldsLineEdit
;
StyledLabel
*
mMinYieldLabel
;
Q
LineEdit
*
mMinYieldLineEdit
;
LineEdit
FocusSelectAll
*
mMinYieldLineEdit
;
StyledLabel
*
mMaxYieldLabel
;
Q
LineEdit
*
mMaxYieldLineEdit
;
LineEdit
FocusSelectAll
*
mMaxYieldLineEdit
;
StyledLabel
*
mYieldSamplingLabel
;
QComboBox
*
mYieldSamplingComboBox
;
StyledLabel
*
mHOBLabel
;
Q
LineEdit
*
mHOBLineEdit
;
LineEdit
FocusSelectAll
*
mHOBLineEdit
;
// TODO: enable/disable all other controls in group box
QCheckBox
*
mHOBDefineEnsCheckBox
;
StyledLabel
*
mNumHOBsLabel
;
Q
LineEdit
*
mNumHOBsLineEdit
;
LineEdit
FocusSelectAll
*
mNumHOBsLineEdit
;
StyledLabel
*
mMinHOBLabel
;
Q
LineEdit
*
mMinHOBLineEdit
;
LineEdit
FocusSelectAll
*
mMinHOBLineEdit
;
StyledLabel
*
mMaxHOBLabel
;
Q
LineEdit
*
mMaxHOBLineEdit
;
LineEdit
FocusSelectAll
*
mMaxHOBLineEdit
;
StyledLabel
*
mHOBSamplingLabel
;
QComboBox
*
mHOBSamplingComboBox
;
...
...
@@ -266,10 +275,10 @@ class APTEnsWidget : public QWidget
QPushButton
*
mSetupCfgsRemoveButton
;
StyledLabel
*
mTurbEnsNumLabel
;
Q
LineEdit
*
mTurbEnsNumLineEdit
;
LineEdit
FocusSelectAll
*
mTurbEnsNumLineEdit
;
StyledLabel
*
mMetEnsNumLabel
;
Q
LineEdit
*
mMetEnsNumLineEdit
;
LineEdit
FocusSelectAll
*
mMetEnsNumLineEdit
;
void
readInputsFromDM
();
...
...
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