Your code as presented will not compile. "myline" at cpp line 41 is not declared anywhere. Given that you seem to have had it compile you must have a "myline" declared as a member variable that you did not show us. This variable is in no way related to the "myline" variable declared at line 18 and used in the function frm_create(). Your compiler is probably warning you that the "myline" in frm_create() masks an earlier definition.
Line 41 crashes because myline is null or invalid.
Line 44 can crash because parentWidget() is null. If it doesn't crash for that reason then it will return null because you have not called setObjectName() on any of your widgets, so there is no widget named "myline". This will make line 45 crash.
Ditto line 47, 50, and 53.
Keep a pointer to the widget as a member variable and access the widget through its pointer.
You access member and local variables by name.2) How do i then access the values From sub Functions
If the variable is an object (or reference to one) you can access its member functions using object.function() notation.
If the variable is a pointer to an object then you can access its member functions using object->function() notation.
You can only access variables that are in scope.
All of this is basic C++ and nothing particularly to do with Qt.
Bookmarks