Hi, the image show the yellow color node which is drawn using Qpainter. i would now like to place a textbox above the End Device. so that the user could input words on top of the End Device. anyway to do so?
 Novice
					
					
						Novice
					
					
                                        
					
						
							
								 
							
						
					
					
						 Textbox
 Textbox
		Hi, the image show the yellow color node which is drawn using Qpainter. i would now like to place a textbox above the End Device. so that the user could input words on top of the End Device. anyway to do so?
Last edited by Devoraz; 22nd July 2009 at 11:55.
 
    
    
    
    
    
    
   
    
    
       
    
    
       
    
    
    
   Re: Textbox
 Re: Textbox
		Hi,
fist you can use a QGraphicsView for your image and then you can easily put a QLineEdit on it
or
you positioning a line edit absolutely over your QWidget with the image. but then you have to catch move event of you widget to move the line edit with it.
And please add your images on that forum and not from 3rd part services to keep your post valid also in 2 years...
 Novice
					
					
						Novice
					
					
                                        
					
						
							
								 
							
						
					
					
						 Re: Textbox
 Re: Textbox
		can you roughly guide me what to write for the QGraphicsView command?
 
    
    
    
    
    
    
   
    
    
       
    
    
       
    
    
    
   Re: Textbox
 Re: Textbox
		Something like that
Qt Code:
int main(int argc, char **argv)
{
QGraphicsScene scene;
// resize your scene and view to the pix bounding rect
pi->setPos(0,0);
// set position and hide/show it when needed
// -> QGraphicsScene::mousePressEvent() and release event...
view.show();
return app.exec();
}To copy to clipboard, switch view to plain text mode
 
    
    
    
    
    
    
   
    
    
       
    
    
       
    
    
    
   Re: Textbox
 Re: Textbox
		Is the picture size fix? if so, a more easier possibility would be: Create a QFrame of the picture size and positioning a QLineEdit inside using QSpacer and stuff. Then set your image as the background of the frame. But still for the frame you must detect the button press, but that's only 10 lines as maximum.
 Novice
					
					
						Novice
					
					
                                        
					
						
							
								 
							
						
					
					
						 Re: Textbox
 Re: Textbox
		yes what ever inside the yellow node is fix. the yellow node will move around though, but what ever inside the yellow node will move with the node i suppose. haha. QT is kind of complicated man. totally knew to this project i've got. i had learn C# and C++. but this whole c++ user QT library.
its making my life difficult. my project gonna be doom~! well. but i have changed and enchance a few things in my GUI though. just this changing of the name of the End Device is making me really headache...
Bookmarks