Unsolved Regarding the exposing of the properties using Q_Property
-
Hi,
Posted the same query in WinCC OA forum
the below is the link
https://portal.etm.at/index.php?option=com_kunena&Itemid=75&func=view&catid=16&id=4804#4819
They said its automatically done by Gedi.
and going through the documentation, and how to provide the properties as string , QVariant so the gedi understands?.Thanks,
-
@Pradeep-Kumar
Ok so no QStringList for us.
Then yes, seems it just need to be normal Qt properties ( with Q_PROPERTY)
and Gedi ( what ever that is) should just do it. -
k thats what i am figuring what datatypr should i use to make Gedi understand , so i will get toolbutton and combobox.
Thanks,
-
@Pradeep-Kumar
Well the dude says it takes QColor, QPen, QBrush, QFont, QPoint
so I would just try and see what you get :) -
Thats what i m figuring but the thing is i require the root of how it has be done.
Thanks,
-
-
Hi,
from Qt perspective , and how gedi will come to know to provide toolbutton.
Thanks,
-
Well just define properties and make sure you have Q_OBJECT macro in the class.
Then Qt part should be fine.For Gedi, you should ask other forum. It's not possible to know what is required for Gedi to load
your code. With Creator it's a plugin (DLL) but i have no idea what Gedi is or how to make it load
any Qt code and in what form that code should be.So the most important info is still msising
What does Gedi support / wants / have ?
-
Hi,
using the datatypes bool i am able to get combobox in extended properties.
And using QBrush,QColor i am getting toolbutton,
Q_PROPERTY(QBrush brush READ getBrush WRITE setBrush DESIGNABLE true) void BaseWidget::setBrush(QBrush brush) { // m_brush = brush; m_widget = new QWidget; m_widget->setWindowTitle("toolbutton"); m_widget->show(); } QBrush BaseWidget::getBrush() { return m_brush; }
on click of toolbutton, we need the widget which we created , but the default widget is poping up, how can it be avoided?.
Thanks,
-
Hi
-click of toolbutton, we need the widget which we created , but the default widget is poping up, how can it be avoided?I have no idea what you mean :)
Can you please show code for
- the widget which we created
( what widget ?)
and the code click of toolbutton
and then what default widget is. ?if you mean that , inside Gedi, the editor there - shows a default something and not Class X, you have created
then please tell more what you do. Else it might be better to ask Gedi forum. - the widget which we created
-
Hi,
When we click on tollbutton,
https://i.imgsafe.org/739c70e6f0.png
setter function is called then, the below widget is poping up
https://i.imgsafe.org/73a0892228.png
, after click on ok in the above widget , the widget which we created is poping up.
https://i.imgsafe.org/73a49cabfd.png
This widget we created.
My question was when we click on tollbutton in extended properties , cant we have 3 image widget to get poped up?.
Q_PROPERTY(QBrush brush READ getBrush WRITE setBrush DESIGNABLE true) void BaseWidget::setBrush(QBrush brush) { // m_brush = brush; m_widget = new QWidget; m_widget->setWindowTitle("toolbutton"); m_widget->show(); } QBrush BaseWidget::getBrush() { return m_brush; }
Thanks,
-
@Pradeep-Kumar
Sorry, i don't know that. It is not a Qt thing so whatever that "extended properties"
really is, I guess its the one who controls what shall be opened.
So i guess it sees the Brush and then the Brush Dialog comes.
So unless you can register a Type and a Window for that type, i guess you
cannot.Maybe there is some sort of Custom Type that allows custom windows.
-
can u explain how to register the type for WinCC OA?.
Thanks,
-
@Pradeep-Kumar said in Regarding the exposing of the properties using Q_Property:
can u explain how to register the type for WinCC OA?.
He can't, and neither can I. You should really ask that question - about substituting the dialog window with your own one - on the Gedi forums, as it entirely depends on the application. If the application doesn't have that feature, you won't be able to do it.