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. Returning a value passed to a constructor
Forum Updated to NodeBB v4.3 + New Features

Returning a value passed to a constructor

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 903 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.
  • N Offline
    N Offline
    nicky j
    wrote on last edited by
    #1

    Hey there,

    I am having trouble figuring out how to return a value passed to a constructor.

    Heres my code:
    @NBhistoryItem::NBhistoryItem( QString hurl, const QDateTime &hdatetime, const QString &htitle)
    {

    }

    QString NBhistoryItem::url()
    {
    //return the QString hurl parameter.
    }@

    As you can see, I need url() to return the value of the QString hurl parameter in the class constructor.

    Thanks!

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kenchan
      wrote on last edited by
      #2

      So don't you remember the hurl value as member data in your class?

      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