Results 1 to 16 of 16

Thread: Qt Function doesn't work And there is no error

Hybrid View

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

    Default Re: Qt Function doesn't work And there is no error

    Have you looked at the value of CreationTime inside that function?
    Is it a valid QDate object?

    E.g.
    Qt Code:
    1. QString getCreationDate() const
    2. {
    3. qDebug() << Q_FUNC_INFO << CreationTime;
    4. return CreationTime.toString("dd/MM/yyyy"); //this one don't
    5. }
    To copy to clipboard, switch view to plain text mode 
    Or with the debugger.

    Cheers,
    _

  2. #2
    Join Date
    Feb 2016
    Posts
    11
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt Function doesn't work And there is no error

    @anda_skoa

    well i never tried the qdebug before, however when i did what you said, CreationTime doesn't have anything in it ( "" ) .

    thats the QDebug message => class QString __cdecl Counter::getCreationDate(void) const QDate("")

    so i changed this

    Qt Code:
    1. pCounters.push_back(Counter(text2,0,true));
    To copy to clipboard, switch view to plain text mode 
    to

    Qt Code:
    1. pCounters.push_back(Counter(text2,0,true,QDate::currentDate())); //i thought this maybe the problem as Qt doesn't like my defaults
    To copy to clipboard, switch view to plain text mode 

    but still the variable don't get anything even though i explicitly passed the date to it.
    Last edited by eyad; 23rd February 2016 at 14:03. Reason: added the qdebug message

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

    Default Re: Qt Function doesn't work And there is no error

    Since your member and your constructor argument have the same name, have you tried different names?

    Cheers,
    _

  4. #4
    Join Date
    Feb 2016
    Posts
    11
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt Function doesn't work And there is no error

    i tried this after reading you reply.
    but it didn't change a thing.....

    i may give you the whole solution if you want , its a small program after all (2 headers , 1 cpp , 1 ui) 56kb total
    thats how desperate iam....

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

    Default Re: Qt Function doesn't work And there is no error

    Attaching the program would definitely be useful.

    Cheers,
    _

Similar Threads

  1. Replies: 10
    Last Post: 3rd February 2015, 21:24
  2. Replies: 15
    Last Post: 23rd December 2013, 07:38
  3. Replies: 3
    Last Post: 1st May 2013, 21:44
  4. why on Linux ,doesn't work?
    By maider in forum Qt Programming
    Replies: 5
    Last Post: 11th March 2010, 09:57
  5. qSort doesn't work with member function
    By ber_44 in forum Qt Programming
    Replies: 10
    Last Post: 2nd June 2007, 13:00

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
  •  
Qt is a trademark of The Qt Company.