JKQtExtras
a library of useful Qt widgets and tools
JKQTEURLOpenToolButton Class Reference

specialized QToolButton which takes the contents of its buddy as webpage adress (URL) and opens it in the system's standard application More...

#include <jkqtespecialtoolbutton.h>

Inheritance diagram for JKQTEURLOpenToolButton:
Collaboration diagram for JKQTEURLOpenToolButton:

Public Member Functions

 JKQTEURLOpenToolButton (QWidget *parent=nullptr)
 
virtual ~JKQTEURLOpenToolButton ()
 
QLineEdit * buddy ()
 buddy associated with this button More...
 
const QLineEdit * buddy () const
 buddy associated with this button More...
 
void setBuddy (QLineEdit *b)
 set the buddy widget, which provides the contents More...
 

Protected Slots

void openBuddyContents ()
 opens the contents of the buddy() as URL More...
 

Private Attributes

QLineEdit * m_buddy
 

Detailed Description

specialized QToolButton which takes the contents of its buddy as webpage adress (URL) and opens it in the system's standard application

Usage example:

QLineEdit* lineUrl=new QLineEdit("https://github.com/jkriege2/JKQtExtras", wid);
btnUrl->setBuddy(lineUrl);

Constructor & Destructor Documentation

◆ JKQTEURLOpenToolButton()

JKQTEURLOpenToolButton::JKQTEURLOpenToolButton ( QWidget *  parent = nullptr)

Default constructor

◆ ~JKQTEURLOpenToolButton()

virtual JKQTEURLOpenToolButton::~JKQTEURLOpenToolButton ( )
virtual

Default destructor

Member Function Documentation

◆ buddy() [1/2]

QLineEdit* JKQTEURLOpenToolButton::buddy ( )

buddy associated with this button

◆ buddy() [2/2]

const QLineEdit* JKQTEURLOpenToolButton::buddy ( ) const

buddy associated with this button

◆ openBuddyContents

void JKQTEURLOpenToolButton::openBuddyContents ( )
protectedslot

opens the contents of the buddy() as URL

This internally calls QDesktopServices::openUrl(QUrl(buddyContents,QUrl::TolerantMode));

◆ setBuddy()

void JKQTEURLOpenToolButton::setBuddy ( QLineEdit *  b)

set the buddy widget, which provides the contents

Member Data Documentation

◆ m_buddy

QLineEdit* JKQTEURLOpenToolButton::m_buddy
private

The documentation for this class was generated from the following file:
JKQTEURLOpenToolButton
specialized QToolButton which takes the contents of its buddy as webpage adress (URL) and opens it in...
Definition: jkqtespecialtoolbutton.h:44
JKQTEURLOpenToolButton::setBuddy
void setBuddy(QLineEdit *b)
set the buddy widget, which provides the contents
JKQTEURLOpenToolButton::JKQTEURLOpenToolButton
JKQTEURLOpenToolButton(QWidget *parent=nullptr)