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. Links and ToolTips per word in QPlainTextEdit
Forum Updated to NodeBB v4.3 + New Features

Links and ToolTips per word in QPlainTextEdit

Scheduled Pinned Locked Moved General and Desktop
qplaintexteditqurlqtooltip
1 Posts 1 Posters 1.2k 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.
  • M Offline
    M Offline
    Mortaneous
    wrote on 13 Apr 2015, 12:45 last edited by
    #1

    I'm trying to design a log / console widget for a text rpg I'm making.
    Currently I'm using the QPlainTextEdit to display everything.
    For new messages I'm using QPlainTextEdit::appendHtml(const QString & html).
    So far it works great for populating with messages from different parts of the app, like Combat messages for example.

    Now I would like to extend it's functionality but I can't for the life of me figure out a simple solution. There are 2 problems that I would like to solve.

    1. Add a tool tip to specific words.
      For example, in a combat situation, user should be able to hover over text like "[Magicarp] attacked with [splash] doing [0 damage]" and get more information for each bracketed text.
    2. Add clickable text (like an anchor in html) and open different dialog windows depending on different types.
      For Example, text like "You find a [Sword] in a block of stone", user should be able to click, and perform an action or open a dialog on the bracketed text.

    I have been searching online and in the forums for days now, and all I can find is to use QTextBrowser and QTextBlock but just can't make an implementation that works, in any way.

    Is there someone that can offer some guidance? A solution, a helpful link, an alternate idea? Much appreciated, thank you.

    P.S. I'm beginner with Qt framework (1 year) and intermediate with C++(about 4 years self taught)

    1 Reply Last reply
    0

    1/1

    13 Apr 2015, 12:45

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved