Results 1 to 3 of 3

Thread: Adding MyWidget to .ui from design

  1. #1
    Join Date
    Aug 2012
    Posts
    30
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding MyWidget to .ui from design

    So I am trying to make a SVGViewer. I have DisplayWidget and window classes (both with .h and .cpp files). Also a main method. What I would like to do is that add my DisplayWidget to my Window but from .ui files Design part. Can somebody help me please?( The similar example is here: http://doc.qt.nokia.com/4.7-snapshot...generator.html) If you look here you will see that window.h does not contain a DisplayWidget variable but in the window.cpp file it uses the displayWidget variable to update both background and shape. When I write the same thing I get the error of : displayWidget is not declared in the scope (for update Background and Shape)


    Added after 30 minutes:


    I tried to promote the widget but I cant click on the Promote button.
    Last edited by jeff28; 16th August 2012 at 15:36.

  2. #2
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Adding MyWidget to .ui from design

    You need to add a plain QWidget to your UI in Designer and promote it to DisplayWidget. See here for details.

  3. #3
    Join Date
    Aug 2012
    Posts
    30
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding MyWidget to .ui from design

    Thank you very much you just made my day

Similar Threads

  1. type QWidget is not a direct base of MyWidget
    By eLancaster in forum Newbie
    Replies: 4
    Last Post: 4th December 2010, 21:16
  2. Replies: 3
    Last Post: 5th October 2008, 23:41
  3. Undefined reference MyWidget::....()
    By DrDonut in forum Newbie
    Replies: 1
    Last Post: 7th March 2008, 16:44
  4. qt design and adding other code
    By cxl2253 in forum Qt Tools
    Replies: 2
    Last Post: 1st February 2007, 17:12
  5. Replies: 2
    Last Post: 30th June 2006, 18:42

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.