Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]QImageWriter~initial bug
Forum Updated to NodeBB v4.3 + New Features

[Solved]QImageWriter~initial bug

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    colinRao
    wrote on last edited by
    #1

    @void SQLite::addImage(QImage image, QStringList tags)
    {
    QBuffer buffer;
    QImageWriter writer(&buffer,"PNG");

    writer.write(image);
    QSqlQuery qry;
    int id;
    qry.prepare( "SELECT COUNT(*) FROM images" );
    qry.exec();
    qry.next();
    id = qry.value(0).toInt() + 1;
    qry.prepare( "INSERT INTO images (id, data) VALUES (:id, :data)" );
    qry.bindValue( ":id", id );
    qry.bindValue( ":data", buffer.data() );
    qry.exec();
    foreach( QString tag, tags )
        addTag( id, tag );
    

    }@

    enviroment:
    Qt Creator 2.0.1
    based on Qt 4.7.0(32bit)
    My os is micorsoft xp
    Is there some body can help me to shooting this bug. Thank you very much!

    ..\SqlDialog\sqlite.cpp: In member function 'void SQLite::addImage(QImage, QStringList)':

    ..\SqlDialog\sqlite.cpp:118: error: variable 'QImageWriter writer' has initializer but incomplete type

    ..\SqlDialog\sqlite.cpp: In member function 'QImage SQLite::getImage(int)':

    ..\SqlDialog\sqlite.cpp:151: error: variable 'QImageReader reader' has initializer but incomplete type

    1 Reply Last reply
    0
    • D Offline
      D Offline
      d.oberkofler
      wrote on last edited by
      #2

      I'm just guessing but based on my experience with this gcc error messaged you might be missing some includes.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        colinRao
        wrote on last edited by
        #3

        Yeah! I got it. Thanks!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved