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

List:       kde-devel
Subject:    Re: A newbie question about QXEmbed
From:       "=?UTF-8?Q?Lo=C3=AFc_Corbasson?=" <loic.corbasson () gmail ! com>
Date:       2008-06-07 17:53:37
Message-ID: e20251640806071053h6e09be14ode763d5237ad3d3d () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

2008/6/7 Robert Wood <robert.wood@apostrophe.co.uk>:

> I'm trying to develop a little open source application to set-up and use
> Hauppauge boxes on Linux. I'm using KDevelop and have got to the stage
> where I can set-up the box and alter its settings just fine. However,
> what I would now like to do is embed a small mplayer Window within my
> application.
>
> It looks like QXEmbed is what I need to use, but no matter what I have
> tried I cannot get it to work. Someone helped by showing me how to do it
> qt4, but I'd really like to do it with the qt3 libraries as, AFAIK, most
> distributions come with qt3 libraries and not qt4 for the moment.
>
> I have tried the following code (sorry for horrible formatting):
>
>        QXEmbed *eframe = new QXEmbed(this);
>        eframe->setGeometry(0,0,1280,720);
>        eframe->show();
>        QProcess *mp = new QProcess(eframe);
>
>        mp->setArguments("/usr/bin/mplayer");
>        mp->addArgument(QString("-wid ") +
> QString::number(eframe->winId()));
>        mp->addArgument("/home/robertw/avocent.avi");
>
>        if (!mp->start())
>                {
>                textLabel1->setText("The application has not started");
>                }
>        eframe->setProtocol(QXEmbed::XEMBED);
>
>
> Now, I think *maybe* I need something like the next line (I realise it's
> not correct code):
>
>        eframe->embed(mp->winId());
>
> This doesn't work properly. You can see that eframe is being created
> because it overwrites an existing button, but mplayer is just not
> started. I have tried the same with konsole and the closest I could get
> was to remove the line where it is passed the window ID of eframe and
> then it would just run as a stand alone application.
>
> I am guessing that I am close to achieving what I need to do, but after
> several days of trying am getting nowhere at all.
>
> Would anyone be able to advise? I really would be most grateful!
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> unsubscribe <<
>

I think you're missing a QProcess::start() or equivalent, aren't you?

-- 
Loïc Corbasson
[loic.corbasson@gmail.com]

[Attachment #5 (text/html)]

2008/6/7 Robert Wood &lt;<a \
href="mailto:robert.wood@apostrophe.co.uk">robert.wood@apostrophe.co.uk</a>&gt;:<br><div \
class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid \
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I&#39;m trying to \
develop a little open source application to set-up and use<br> Hauppauge boxes on \
Linux. I&#39;m using KDevelop and have got to the stage<br> where I can set-up the \
box and alter its settings just fine. However,<br> what I would now like to do is \
embed a small mplayer Window within my<br> application.<br>
<br>
It looks like QXEmbed is what I need to use, but no matter what I have<br>
tried I cannot get it to work. Someone helped by showing me how to do it<br>
qt4, but I&#39;d really like to do it with the qt3 libraries as, AFAIK, most<br>
distributions come with qt3 libraries and not qt4 for the moment.<br>
<br>
I have tried the following code (sorry for horrible formatting):<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;QXEmbed *eframe = new QXEmbed(this);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;eframe-&gt;setGeometry(0,0,1280,720);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;eframe-&gt;show();<br>
 &nbsp; &nbsp; &nbsp; &nbsp;QProcess *mp = new QProcess(eframe);<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;mp-&gt;setArguments(&quot;/usr/bin/mplayer&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;mp-&gt;addArgument(QString(&quot;-wid &quot;) + \
QString::number(eframe-&gt;winId()));<br>  &nbsp; &nbsp; &nbsp; \
&nbsp;mp-&gt;addArgument(&quot;/home/robertw/avocent.avi&quot;);<br> <br>
 &nbsp; &nbsp; &nbsp; &nbsp;if (!mp-&gt;start())<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;textLabel1-&gt;setText(&quot;The application has not started&quot;);<br>  \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>  &nbsp; &nbsp; &nbsp; \
&nbsp;eframe-&gt;setProtocol(QXEmbed::XEMBED);<br> <br>
<br>
Now, I think *maybe* I need something like the next line (I realise it&#39;s<br>
not correct code):<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;eframe-&gt;embed(mp-&gt;winId());<br>
<br>
This doesn&#39;t work properly. You can see that eframe is being created<br>
because it overwrites an existing button, but mplayer is just not<br>
started. I have tried the same with konsole and the closest I could get<br>
was to remove the line where it is passed the window ID of eframe and<br>
then it would just run as a stand alone application.<br>
<br>
I am guessing that I am close to achieving what I need to do, but after<br>
several days of trying am getting nowhere at all.<br>
<br>
Would anyone be able to advise? I really would be most grateful!<br>
<br>
&gt;&gt; Visit <a href="http://mail.kde.org/mailman/listinfo/kde-devel#unsub" \
target="_blank">http://mail.kde.org/mailman/listinfo/kde-devel#unsub</a> to \
unsubscribe &lt;&lt;<br> </blockquote></div><br>I think you&#39;re missing a \
QProcess::start() or equivalent, aren&#39;t you?<br clear="all"><br>-- <br>Loïc \
Corbasson<br>[<a href="mailto:loic.corbasson@gmail.com">loic.corbasson@gmail.com</a>]



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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