Results 1 to 12 of 12

Thread: QShared

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: QShared

    But what exactly is the problem? If you don't tell us what is wrong with the code (does it compile? does it crash? does it do something you don't want?), we won't be able to help you.

    And please use the [code] tags to embed code in your posts.

  2. #2
    Join Date
    Jul 2007
    Posts
    166
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    25
    Thanked 1 Time in 1 Post

    Default Re: QShared

    Hi,
    I can make and run the program in QT-4. But I didn't get any output from this code in QT-4. But the old program working in QT-3. When I comment the line

    frame->GetRGB()


    in QT-3 it also doesn't display the image in screen. So i think that, that line is error.

  3. #3
    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: QShared

    It seems that ImgRGB is a QImage pointer and QImage::copy() returns the object, not a pointer to it. First of all I suggest you change pointers to QImage to QImage objects as in Qt4 there is no point in having bare QImage pointers. Then make sure you assign proper types (pointers to pointers and objects to objects). Then we can continue.

  4. #4
    Join Date
    Jul 2007
    Posts
    166
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    25
    Thanked 1 Time in 1 Post

    Default Re: QShared

    Hi,
    please check this code it is in QT-3

    Qt Code:
    1. QVector<QImage> m_RGB;
    2. for (u = 0; u < m_Buffers; u++) {
    3. m_RGB.insert(u, new QImage(vid_io_buffer + vid_io_offsets[u], w, h, 32,0,0, QImage::IgnoreEndian));
    4. }
    To copy to clipboard, switch view to plain text mode 
    it is working in QT-3. How can I create this in QT-4. I do it like this,

    Qt Code:
    1. QVector<QImage *> m_RGB;
    2.  
    3. for (u = 0; u < m_Buffers; u++) {
    4. m_RGB.insert(u, *(new QImage(vid_io_buffer + vid_io_offsets[u], w, h, 32, QImage::Format_RGB32 )));
    To copy to clipboard, switch view to plain text mode 

    it doesn't deisplay any error at the time of make, but it doesn't display any image at run time. I think this is the most important part or that program, because when i comment this line in qt-3, then that program crashed at the time of run.
    Please help me. please find the error in my code.


    }
    Last edited by wysota; 11th October 2007 at 12:39. Reason: missing [code] tags

  5. #5
    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: QShared

    Could you please start using the proper tags to embed you code?

    Why do you keep using pointers in Qt4 code? Is there a reason for that? I told you there is no point in using pointers to QImage in Qt4, because it's an implicitely shared class! The code you have given won't even compile.

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.