Results 1 to 6 of 6

Thread: tab & plugin

  1. #1
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default tab & plugin

    Hello,

    I'm creating a plugin for Qt Designer, it's a simple QLabel and QLineEdit. When I use it in the designer I cannot set the tab order to the plugin. How I can do it ? it's a property ?

    Thank you.

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

    Default Re: tab & plugin

    Of the plugin or of the line edit and label? If the latter, then it's not possible as the custom widget is treated as a single whole, not as two separate widgets. So if you want to set the tab order, set it when designing the custom widget and not when using it in Designer. If the problem is the former, then you might need to set a focus proxy for your custom widget.

  3. #3
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: tab & plugin

    Hello Wysota,

    The tab order is for plugin. I tried the setFocusProxy without exit. This is my code of my custom widget:

    Qt Code:
    1. AKLbField::AKLbField(QWidget *parent, Qt::WFlags f)
    2. : QWidget(parent, f)
    3. {
    4. createObjects();
    5. init();
    6. }
    7.  
    8. AKLbField::~AKLbField()
    9. {
    10. }
    11.  
    12. void AKLbField::createObjects()
    13. {
    14. akLabelName = new AKLabel();
    15. akFieldEdit = new AKField();
    16. setFocusProxy(akFieldEdit);
    17.  
    18. QHBoxLayout *qHBoxLayout = new QHBoxLayout();
    19. qHBoxLayout->addWidget(akLabelName);
    20. qHBoxLayout->addWidget(akFieldEdit);
    21.  
    22. QVBoxLayout *qVBoxLayout = new QVBoxLayout();
    23. qVBoxLayout->addLayout(qHBoxLayout);
    24. setLayout(qVBoxLayout);
    25.  
    26. }
    To copy to clipboard, switch view to plain text mode 

    When I go to the designer I cannot assign tab order to my custom widget whole.
    Last edited by wysota; 23rd April 2007 at 12:52. Reason: missing [code] tags

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

    Default Re: tab & plugin

    What does it mean that you can't? The square with a number doesn't appear next to your widget or what exactly happens?

  5. #5
    Join Date
    Jul 2006
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: tab & plugin

    Yes, the square with the number doesn't appear

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

    Default Re: tab & plugin

    Change the focus policy of your widget to something different than NoFocus.

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

    fpujol (23rd April 2007)

Similar Threads

  1. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 19:05
  2. Testing a custom Plugin
    By maluta in forum Qt Programming
    Replies: 5
    Last Post: 31st October 2006, 15:09
  3. Plugin woes
    By stevey in forum Qt Programming
    Replies: 8
    Last Post: 24th July 2006, 01:30
  4. creating table plugin
    By mgurbuz in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2006, 13:50
  5. Application plugin on windows
    By Eyee in forum Qt Programming
    Replies: 2
    Last Post: 22nd March 2006, 17:36

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
  •  
Qt is a trademark of The Qt Company.