Results 1 to 9 of 9

Thread: Can i set resultLinEdit->text() from outside class ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    74
    Thanks
    31
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question Can i set resultLinEdit->text() from outside class ?

    Hello! Friends,
    I am working in WinXP with Qt4.3.4. I have designed a GUI for getting square of a given number. I have following files: -
    1.)sample.ui
    2.)sample.h
    3.)sample.cpp
    4.)ui_sample.h
    5.)main.cpp
    6.)square.h
    7.)square.cpp

    From these 5th & 6th are simple .cpp files for calculating square of the number which am passing from sample.cpp. Like getting input from GUI & passing it to square.cpp and displazing the result.

    Am able to set the calculated value from sample.cpp. But i want to set the resultLineEdit->text() from square.cpp to the calculated value.

    I have inherited in square.cpp from ui_sample class, and tried to include ui_sample.h in square.cpp to set text() property, it shows me an error that: -
    {
    square.cpp: In static member function `static int Square::Square_of(int)':
    ./ui_sample.h:34: error: invalid use of member `Ui_Form::resultLineEdit' in stat
    ic member function
    square.cpp:8: error: from this location
    }

    I might be wrong in doing few things. Can anyone please help me out in this problem.

    I will be thankful
    Last edited by Krish; 17th March 2008 at 16:54.

Similar Threads

  1. How to use Signal through direct connection
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2007, 07:07
  2. Connecting to a base class signal?
    By AaronMK in forum Qt Programming
    Replies: 4
    Last Post: 26th October 2007, 22:37
  3. Creating object of other class in Run() method
    By santosh.kumar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2007, 15:05
  4. Replies: 2
    Last Post: 16th March 2007, 09:04
  5. Replies: 2
    Last Post: 4th May 2006, 19:17

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.