J
Jaco Naude
Hi
I've been struggling with something that should be very simple to
solve... Basically, I get a const Obj* from a function and I need to
send a pointer to this object to a function accepting only a Obj*. I
get compiler errors as shown below:
source\ManagerViewer.cpp: In member function `void
managerViewer::addLoggerWidget(const QWidget*)':
source\ManagerViewer.cpp:26: error: invalid conversion from `const
QWidget*' to `QWidget*'
I understand that the following will result in a pointer which can be
changed, and the compiler stops:
QWidget* widget = const_widget_ptr;
But the function accepting the pointer is not my own and I need to
send a non-const pointer to it.
Is there a way to work around this?
Thanks in advance
Jaco
I've been struggling with something that should be very simple to
solve... Basically, I get a const Obj* from a function and I need to
send a pointer to this object to a function accepting only a Obj*. I
get compiler errors as shown below:
source\ManagerViewer.cpp: In member function `void
managerViewer::addLoggerWidget(const QWidget*)':
source\ManagerViewer.cpp:26: error: invalid conversion from `const
QWidget*' to `QWidget*'
I understand that the following will result in a pointer which can be
changed, and the compiler stops:
QWidget* widget = const_widget_ptr;
But the function accepting the pointer is not my own and I need to
send a non-const pointer to it.
Is there a way to work around this?
Thanks in advance
Jaco