Results 1 to 9 of 9

Thread: Weird QTextEdit error

  1. #1
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    111
    Thanked 4 Times in 4 Posts

    Default Weird QTextEdit error

    I've added some QTextEdit to a QWidget and I get this weirdo error. The code of line is:
    Qt Code:
    1. inline QString textInput()
    2. { return m_pTextInput->text(); };
    To copy to clipboard, switch view to plain text mode 
    And the error is:
    Qt Code:
    1. mingw32-make
    2. mingw32-make -f Makefile.Debug
    3. mingw32-make[1]: Entering directory `C:/Documents and Settings/markofr/workspace/SettingsEditor'
    4. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.3.4\include\QtCore" -I"..\..\..\..\Qt\4.3.4\include\QtCore" -I"..\..\..\..\Qt\4.3.4\include\QtGui" -I"..\..\..\..\Qt\4.3.4\include\QtGui" -I"..\..\..\..\Qt\4.3.4\include" -I"c:\Qt\4.3.4\include\ActiveQt" -I"debug" -I"." -I"..\..\..\..\Qt\4.3.4\mkspecs\win32-g++" -o debug\CDataInputWidget.o CDataInputWidget.cpp
    5. In file included from CDataInputWidget.cpp:1:
    6. CDataInputWidget.h: In member function `QString CDataInputWidget::textInput()':
    7. CDataInputWidget.h:36: error: 'class QTextEdit' has no member named 'text'
    8. mingw32-make[1]: *** [debug/CDataInputWidget.o] Error 1
    9. mingw32-make[1]: Leaving directory `C:/Documents and Settings/markofr/workspace/SettingsEditor'
    10. mingw32-make: *** [debug] Error 2
    To copy to clipboard, switch view to plain text mode 
    This CInputWidget is a class, made for QLabel+QTextEdit, grouped into QGroupBox. I am pretty sure it is a dumb error, but I cannot crack it, please help!
    Qt 5.3 Opensource & Creator 3.1.2

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

    Default Re: Weird QTextEdit error

    Nothing weird there. QTextEdit indeed has no such member as text(). You might want to take a closer look at QTextEdit docs.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    111
    Thanked 4 Times in 4 Posts

    Default Re: Weird QTextEdit error

    Quote Originally Posted by jpn View Post
    Nothing weird there. QTextEdit indeed has no such member as text(). You might want to take a closer look at QTextEdit docs.
    Citate from docs:
    QString QTextEdit::text () const Returns all the text in the text edit as plain text.
    See also setText().
    So, what the hell is going on?!
    Qt 5.3 Opensource & Creator 3.1.2

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

    Default Re: Weird QTextEdit error

    Are you reading docs of Qt 3? Could you provide a link?

    Edit: Oh, it's part of Qt 3 Support Members for QTextEdit:
    The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.
    Qt3 support methods are only available if your Qt was built with Qt3Support.
    Last edited by jpn; 31st March 2008 at 09:42. Reason: updated contents
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    MarkoSan (31st March 2008)

  6. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 334 Times in 317 Posts

    Default Re: Weird QTextEdit error

    Did u include QTextEdit ??
    #include<QTextEdit>
    and does toPlainText() work instead of text() ??

  7. The following user says thank you to aamer4yu for this useful post:

    MarkoSan (31st March 2008)

  8. #6
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    111
    Thanked 4 Times in 4 Posts

    Default Re: Weird QTextEdit error

    Quote Originally Posted by MarkoSan View Post
    Citate from docs:

    So, what the hell is going on?!
    Ok, jpn! I was wrong, sorry, read the WRONG DOCS . But now I have a deeper problem. The following code:
    Qt Code:
    1. connect(m_pStationIDInputWidget->ptrTextInput(),
    2. SIGNAL(textChanged()),
    3. this,
    4. SLOT(stationIDTextChanged()));
    To copy to clipboard, switch view to plain text mode 

    returns warning:
    warning: Object::connect: No such signal QLineEdit::textChanged()
    Must I implement signal mapper or why this slot is never called when it should be?
    Qt 5.3 Opensource & Creator 3.1.2

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

    Default Re: Weird QTextEdit error

    Quote Originally Posted by MarkoSan View Post
    returns warning:
    warning: Object::connect: No such signal QLineEdit::textChanged()
    QLineEdit doesn't have such signal. It has a parameter.
    J-P Nurmi

  10. #8
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    111
    Thanked 4 Times in 4 Posts

    Default Re: Weird QTextEdit error

    Yes yes, I forgot to tell you I've changed the base class to QTextEdit, which has textChanged() signal. But I still get same warning.
    Qt 5.3 Opensource & Creator 3.1.2

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

    Default Re: Weird QTextEdit error

    But it says that you are passing a QLineEdit to the connect statement.
    J-P Nurmi

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 15:22
  2. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 13:57
  3. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 03:49
  4. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 13:19
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 13:52

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.