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. Best technique for this case

Best technique for this case

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.0k 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.
  • F Offline
    F Offline
    FujuMazzr
    wrote on last edited by FujuMazzr
    #1

    I need options to solve this problem: I want to support several domains in order to grab a few information on them, for example: CNN, USA Today, NY Times, Fox News and so on.
    Imagine that the user has a link to one of the networks listed above, and he puts it in a QLineEdit and press the button to submit, I want the application to parse the address and find who can handle that domain. I though of using the plugin system in order to register the handlers for the domains, but I don't know how to determinate who can handle who and call the right one.

    Is there a way to create handlers for each domain and determine who can handle the domain?

    Thank you.

    F 1 Reply Last reply
    0
    • F FujuMazzr

      I need options to solve this problem: I want to support several domains in order to grab a few information on them, for example: CNN, USA Today, NY Times, Fox News and so on.
      Imagine that the user has a link to one of the networks listed above, and he puts it in a QLineEdit and press the button to submit, I want the application to parse the address and find who can handle that domain. I though of using the plugin system in order to register the handlers for the domains, but I don't know how to determinate who can handle who and call the right one.

      Is there a way to create handlers for each domain and determine who can handle the domain?

      Thank you.

      F Offline
      F Offline
      FujuMazzr
      wrote on last edited by
      #2

      Someone can help me here, please?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mcosta
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        I think your question is too generic; anyway you could use QUrl to parse the user input and detect the domain.

        Are you trying to implement a feed reader?

        Once your problem is solved don't forget to:

        • Mark the thread as SOLVED using the Topic Tool menu
        • Vote up the answer(s) that helped you to solve the issue

        You can embed images using (http://imgur.com/) or (http://postimage.org/)

        F 1 Reply Last reply
        0
        • M mcosta

          Hi and welcome to devnet,

          I think your question is too generic; anyway you could use QUrl to parse the user input and detect the domain.

          Are you trying to implement a feed reader?

          F Offline
          F Offline
          FujuMazzr
          wrote on last edited by
          #4

          @mcosta I think that I found what I was looking for, it's the chain of responsibility pattern, the only thing missing is how to return a value in a chain if the handler can handle and return an error if no handler can handle the network. Is this a case for use QVariant?

          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