Results 1 to 7 of 7

Thread: Problem in combobox

  1. #1
    Join Date
    May 2011
    Posts
    120
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Problem in combobox

    Hi all
    when i am including #include<QComboBox> in my header file , following are the error message

    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:139: error: expected identifier before numeric constant
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:139: error: expected '}' before numeric constant
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:139: error: expected unqualified-id before numeric constant
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:142: error: 'FrameFeature' was not declared in this scope
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:142: error: template argument 1 is invalid
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:142: error: invalid type in declaration before ';' token
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:145: error: expected unqualified-id before ')' token
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:146: error: expected unqualified-id before 'const'
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:146: error: expected ')' before 'const'
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:147: error: expected unqualified-id before 'const'
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:147: error: expected ')' before 'const'
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:148: error: 'QStyleOptionFrameV2& operator=(const QStyleOptionFrame&)' must be a nonstatic member function
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:150: error: expected unqualified-id before 'protected'
    c:\QtSDK1\Desktop\Qt\4.7.3\mingw\include/QtGui/qstyleoption.h:152: error: expected declaration before '}' token


    Please suggest what is wrong with this.

    Thanks
    Waiting for reply.

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem in combobox

    Does it happen only for the combo box?
    What about other widgets, list, button, etc? Do they work?
    Is it a Qt app or non-qt app where you want to add qt widget?

  3. #3
    Join Date
    May 2011
    Posts
    120
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Problem in combobox

    yes it is happening with combobox only , other widgets working well.
    earlier combobox also worked.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Problem in combobox

    Hi, have you altered the Qt sources? Can you please post the lines above and below your include.

  5. #5
    Join Date
    May 2011
    Posts
    120
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Problem in combobox

    I did not altered any qt source file.
    This is my header file in which as i include QComboBox file it gives me above line of errors
    Qt Code:
    1. #ifndef SETTINGS_FRAME_H
    2. #define SETTINGS_FRAME_H
    3.  
    4. #include<QFrame>
    5. #include<QLabel>
    6. #include<QPushButton>
    7. #include<QLineEdit>
    8. #include<QComboBox>
    9.  
    10.  
    11. class Settings_frame : public QFrame
    12. {
    13. Q_OBJECT
    14. public:
    15. QPushButton *button_cancel;
    16. Settings_frame(QWidget *parent = 0);
    17. void loadsetting();
    18. void savesettings();
    19.  
    20. private:
    21. QLabel *label_screen_name, *label_zone_name, *label_control_1, *label_control_2, *label_control_3;
    22. QPushButton *button_save;
    23. QLineEdit *line_control_1, *line_control_2, *line_zone_name, *line_screen_name, *line_control_3;
    24. QComboBox *combobox_screens, *combobox_zone;
    25.  
    26.  
    27. };
    28. #endif // SETTINGS_FRAME_H
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Nov 2006
    Location
    indonesia
    Posts
    55
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem in combobox

    Hi,
    I dont see any of problem at your header file. Maybe in other file. Can you show error message after you type "make" command?

    Best regards,

    Myta

  7. #7
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem in combobox

    IMHO you should not #include <> in the header file anything that you don't need in the header.
    I would forward-declare all the elements in the header and include the correct headers in implementation file.

    Qt Code:
    1. #include<QFrame>
    2.  
    3. class QLabel
    4. class QLineEdit
    5. class QComboBox
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. problem with comboBox
    By tinysoft in forum Newbie
    Replies: 5
    Last Post: 3rd May 2010, 08:01
  2. Combobox style problem
    By zgulser in forum Qt Tools
    Replies: 5
    Last Post: 13th March 2009, 09:01
  3. [Qt 4.3.1]A problem with combobox style
    By Tamara in forum Qt Programming
    Replies: 3
    Last Post: 19th September 2007, 10:49
  4. color comboBox problem
    By chguy2 in forum Qt Programming
    Replies: 2
    Last Post: 22nd April 2007, 09:57
  5. Problem with a combobox
    By Tindor in forum Qt Programming
    Replies: 2
    Last Post: 22nd November 2006, 19: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.