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. To Read Multiple lines on PushButton click.d
QtWS25 Last Chance

To Read Multiple lines on PushButton click.d

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.1k 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
    bmps
    wrote on last edited by
    #1

    I have a Push button that is supposed to display the entire GPL 3.0 on its click. But i dont know how to add multiple lines in a string. Could someone help me out here.
    I have previously used the settext for the button slot and added strings. But how do i add the 100's of lines of the License???

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on last edited by
      #2

      What is your intent to put the text in push button ?
      "QLabel::text":http://doc.qt.nokia.com/stable/qlabel.html#text-prop has a lot of possibilities

      edit: For large documents, use "QTextEdit":http://doc.qt.nokia.com/stable/qtextedit.html in read-only mode instead

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

        Its this entire piece of text i want to put there.http://www.opensource.org/licenses/GPL-3.0 And i already have a text edit box for that. The push button is just supposed to display this huge text in the text edit box when clicked.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cincirin
          wrote on last edited by
          #4

          The simplest example would be to save the entire "GPL-3.0":http://www.opensource.org/licenses/GPL-3.0 into resource file. When button is clicked, read the file, and put the "plain text":http://doc.qt.nokia.com/stable/qtextedit.html#plainText-prop into QTextEdit

          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