qv4l2 is broken with qt4.3 and qt4.4 - fixpatch enclosed
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
v4l2-apps/util/Makefile +1 -1
@@ -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
v4l2-apps/util/qv4l2/ctrl-tab.cpp +19 -17
@@ -1,13 +1,15 @@ #include "qv4l2.h" +//Added by qt3to4: +#include <Q3Frame> #include "v4l2.h" #include <qstatusbar.h> #include <qlineedit.h> #include <qvalidator.h> #include <qlayout.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qlabel.h> #include <qslider.h> #include <qspinbox.h>
@@ -15,7 +17,7 @@ #include <qcheckbox.h> #include <qpushbutton.h> #include <qtooltip.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #include <fcntl.h> #include <sys/ioctl.h>
@@ -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"
v4l2-apps/util/qv4l2/general-tab.cpp +7 -6
@@ -25,14 +25,15 @@ #include <qlabel.h> #include <qspinbox.h> #include <qcombobox.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #include <fcntl.h> #include <sys/ioctl.h> #include <errno.h> +#include <limits.h> 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++;
v4l2-apps/util/qv4l2/general-tab.h +2 -2
@@ -23,12 +23,12 @@#include <sys/time.h> #include <linux/videodev2.h> -#include <qgrid.h> +#include <q3grid.h> class QComboBox;class QSpinBox; -class GeneralTab: public QGrid +class GeneralTab: public Q3Grid {Q_OBJECT
v4l2-apps/util/qv4l2/qv4l2.cpp +23 -19
114 lines not on this page · raw message
v4l2-apps/util/qv4l2/qv4l2.h +7 -5
@@ -20,10 +20,12 @@#ifndef QV4L2_H #define QV4L2_H -#include <qmainwindow.h> +#include <q3mainwindow.h> #include <qtabwidget.h> #include <qsignalmapper.h> -#include <qgrid.h> +#include <q3grid.h> +//Added by qt3to4: +#include <QCloseEvent> #include <map> #include <vector>
@@ -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);
v4l2-apps/util/qv4l2/qv4l2.pro +2 -0
@@ -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
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list