Results 1 to 2 of 2

Thread: How to use widgets of other ui within a class???

  1. #1
    Join Date
    Jan 2008
    Location
    India
    Posts
    31
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question How to use widgets of other ui within a class???

    I have a class and its associated GUI now i want to use another GUI and want to access all the widgets of that GUI within that class. please help me to do so.....!!!!!!

    Details are:

    Forms
    -------
    vista.ui
    vod.ui name of dialog object is vod

    Headers
    ---------
    vista.h
    ui_vista.h
    ui_vod.h

    Sources
    ----------
    vista.cpp
    main.cpp


    /*CODE of vista .cpp*/

    #include "vista.h"
    #include "ui_vod.h"
    VistaMedia::VistaMedia(QString uname, QWidget *parent):QDialog(parent)
    {
    setupUi(this);
    Ui_vod *adform=new Ui_vod;
    adform->show();
    }

    i got error that adform has no member named "show"
    any tricks???????
    Last edited by sinha.ashish; 10th April 2008 at 08:43.
    @shish

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to use widgets of other ui within a class???

    Hi,

    did you recognize the code-blocks in the editor and the designer manual "Using a Component in Your Application"?
    Qt Code:
    1. QWidget *widget = new QWidget;
    2. Ui::CalculatorForm ui;
    3. ui.setupUi(widget);
    4. widget->show();
    To copy to clipboard, switch view to plain text mode 

    Just customize to your needs.

    Lykurg

Similar Threads

  1. class QHBoxLayout
    By csvivek in forum Installation and Deployment
    Replies: 2
    Last Post: 10th April 2008, 07:57
  2. How to use Signal through direct connection
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2007, 07:07
  3. Replies: 11
    Last Post: 7th July 2006, 13:09
  4. Replies: 2
    Last Post: 4th May 2006, 19:17

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.