Results 1 to 5 of 5

Thread: Passing object a constructor parameter in Designer

  1. #1
    Join Date
    Aug 2006
    Posts
    163
    Thanks
    12
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Passing object a constructor parameter in Designer

    Is it possible to pass a child of a widget that you have made in Designer a constructor varialbe? In my case I wish to pass a KFontChooser the second parameter of false to force it to only display fixed fonts.

  2. #2
    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: Passing object a constructor parameter in Designer

    Could you show an example of what you mean? If you mean one of your widgets in Designer has a child object which you want to initialize with some variable, then no - you have to do that from within the widget containing the object, regardless if you use Designer or not.

  3. #3
    Join Date
    Aug 2006
    Posts
    163
    Thanks
    12
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Passing object a constructor parameter in Designer

    Well, in this case I am making pages for a KConfigDialog in Designer. One of the pages was a widget containing a KFontChooser. If you want KFontChooser to display only fixed fonts, you have to initialize it with the second constructor argument as "false". Hence my question.
    But you say this is not possible using designer?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Passing object a constructor parameter in Designer

    Quote Originally Posted by Valheru View Post
    If you want KFontChooser to display only fixed fonts, you have to initialize it with the second constructor argument as "false".
    Unless there is a property for that, I'd say it's a little design issue of KFontChooser.
    J-P Nurmi

  5. #5
    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: Passing object a constructor parameter in Designer

    Quote Originally Posted by Valheru View Post
    If you want KFontChooser to display only fixed fonts, you have to initialize it with the second constructor argument as "false".
    Doesn't it have a regular method that does the same?

Similar Threads

  1. passing an object
    By mickey in forum General Programming
    Replies: 3
    Last Post: 16th January 2008, 10:27
  2. QT Designer? Coding by hand?
    By lewis in forum Qt Tools
    Replies: 47
    Last Post: 2nd April 2007, 16:30
  3. Replies: 2
    Last Post: 17th May 2006, 21:01
  4. Passing Object to dll
    By ankurjain in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2006, 09:50
  5. passing a QPainter object to widgets
    By vratojr in forum Qt Programming
    Replies: 9
    Last Post: 11th January 2006, 15:27

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.