Results 1 to 4 of 4

Thread: accessing gui elements from parent

  1. #1
    Join Date
    Apr 2006
    Posts
    11
    Thanked 1 Time in 1 Post

    Default accessing gui elements from parent

    Hi,

    i`m using qt4 and have defined my gui interface with the designer. the already existent qtablewidget wasn`t good enough for me and i have created subclass of this. i add this in the with the uic generated header. now i need to access other - defined in the ui header file - gui elements.

    when i subclass my tablewidget from the ui-header to i get an error. i think because of the added subclassed table.

    how can i handle this?

    should i rewrite my program without using the autom. generated ui_xxx file or is there any other solution?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: accessing gui elements from parent

    Did you notice the option "Promote to Custom Widget" in Designer?
    J-P Nurmi

  3. #3
    Join Date
    Apr 2006
    Posts
    11
    Thanked 1 Time in 1 Post

    Default Re: accessing gui elements from parent

    i`ve looked this possibility. it create the same what i have created manually. only a header file and the pointer are created, nothing else.

    does it set some other flags or settings for the compiler?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: accessing gui elements from parent

    I don't think I understand the problem here..

    Just a side note: you really shouldn't modify the generated ui_xxx.h file, because it'll be regenerated and overwritten by uic whenever the .ui file changes.

    Designer is limited to the standard Qt widgets. You can use the widget promotion in case you want to place your QTableWidget derivate in the form. You don't instantiate and/or subclass your own table widget from the one in the form. The intention is to use it directly, as the widget has already been instantiated during the setupUi() call.
    J-P Nurmi

Similar Threads

  1. QSql*Model + QTreeView : make a tree
    By punkypogo in forum Qt Programming
    Replies: 18
    Last Post: 24th October 2008, 18:14
  2. accessing table elements in Qt
    By awanish_jmi in forum Newbie
    Replies: 5
    Last Post: 28th July 2008, 12:51

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.