Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Syntax for QspinBox connection
Forum Updated to NodeBB v4.3 + New Features

Syntax for QspinBox connection

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 256 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    summit
    wrote on last edited by summit
    #1

    For QPushButton named "pushButtonShow" we can create a slot with this syntax and we do not need to explicitly create the connect expression

    void on_pushButtonShow_clicked();
    

    what would be the similar syntax for QSpinBox value changed

    JonBJ 1 Reply Last reply
    0
    • S summit

      For QPushButton named "pushButtonShow" we can create a slot with this syntax and we do not need to explicitly create the connect expression

      void on_pushButtonShow_clicked();
      

      what would be the similar syntax for QSpinBox value changed

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @summit
      I would guess

      void on_nameOfSpinBox_valueChanged();
      

      because of void QSpinBox::valueChanged(int i).

      You are achieving this because of the behaviour of Qt Designer doing "auto-connects" of signals to slots based on what the widget is named and what the signal is named. This is generally considered inadvisable (e.g. try changing the name of your widget in Designer and see what happens),

      Despite the apparent convenience of this approach in Designer, most of us would suggest you simple do not use the signal/slot connection mechanism it offers and rather put the necessary connect() statements into your code explicitly instead.

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved