connect the singnal of combobox activated() to some slot in your dialog and play with lineedit
connect the singnal of combobox activated() to some slot in your dialog and play with lineedit
i know the connect part. but how about the play part?
i have attach an image what..
why cant you rephrase your question?
do you whant to change the text in combobox to whatever u type in lineedit?
EDIT..
i still cant understat what is qTemp?
nope. okay i roughly explain what i am doing and what i want. first for the image there is a yellow node. they will be 8 of them. so my combobox i already set it to 8 choice. from "End Device 1 to 8"
so now lets say when i select End device 1 on my combobox, and a type a certain word in the lineEdit. when i press ok. the word in the line edit will appear on the yellow node.
nvm just know it as printf.i still cant understat what is qTemp?
do it like this..
Qt Code:
//main MyDialog dlg; { int deviceId = dlg.getDeviceId(); if(!word.isEmpty()) putWordInUse(word); ..... ... } //MyDialog int MyDialog::getDeviceId() { return combobox->currentIndex()+1;//0+1=end device 1 ,1+1..... } int MyDialog::getWord() { return lineEdit->text(); }To copy to clipboard, switch view to plain text mode
do not forget to connect the ok button to accept() slot of QDialog
i dun think this will work with my current code. argh talking in forum is pretty hard man. i cant possible post my whole source code here.
do you have a msn or something? so i could end you my whole program. and u help me take a look?
sorry man .. this is the best i can do...
oh man. i seriously need some help here. anybody?
no reply from anyone else?
I think that it is hard to give you some example because we don't know what is that yellow node. Is it some widget or what? A picture? Diagram in some other application? There are some signals in QLineEdit which you can use (like textChanged() ) so you can connect them to your slots, where you can check the current combo box selection and change proper node (yellow or any other you want). But how would I know how to change that yellow node? Paint it with QPainter or what?
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
That's a bad idea, because then all other board members can't learn from your problem.
We live in different time zones, so sometimes we have to sleep
And as to your question: It's also not very clear to me what you want to achieve: Change the yellow bubble text on the fly while typing in the line edit, or after the dialog has closed?
For the first, emit a signal from the dialog whenever the text changes. catch that in your main window and manipulate the corresponding node.
Bookmarks