QComboBox - few questions
-
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" ... -
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" ...@AnneRanch
Q1:
The programmatic way to change the text is usingQComboBox::setItemText()
. If an item should be explicitly erased, you have to useQComboBox::removeItem()
andQComboBox::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. -
@AnneRanch
Q1:
The programmatic way to change the text is usingQComboBox::setItemText()
. If an item should be explicitly erased, you have to useQComboBox::removeItem()
andQComboBox::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....and for the records: It's all nicely written down here.