Return-path: Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m5PDjrQO011440 for ; Wed, 25 Jun 2008 09:45:53 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by mx3.redhat.com (8.13.8/8.13.8) with ESMTP id m5PDjc6R008669 for ; Wed, 25 Jun 2008 09:45:43 -0400 Date: Wed, 25 Jun 2008 10:45:24 -0300 From: Mauro Carvalho Chehab To: Hans Verkuil , Video Message-ID: <20080625104524.35667829@gaivota> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/gdWKhNO=HlBdD.XRppK2zjM" Cc: Subject: qv4l2 is broken with qt4.3 and qt4.4 - fixpatch enclosed List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: video4linux-list-bounces@redhat.com Errors-To: video4linux-list-bounces@redhat.com List-ID: --MP_/gdWKhNO=HlBdD.XRppK2zjM Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Hans, I've did an upgrade on some machines here to use newer versions of qt, being one machine with Fedora 9 (qt4.3), and another with Mandriva Cooker (qt4.4), and I noticed that qv42 compilation were broken. The enclosed patch fixes compilation for those newer versions of qt4 (using qt3 backport methods, present on Qt4). It were generated by running qt3to4 and some required manual fixes. However, this patch will likely break compilation for qt3. Probably, it is a good idea to keep it compiling against qt3 also. Due to that, I didn't merged it at v4l-dvb. Maybe you may try to visit it and make it work with both Qt versions. Cheers, Mauro --MP_/gdWKhNO=HlBdD.XRppK2zjM Content-Type: text/x-patch; name=convert_qv4l2_to_qt4_3.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=convert_qv4l2_to_qt4_3.patch diff -r 69252caed40c v4l2-apps/util/Makefile --- a/v4l2-apps/util/Makefile Wed Jun 25 08:54:05 2008 +0200 +++ b/v4l2-apps/util/Makefile Wed Jun 25 10:34:31 2008 -0300 @@ -24,7 +24,7 @@ make -C xc3028-firmware $@ qv4l2: - if [ ! -f qv4l2/Makefile ]; then (cd qv4l2; qmake); fi + if [ ! -f qv4l2/Makefile ]; then (cd qv4l2; qmake-qt4); fi make -C qv4l2 v4l2-dbg: v4l2-dbg.o v4l2-driverids.o v4l2-chipids.o diff -r 69252caed40c v4l2-apps/util/qv4l2/ctrl-tab.cpp --- a/v4l2-apps/util/qv4l2/ctrl-tab.cpp Wed Jun 25 08:54:05 2008 +0200 +++ b/v4l2-apps/util/qv4l2/ctrl-tab.cpp Wed Jun 25 10:34:31 2008 -0300 @@ -1,13 +1,15 @@ #include "qv4l2.h" +//Added by qt3to4: +#include #include "v4l2.h" #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -15,7 +17,7 @@ #include #include #include -#include +#include #include #include @@ -65,8 +67,8 @@ ctrl_class = V4L2_CTRL_ID2CLASS(iter->second[0]); id = ctrl_class | 1; const struct v4l2_queryctrl &qctrl = ctrlMap[id]; - QVBox *vbox = new QVBox(tabs); - QGrid *grid = new QGrid(4, vbox); + Q3VBox *vbox = new Q3VBox(tabs); + Q3Grid *grid = new Q3Grid(4, vbox); grid->setSpacing(3); tabs->addTab(vbox, (char *)qctrl.name); for (i = 0; i < iter->second.size(); i++) { @@ -80,7 +82,7 @@ } } -void ApplicationWindow::finishGrid(QWidget *vbox, QGrid *grid, unsigned ctrl_class, bool odd) +void ApplicationWindow::finishGrid(QWidget *vbox, Q3Grid *grid, unsigned ctrl_class, bool odd) { if (odd) { new QWidget(grid); @@ -89,12 +91,12 @@ QWidget *stretch = new QWidget(grid); stretch->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored); - QFrame *frame = new QFrame(vbox); - frame->setFrameShape(QFrame::HLine); - frame->setFrameShadow(QFrame::Sunken); + Q3Frame *frame = new Q3Frame(vbox); + frame->setFrameShape(Q3Frame::HLine); + frame->setFrameShadow(Q3Frame::Sunken); frame->setMargin(3); - QHBox *hbox = new QHBox(vbox); + Q3HBox *hbox = new Q3HBox(vbox); hbox->setSpacing(3); QCheckBox *cbox = new QCheckBox("Update on change", hbox); @@ -126,7 +128,7 @@ refresh(ctrl_class); } -void ApplicationWindow::addCtrl(QGrid *grid, const struct v4l2_queryctrl &qctrl) +void ApplicationWindow::addCtrl(Q3Grid *grid, const struct v4l2_queryctrl &qctrl) { QIntValidator *val; QLineEdit *edit; @@ -143,7 +145,7 @@ widgetMap[qctrl.id] = new QSlider(qctrl.minimum, qctrl.maximum, qctrl.step, qctrl.default_value, - Horizontal, grid); + Qt::Horizontal, grid); connect(widgetMap[qctrl.id], SIGNAL(valueChanged(int)), sigMapper, SLOT(map())); break; @@ -470,7 +472,7 @@ switch (qctrl.type) { case V4L2_CTRL_TYPE_INTEGER: - QWhatsThis::add(w, what.sprintf("Integer type control\n" + Q3WhatsThis::add(w, what.sprintf("Integer type control\n" "Minimum: %d\n" "Maximum: %d\n" "Current: %d\n" @@ -479,23 +481,23 @@ break; case V4L2_CTRL_TYPE_INTEGER64: - QWhatsThis::add(w, what.sprintf("64-bit Integer type control\n" + Q3WhatsThis::add(w, what.sprintf("64-bit Integer type control\n" "Current: %lld\n", v) + flags); break; case V4L2_CTRL_TYPE_BUTTON: - QWhatsThis::add(w, what.sprintf("Button type control\n") + flags); + Q3WhatsThis::add(w, what.sprintf("Button type control\n") + flags); break; case V4L2_CTRL_TYPE_BOOLEAN: - QWhatsThis::add(w, what.sprintf("Boolean type control\n" + Q3WhatsThis::add(w, what.sprintf("Boolean type control\n" "Current: %d\n" "Default: %d\n", (int)v, qctrl.default_value) + flags); break; case V4L2_CTRL_TYPE_MENU: - QWhatsThis::add(w, what.sprintf("Menu type control\n" + Q3WhatsThis::add(w, what.sprintf("Menu type control\n" "Minimum: %d\n" "Maximum: %d\n" "Current: %d\n" diff -r 69252caed40c v4l2-apps/util/qv4l2/general-tab.cpp --- a/v4l2-apps/util/qv4l2/general-tab.cpp Wed Jun 25 08:54:05 2008 +0200 +++ b/v4l2-apps/util/qv4l2/general-tab.cpp Wed Jun 25 10:34:31 2008 -0300 @@ -25,14 +25,15 @@ #include #include #include -#include +#include #include #include #include +#include GeneralTab::GeneralTab(const char *device, int _fd, int n, QWidget *parent) : - QGrid(n, parent), + Q3Grid(n, parent), fd(_fd) { int cnt = 0; @@ -149,7 +150,7 @@ QLabel *label = new QLabel("Frequency", this); label->setAlignment(Qt::AlignRight); freq = new QSpinBox(tuner.rangelow, tuner.rangehigh, 1, this); - QWhatsThis::add(freq, what.sprintf("Frequency\n" + Q3WhatsThis::add(freq, what.sprintf("Frequency\n" "Low: %d\n" "High: %d\n", tuner.rangelow, tuner.rangehigh)); @@ -179,7 +180,7 @@ QLabel *label = new QLabel("Frequency", this); label->setAlignment(Qt::AlignRight); freq = new QSpinBox(tuner.rangelow, tuner.rangehigh, 1, this); - QWhatsThis::add(freq, what.sprintf("Frequency\n" + Q3WhatsThis::add(freq, what.sprintf("Frequency\n" "Low: %d\n" "High: %d\n", tuner.rangelow, tuner.rangehigh)); @@ -295,7 +296,7 @@ what += ", has AVL"; if (audio.mode & V4L2_AUDMODE_AVL) what += ", AVL is on"; - QWhatsThis::add(audioInput, what); + Q3WhatsThis::add(audioInput, what); } void GeneralTab::updateAudioOutput() @@ -323,7 +324,7 @@ (double)vs.frameperiod.numerator / vs.frameperiod.denominator, vs.frameperiod.numerator, vs.frameperiod.denominator, vs.framelines); - QWhatsThis::add(tvStandard, what); + Q3WhatsThis::add(tvStandard, what); return; } vs.index++; diff -r 69252caed40c v4l2-apps/util/qv4l2/general-tab.h --- a/v4l2-apps/util/qv4l2/general-tab.h Wed Jun 25 08:54:05 2008 +0200 +++ b/v4l2-apps/util/qv4l2/general-tab.h Wed Jun 25 10:34:31 2008 -0300 @@ -23,12 +23,12 @@ #include #include -#include +#include class QComboBox; class QSpinBox; -class GeneralTab: public QGrid +class GeneralTab: public Q3Grid { Q_OBJECT diff -r 69252caed40c v4l2-apps/util/qv4l2/qv4l2.cpp --- a/v4l2-apps/util/qv4l2/qv4l2.cpp Wed Jun 25 08:54:05 2008 +0200 +++ b/v4l2-apps/util/qv4l2/qv4l2.cpp Wed Jun 25 10:34:31 2008 -0300 @@ -1,24 +1,27 @@ #include "qv4l2.h" +//Added by qt3to4: +#include #include "general-tab.h" #include "v4l2.h" +#include #include #include -#include +#include #include -#include +#include #include #include -#include +#include #include #include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -26,7 +29,8 @@ #include #include #include -#include +#include +#include #include #include @@ -35,14 +39,14 @@ #include "fileopen.xpm" ApplicationWindow::ApplicationWindow() - : QMainWindow( 0, "V4L2 main window", WDestructiveClose | WGroupLeader ) + : Q3MainWindow( 0, "V4L2 main window", Qt::WDestructiveClose | Qt::WGroupLeader ) { QPixmap openIcon, saveIcon; fd = -1; sigMapper = NULL; - QToolBar * fileTools = new QToolBar( this, "file operations" ); + Q3ToolBar * fileTools = new Q3ToolBar( this, "file operations" ); fileTools->setLabel( "File Operations" ); openIcon = QPixmap( fileopen ); @@ -50,39 +54,39 @@ = new QToolButton( openIcon, "Open File", QString::null, this, SLOT(choose()), fileTools, "open file" ); - (void)QWhatsThis::whatsThisButton( fileTools ); + (void)Q3WhatsThis::whatsThisButton( fileTools ); const char * fileOpenText = "

