Results 1 to 2 of 2

Thread: [QStackedWidget] adding widget to existing page

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Location
    Poland
    Posts
    184
    Thanks
    70
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default [QStackedWidget] adding widget to existing page

    Hello!

    I'm trying to add widget to an existing page of QStackedWidget. My code:

    Qt Code:
    1. widgetPointer = new myWidget(this);
    2. widgetPointer->setLayout(ui->widgetLayout);
    3. widgetPointer->setGeometry(QRect(0,0,430,310));
    4. ui->stackedWidget->insertWidget(0, widgetPointer);
    5. wykresStan->move(QPoint(0,0));
    To copy to clipboard, switch view to plain text mode 

    Widget adds to QStackedWidget but it also creates new page with index '0'. And my '0' page is now '1'. I've tried:

    Qt Code:
    1. widgetPointer = new myWidget(ui->widgetLayout);
    To copy to clipboard, switch view to plain text mode 

    But widget added 'on top' of QStackedWidget. Any ideas?

    thanks in advance
    best regards
    Tomasz

  2. The following 2 users say thank you to Tomasz for this useful post:


Similar Threads

  1. Replies: 7
    Last Post: 15th May 2014, 19:29
  2. Multi-page application and QStackedWidget
    By Mek82 in forum Qt Programming
    Replies: 10
    Last Post: 31st October 2010, 22:06
  3. Adding custom widget to an existing layout
    By santana in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2010, 17:29
  4. adding dll to existing project...
    By aj2903 in forum Qt Programming
    Replies: 1
    Last Post: 1st December 2009, 09:35
  5. QStackedWidget page with different size
    By nina1983 in forum Qt Tools
    Replies: 1
    Last Post: 26th July 2008, 10:58

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.