Results 1 to 2 of 2

Thread: qtextoption.h Expected unqualified-id before '\x9'

  1. #1
    Join Date
    Nov 2009
    Posts
    5
    Qt products
    Qt4

    Lightbulb qtextoption.h Expected unqualified-id before '\x9'

    Hi everyone,

    So I am getting this strange error:

    qtextoption.h:140: error: expected unqualified-id before '\x9'
    qtextoption.h:153: error: lvalue required as left operand of assignment

    But this is only is I have
    Qt Code:
    1. #include "PPincludes.h"
    To copy to clipboard, switch view to plain text mode 
    in my code below for cgui.h:

    Qt Code:
    1. #ifndef CGUI_H
    2. #define CGUI_H
    3.  
    4. #include <QMainWindow>
    5. #include "PPincludes.h"
    6.  
    7.  
    8. namespace Ui {
    9. class CGUI;
    10. }
    11.  
    12. //! The main application class
    13. /*!
    14.   The CGUI class contains declarations of all variables and functions used
    15.   by the application. It is divided into Pre-processing, Run and Post-processing
    16.   groups.
    17. */
    18.  
    19. class CGUI : public QMainWindow {
    20. Q_OBJECT
    21. public:
    22. CGUI(QWidget *parent = 0);
    23. ~CGUI();
    24.  
    25. protected:
    26. void changeEvent(QEvent *e);
    27.  
    28. private:
    29. Ui::CGUI *ui;
    30.  
    31. };
    32.  
    33. #endif // CGUI_H
    To copy to clipboard, switch view to plain text mode 

    PPincludes.h is blank.

    Then, cgui.cpp:

    Qt Code:
    1. #include "cgui.h"
    2. #include "ui_cgui.h"
    3.  
    4. CGUI::CGUI(QWidget *parent) :
    5. QMainWindow(parent),
    6. ui(new Ui::CGUI)
    7. {
    8. ui->setupUi(this);
    9. }
    10.  
    11. CGUI::~CGUI()
    12. {
    13. delete ui;
    14.  
    15. }
    16.  
    17. void CGUI::changeEvent(QEvent *e)
    18. {
    19. QMainWindow::changeEvent(e);
    20. switch (e->type()) {
    21. case QEvent::LanguageChange:
    22. ui->retranslateUi(this);
    23. break;
    24. default:
    25. break;
    26. }
    27. }
    To copy to clipboard, switch view to plain text mode 

    Please help. I am not sure why it is giving me such a strange error.
    The error dissappears if I remove #include "PPinclude.h"

    Thank you in advance,

    Ncrusader
    -----------------------------------------------------------

    Ok I figured it out,
    Solution:

    in the cgui.cpp file of the form class,
    Qt Code:
    1. //***Must include QtGui in the beginning of the file***
    2. #include <QtGui>
    3. //***
    4.  
    5. #include <cgui.h>
    6. #include <ui_cgui.h>
    7.  
    8. //etc
    To copy to clipboard, switch view to plain text mode 

    Cheers,

    ncrusader

  2. #2
    Join Date
    Apr 2010
    Location
    Singapore
    Posts
    156
    Thanks
    47
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qtextoption.h Expected unqualified-id before '\x9'

    Hi ncrusader,
    Do you know the reason why
    #include<QtGui>

    solves the problem?

Similar Threads

  1. error: expected unqualified-id before numeric constant
    By Pragya in forum Qt Programming
    Replies: 28
    Last Post: 9th February 2020, 20:39
  2. QTableView not working as expected.
    By junxuan in forum Qt Programming
    Replies: 7
    Last Post: 30th July 2009, 08:17
  3. Expected class-name before '{' token
    By imagiro1 in forum Newbie
    Replies: 16
    Last Post: 16th June 2009, 11:37
  4. Replies: 5
    Last Post: 17th February 2009, 14:18
  5. Expected lifetime of QModelIndex?
    By Ishark in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 21:18

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.