Results 1 to 3 of 3

Thread: Add QSvgWidget to Layout

  1. #1
    Join Date
    Aug 2009
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Add QSvgWidget to Layout

    Hello,
    I have private QSvgWidget in a shared library and once created, it is shown by svgWidget.show(); and it gets displayed on the screen. I want to be able to add the Widget to a layout in a QMainWindow with something like: SvgView-> addWidget(_myViewer->_svgWidget);. Is there a way to do this without making svgWidget public?

    Thanks.

  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: Add QSvgWidget to Layout

    You could make the mainwindow public to the shared library and at the widget from there but I doubt that this is what you had in mind.

    Next trick: Get the mainwindow in the shared library by QApplication::topLevelWidgets

    This would also work the other way around to find the widget.

    But all of these are hacks so I wonder what you realy want to do. You can have a look at other frameworks that do similar:

    KDE's ioslaves
    Qt's widget plugins.
    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:

    calh1578 (18th August 2009)

  4. #3
    Join Date
    Aug 2009
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Add QSvgWidget to Layout

    Thanks for the suggestions. I will try those out and see if they will do the job.

Similar Threads

  1. changing layout of a widget
    By mikro in forum Qt Programming
    Replies: 10
    Last Post: 4th August 2009, 20:21
  2. Qt like Layout Manager available for .NET platform
    By vkhaitan in forum Qt Programming
    Replies: 0
    Last Post: 5th November 2008, 13:36
  3. Qt layout memory issue
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 25th August 2007, 17:11
  4. Resizing problems when applying a layout
    By JimBrown in forum Newbie
    Replies: 1
    Last Post: 21st February 2007, 22:54
  5. "dynamic" layout
    By hulk in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2006, 07:16

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.