Results 1 to 3 of 3

Thread: Promoted Widget within a Promoted Widget programmatically

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2015
    Posts
    2
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Smile Promoted Widget within a Promoted Widget programmatically

    Hi

    Widget Promotion

    Based on several forums I managed to promote a graphicsView accordingly.
    The issue comes when within the promoted class I need to create a QLabel (within the graphicsView) that itself needs to be promoted.

    1. Promote Graphics View (through the designer)
    2. Add QLabel Widget within graphicsView (programatically)
    Qt Code:
    1. label= new QLabel();
    2. label->setFixedSize(320, 320);
    3. label->setText("Test Label");
    4. proxy = myScene->addWidget(label);
    5. proxy->setZValue(0);
    To copy to clipboard, switch view to plain text mode 
    3. try to promote the generated label (That is within the graphicsView) to another class in code
    Since i only have access to the label in the code and not via the designer.

    How do I promote a QLabel to a specified class within code? (Not through the designer)

    Your assistance is appreciated

    Regards
    Last edited by ByForeward; 16th September 2015 at 15:24. Reason: updated title

Similar Threads

  1. Replies: 6
    Last Post: 24th October 2013, 18:08
  2. Replies: 6
    Last Post: 24th November 2011, 09:54
  3. Why dont see a Custom Widget Promoted ?
    By tonnot in forum Newbie
    Replies: 1
    Last Post: 27th October 2010, 13:24
  4. Promoted widgets in Qt Designer
    By martinb0820 in forum Qt Tools
    Replies: 1
    Last Post: 9th June 2010, 15:07
  5. Replies: 2
    Last Post: 20th March 2010, 18:22

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.