Results 1 to 10 of 10

Thread: QLabel's linkActivated() signal in QT 4.2

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: QLabel's linkActivated() signal in QT 4.2

    actually it should be:
    connect(label_2, SIGNAL(linkActivated(const QString & )), this, SLOT(myslot(const QString &)));

  2. #2
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QLabel's linkActivated() signal in QT 4.2

    Thanks for the help. I'll try it out tonight.

    This is probably a dumb question, but what does the (const QString & ) reference?

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: QLabel's linkActivated() signal in QT 4.2

    From the docs:
    void QLabel::linkActivated ( const QString & link ) [signal]

    This signal is emitted when the user clicks a link. The URL referred to by the anchor is passed in link.

    This function was introduced in Qt 4.2.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QLabel's linkActivated() signal in QT 4.2

    The slot can have no arguments, but I doubt you'll be able to do anything useful then

  5. #5
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QLabel's linkActivated() signal in QT 4.2

    OK. Thanks again. I'm not trying to open a link. I'm filling a QPUListView object with QLabel objects. This would be similar to some of the Task Panel tasks you see on some .Net applications. When the user clicks the label, it needs to emit a signal so the connected slot can be executed. Hopefully the linkActivated signal will work.

  6. #6
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QLabel's linkActivated() signal in QT 4.2

    Thanks Guys. That worked. Once I realized how to set the anchor and link via QT Designer, it worked perfectly.

    Glenn

Similar Threads

  1. Signal and slots
    By villy in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2007, 10:10
  2. Replies: 2
    Last Post: 17th May 2006, 21:01
  3. no such signal QListBox::currentChanged()
    By jopie bakker in forum Newbie
    Replies: 2
    Last Post: 2nd March 2006, 15:17
  4. send signal from QCombobox
    By raphaelf in forum Qt Programming
    Replies: 22
    Last Post: 28th February 2006, 14:18
  5. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.