Click here to Skip to main content
14,978,528 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How do I access private variable of an object ? Pin
CPallini16-Jun-21 23:27
mveCPallini16-Jun-21 23:27 
GeneralRe: How do I access private variable of an object ? Pin
Richard MacCutchan17-Jun-21 0:35
mveRichard MacCutchan17-Jun-21 0:35 
GeneralRe: How do I access private variable of an object ? Pin
CPallini17-Jun-21 1:32
mveCPallini17-Jun-21 1:32 
GeneralRe: How do I access private variable of an object ? Pin
Member 1496877117-Jun-21 6:36
MemberMember 1496877117-Jun-21 6:36 
GeneralRe: How do I access private variable of an object ? Pin
Richard MacCutchan17-Jun-21 6:40
mveRichard MacCutchan17-Jun-21 6:40 
GeneralRe: How do I access private variable of an object ? Pin
CPallini17-Jun-21 7:43
mveCPallini17-Jun-21 7:43 
AnswerRe: How do I access private variable of an object ? Pin
Magnus Forslund15-Jul-21 2:19
MemberMagnus Forslund15-Jul-21 2:19 
QuestionPass a function with parameter Pin
Member 1496877115-Jun-21 10:35
MemberMember 1496877115-Jun-21 10:35 
Reason for this post is
I am trying to learn not just "cut and paste".

In the following code I am trying to put a function with parameter into "addAction " function It fails with two errors I am trying to decipher and learn what I am doing wrong.
I tested
Run_DDD_OPTION(testWidget); and it runs fine 



<pre>    QWidget *testWidget = new QWidget();
    testWidget->setWindowTitle("test widget window ");
    Run_DDD_OPTION(testWidget); runs fine 

    QAction *CAT_DDD_OPTION = CATMenu->
    addAction(tr("&Device Discovery Dialog (modified Bluetooth scanner ) "),
    this,
    &MainWindow::Run_DDD_OPTION(testWidget)
    );
    
   this runs as expected when no parameters are passed 

    QAction *CAT_DDD_OPTION_TAB = CATMenu->
    addAction(tr("&Device Discovery Dialog (modified Bluetooth scanner ) "),
    this,
    &MainWindow::Run_TAB
    );






There are too many "addAction" functions , different objects, so all I have to go by are these errors. (It woudl probably help if I knew what "addAction" expects as parameters.


<pre>/media/qe/TSET_QT_LABEL/QT_PROGRAMS/JUNE  15  WORKCOPY 2/CAT/mdi/mainwindow.cpp:1157: error: lvalue required as unary ‘&’ operand
../../../JUNE  15  WORKCOPY 2/CAT/mdi/mainwindow.cpp: In member function ‘void MainWindow::createActions()’:
../../../JUNE  15  WORKCOPY 2/CAT/mdi/mainwindow.cpp:1157:32: error: lvalue required as unary ‘&’ operand
 1157 |     &MainWindow::Run_DDD_OPTION(testWidget)
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~



/media/qe/TSET_QT_LABEL/QT_PROGRAMS/JUNE  15  WORKCOPY 2/CAT/mdi/mainwindow.cpp:1155: error: cannot take the address of an rvalue of type 'void'

AnswerRe: Pass a function with parameter Pin
Greg Utas15-Jun-21 11:38
mvaGreg Utas15-Jun-21 11:38 
GeneralRe: Pass a function with parameter Pin
Member 1496877115-Jun-21 13:30
MemberMember 1496877115-Jun-21 13:30 
GeneralRe: Pass a function with parameter Pin
Greg Utas15-Jun-21 13:39
mvaGreg Utas15-Jun-21 13:39 
GeneralRe: Pass a function with parameter Pin
Member 1496877115-Jun-21 15:23
MemberMember 1496877115-Jun-21 15:23 
GeneralRe: Pass a function with parameter Pin
Greg Utas16-Jun-21 0:22
mvaGreg Utas16-Jun-21 0:22 
QuestionRegarding Constructor Calling in C++ Pin
Member 1522917415-Jun-21 3:08
MemberMember 1522917415-Jun-21 3:08 
AnswerRe: Regarding Constructor Calling in C++ Pin
David Crow15-Jun-21 3:29
MemberDavid Crow15-Jun-21 3:29 
GeneralRe: Regarding Constructor Calling in C++ Pin
Member 1522917415-Jun-21 3:55
MemberMember 1522917415-Jun-21 3:55 
GeneralRe: Regarding Constructor Calling in C++ Pin
Richard MacCutchan15-Jun-21 5:02
mveRichard MacCutchan15-Jun-21 5:02 
AnswerRe: Regarding Constructor Calling in C++ Pin
Maximilien15-Jun-21 5:01
MemberMaximilien15-Jun-21 5:01 
AnswerRe: Regarding Constructor Calling in C++ Pin
CPallini15-Jun-21 23:39
mveCPallini15-Jun-21 23:39 
QuestionAdvice on writing a GUI application that can run on very old Windows operating systems without Service Packs and Frameworks Pin
arnold_w14-Jun-21 8:32
Memberarnold_w14-Jun-21 8:32 
AnswerRe: Advice on writing a GUI application that can run on very old Windows operating systems without Service Packs and Frameworks Pin
Victor Nijegorodov14-Jun-21 8:43
MemberVictor Nijegorodov14-Jun-21 8:43 
AnswerRe: Advice on writing a GUI application that can run on very old Windows operating systems without Service Packs and Frameworks Pin
Mircea Neacsu14-Jun-21 8:45
mvaMircea Neacsu14-Jun-21 8:45 
AnswerRe: Advice on writing a GUI application that can run on very old Windows operating systems without Service Packs and Frameworks Pin
Richard MacCutchan14-Jun-21 8:51
mveRichard MacCutchan14-Jun-21 8:51 
AnswerRe: Advice on writing a GUI application that can run on very old Windows operating systems without Service Packs and Frameworks Pin
Eddy Vluggen14-Jun-21 9:18
professionalEddy Vluggen14-Jun-21 9:18 
AnswerRe: Advice on writing a GUI application that can run on very old Windows operating systems without Service Packs and Frameworks Pin
Maximilien15-Jun-21 5:22
MemberMaximilien15-Jun-21 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.