Results 1 to 2 of 2

Thread: [QT4] Trivial question(s)

  1. #1
    Join Date
    Jun 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question [QT4] Trivial question(s)

    Hello all !

    I have some new questions but I'll begin with a "simple" one.

    ui_muref.h (automatically generated from the .ui file itself from QtDesigner)
    Qt Code:
    1. #ifndef UI_MUREF_H
    2. #define UI_MUREF_H
    3.  
    4. #include <QtCore/QVariant>
    5. ...// (other default includes...)
    6.  
    7. class Ui_MainWindow
    8. {
    9. public:
    10. ...
    11. QTreeView *treeView;
    12. ...
    To copy to clipboard, switch view to plain text mode 

    ui_murefimpl.h
    Qt Code:
    1. #ifndef UI_MUREFIMPL_H
    2. #define UI_MUREFIMPL_H
    3.  
    4. #include "ui_muref.h"
    5. #include <qmainwindow.h>
    6. #include <qwidget.h>
    7. #include <qtreeview.h>
    8.  
    9. class ui_murefImpl : public QMainWindow
    10. {
    11. Q_OBJECT
    12. public:
    13. ui_murefImpl(QWidget *parent = 0);
    14. QTreeView *qTree;
    15. void buildQTree();
    16. private:
    17. Ui::MainWindow ui;
    18. private slots:
    19. void slotQuit();
    20.  
    21. // test slots
    22. void slotTest();
    23. };
    24. #endif
    To copy to clipboard, switch view to plain text mode 

    ui_murefimpl.cpp
    Qt Code:
    1. #include "ui_murefimpl.h"
    2. #include <qwidget.h>
    3. #include <qtreeview.h>
    4. #include "ui_muref.h"
    5.  
    6. ui_murefImpl::ui_murefImpl(QWidget *parent) : QMainWindow(parent)
    7. {
    8. ui.setupUi(this);
    9. // do connections
    10. connect(ui.actionQuit, SIGNAL(activated()), this, SLOT(slotQuit()));
    11.  
    12. // test slots
    13. connect(ui.actionTest, SIGNAL(activated()), this, SLOT(slotTest()));
    14. // end
    15. }
    16.  
    17. void ui_murefImpl::slotTest()
    18. {
    19. ui_murefImpl::buildQTree();
    20. }
    21.  
    22. void ui_murefImpl::buildQTree()
    23. {
    24. // what to put here ?
    25. }
    To copy to clipboard, switch view to plain text mode 

    The question is : "how to access to the treeView which is in the ui_muref.h" ??
    My goal is to "configure" it by default with the function "buildQTree()" !

    Thanks a lot for the first who solve this (noob) problem !

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: [QT4] Trivial question(s)

    ui.treeView->doSomething();
    It's nice to be important but it's more important to be nice.

  3. The following user says thank you to axeljaeger for this useful post:

    agent007se (27th June 2006)

Similar Threads

  1. 2 Questions about layouts
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 26th February 2006, 13:54
  2. Qt related questions and thoughts about getting job
    By AlexKiriukha in forum General Discussion
    Replies: 4
    Last Post: 26th January 2006, 12:25

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.