Results 1 to 14 of 14

Thread: install sqlite

  1. #1
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default install sqlite

    Hi all!

    Im newbi in qt and need to use to developer sqlite apps, but how I can use de designer with it?

    tank's

    peace!

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: install sqlite

    Why should sqlite be in designer? Database is not gui/widget.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: install sqlite

    Quote Originally Posted by amleto View Post
    Why should sqlite be in designer? Database is not gui/widget.
    hi my friend!
    thanks for replying
    but I'm having difficulty using the QT interface, I downloaded a practical tutorial on how to create a calculator to start, but the author asked to create the interface of the calculator, I did it without problems following the example he gave, but he asked to create a file ".h" but where should I create this file? in an ordinary text editor and save it in the folder where I recorded the project?

    thank you!

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install sqlite

    marquessbr, do not understand me wrong, but I think first you have to study a tutorial on programming in C / C++. Without it, the moment you come back here with another question on the basis of C++

  5. #5
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: install sqlite

    Quote Originally Posted by Lesiok View Post
    marquessbr, do not understand me wrong, but I think first you have to study a tutorial on programming in C / C++. Without it, the moment you come back here with another question on the basis of C++
    hi my friend!
    I have no problem in programming in C / C++, the problem I'm having is with the interface of QT, which is a bit strange for me that always programmed in Delphi and Lazarus / FPC, but thank you, even as I followed the tutorial and finished the project but gave some strange errors and now means no time to see how to solve.

    Thanks anyway

  6. #6
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: install sqlite

    Sorry marquessbr but You have problems with C/C++. You are asking what is h file and hwo to create it.

  7. #7
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: install sqlite

    use Qt Creator and add files to the projects from there.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  8. #8
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: install sqlite

    Hi leslok, I did not ask what is a ".h" file, I know with it is, I asked where it should be saved in a project QT, I do this already solved, and yes, I'm having trouble with C/C++, but it is because of error shown below, which is a copy of the output from my terminal when I'm compiling with qmake.

    -----------------------------------------------------------------------------------------------
    armando@odin-lap:~/projects/qt/calc$ qmake -project
    armando@odin-lap:~/projects/qt/calc$ qmake
    armando@odin-lap:~/projects/qt/calc$ make
    g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -o main.o main.cpp
    In file included from main.cpp:2:0:
    myCalc.h:5:1: erro: stray ‘\302’ in program
    myCalc.h:5:1: erro: stray ‘\240’ in program
    myCalc.h:6:1: erro: stray ‘\302’ in program
    myCalc.h:6:1: erro: stray ‘\240’ in program
    myCalc.h:6:1: erro: stray ‘\302’ in program
    myCalc.h:6:1: erro: stray ‘\240’ in program
    myCalc.h:6:1: erro: stray ‘\302’ in program

    ...
    ...

    main.cpp:8:2: erro: stray ‘\255’ in program
    main.cpp:9:2: erro: stray ‘\302’ in program
    main.cpp:9:2: erro: stray ‘\240’ in program
    In file included from main.cpp:2:0:
    myCalc.h:6:40: erro: ‘Ui’ has not been declared
    myCalc.h:6:44: erro: expected ‘{’ before ‘qtCalc’
    myCalc.h:7:1: erro: invalid type in declaration before ‘{’ token
    myCalc.h:7:1: aviso: extended initializer lists only available with -std=c++0x or -std=gnu++0x [habilitado por padrão]
    myCalc.h:8:3: erro: expected primary-expression before ‘public’
    myCalc.h:8:3: erro: expected ‘}’ before ‘public’
    myCalc.h:8:3: erro: expected ‘,’ or ‘;’ before ‘public’
    myCalc.h:8:3: erro: uninitialized const ‘staticMetaObject’ [-fpermissive]
    /usr/include/qt4/QtCore/qobjectdefs.h:304:22: nota: ‘const struct QMetaObject’ has no user-provided default constructor
    /usr/include/qt4/QtCore/qobjectdefs.h:469:28: nota: and the implicitly-defined constructor does not initialize ‘const QMetaObject* QMetaObject::<anônimo struct>::superdata’
    myCalc.h:8:3: erro: ‘virtual’ outside class declaration
    myCalc.h:8:3: erro: non-member function ‘const QMetaObject* metaObject()’ cannot have cv-qualifier
    myCalc.h:8:3: erro: ‘virtual’ outside class declaration
    myCalc.h:8:3: erro: ‘virtual’ outside class declaration
    myCalc.h:8:3: erro: expected unqualified-id before ‘private’
    myCalc.h:8:3: aviso: ‘visibility’ attribute ignored [-Wattributes]
    myCalc.h:9:3: erro: expected unqualified-id before ‘public’
    myCalc.h:12:3: erro: expected unqualified-id before ‘public’
    myCalc.h:17:3: erro: expected unqualified-id before ‘private’
    myCalc.h:21:1: erro: expected declaration before ‘}’ token
    myCalc.h:8:3: aviso: ‘void qt_static_metacall(QObject*, QMetaObject::Call, int, void**)’ declared ‘static’ but never defined [-Wunused-function]
    make: ** [main.o] Erro 1
    armando@odin-lap:~/projects/qt/calc$ ls^C
    armando@odin-lap:~/projects/qt/calc$ ^C
    armando@odin-lap:~/projects/qt/calc$

    -----------------------------------------------------------------------------------------------

    here is the code of the "main.cpp; myCalc.cpp; myCalc.h" files, I put the three files in a single pastebin submission:
    http://pastebin.com/hZqM5xnz

    and this is the myCalc.ui - generated by QT4 designer
    http://pastebin.com/dBL7p9Br

    the ".cpp" and the ".h" file Im created it in "gedit"!

    thank's!

    peace!
    Last edited by marquessbr; 13th November 2012 at 19:09.

  9. #9
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: install sqlite

    for starters you need ';' after class.

    Qt Code:
    1. class abc
    2. {
    3. };
    To copy to clipboard, switch view to plain text mode 

    as for the errors, they are pretty simple obvious, aren't they? You have some non valid chars in your code files. Remove them!

    You also reference Ui::qtCalc, but have not included any information about it.


    Oh yeah, learn how to use pointers.
    Qt Code:
    1. ptr>method();
    To copy to clipboard, switch view to plain text mode 
    This is NOT correct!
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  10. #10
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: install sqlite

    hi my friend, thanks, well, I cant see this inválid chars, mabe it is the " ' " or the " " " chars?
    and about UI::qtCalc? where and how it need to be refered?

    thank's!!

  11. #11
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: install sqlite

    re-type the lines with any char problems. use a plain text editor.

    and about UI::qtCalc? where and how it need to be refered?
    use #include
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  12. The following user says thank you to amleto for this useful post:

    marquessbr (14th November 2012)

  13. #12
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: install sqlite

    ok, amlto, thank you!

    Im redited my sources and now is ok, but returned this error, as the output of the terminal:

    -------------------------------------------------------------------------------------------------
    armando@odin-lap:~/projects/qt/calc$ make
    g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -o main.o main.cpp
    main.cpp:2:20: erro fatal: qtCalc.h: Arquivo ou diretório não encontrado
    compilação terminada.
    make: ** [main.o] Erro 1
    armando@odin-lap:~/projects/qt/calc$
    -------------------------------------------------------------------------------------------------

    but why? if I had refered to qtCalc.h in the main.cpp file here is the code:

    #include <QApplication>
    #include "qtCalc.h"

    int*main(int*argc,*char *argv[])
    {
    QApplication*app(argc,*argv);
    Calc**dialog*=*new*Calc();
    dialog*>show();
    return*app.exec();
    }

    I need help

    peace!

  14. #13
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: install sqlite

    what is up with your code pasting??

    did you actually try and compile this?
    Qt Code:
    1. #include <QApplication>
    2. #include "qtCalc.h"
    3.  
    4. int*main(int*argc,*char *argv[])
    5. {
    6. QApplication*app(argc,*argv);
    7. Calc**dialog*=*new*Calc();
    8. dialog*>show();
    9. return*app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    what's with all of the '*'??


    qtCalc.h: Arquivo ou diretório não encontrado - pretty obvious, nes pas? (yes, I know different language)
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  15. The following user says thank you to amleto for this useful post:

    marquessbr (15th November 2012)

  16. #14
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: install sqlite

    Hi, amleto!

    I tried other examples and they worked very well with that given to know a little more about how the compiler and also a little on the QT interface.

    So thanks for all at now!

    I say this because, like I said, I program in other languages, (pascal, python, php, json) and had litle contact with C/C++/QT, but I need to maintain this post unclosed, because the real reason for this post is because I had a idea to a project with will be more complex than its examples, for developer this project I will need to use one database and the sqlite/salite3 is perfect for me, because its amalgamation whose source is write in C.

    so, at the right time I'll have to go deeper into the matter and if I have a question I ask for help here in the forum!

    thank's

    peace!

Similar Threads

  1. Replies: 0
    Last Post: 17th November 2011, 13:35
  2. Replies: 6
    Last Post: 13th March 2011, 23:49
  3. [Qt][SQLite] Two problems with SQLite.
    By Xandareva in forum Newbie
    Replies: 6
    Last Post: 6th April 2010, 23:06
  4. How install fonts with make install
    By jiveaxe in forum Qt Programming
    Replies: 1
    Last Post: 2nd January 2008, 19:38
  5. "make install" doesn't install binary
    By jiveaxe in forum Newbie
    Replies: 2
    Last Post: 2nd January 2008, 12:00

Tags for this Thread

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.