[SOLVED] how to create an instance of a class from a lib



  • Dear friends,
    I'm trying to create an instance of a class into the main.cpp but without success.
    here you have some piece of my code

    • main.cpp
      @
      atpGuiMainWindow win = new atpGuiMainWindow;
      vin->show();
      @
      give error
      /home/andrei/Qt5.3.0/5.3/gcc_64/include/QtWidgets/qmainwindow.h:204: error: 'QMainWindow::QMainWindow(const QMainWindow&)' is private
      Q_DISABLE_COPY(QMainWindow)
      ^

    now I find anther aproch but this time not so much changed...
    @
    typedef atpGuiMainWindow(*MainWindowHandler)();
    MainWindowHandler win = (MainWindowHandler());

    @
    but this dows not allow for
    @win->shhow();@
    /home/andrei/myQt/drawElectricity/main/main.cpp:72: error: request for member 'show' in '* win', which is of non-class type 'atpGuiMainWindow()'
    win->show();
    ^
    without this the code is working - but no gui :))
    operation succesfull - client dead :))
    any help much apreciated
    please note that the atpGuiMainWindow is in a library and I call it from library



  • I've just realised that I had few virtual function there that supose not to be... now is working


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.