Page 2 of 2 FirstFirst 12
Results 21 to 31 of 31

Thread: Is this a Qt5 bug

  1. #21
    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: Is this a Qt5 bug

    I am confused now. I thought the problem was that an empty string was not applied, but now it is about incorrect number of whitespaces?

    Cheers,
    _

  2. #22
    Join Date
    Feb 2013
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is this a Qt5 bug

    that does not explain why the designer handles an empty string correctly, but quiloader not!

    regards

    anda, it is about an empty string, the number of blancs is not important

    regards

  3. #23
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is this a Qt5 bug

    Quote Originally Posted by acmezger View Post
    that does not explain why the designer handles an empty string correctly, but quiloader not!
    "Correctly" is a relative term.

    anda, it is about an empty string, the number of blancs is not important
    Now I'm confused. So you say QUiLoader should call your method to replace the empty string with an empty string? That's not really how the property system works. If you are relying on such behavior then you are abusing the system. Property setters are for changing property values, not for something else. If you want to do some initialization or something like that, better do it either in the constructor or using QMetaObject::invokeMethod(..., Qt::QueuedConnection) to execute some code after the flow returns to the event loop.

    Could you try to explain to us what your method is doing and why?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #24
    Join Date
    Feb 2013
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is this a Qt5 bug

    in my custom widget I initialize the property to a non-empty string. with the designer I construct my custom widget by emptying the string. This is reflected in the ui file. When I then load in my application with quiloader.load the routine responsible for setting this property is not called in qt5.1 but called in qt4.8

    regards

  5. #25
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is this a Qt5 bug

    And why are you doing that?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #26
    Join Date
    Feb 2013
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is this a Qt5 bug

    my custom widget needs a default non-empty string that can be emptied by the user . in principle that should not matter

    regards

  7. #27
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is this a Qt5 bug

    If you're not willing to share more information, then I can't help you, sorry.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #28
    Join Date
    Feb 2013
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is this a Qt5 bug

    carowcolmenu.cppcarowcolmenu.hcarelateddisplay.cppcarelateddisplay.h
    I can do not more than give you these attachments of a custom widget
    Last edited by acmezger; 22nd August 2013 at 10:55. Reason: updated contents

  9. #29
    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: Is this a Qt5 bug

    Quote Originally Posted by acmezger View Post
    that does not explain why the designer handles an empty string correctly, but quiloader not!
    Indeed.

    Quote Originally Posted by acmezger View Post
    anda, it is about an empty string, the number of blancs is not important
    Right. With the recent discussion on spaces I wasn't sure anymore if we were talking about empty strings or non-empty string with whitespace only.

    Lets be sure
    You have a widget like this
    Qt Code:
    1. class Widget : public QWidget
    2. {
    3. Q_OBJECT
    4. Q_PROPERTY(QString text READ text WRITE setText)
    5.  
    6. public:
    7. explicit Widget(QWidget *parent = 0) : QWidget(parent), m_text("foo") {}
    8.  
    9. void setText(const QString &text) { m_text = text; }
    10. QString text() const { return m_text;}
    11.  
    12. private:
    13. QString m_text;
    14. };
    To copy to clipboard, switch view to plain text mode 

    And what you expect to happen is something like this (using QtTest syntax)
    Qt Code:
    1. Widget *w = new Widget;
    2. QVERIFY(!w->text().isEmpty());
    3.  
    4. w->setProperty("text", QString());
    5. QVERIFY(w->text().isEmpty());
    To copy to clipboard, switch view to plain text mode 

    Only that creation and setProperty() call should have been done by the QUiLoader, right?

    Cheers,
    _

  10. #30
    Join Date
    Feb 2013
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is this a Qt5 bug

    yes, that is it. A better idea you can get through the sources a attached before

    regards

  11. #31
    Join Date
    Feb 2013
    Posts
    22
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is this a Qt5 bug

    Folks,

    this is really a bug in QFormLoader and has been solved by the Qt-Gurus. see bug 33130

    thanks to you all participating

    regards

    Anton

Tags for this Thread

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.