[Qt-interest] Phonon + QWidget?! It's a problem!
Luiz Vitor Martinez Cardoso
grabber at gmail.com
Sun Mar 29 16:54:31 CEST 2009
Hello guy,
I'm very new to Qt developing and them I decided to start writing some
simple applications to undestand how the stuffs realy works. I'm trying to
do a simple video player using the Phonon library.
But now I have a problem that I can't undestand very well. Please look at
the bold line at main.cpp! What I need to pass in "<???>"?
I wrote a main.cpp file:
#include <QApplication>
#include <Phonon/VideoPlayer>
#include "ui_layout.h"
using namespace Phonon;
int main(int argc, char *argv[]){
QApplication a(argc, argv);
QWidget *main = new QWidget;
Ui::Form gui;
gui.setupUi(main);
* VideoPlayer *player = new VideoPlayer(VideoCategory, <???>);*
QObject::connect(gui.pushButton, SIGNAL(clicked()), main,
SLOT(close()));
main->show();
a.exec();
}
Build a simple interface with QtDesigner:
/********************************************************************************
** Form generated from reading ui file 'layout.ui'
**
** Created: Sun Mar 29 11:48:19 2009
** by: Qt User Interface Compiler version 4.5.0
**
** WARNING! All changes made in this file will be lost when recompiling ui
file!
********************************************************************************/
#ifndef UI_LAYOUT_H
#define UI_LAYOUT_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QHeaderView>
#include <QtGui/QPushButton>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Form
{
public:
QPushButton *pushButton;
QWidget *video_widget;
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(557, 493);
pushButton = new QPushButton(Form);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
pushButton->setGeometry(QRect(260, 440, 113, 32));
video_widget = new QWidget(Form);
video_widget->setObjectName(QString::fromUtf8("video_widget"));
video_widget->setGeometry(QRect(140, 210, 120, 80));
retranslateUi(Form);
QMetaObject::connectSlotsByName(Form);
} // setupUi
void retranslateUi(QWidget *Form)
{
Form->setWindowTitle(QApplication::translate("Form", "Form", 0,
QApplication::UnicodeUTF8));
pushButton->setText(QApplication::translate("Form", "PushButton", 0,
QApplication::UnicodeUTF8));
Q_UNUSED(Form);
} // retranslateUi
};
namespace Ui {
class Form: public Ui_Form {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_LAYOUT_H
Thank you very much!
--
Regards,
Luiz Vitor Martinez Cardoso
cel.: (11) 8187-8662
blog: rubz.org
engineer student at maua.br
"Posso nunca chegar a ser o melhor engenheiro do mundo, mas tenha certeza de
que eu vou lutar com todas as minhas forças para ser o melhor engenheiro que
eu puder ser"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090329/1a187a27/attachment.html
More information about the Qt-interest-old
mailing list