Results 1 to 14 of 14

Thread: Some problems

  1. #1
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Some problems

    Hi
    I'm learning Qt from its,as I heard,official book.But I have problems with two of its examples.
    1-This with the find Dialog example.I wrote exactly what was written in the book.But after making,I understood that the layout direction is right to left.As you may know,this example doesn't have a .ui file that I can modify it to change the layout direction.What is the problem and the solution?
    2-This one is with the cell location dialog example.Again I did exactly everything that was written in the book.But after making it,there was two errors.The strange thing about the errors was this that they were complaining about the XML code in the .ui file.The errors are:
    expected unqualified-id before '<?' token
    'Cell' does not name a type
    They are respectively for the lines below:

    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <string>&amp;Cell Location</string>
    To copy to clipboard, switch view to plain text mode 

    thanks
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Some problems

    Are you trying to compile an XML file with a C++ compiler or what?
    J-P Nurmi

  3. #3
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some problems

    No.I just run make on my project and I got these messages.I if I tried to compile the XML file with the C++ compiler I would take hundred lines of error.
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Some problems

    So where does this error:
    expected unqualified-id before '<?' token
    'Cell' does not name a type
    come from? Could you paste a bit more, including the last command what was run etc?

    EDIT: And what does your .pro file look like?
    J-P Nurmi

  5. #5
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some problems

    This is my .pro file
    ################################################## ####################
    # Automatically generated by qmake (2.01a) ???? ????? 10 13:44:15 2009
    ################################################## ####################

    TEMPLATE = app
    TARGET =
    DEPENDPATH += .
    INCLUDEPATH += .

    # Input
    HEADERS += ui_gotocelldialog.h
    FORMS += gotocelldialog.ui
    SOURCES += main.cpp
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Some problems

    Remove the file from HEADERS, it shouldn't be there. Anyway your first post suggests you did try to compile an xml file with c++ compiler - it broke on the <?xml token and tried to recover by moving to the next statement (after the semicolon) and immediately broke again on "Cell".
    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.


  7. #7
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some problems

    I didn't write that.anyway I changed it but there was no difference.when I remove and run qmake on it,it adds that line again and the make gives the same error.I even deleted that line and run make on it but there was still the same problem.
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Some problems

    No, you run "qmake -project", not qmake. Remove the line and run qmake.
    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.


  9. #9
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some problems

    No difference
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  10. #10
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Some problems

    could you attach whole project that we can try to build?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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

    Default Re: Some problems

    Quote Originally Posted by Dante View Post
    No difference
    You mean it still adds something to the HEADERS variable?
    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. #12
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some problems

    No.it adds nothing but gives the same errors.
    And here's the project.
    Attached Files Attached Files
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

  13. #13
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Some problems

    jpn was right, you compile a xml file
    Qt Code:
    1. #include "gotocelldialog.ui"//ui has xml structure!!
    To copy to clipboard, switch view to plain text mode 
    try this
    Qt Code:
    1. #include "ui_gotocelldialog.h"
    To copy to clipboard, switch view to plain text mode 

    I don't know your code will work at all.
    looks like you still don't want to read docs about Qt and even more -- about C++!

    this is correct code
    Qt Code:
    1. #include <QApplication>
    2. #include <QDialog>
    3.  
    4. #include "ui_gotocelldialog.h"
    5.  
    6. int main(int argc,char *argv[]){
    7. QApplication app(argc,argv);
    8.  
    9. Ui::GoToCellDialog ui;
    10. QDialog dialog;
    11. ui.setupUi(&dialog);
    12.  
    13. return dialog.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  14. #14
    Join Date
    Mar 2009
    Posts
    68
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some problems

    Corrected.
    thanks
    Try to be useful for your society,not important.
    ------------------------------------------------------
    Every thing that has a beginning,Has an end.

Similar Threads

  1. problems creating toolbar...(do see the attachment)!
    By sumit in forum Qt Programming
    Replies: 15
    Last Post: 10th September 2008, 11:23
  2. Problems with scope and C header functions
    By waldowoc in forum Newbie
    Replies: 5
    Last Post: 5th August 2008, 11:29
  3. Replies: 2
    Last Post: 8th March 2007, 22:22
  4. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.