Unsolved Regarding the exposing of the properties using Q_Property
-
@Pradeep-Kumar
Hi, that is not part of the QBrush. That is
part of the editor. Some sort of color picker.The documentation for the Editor should clearly state the requirements of
making an add-in and allow properties to be edited.Since this is NOT Creator, we cannot know how to do it but siemens will :)
-
i was going through another link
https://doc.qt.io/archives/qq/qq18-propertybrowser.html
in
Extending the Framework section , they have property name and value, with spinbox , combobox, toolbutton.Can the user manually create and expose using Q_PROPERTY or any other way?.
I want toolbutton and combobox in value column of property editor , how can it be acheived?.
Thanks,
-
@Pradeep-Kumar
Hi
Yes those samples are example of writing a property editor for us use in own program.
Just like Creator has its own.But this is for Qt. Are you not talking about
integrating inside another program from siemens ( some editor)?
Not your own own code / program ?- Can the user manually create and expose using Q_PROPERTY or any other way?.
Where do you mean ? Expose from where ?
In Qt and Creator, this is exported via DLLS/Plugins so user can make a custom plugin for Creator.
Where are you trying to export something? and to what?
- Can the user manually create and expose using Q_PROPERTY or any other way?.
-
k let me make understand .
i want to add toolbutton and combobox visual elements from Qt code to WinnCC OA property editor.
When i add as ewo to WinCC OA, i want the property value to show toolbutton and combobox. so the user can select the items in combobox and click to show dialog on toolbutton.Thanks,
-
@Pradeep-Kumar said in Regarding the exposing of the properties using Q_Property:
WinnCC OA property editor.
Yes so you must use WinnCC OA documentation to do so.
How can WinnCC OA property editor even see you object ?
Did you made a plugin for it ?
Qt cannot do this for you. Its WinnCC OA that must , if its even possible.
-
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.