Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
8e68f518
Commit
8e68f518
authored
Jan 03, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Added destructor to cow_pn_gsdml_attr
parent
6e9a8354
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
35 deletions
+37
-35
profibus/lib/cow/qt/cow_pb_gsd_attr_qt.cqt
profibus/lib/cow/qt/cow_pb_gsd_attr_qt.cqt
+20
-18
profibus/lib/cow/qt/cow_pb_gsd_attr_qt.h
profibus/lib/cow/qt/cow_pb_gsd_attr_qt.h
+3
-2
profibus/lib/cow/qt/cow_pn_gsdml_attr_qt.cqt
profibus/lib/cow/qt/cow_pn_gsdml_attr_qt.cqt
+12
-13
profibus/lib/cow/qt/cow_pn_gsdml_attr_qt.h
profibus/lib/cow/qt/cow_pn_gsdml_attr_qt.h
+1
-1
profibus/lib/cow/qt/cow_pn_gsdml_attrnav_qt.cpp
profibus/lib/cow/qt/cow_pn_gsdml_attrnav_qt.cpp
+1
-1
No files found.
profibus/lib/cow/qt/cow_pb_gsd_attr_qt.cqt
View file @
8e68f518
...
...
@@ -50,6 +50,8 @@
#include <QPushButton>
#include <QVBoxLayout>
CoWowRecall GsdAttrQt::value_recall;
void GsdAttrQt::message(char severity, const char* message)
{
msg_label->setText(fl(message));
...
...
@@ -69,7 +71,7 @@ void GsdAttrQt::set_prompt(const char* prompt)
void GsdAttrQt::change_value()
{
if (input_open) {
cmd_
input
->setVisible(false);
cmd_
entry
->setVisible(false);
set_prompt("");
input_open = 0;
return;
...
...
@@ -91,18 +93,18 @@ void GsdAttrQt::change_value()
return;
}
cmd_
input
->setVisible(true);
cmd_
entry
->setVisible(true);
message(' ', "");
cmd_
input
->setFocus();
cmd_
entry
->setFocus();
if (value) {
cmd_
input
->setText(fl(value));
cmd_
entry
->setText(fl(value));
// Select the text
cmd_
input
->selectAll();
cmd_
entry
->selectAll();
} else {
cmd_
input
->setText("");
cmd_
entry
->setText("");
}
set_prompt("value >");
input_open = 1;
...
...
@@ -171,16 +173,16 @@ void GsdAttrQtWidget::activate_cmd_apply()
attr->activate_cmd_apply();
}
void GsdAttrQtWidget::activate_cmd_
input
()
void GsdAttrQtWidget::activate_cmd_
entry
()
{
attr->cmd_prompt->setVisible(false);
attr->cmd_
input
->setVisible(false);
attr->cmd_
entry
->setVisible(false);
attr->attrnav->set_inputfocus();
if (attr->input_open) {
attr->attrnav->set_attr_value(qPrintable(attr->cmd_
input
->text()));
attr->cmd_
input
->setVisible(false);
attr->attrnav->set_attr_value(qPrintable(attr->cmd_
entry
->text()));
attr->cmd_
entry
->setVisible(false);
attr->set_prompt("");
attr->input_open = 0;
}
...
...
@@ -189,8 +191,8 @@ void GsdAttrQtWidget::activate_cmd_input()
void GsdAttrQtWidget::focusInEvent(QFocusEvent* event)
{
if (!attr->focustimer.disabled()) {
if (attr->cmd_
input
->isVisible()) {
attr->cmd_
input
->setFocus();
if (attr->cmd_
entry
->isVisible()) {
attr->cmd_
entry
->setFocus();
} else if (attr->attrnav) {
attr->attrnav->set_inputfocus();
}
...
...
@@ -274,14 +276,14 @@ GsdAttrQt::GsdAttrQt(QWidget* a_parent_wid, void* a_parent_ctx, void* a_object,
cmd_prompt = new QLabel("value > ");
cmd_prompt->setFixedHeight(25);
cmd_
input = new QLineEdit(
);
cmd_
input
->setFixedHeight(25);
QObject::connect(cmd_
input, SIGNAL(editingFinish
ed()), toplevel,
SLOT(valchanged_cmd_
input
()));
cmd_
entry = new CoWowEntryQt(&value_recall
);
cmd_
entry
->setFixedHeight(25);
QObject::connect(cmd_
entry, SIGNAL(returnPress
ed()), toplevel,
SLOT(valchanged_cmd_
entry
()));
statusbar->addWidget(msg_label);
statusbar->addWidget(cmd_prompt);
add_expanding(statusbar, cmd_
input
);
add_expanding(statusbar, cmd_
entry
);
// Apply and Ok buttons
QDialogButtonBox* buttons = new QDialogButtonBox();
...
...
@@ -306,7 +308,7 @@ GsdAttrQt::GsdAttrQt(QWidget* a_parent_wid, void* a_parent_ctx, void* a_object,
toplevel->show();
cmd_prompt->setVisible(false);
cmd_
input
->setVisible(false);
cmd_
entry
->setVisible(false);
if (!edit_mode) {
buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
...
...
profibus/lib/cow/qt/cow_pb_gsd_attr_qt.h
View file @
8e68f518
...
...
@@ -53,12 +53,13 @@ public:
QWidget
*
form_widget
;
QLabel
*
msg_label
;
QLabel
*
cmd_prompt
;
QLineEdit
*
cmd_input
;
QAction
*
menubutton_copy
;
QAction
*
menubutton_cut
;
QAction
*
menubutton_paste
;
QAction
*
menubutton_changevalue
;
CoWowFocusTimerQt
focustimer
;
static
CoWowRecall
value_recall
;
CoWowEntryQt
*
cmd_entry
;
GsdAttrQt
(
QWidget
*
a_parent_wid
,
void
*
a_parent_ctx
,
void
*
a_object
,
pb_gsd
*
a_gsd
,
int
a_edit_mode
);
...
...
@@ -96,7 +97,7 @@ public slots:
void
activate_zoom_out
();
void
activate_zoom_reset
();
void
activate_print
();
void
activate_cmd_
input
();
void
activate_cmd_
entry
();
void
activate_cmd_ok
();
void
activate_cmd_apply
();
...
...
profibus/lib/cow/qt/cow_pn_gsdml_attr_qt.cqt
View file @
8e68f518
...
...
@@ -38,10 +38,10 @@
#include "co_string.h"
#include "cow_qt_helpers.h"
#include "rt_pb_msg.h"
#include "cow_qt_helpers.h"
#include "cow_pn_gsdml_attr_qt.h"
#include "cow_pn_gsdml_attrnav_qt.h"
...
...
@@ -60,6 +60,7 @@ void GsdmlAttrQt::message(char severity, const char* message)
void GsdmlAttrQt::attr_help_text(const char* text)
{
help_text->setText(fl(text));
help_text->setVisible(strlen(text) > 0);
}
void GsdmlAttrQt::set_prompt(const char* prompt)
...
...
@@ -75,9 +76,6 @@ void GsdmlAttrQt::set_prompt(const char* prompt)
void GsdmlAttrQt::change_value()
{
int sts;
char* value;
if (input_open) {
cmd_entry->setVisible(false);
set_prompt("");
...
...
@@ -90,7 +88,8 @@ void GsdmlAttrQt::change_value()
return;
}
sts = attrnav->check_attr_value(&value);
char* value;
int sts = attrnav->check_attr_value(&value);
if (EVEN(sts)) {
if (sts == PB__NOATTRSEL) {
message('E', "No attribute is selected");
...
...
@@ -210,11 +209,6 @@ void GsdmlAttrQtWidget::activate_cmd_apply()
attr->activate_cmd_apply();
}
void GsdmlAttrQtWidget::activate_cmd_ca()
{
attr->activate_cmd_ca();
}
void GsdmlAttrQtWidget::activate_cmd_entry()
{
attr->cmd_prompt->setVisible(false);
...
...
@@ -247,11 +241,15 @@ void GsdmlAttrQtWidget::focusInEvent(QFocusEvent* event)
void GsdmlAttrQtWidget::closeEvent(QCloseEvent* event)
{
debug_print("GsdmlAttrQtWidget::closeEvent\n");
attr->activate_exit();
QWidget::closeEvent(event);
}
GsdmlAttrQt::~GsdmlAttrQt()
{
delete attrnav;
}
GsdmlAttrQt::GsdmlAttrQt(QWidget* a_parent_wid, void* a_parent_ctx,
void* a_object, pn_gsdml* a_gsdml, int a_edit_mode,
const char* a_data_filename, pwr_tStatus* a_sts)
...
...
@@ -352,7 +350,7 @@ GsdmlAttrQt::GsdmlAttrQt(QWidget* a_parent_wid, void* a_parent_ctx,
QObject::connect(buttons->button(QDialogButtonBox::Apply), SIGNAL(clicked()),
toplevel, SLOT(activate_cmd_apply()));
QObject::connect(buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()),
toplevel, SLOT(
activate_cmd_ca
()));
toplevel, SLOT(
close
()));
QVBoxLayout* vbox = new QVBoxLayout(toplevel);
vbox->setMenuBar(menu_bar);
...
...
@@ -367,6 +365,7 @@ GsdmlAttrQt::GsdmlAttrQt(QWidget* a_parent_wid, void* a_parent_ctx,
cmd_prompt->setVisible(false);
cmd_entry->setVisible(false);
help_text->setVisible(false);
if (!edit_mode) {
buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
...
...
profibus/lib/cow/qt/cow_pn_gsdml_attr_qt.h
View file @
8e68f518
...
...
@@ -68,6 +68,7 @@ public:
GsdmlAttrQt
(
QWidget
*
a_parent_wid
,
void
*
a_parent_ctx
,
void
*
a_object
,
pn_gsdml
*
a_gsdml
,
int
a_edit_mode
,
const
char
*
a_data_filename
,
pwr_tStatus
*
a_sts
);
~
GsdmlAttrQt
();
void
message
(
char
severity
,
const
char
*
message
);
void
attr_help_text
(
const
char
*
help_text
);
...
...
@@ -108,7 +109,6 @@ public slots:
void
activate_cmd_entry
();
void
activate_cmd_ok
();
void
activate_cmd_apply
();
void
activate_cmd_ca
();
void
valchanged_cmd_entry
(){}
...
...
profibus/lib/cow/qt/cow_pn_gsdml_attrnav_qt.cpp
View file @
8e68f518
...
...
@@ -48,7 +48,6 @@ GsdmlAttrNavQt::GsdmlAttrNavQt(void* xn_parent_ctx, QWidget* xn_parent_wid,
pwr_tStatus
*
status
)
:
GsdmlAttrNav
(
xn_parent_ctx
,
xn_name
,
xn_gsdml
,
xn_edit_mode
,
status
)
{
debug_print
(
"creating a scrolledbrowwidgetqt
\n
"
);
form_widget
=
scrolledbrowwidgetqt_new
(
init_brow_cb
,
this
,
&
brow_widget
);
*
w
=
form_widget
;
...
...
@@ -61,6 +60,7 @@ GsdmlAttrNavQt::GsdmlAttrNavQt(void* xn_parent_ctx, QWidget* xn_parent_wid,
GsdmlAttrNavQt
::~
GsdmlAttrNavQt
()
{
delete
trace_timerid
;
delete
wow
;
delete
brow
;
form_widget
->
close
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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