Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] how to create an instance of a class from a lib
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 801 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arsinte_andrei
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • A Offline
      A Offline
      arsinte_andrei
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved