Results 1 to 3 of 3

Thread: reference to connect is ambiguous QQuickItem QMainWindow QCustomPlot

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    231
    Thanks
    141
    Thanked 6 Times in 5 Posts

    Default reference to connect is ambiguous QQuickItem QMainWindow QCustomPlot

    I am trying to use QCustomPlot's example of the following folder, in my program:

    /examples/plots

    and at the same time I want it accessible from QML. So, I added <QQuickItem> and it resulted in the error stated in the title.

    The code:

    Qt Code:
    1. #include <QQuickItem>
    2. #include <QMainWindow>
    3. #include <QTimer>
    4. #include "../../qcustomplot.h"
    5.  
    6. namespace Ui {
    7. class MainWindow;
    8. }
    9.  
    10. class MainWindow : public QQuickItem, public QMainWindow
    11. {
    12. Q_OBJECT
    To copy to clipboard, switch view to plain text mode 

    What should I do to make it accessible from QML and solve the error too?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: reference to connect is ambiguous QQuickItem QMainWindow QCustomPlot

    QMainWindow and QQuickItem are QObject subclasses.You can only derive from QObject once.

    QMainWindow is also a QWidget, which is not something you can display in a QtQuick2 scene anyway.

    Cheers,
    _

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: reference to connect is ambiguous QQuickItem QMainWindow QCustomPlot

    Or if you want a QMainWindow like thing in QML, you can have a look at QML's Window element

Similar Threads

  1. Replies: 4
    Last Post: 28th May 2011, 21:57
  2. Replies: 2
    Last Post: 9th May 2011, 10:38
  3. Replies: 12
    Last Post: 30th December 2010, 10:37
  4. Replies: 5
    Last Post: 30th December 2009, 23:40
  5. ambiguous connect()
    By Cruz in forum Qt Programming
    Replies: 2
    Last Post: 27th August 2009, 11:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.