Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Linked text in an application?

Linked text in an application?

Scheduled Pinned Locked Moved Language Bindings
3 Posts 2 Posters 4.2k Views
  • 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.
  • B Offline
    B Offline
    BadOmen
    wrote on last edited by
    #1

    Hi
    I am going to use pyside for this, this is my first QT app. I have just looked at pyside and Qt and just made little tests with PyQT before I found PySide, not installed it yet. Need to know if this is possible first :)

    What I want to do is an application to use in a linux based PC and have the ability to port it to other platforms with not that much changes. (The last part is not really important to me)

    So to my questions...

    I want the user to be able to make a part of there text clickable as an link, underscored text working as a button. I want it to be done by a right mouse button menu. The marked text will be the link and used as a key in a dictionary to show what it is linked to.
    Is it possible to do that, make a part of the text underscored and work as a button?

    As I see it the user must be able to switch between edit and view mode to make the link clickable, what do I use to show a clickable text?

    I also want the user to have the ability to do the opposite, right click on the link and remove it but keeping the text. Would it be possible?

    And if the user removes the key from the dictionary it will trigger a function that searches through the text and removes the link corresponding with the dictionary key but keeps the text.
    Would it be possible to do that?

    Is there some example code for doing this with pyside?

    Can someone tell me what I need to read up on and point me in the right direction?

    Thanks in advanced.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Yes, you can use hyperlinks in the different widget that can display rich text. You can use QLabel for instance (see QLabel::linkActivated() and QLabel::linkHovered()), but a QTextBrowser can do it too (QTextBrowser::anchorClicked()).

      Seeing how you want to make the user edit the links, perhaps using QTextEdit and/or a QTextBrowser is the best place to start.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BadOmen
        wrote on last edited by
        #3

        Thank you very much :D

        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