Results 1 to 8 of 8

Thread: Program with many waidgets[how to]

  1. #1
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Program with many waidgets[how to]

    I will be making a large app with buttons that open additional Qwidgets.
    What is the best way to orgg=anise the whole process?

    Thanks

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Program with many waidgets[how to]

    Well - each widget will have it's own .h/.cpp (maybe .ui) files - i think this is, pretty much, already organized...
    or i didn't understood you? Do you ask for some "design patterns" for the whole project?

  3. #3
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Program with many waidgets[how to]

    The project will be like: Main form and many buttons leading each one to a different widget(I want a new form to appear for each widget).
    I have created the main window and added a Form class > widget.
    Then how do I link the buttons of the main form to open any widget I have?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Program with many waidgets[how to]

    Use signals and slots. Possibly with QSignalMapper.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Program with many waidgets[how to]

    Well I already found a way to do this.
    I made an object of the widget class in me main .h file and then just used this object(.show()),in a slot.
    Is that ok if I do it for like 10 widgets?
    And how slow my program gonna be if i make all those 10 widgets(10 more classes..:/)

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Program with many waidgets[how to]

    I have no idea what you mean.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Program with many waidgets[how to]

    Quote Originally Posted by "BumbleBee" View Post
    And how slow my program gonna be if i make all those 10 widgets(10 more classes..:/)
    It sounds like you are creating 10 widget objects in your main window constructor and only show()-ing them when a button is pressed. This is less efficient than it could be memory-wise (versus creating each widget only when requested), but unless it makes the machine starting pushing things out to disc cache it will have little impact on speed.

  8. #8
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Program with many waidgets[how to]

    Quote Originally Posted by ChrisW67 View Post
    It sounds like you are creating 10 widget objects in your main window constructor and only show()-ing them when a button is pressed. This is less efficient than it could be memory-wise (versus creating each widget only when requested), but unless it makes the machine starting pushing things out to disc cache it will have little impact on speed.
    Well,I would like the widgets to save some things(like listview),so that I write something to it and then when I open it again it should be there...

Similar Threads

  1. Replies: 0
    Last Post: 20th August 2010, 14:45
  2. Replies: 1
    Last Post: 30th April 2010, 14:25
  3. running external console program by gui program
    By alireza.mixedreality in forum Qt Programming
    Replies: 4
    Last Post: 24th April 2010, 19:05
  4. a program to start another program.
    By zakis in forum Qt Programming
    Replies: 4
    Last Post: 17th December 2009, 20:25
  5. Replies: 7
    Last Post: 19th January 2008, 16:29

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.