PDA

View Full Version : access between windows



DarsVaeda
7th October 2008, 20:43
hi,

my main.cpp creates a mainwindow that contains a drawing field to draw lines, circles or squares.
there is a contextmenu from which you can choose to view a popup where you can enter parameters for changing linestyle or something.
but i don't get how to set values of those drawing field through the popup.
the drawing field has a public function "set" to set that variables. but i have no access to this function at the popup.
if i include the header of the drawing field to the popup, i have that access but there is a redeclaration of variables.

how can i set the variables of the drawing field in that popup?

my excuses for the bad English...hope you can understand what i mean :o

amicitas
8th October 2008, 09:56
One way to to this is to have your popup emit a signal, then connect the signal to a slot in your drawing field.
For your example you would make "set" into a slot.

Best place to start for this is here:
Signals and Slots (http://doc.trolltech.com/4.4/signalsandslots.html)