[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-edu-devel
Subject:    Re: creating custom widget
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2012-07-09 22:47:29
Message-ID: CACcA1RqmjFnKmTF1JVoOVqYRgBj0vfJkPQmtL6c_G6Z=Trfpmg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Mon, Jul 9, 2012 at 7:42 PM, Heena Mahur <hena18@rocketmail.com> wrote:

> Hey,
>
> 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
> <image>
> 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.
> Thanks
>
> _______________________________________________
> kde-edu mailing list
> kde-edu@mail.kde.org
> https://mail.kde.org/mailman/listinfo/kde-edu
>
>
What you want to do, is to generate a model from the XML data. You can use
QStandardItemModel for that. Note that you'll have to make sure you can
write back the model afterwards.

As I said before, please don't start sending the e-mails to several mailing
lists at the same time.

Aleix

[Attachment #5 (text/html)]

<div class="gmail_quote">On Mon, Jul 9, 2012 at 7:42 PM, Heena Mahur <span \
dir="ltr">&lt;<a href="mailto:hena18@rocketmail.com" \
target="_blank">hena18@rocketmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">

<div><div style="font-size:12pt;font-family:arial,helvetica,sans-serif"><div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">Hey,</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">


<h1 style="margin-top:0px;margin-right:0px;margin-bottom:7px;margin-left:0px;padding-t \
op:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;bord \
er-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial; \
border-color:initial;font-size:23px;vertical-align:baseline;background-image:initial;font-family:&#39;Trebuchet \
MS&#39;,&#39;Liberation Sans&#39;,&#39;DejaVu \
Sans&#39;,sans-serif;line-height:1.3;color:rgb(0,0,0);text-align:left">

<br></h1><div>I want to know how to create custom widget to change the attribute of \
xml node in qt ?</div><div>for eg-</div></div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">


<br></div><div style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">when \
you click on one node let&#39;s take</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">


&lt;image&gt;</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">sorry \
&lt;element&gt;</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">


and let&#39;s say this is the line in the XML file</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">&lt;element&gt;&lt;image \
src=&#39;ktuberling.svg&#39; lang=&#39;any&#39; /&gt;&lt;pfound \
src=&#39;test.ogg&#39; lang=&#39;any&#39; /&gt;&lt;word \
lang=&#39;any&#39;&gt;KTuberling&lt;/word&gt;&lt;/element&gt;</div>

<div style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">then \
I want on the widget area something like</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">


type image</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">file \
ktuberling.svg (with the possibility to load from a file</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">


attribute lang any</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">and \
so on</div><div style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">


and this changes depending on which element you click</div><div \
style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font-size:13px;line-height:15px">Please \
elaborate in detail I am a beginner.</div>

<div style="font-family:arial,sans-serif;word-wrap:break-word;color:rgb(34,34,34);font \
-size:13px;line-height:15px">Thanks</div></div></div></div><br>_______________________________________________<br>
 kde-edu mailing list<br>
<a href="mailto:kde-edu@mail.kde.org">kde-edu@mail.kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kde-edu" \
target="_blank">https://mail.kde.org/mailman/listinfo/kde-edu</a><br> \
<br></blockquote></div><br><div>What you want to do, is to generate a model from the \
XML data. You can use QStandardItemModel for that. Note that you&#39;ll have to make \
sure you can write back the model afterwards.</div>

<div><br></div><div>As I said before, please don&#39;t start sending the e-mails to \
several mailing lists at the same time.</div><div><br></div><div>Aleix</div>



_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic