Here's a pic and some code. Thanks 
MovieTabPane.h
#pragma once
#include <QtGui>
#include <Phonon>
#include "ChatWindowPane.h"
class MovieTabPane
: public QWidget{
Q_OBJECT
public:
MovieTabPane
( QWidget *parent
= 0 ) {
// Create Gui
init();
}
void init()
{
// Vertical Splitter (Top is VideoPlayer)
vSplitter->setOrientation( Qt::Vertical );
// Create Video Player and add it to the layout
vidWindow = new Phonon::VideoPlayer( Phonon::VideoCategory, this );
vSplitter->addWidget( vidWindow );
// Create Chat Window and add it
chatWindow = new ChatWindowPane( this );
vSplitter->addWidget( chatWindow );
// Horizontal Splitter (Left Side is Vertical Splitter, right side is contact list)
hSplitter->setOrientation( Qt::Horizontal );
// Create Buddy List
// Add vSplitter, then Buddy List
hSplitter->addWidget( vSplitter );
hSplitter->addWidget( buddyList );
// Add Splitter to hLayout to size correctly
hLayout->addWidget(hSplitter);
hLayout->setSpacing(0);
// Set Layout
this->setLayout( hLayout );
}
protected:
Phonon::VideoPlayer *vidWindow;
ChatWindowPane *chatWindow;
};
#pragma once
#include <QtGui>
#include <Phonon>
#include "ChatWindowPane.h"
class MovieTabPane : public QWidget
{
Q_OBJECT
public:
MovieTabPane( QWidget *parent = 0 )
: QWidget( parent )
{
// Create Gui
init();
}
void init()
{
// Vertical Splitter (Top is VideoPlayer)
vSplitter = new QSplitter( this );
vSplitter->setOrientation( Qt::Vertical );
// Create Video Player and add it to the layout
vidWindow = new Phonon::VideoPlayer( Phonon::VideoCategory, this );
vSplitter->addWidget( vidWindow );
// Create Chat Window and add it
chatWindow = new ChatWindowPane( this );
vSplitter->addWidget( chatWindow );
// Horizontal Splitter (Left Side is Vertical Splitter, right side is contact list)
hSplitter = new QSplitter( this );
hSplitter->setOrientation( Qt::Horizontal );
// Create Buddy List
buddyList = new QListView( this );
// Add vSplitter, then Buddy List
hSplitter->addWidget( vSplitter );
hSplitter->addWidget( buddyList );
// Add Splitter to hLayout to size correctly
hLayout = new QHBoxLayout;
hLayout->addWidget(hSplitter);
hLayout->setSpacing(0);
// Set Layout
this->setLayout( hLayout );
}
protected:
QSplitter *hSplitter;
QSplitter *vSplitter;
QHBoxLayout *hLayout;
Phonon::VideoPlayer *vidWindow;
ChatWindowPane *chatWindow;
QListView *buddyList;
QString *mTitle;
};
To copy to clipboard, switch view to plain text mode
And here's ChatWindowPane.h
#pragma once
#include <QtGui>
#include <Phonon>
class ChatWindowPane
: public QWidget{
Q_OBJECT
public:
ChatWindowPane
( QWidget *parent
= 0 ) {
// Create Gui
init();
}
void init()
{
send->setText( tr("Send") );
vLayout->addWidget( textOut );
hLayout->addWidget( textIn );
hLayout->addWidget( send );
vLayout->addLayout( hLayout );
this->setLayout( vLayout );
}
protected:
};
#pragma once
#include <QtGui>
#include <Phonon>
class ChatWindowPane : public QWidget
{
Q_OBJECT
public:
ChatWindowPane( QWidget *parent = 0 )
: QWidget( parent )
{
// Create Gui
init();
}
void init()
{
textIn = new QLineEdit( this );
textOut = new QTextEdit( this );
send = new QPushButton( this );
send->setText( tr("Send") );
vLayout = new QVBoxLayout( this );
vLayout->addWidget( textOut );
hLayout = new QHBoxLayout( this );
hLayout->addWidget( textIn );
hLayout->addWidget( send );
vLayout->addLayout( hLayout );
this->setLayout( vLayout );
}
protected:
QHBoxLayout *hLayout;
QVBoxLayout *vLayout;
QLineEdit *textIn;
QTextEdit *textOut;
QPushButton *send;
};
To copy to clipboard, switch view to plain text mode
Bookmarks