Re: creating custom widget
Tomaz Canabrava <tcanabrava <at> kde.org>
2012-07-09 19:19:52 GMT
On Mon, Jul 9, 2012 at 2:42 PM, Heena Mahur <hena18 <at> rocketmail.com> wrote:
> I want to know how to create custom widget to change the attribute of xml
> node in qt ?
> for eg-
> when you click on one node let's take
> sorry <element>
> and let's say this is the line in the XML file
> <element><image src='ktuberling.svg' lang='any' /><pfound src='test.ogg'
> lang='any' /><word lang='any'>KTuberling</word></element>
> then I want on the widget area something like
> type image
> file ktuberling.svg (with the possibility to load from a file
> attribute lang any
> and so on
> and this changes depending on which element you click
> Please elaborate in detail I am a beginner.
> kde-edu mailing list
> kde-edu <at> mail.kde.org
I didn't quite understood what you whant, but it looks like an use of
the Model/View framework.:
you need to implement a new class, that extends from
QAbstractTableModel, and populate the xml stuff on it, on the data()
But you say that you are a beginner, how beginner are you in Qt and
C++? because if you are just starting, the Qt Model/View framework is
not the best place to start.
If Model/View framework is too complicated, you can create an new
QWidget by aggregating QLabels/QLineEdits.