Page 2 of 2 FirstFirst 12
Results 21 to 35 of 35

Thread: camera

  1. #21
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Exclamation Re: camera

    /home/stesalit/Desktop/cam/webcam.cpp:186: error: within this context ---> what does this mean??

    left with only these

    /home/stesalit/Desktop/cam/webcam.cpp:348: error: request for member ‘load’ in ‘((WebCam*)this)->WebCam:mBk’, which is of non-class type ‘QPixmap*’


    /home/stesalit/Desktop/cam/webcam.cpp:364: error: expected primary-expression before ‘*’ token


    /home/stesalit/Desktop/cam/webcam.cpp:361: error: ‘class QPixmap’ has no member named ‘resize’

    Here, in the above error I'm not getting what to use in the place of "resize" I searched the entire doc but i dint found the size option so, what to use here??



    Any one please please help me in rectifying these errors....
    Last edited by Harini; 23rd December 2013 at 06:21.

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: camera

    Quote Originally Posted by Harini View Post
    /home/stesalit/Desktop/cam/webcam.cpp:186: error: within this context ---> what does this mean??
    This means the previous error happened because of this line. As I said (and I won't repeat myself again) always look on the first error message.

    left with only these

    /home/stesalit/Desktop/cam/webcam.cpp:348: error: request for member ‘load’ in ‘((WebCam*)this)->WebCam:mBk’, which is of non-class type ‘QPixmap*’


    /home/stesalit/Desktop/cam/webcam.cpp:364: error: expected primary-expression before ‘*’ token


    /home/stesalit/Desktop/cam/webcam.cpp:361: error: ‘class QPixmap’ has no member named ‘resize’
    I think these messages are pretty much self-explanatory.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Harini (23rd December 2013)

  4. #23
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: camera

    done !! fynally ,left with this... getting :364: error: expected primary-expression before ‘*’ token here. painter.drawPixmap(QPixmap *pmBk,this); in the below code. please help me


    void WebCam::drawImage()
    {
    QMatrix matrix;
    QPainter painter(this);
    QString strTime;

    matrix.scale(-1.0,1.0);
    // pmBk=pmBk.xForm(matrix);
    // pmPaint->resize(width(),height());
    resize(width(),height());
    // pmPaint->resize( QSize(width(),height()).expandedTo(minimumSizeHint ()));
    //pmPaint->rect(width(), height());
    // painter.begin(QPaintDevice* pmPaint, this);
    // painter.begin(*pmBk);
    painter.begin(this);
    // painter.drawPixmap(QPointF(0,0), QPixmap *pmBk, this);
    painter.drawPixmap(QPixmap *pmBk,this);
    // painter.drawPixmap(QPointF(0,0), &pmBk,this);
    painter.begin(this);
    painter.end();

  5. #24
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: camera

    The offending line is not a proper C++ syntax. It should probably be drawPixmap(pmBk, this) or something like that.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #25
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: camera

    Quote Originally Posted by wysota View Post
    The offending line is not a proper C++ syntax. It should probably be drawPixmap(pmBk, this) or something like that.

    when i use drawPixmap(pmBk, this) getting warnings and this error
    error: no matching function for call to ‘QPainter::drawPixmap(QPixmap*&, WebCam* const)’

  7. #26
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: camera

    Great. Now go and fix your code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #27
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: camera

    Quote Originally Posted by wysota View Post
    Great. Now go and fix your code.
    sorry, I dint get u


    can u please give me the line with which I can replace??
    Last edited by Harini; 23rd December 2013 at 09:43.

  9. #28
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: camera

    How should I know that? It is your code, not mine. You are the only person who knows what your intentions were when you were writting this non-working code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #29
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: camera

    I replaced with this line painter.drawPixmap(this,QPixmap *pmBk,this ); but getting the same error error: expected primary-expression before ‘*’ token

  11. #30
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: camera

    This is again invalid C++ code.

    Maybe you should learn C++ first before trying to use it?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. #31
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: camera

    god diying with this tried a lot
    again getting errors here...
    Qt Code:
    1. #include <QApplication>
    2. #include <QPainter>
    3. #include <QPixmap>
    4. #include <QSplashScreen>
    5. #include <QWidget>
    6.  
    7. #include "SplashScreen.h"
    8.  
    9. SplashScreen::SplashScreen(const QPixmap &pixmap,Qt::WindowFlags ) :
    10. QWidget(pixmap , 0,Qt::FramelessWindowHint,
    11. Qt::WindowStaysOnTopHint,
    12. Qt::Tool)
    13. //Qt::WStyle_Customize ,Qt:: WStyle_NoBorder ,Qt:: WStyle_StaysOnTop ,Qt:: WStyle_Tool)
    14.  
    15. {
    16. QPixmap pix;
    17. pix.load("image.jpg");
    18. //setBackgroundPixmap(pix);
    19.  
    20. resize( pix.size() );
    21.  
    22. QRect scr = QApplication::desktop()->geometry();
    23. move( scr.center() - rect().center() );
    24. show();
    25. repaint();
    26. }
    27.  
    28. void SplashScreen::repaint()
    29. {
    30. QWidget::repaint();
    31. qApp->processEvents();
    32. }
    33.  
    34. void SplashScreen::finish()
    35. {
    36. close();
    37. }
    38.  
    39. void SplashScreen::showMessage(const QString &message,
    40. int alignment =Qt::AlignLeft,
    41. const QColor &color = Qt:: white)
    42.  
    43. {
    44. QPixmap textPix = pix;
    45. QPainter painter( &textPix, this );
    46. painter.setPen(Qt::blue);
    47. painter.setFont(QFont("Arial", 30));
    48. QRect r = rect();
    49. r.setRect( r.x() + 10, r.y() + 10, r.width() - 20, r.height() - 20 );
    50. painter.drawText( r, alignment, message );
    51. // setBackgroundPixmap( textPix );
    52. painter.background(textPix);
    53. repaint();
    54. }
    To copy to clipboard, switch view to plain text mode 


    errors

    /home/stesalit/Desktop/cam/SplashScreen.cpp:41: error: default argument given for parameter 2 of ‘void SplashScreen::showMessage(const QString&, int, const QColor&)’

    /home/stesalit/Desktop/cam/SplashScreen.h:24: error: after previous specification in ‘void SplashScreen::showMessage(const QString&, int, const QColor&)’

    /home/stesalit/Desktop/cam/SplashScreen.cpp:41: error: default argument given for parameter 3 of ‘void SplashScreen::showMessage(const QString&, int, const QColor&)’

    /home/stesalit/Desktop/cam/SplashScreen.h:24: error: after previous specification in ‘void SplashScreen::showMessage(const QString&, int, const QColor&)’

    /home/stesalit/Desktop/cam/SplashScreen.cpp:45: error: no matching function for call to ‘QPainter::QPainter(QPixmap*, SplashScreen* const)’

    /home/stesalit/Desktop/cam/SplashScreen.cpp:52: error: no matching function for call to ‘QPainter::background(QPixmap&)’

  13. #32
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: camera

    The error is self-explanatory, it's still a problem with C++ syntax. Don't blindly copy code but rather write your own (which you understand) using correct C++ syntax.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  14. #33
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Exclamation Re: camera

    Qt Code:
    1. #include <QMessageBox>
    2. #include <QDir>
    3. #include <QList>
    4. #include <QComboBox>
    5. #include "mydialog.h"
    6.  
    7. //MyDialog::MyDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WindowFlags f= 0 )
    8. //:QDialog(parent,name,modal,f)
    9.  
    10. MyDialog::MyDialog(QWidget* parent )
    11. :QDialog(parent)
    12.  
    13. {
    14. lb1 = new QComboBox(this);
    15. lb1->setGeometry(10,10,200,70);
    16.  
    17. QDir dir;
    18.  
    19. dir.setCurrent( "./" );
    20. //dir.setNameFilter("*.jpg");
    21. dir.setNameFilters(QStringList()<<"*.jpg");
    22. for(int i=0;i<(int)dir.count();i++)
    23. lb1->insertItem(dir[i]);
    24.  
    25. connect(lb1,SIGNAL(selected(int)),this,SLOT(slotSelected(int)));
    26. connect(lb1,SIGNAL(highlighted(int)),this,SLOT(slotHighlighted(int)));
    27. }
    28.  
    29. QString MyDialog::getName()
    30. {
    31. return str;
    32. }
    33.  
    34. void MyDialog::slotSelected(int index)
    35. {
    36. str = lb1->itemText(index);
    37. accept();
    38. }
    39.  
    40. void MyDialog::slotHighlighted(int index)
    41. {
    42. str = lb1->currentText();
    43. }
    To copy to clipboard, switch view to plain text mode 

    error

    /home/stesalit/Desktop/cam/mydialog.cpp:23: error: no matching function for call to ‘QComboBox::insertItem(QString)’


    syntax error
    tis is the line
    void QComboBox::insertItem ( int index, const QString & text, const QVariant & userData = QVariant() )


    and i tried a lot to implement this but still getting the error

    with which line i can replace this ???

  15. #34
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: camera

    This forum is not a compiler. You have a compiler on your own machine. The compiler tells you there is not "insertItem" method that takes a string in QComboBox so don't use it.There is a insertItem method taking two arguments -- an index and a string. There is also an addItem() method that takes a single string. I really don't see the intent behind posting every syntax error you get to this forum. If you get a syntax error because you are using methods which don't exist then correct your code to use existing methods.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  16. #35
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 2 Times in 2 Posts

    Default Re: camera

    which class supports QCamera properties in Qt 4.7

Similar Threads

  1. Replies: 0
    Last Post: 1st July 2013, 08:59
  2. Camera Frames in UI
    By Johncdy in forum Qt Programming
    Replies: 1
    Last Post: 14th March 2011, 02:03
  3. how to connect to the camera
    By zeshu in forum Qt Programming
    Replies: 0
    Last Post: 25th November 2010, 15:15
  4. Connect camera in Qt?
    By nthung in forum Qt Programming
    Replies: 12
    Last Post: 25th May 2010, 11:19
  5. IP camera
    By vinod sharma in forum Qt Programming
    Replies: 1
    Last Post: 12th March 2010, 13:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.