Results 1 to 4 of 4

Thread: How to make a business application using QT? QTreeWidget, Custom Widget

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

    Default How to make a business application using QT? QTreeWidget, Custom Widget

    hi all,

    I want the following interface for my accounting application.

    MainWindow
    QTreeWidget on the left side
    Custom Widget on the right side which is based on the item selected in the
    QTreeWidget

    My question is how can I determine the item selected and display the corresponding custom widget. Do I need to use 'switch'?

    I can't use QTabWidget and QStackedWidget since I need a lot of views.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to make a business application using QT? QTreeWidget, Custom Widget

    Quote Originally Posted by paulb View Post
    My question is how can I determine the item selected and display the corresponding custom widget. Do I need to use 'switch'?
    http://doc.qt.nokia.com/4.6/qtreewid...ml#itemClicked

    And what is switch? Do you mean a switch statement?
    Why is a stacked widget not possible? You can also try using a stacked layout and create your own stacked widget.

  3. #3
    Join Date
    Jun 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to make a business application using QT? QTreeWidget, Custom Widget

    And what is switch? Do you mean a switch statement?
    Ya. for performing an action corresponding to the item selected.

    Why is a stacked widget not possible? You can also try using a stacked layout and create your own stacked widget.
    but what to do if there are lot of pages in stackedwidget. memory matters.

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to make a business application using QT? QTreeWidget, Custom Widget

    I doubt you get into memory problems unless you want to add thousands of widgets.

    You can create a central widget (like in the main window) and set it to the corresponding widget. Unused widgets can then be deleted. Care should be given to prevent data corruption though.

Similar Threads

  1. How to make widget grow outside of its parent widget
    By shakeandbake in forum Qt Programming
    Replies: 2
    Last Post: 9th January 2010, 09:52
  2. Replies: 2
    Last Post: 4th December 2009, 10:38
  3. add .ui file with custom widget in application
    By stella1016 in forum Qt Programming
    Replies: 10
    Last Post: 19th November 2009, 10:25
  4. Replies: 4
    Last Post: 17th November 2009, 21:48
  5. Problem building application with custom widget
    By Uthar in forum Installation and Deployment
    Replies: 6
    Last Post: 19th January 2009, 18:57

Tags for this Thread

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.