Results 1 to 3 of 3

Thread: communication between ui and qwtplot

  1. #1
    Join Date
    Aug 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default communication between ui and qwtplot

    I have to write a program for physical application. I want to write in the following way.

    ui file

    QLinedit // Inputting data of the System
    QPushButton // Caculate und Quit
    QwtPlot // Output of an simple Plot

    if you push the Button calculate -> the curve will be plotted into the qwtplot widget.
    if you push Quit the programm has to close
    In the lineedits you can put data for the function or curve with is show in the qwtplot widget after putting calculate.

    I don't get the communication between the different objects

    How works the communication between line Edit and qwtplot?
    How works the communication between ui and qwtplot
    How works the communication between QPushButton an qwtplot

    In the qwt examples are no ui connection show, help me how communicate with the object of the ui?

  2. #2
    Join Date
    Oct 2009
    Location
    South Africa
    Posts
    94
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: communication between ui and qwtplot

    Sorry, can't answer your question.
    I'm trying a similar thing where I have created a ui in designer, now I want to add a plot to it. I'm not sure how to do it. I have followed the tutorial on http://www.squad17.org/node/41 but it doesn't have part 4 yet!

    I do know how to change properties of the widgets already on the ui programatically, just not how to add a widget created programatically to the ui.

  3. #3
    Join Date
    Oct 2007
    Location
    Warminster, England
    Posts
    31
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: communication between ui and qwtplot

    The communiction between itens is controlled via the QDialog class that is the ui.
    By over loading the signals and slots of the ui control can be passed between items.
    For example, when you press the Calculate button, ovreride the clicked() slot function.
    In your function, take the contents of the linedit and generate the data for the QwtPlot.
    Here are some of my examples below;
    Call your plotting routine when the plotbutton is clicked.
    Qt Code:
    1. connect ( plotButton, SIGNAL ( clicked() ), this, SLOT ( plotActiveAccount( ) ) );// plot the active account
    To copy to clipboard, switch view to plain text mode 
    The following slot can be used to recognise when the contets of a linedit is changed.
    Qt Code:
    1. connect ( lineEdit_Tamount, SIGNAL ( textChanged ( QString ) ), this, SLOT ( updateTamount( QString ) ) );
    To copy to clipboard, switch view to plain text mode 
    The dialog class controls all the communication between the various widgets on it.
    Best of luck,
    Carlton.

Similar Threads

  1. Qt and .Net communication
    By soniaerm in forum Qt Programming
    Replies: 0
    Last Post: 22nd April 2010, 06:37
  2. Replies: 6
    Last Post: 14th May 2009, 12:02
  3. Example of SSL communication
    By Morea in forum Qt Programming
    Replies: 4
    Last Post: 25th January 2009, 23:41
  4. USB communication
    By M. Bashir in forum Qt Programming
    Replies: 1
    Last Post: 29th January 2008, 02:56
  5. Communication Help Pls
    By munna in forum Newbie
    Replies: 1
    Last Post: 25th May 2006, 13:22

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.