Results 1 to 13 of 13

Thread: QT designer 4.5

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QT designer 4.5

    Hello,

    I'm a complete newbie when it comes to QT and although I can find plenty of examples of coding from scratch, can not seem to find much in the way of help when it comes to using QT Designer 4.5.

    How do you implement a tree view (not tree widget) with this version of designer?

    I am obviously missing something basic in the way QT Designer works.

    for instance I know that a directory view of the local file system can be generated with the following fairly trivial class:

    -------------------------------------------
    directoryTreeView.h
    Qt Code:
    1. #ifndef DIRECTOTYTREEVIEW_H
    2. #define DIRECTOTYTREEVIEW_H
    3.  
    4. #include <QWidget>
    5. #include <QTreeView>
    6. #include <QModelIndex>
    7. #include <QDirModel>
    8.  
    9. class directoryTreeView : public QWidget
    10. {
    11. public:
    12. directoryTreeView();
    13. };
    14.  
    15. #endif // DIRECTOTYTREEVIEW_H
    To copy to clipboard, switch view to plain text mode 
    -------------------------------------------

    directoryTreeView.cpp

    Qt Code:
    1. #include "directorytreeview.h"
    2.  
    3.  
    4. directoryTreeView::directoryTreeView()
    5. {
    6. QDirModel *model = new QDirModel;
    7. QTreeView *tree = new QTreeView();
    8. tree->setModel(model);
    9. tree->show();
    10. }
    To copy to clipboard, switch view to plain text mode 
    --------------------------------------------


    With QT Designer you can create a QU GUI application, drag a model based tree view onto the resulting mainwindow.ui form, but then what?

    Any help would be most appreciated, thanks.
    Last edited by wysota; 26th October 2009 at 22:32. Reason: missing [code] tags

Similar Threads

  1. Replies: 3
    Last Post: 10th December 2009, 22:53
  2. Threads in Designer plugins
    By hvengel in forum Qt Tools
    Replies: 2
    Last Post: 3rd January 2009, 19:19
  3. Replies: 13
    Last Post: 15th December 2006, 11:52
  4. Designer crashes when selecting some widgets
    By gwendal in forum Qt Tools
    Replies: 4
    Last Post: 21st July 2006, 13:18
  5. Adding slots in Designer
    By jamos in forum Qt Tools
    Replies: 5
    Last Post: 18th May 2006, 23:28

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.