" "Click this button to open a new v4l device.
" "You can also select the Open command " "from the File menu.

"; - QWhatsThis::add( fileOpen, fileOpenText ); + Q3WhatsThis::add( fileOpen, fileOpenText ); - QMimeSourceFactory::defaultFactory()->setPixmap( "fileopen", openIcon ); + Q3MimeSourceFactory::defaultFactory()->setPixmap( "fileopen", openIcon ); - QPopupMenu * file = new QPopupMenu( this ); + Q3PopupMenu * file = new Q3PopupMenu( this ); menuBar()->insertItem( "&File", file ); int id; id = file->insertItem( openIcon, "&Open...", - this, SLOT(choose()), CTRL+Key_O ); + this, SLOT(choose()), Qt::CTRL+Qt::Key_O ); file->setWhatsThis( id, fileOpenText ); file->insertSeparator(); - file->insertItem( "&Close", this, SLOT(close()), CTRL+Key_W ); + file->insertItem( "&Close", this, SLOT(close()), Qt::CTRL+Qt::Key_W ); - file->insertItem( "&Quit", qApp, SLOT( closeAllWindows() ), CTRL+Key_Q ); + file->insertItem( "&Quit", qApp, SLOT( closeAllWindows() ), Qt::CTRL+Qt::Key_Q ); menuBar()->insertSeparator(); - QPopupMenu * help = new QPopupMenu( this ); + Q3PopupMenu * help = new Q3PopupMenu( this ); menuBar()->insertItem( "&Help", help ); - help->insertItem( "&About", this, SLOT(about()), Key_F1 ); - help->insertItem( "What's &This", this, SLOT(whatsThis()), SHIFT+Key_F1 ); + help->insertItem( "&About", this, SLOT(about()), Qt::Key_F1 ); + help->insertItem( "What's &This", this, SLOT(whatsThis()), Qt::SHIFT+Qt::Key_F1 ); statusBar()->message( "Ready", 2000 ); @@ -131,7 +135,7 @@ void ApplicationWindow::choose() { - QString fn = QFileDialog::getOpenFileName( "/dev/v4l", QString::null, + QString fn = Q3FileDialog::getOpenFileName( "/dev/v4l", QString::null, this); if ( !fn.isEmpty() ) { setDevice(fn); diff -r 69252caed40c v4l2-apps/util/qv4l2/qv4l2.h --- a/v4l2-apps/util/qv4l2/qv4l2.h Wed Jun 25 08:54:05 2008 +0200 +++ b/v4l2-apps/util/qv4l2/qv4l2.h Wed Jun 25 10:34:31 2008 -0300 @@ -20,10 +20,12 @@ #ifndef QV4L2_H #define QV4L2_H -#include +#include #include #include -#include +#include +//Added by qt3to4: +#include #include #include @@ -44,7 +46,7 @@ CTRL_UPDATE }; -class ApplicationWindow: public QMainWindow +class ApplicationWindow: public Q3MainWindow { Q_OBJECT @@ -66,8 +68,8 @@ private: void addTabs(); - void finishGrid(QWidget *vbox, QGrid *grid, unsigned ctrl_class, bool odd); - void addCtrl(QGrid *grid, const struct v4l2_queryctrl &qctrl); + void finishGrid(QWidget *vbox, Q3Grid *grid, unsigned ctrl_class, bool odd); + void addCtrl(Q3Grid *grid, const struct v4l2_queryctrl &qctrl); void updateCtrl(unsigned id); void refresh(unsigned ctrl_class); void setDefaults(unsigned ctrl_class); diff -r 69252caed40c v4l2-apps/util/qv4l2/qv4l2.pro --- a/v4l2-apps/util/qv4l2/qv4l2.pro Wed Jun 25 08:54:05 2008 +0200 +++ b/v4l2-apps/util/qv4l2/qv4l2.pro Wed Jun 25 10:34:31 2008 -0300 @@ -10,3 +10,5 @@ HEADERS += qv4l2.h general-tab.h SOURCES += qv4l2.cpp general-tab.cpp ctrl-tab.cpp LIBS += -lv4l2 -L../../lib +#The following line was inserted by qt3to4 +QT += qt3support --MP_/gdWKhNO=HlBdD.XRppK2zjM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- video4linux-list mailing list Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list --MP_/gdWKhNO=HlBdD.XRppK2zjM--