Results 1 to 4 of 4

Thread: Why QDesigner does not include QListWidgetItem in myfile.h when I use 'gotoslot' ?

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Why QDesigner does not include QListWidgetItem in myfile.h when I use 'gotoslot' ?

    I'like Qdesigner would include <QListWidgetItem> when I use the 'gotoSlot' on a QListWidget-listitemclicked. Now I have to do manually.

    Now, Designer only write this line by me (when a use gotoslot ) :
    Qt Code:
    1. void on_listWidget_itemClicked(QListWidgetItem* item);
    To copy to clipboard, switch view to plain text mode 
    But the ui_ui.h file does not include <QListWidgetItem>

    So, I have to include <QListWidgetItem>, because if not I have an error.
    I'm doing some bad? Why does not designer does the work ?

    (If I'm going to use this slot .... it does not sense I have not include <QListWidgetItem>)
    Any help ? Maybe it be a future feature of Designer ?Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Why QDesigner does not include QListWidgetItem in myfile.h when I use 'gotoslot'

    Why should it include this file? You added the slot so you have to add the include file in the form's settings dialog if you want it there.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Why QDesigner does not include QListWidgetItem in myfile.h when I use 'gotoslot'

    WY.
    If I use a QListWidget, Designer 'writes' the consecuent #include <QListWidget>
    If I use GotoSlot and choose QListItemclicked , and it does not going to work if there is
    not include #include <QListWidgetItem> .... .... (It does not have sense...)
    I think there is a missing feature of Designer, dont you think ?
    Where is the correct place to suggest this ?
    Thanks

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Why QDesigner does not include QListWidgetItem in myfile.h when I use 'gotoslot'

    Quote Originally Posted by tonnot View Post
    WY.
    If I use a QListWidget, Designer 'writes' the consecuent #include <QListWidget>
    Yes, because setupUi() calls methods from QListWidget class.

    If I use GotoSlot and choose QListItemclicked , and it does not going to work if there is
    not include #include <QListWidgetItem> .... .... (It does not have sense...)
    What is not going to work? You write the code in a subclass that has its own compilation unit. You can place the include there. The ui.h file doesn't need it, it only has a pointer to the object and that doesn't require an include.

    I think there is a missing feature of Designer, dont you think ?
    No, not really.
    Where is the correct place to suggest this ?
    In Qt bug tracker.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    tonnot (24th March 2011)

Similar Threads

  1. Replies: 3
    Last Post: 3rd January 2011, 08:54
  2. Using QDesigner Plugin
    By fakefish in forum Installation and Deployment
    Replies: 3
    Last Post: 9th December 2010, 15:37
  3. QDesigner plugin
    By h123 in forum Qt Programming
    Replies: 4
    Last Post: 12th October 2009, 07:36
  4. QDesigner + Qtranslator + QComboBox
    By Atikae in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 15:41
  5. QDesigner classes for Arm platform
    By vjn in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 10th April 2008, 16:34

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.