Results 1 to 6 of 6

Thread: QComboBox Custom Widget has missing designer properties

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question QComboBox Custom Widget has missing designer properties

    I can't understand why my custom widget is missing some designer functions, like in designer,
    the custom widget doesn't have any tab order and it doesn't appear in the tab order list.

    I'm thinking it's because I've placed it in a layout which doesn't have a tab order ?
    I had to do this because without it, my widget didn't show up when placing it on a form.

    Qt Code:
    1. DbComboBox::DbComboBox(QWidget *parent)
    2. : QWidget(parent)
    3. {
    4. cb = new QComboBox(this);
    5. cb->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    6. cb->setEditable(true);
    7. cb->installEventFilter(this);
    8. connect(cb, SIGNAL(currentIndexChanged(int)), this, SLOT(on_currentIndexChanged(int)));
    9. QHBoxLayout *layout = new QHBoxLayout;
    10. layout->addWidget(cb);
    11. layout->setContentsMargins(0,0,0,0);
    12. this->setLayout(layout);
    13. }
    To copy to clipboard, switch view to plain text mode 

    Also QComboBox public methods aren't available, when I compile my project with an instance of this part and access a method:
    Qt Code:
    1. m_ui->myComboBox->currentText
    To copy to clipboard, switch view to plain text mode 
    compiler says
    /home/vince/projects/Qt/myProject/plugins/DbComboBoxExtension/dbcombobox.h:56: error: ‘QString DbComboBox::currentText’ is private
    Can someone please point out why it isn't behaving ?
    Last edited by vieraci; 6th December 2009 at 11:20.

Similar Threads

  1. Replies: 3
    Last Post: 17th November 2009, 14:43
  2. Custom widget - Only works in Designer
    By Darhuuk in forum Qt Tools
    Replies: 6
    Last Post: 8th January 2008, 00:46
  3. Replies: 15
    Last Post: 25th March 2007, 03:40
  4. Replies: 5
    Last Post: 16th May 2006, 20:38
  5. Replies: 4
    Last Post: 1st March 2006, 23:11

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.