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. QComboBox - few questions
Forum Updated to NodeBB v4.3 + New Features

QComboBox - few questions

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 193 Views 2 Watching
  • 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    QComboBox - few questions
    I am trying to analyze example where "QComboBox" is "custom" filled during dialog setup.
    It is set to show first item found ( serial port ) .

    I can then use the "pull down (arrow) " to select the item of interest.
    In this case "Custom serial port" ...

    I need to build this custom entry , so I type " /dev/rfcomm0"
    over the "Custom serial port "" label and it magically erases and takes my
    "/dev/rfcomm0" text.

    Question #1
    what "slot"action does the "erase the old and accept the new text" ?
    ( QComboBox has plenty of function, but I failed to see which could be used for this )

    I like to verify the actual port selection BEFORE I let the "Setting dialog " apply the custom text.

    Question #2
    What would be the slots combination to
    let the QComboBox / QDialog know that the custom text just entered is complete ?
    ( I do not see any (speed) issues evaluating each character entry...)

    and then execute the "is the entry - serial port - for real query ? "
    The QT example evaluates the port - does actual / physical serial port connection
    , but little too late , after the "setting dialog" is accepted .

    PS
    At this point I really do not know the source file of the "working serial ports" ...

    Axel SpoerlA 1 Reply Last reply
    0
    • A Anonymous_Banned275

      QComboBox - few questions
      I am trying to analyze example where "QComboBox" is "custom" filled during dialog setup.
      It is set to show first item found ( serial port ) .

      I can then use the "pull down (arrow) " to select the item of interest.
      In this case "Custom serial port" ...

      I need to build this custom entry , so I type " /dev/rfcomm0"
      over the "Custom serial port "" label and it magically erases and takes my
      "/dev/rfcomm0" text.

      Question #1
      what "slot"action does the "erase the old and accept the new text" ?
      ( QComboBox has plenty of function, but I failed to see which could be used for this )

      I like to verify the actual port selection BEFORE I let the "Setting dialog " apply the custom text.

      Question #2
      What would be the slots combination to
      let the QComboBox / QDialog know that the custom text just entered is complete ?
      ( I do not see any (speed) issues evaluating each character entry...)

      and then execute the "is the entry - serial port - for real query ? "
      The QT example evaluates the port - does actual / physical serial port connection
      , but little too late , after the "setting dialog" is accepted .

      PS
      At this point I really do not know the source file of the "working serial ports" ...

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by Axel Spoerl
      #2

      @AnneRanch
      Q1:
      The programmatic way to change the text is using QComboBox::setItemText(). If an item should be explicitly erased, you have to use QComboBox::removeItem()and QComboBox::insertItem().
      (Thanks to @JonB for leading me to this clarification).

      Q2:
      See Q1. You could encode the "replace" logic in a lambda and connect it to a slot.

      Software Engineer
      The Qt Company, Oslo

      Axel SpoerlA 1 Reply Last reply
      0
      • Axel SpoerlA Axel Spoerl

        @AnneRanch
        Q1:
        The programmatic way to change the text is using QComboBox::setItemText(). If an item should be explicitly erased, you have to use QComboBox::removeItem()and QComboBox::insertItem().
        (Thanks to @JonB for leading me to this clarification).

        Q2:
        See Q1. You could encode the "replace" logic in a lambda and connect it to a slot.

        Axel SpoerlA Offline
        Axel SpoerlA Offline
        Axel Spoerl
        Moderators
        wrote on last edited by
        #3

        ...and for the records: It's all nicely written down here.

        Software Engineer
        The Qt Company, Oslo

        1 Reply Last reply
        0

        • Login

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