Results 1 to 2 of 2

Thread: qwt-6.1-multiaxes and findChildren()

  1. #1
    Join Date
    Aug 2015
    Posts
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default qwt-6.1-multiaxes and findChildren()

    Hi everybody.

    I am trying to port an application from QT4.8 and Qwt-5.x patched with multiaxis to QT5.6 and Qwt-6.1-multiaxis.

    This code worked in previous version:

    Window=(QWidget*)MainWindow;
    varQwt = MainWindow->findChildren<QwtPlot *>();

    and varQwt contained a list of the QwtPlot objects contained in window MainWindow.

    With latest QT/Qwt version varQwt is always empty, so QwtPlot widgets aren't found in MainWindow.

    I made this workaround to overcome such problem.

    Window=(QWidget*)MainWindow;
    QList<QWidget *> tempList=MainWindow->findChildren<QWidget *>();
    for (int i = 0; i < tempList.size(); ++i) {
    QString oName=tempList.at(i)->metaObject()->className();
    if(oName.compare("QwtPlot")==0)
    varQwt.append(((QwtPlot*)tempList.at(i)));
    }

    Is this a bug present only for the multiaxes branch?

    Regards
    Valentino

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qwt-6.1-multiaxes and findChildren()

    Quote Originally Posted by VALE61 View Post
    Is this a bug present only for the multiaxes branch?
    Should be unrelated to Qwt or any of its branches. The find operation is based on QObject stuff and QwtPlot is one.

    Uwe

Similar Threads

  1. Qwt with multiaxes support - bug?
    By Khaine in forum Qwt
    Replies: 0
    Last Post: 13th April 2016, 21:25
  2. findChildren and sorting
    By ravas in forum Qt Programming
    Replies: 3
    Last Post: 17th December 2015, 19:37
  3. QObject::findChildren() strange behavior
    By folibis in forum Qt Programming
    Replies: 3
    Last Post: 2nd December 2013, 08:06
  4. findChildren<QwtPlot *>()
    By gib in forum Qwt
    Replies: 0
    Last Post: 23rd March 2010, 03:09
  5. QObject::findChildren
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2006, 10:34

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.