[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 <<a \
href="mailto:robert.wood@apostrophe.co.uk">robert.wood@apostrophe.co.uk</a>>:<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'm trying to \
develop a little open source application to set-up and use<br> Hauppauge boxes on \
Linux. I'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'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>
QXEmbed *eframe = new QXEmbed(this);<br>
eframe->setGeometry(0,0,1280,720);<br>
eframe->show();<br>
QProcess *mp = new QProcess(eframe);<br>
<br>
mp->setArguments("/usr/bin/mplayer");<br>
mp->addArgument(QString("-wid ") + \
QString::number(eframe->winId()));<br> \
mp->addArgument("/home/robertw/avocent.avi");<br> <br>
if (!mp->start())<br>
{<br>
\
textLabel1->setText("The application has not started");<br> \
}<br> \
eframe->setProtocol(QXEmbed::XEMBED);<br> <br>
<br>
Now, I think *maybe* I need something like the next line (I realise it's<br>
not correct code):<br>
<br>
eframe->embed(mp->winId());<br>
<br>
This doesn'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>
>> 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 <<<br> </blockquote></div><br>I think you're missing a \
QProcess::start() or equivalent, aren'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