mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-23 05:44:45 -04:00
plugin, made in this way, will not leave garbage
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1010 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2f82a962fc
commit
02378236e8
2 changed files with 35 additions and 4 deletions
|
@ -1,10 +1,28 @@
|
||||||
//#include <QApplication>
|
//#include <QApplication>
|
||||||
//#include <QString>
|
//#include <QString>
|
||||||
//#include <QPushButton>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "SMPlayerPlugin.h"
|
#include "SMPlayerPlugin.h"
|
||||||
#include "smplayer.h"
|
#include "smplayer.h"
|
||||||
|
|
||||||
|
SMPlayerPluginWidget::SMPlayerPluginWidget(QWidget* parent,
|
||||||
|
Qt::WindowFlags flags )
|
||||||
|
:QFrame(parent)
|
||||||
|
{
|
||||||
|
player = new SMPlayer();
|
||||||
|
|
||||||
|
lay = new QVBoxLayout(this);
|
||||||
|
lay->addWidget( player->gui() );
|
||||||
|
}
|
||||||
|
|
||||||
|
SMPlayerPluginWidget::~SMPlayerPluginWidget()
|
||||||
|
{
|
||||||
|
delete player;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
|
||||||
QString
|
QString
|
||||||
SMPlayerPlugin::pluginDescription() const
|
SMPlayerPlugin::pluginDescription() const
|
||||||
{
|
{
|
||||||
|
@ -23,9 +41,8 @@ SMPlayerPlugin::pluginName() const
|
||||||
QWidget*
|
QWidget*
|
||||||
SMPlayerPlugin::pluginWidget(QWidget * parent )
|
SMPlayerPlugin::pluginWidget(QWidget * parent )
|
||||||
{
|
{
|
||||||
SMPlayer *smplayer = new SMPlayer();
|
SMPlayerPluginWidget* wd = new SMPlayerPluginWidget(parent);
|
||||||
// smplayer->start();
|
return wd ;
|
||||||
return smplayer->gui();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QFrame>
|
||||||
|
class QVBoxLayout;
|
||||||
|
|
||||||
#include <PluginInterface.h>
|
#include <PluginInterface.h>
|
||||||
|
|
||||||
|
@ -12,6 +14,18 @@
|
||||||
|
|
||||||
class SMPlayer;
|
class SMPlayer;
|
||||||
|
|
||||||
|
class SMPlayerPluginWidget: public QFrame
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
SMPlayerPluginWidget(QWidget* parent, Qt::WindowFlags flags = 0 );
|
||||||
|
~SMPlayerPluginWidget();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
SMPlayer* player;
|
||||||
|
QVBoxLayout* lay;
|
||||||
|
};
|
||||||
|
|
||||||
class SMPlayerPlugin: public QObject, public PluginInterface
|
class SMPlayerPlugin: public QObject, public PluginInterface
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue