Results 1 to 15 of 15

Thread: I don't get expected output in text browser

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Jul 2010
    Posts
    71
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Excuse me a minute

    I Declare input_events * ptr_ie as a private member in Mainwindow class and remove ptr_ie declarations from your get_info and print function.
    But
    Does not print all of the contents linked list

    See
    Qt Code:
    1. class input_events
    2. {
    3. typedef struct input ie;
    4.  
    5. public:
    6. ie *l;
    7. ~input_events();
    8. input_events();
    9. void add_ie(ie *p);
    10. void gener_ie();
    11. friend class Trajectoire;
    12. };
    To copy to clipboard, switch view to plain text mode 

    And

    Qt Code:
    1. class MainWindow : public QMainWindow
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. explicit MainWindow(QWidget *parent = 0);
    7. ~MainWindow();
    8. Ui::MainWindow *ui;
    9.  
    10. private slots:
    11. void GetInfo();
    12. void print();
    13.  
    14. private:
    15. input_events * ptr_ie;
    16.  
    17. };
    To copy to clipboard, switch view to plain text mode 
    ^^^^^^^^^^^^^^^^^^^^^^^
    See private



    And this a function
    Qt Code:
    1. void MainWindow::print()
    2. {
    3. //input_events * ptr_ie;
    4. ie * ine;
    5.  
    6.  
    7. for(ine=ptr_ie->l; ine; ine = ine->suiv)
    8. {
    9. QString resultString = "";
    10. ui->textBrowser->setText( ui->textBrowser->toPlainText() + resultString.setNum(ine->id) + " ");
    11. }
    12. }
    To copy to clipboard, switch view to plain text mode 

    The problem is that does not print ALL linked list
    Last edited by wysota; 24th July 2010 at 23:34.

Similar Threads

  1. Replies: 6
    Last Post: 28th January 2014, 11:57

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.