Results 1 to 3 of 3

Thread: Can't use connect to set spinbox maximum

  1. #1
    Join Date
    Jul 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Exclamation Can't use connect to set spinbox maximum

    If I (please bear with me):
    connect(ui->sbMin,SIGNAL(valueChanged(int)),ui->sbMax,SLOT(setValue(int)));

    All is OK, but if I:
    connect(ui->sbMin,SIGNAL(valueChanged(int)),ui->sbMax,SLOT(setMinimum(int)));

    I get:

    Object::connect: No such slot QSpinBox::setMinimum(int) in thecrypt.cpp:1403
    Object::connect: (sender name: 'sbMin')
    Object::connect: (receiver name: 'sbMax')

    This is driving me crazy...Help

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Can't use connect to set spinbox maximum

    EDIT:
    did you include QSpinBox?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Can't use connect to set spinbox maximum

    QSpinBox::setMinimum() and QSpinBox::setMaximum() are not slots. You will need to subclass QSpinBox to expose these as slots.

Similar Threads

  1. Set maximum input length in spinbox?
    By hakermania in forum Newbie
    Replies: 1
    Last Post: 24th December 2010, 00:54
  2. Replies: 16
    Last Post: 16th February 2010, 14:17
  3. Getting the value from a spinbox
    By X-man in forum Newbie
    Replies: 14
    Last Post: 28th September 2007, 02:27
  4. Replies: 4
    Last Post: 10th November 2006, 16:38
  5. spinbox
    By mickey in forum Newbie
    Replies: 2
    Last Post: 22nd May 2006, 09:35

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.