• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • variableeditor
katehelpbutton.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2011 Dominik Haumann <dhaumann kde org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #include "katehelpbutton.h"
22 
23 #include <kiconloader.h>
24 #include <ktoolinvocation.h>
25 #include <klocale.h>
26 
27 KateHelpButton::KateHelpButton(QWidget* parent)
28  : QToolButton(parent)
29 {
30  setAutoRaise(true);
31  setIconState(IconColored);
32  setToolTip(i18n("Kate Handbook."));
33 
34  connect(this, SIGNAL(clicked()), SLOT(invokeHelp()));
35 }
36 
37 KateHelpButton::~KateHelpButton()
38 {
39 }
40 
41 void KateHelpButton::setIconState(IconState state)
42 {
43  if (state == IconGrayscaled) {
44  setIcon(SmallIcon("help-contents", 0, KIconLoader::DisabledState));
45  } else if (state == IconHidden) {
46  setIcon(QIcon());
47  } else {
48  setIcon(SmallIcon("help-contents", 0, KIconLoader::DefaultState));
49  }
50 
51  update();
52 }
53 
54 void KateHelpButton::invokeHelp()
55 {
56  KToolInvocation::invokeHelp(m_section, "kate");
57 }
58 
59 void KateHelpButton::setSection(const QString& section)
60 {
61  m_section = section;
62 }
63 
64 
65 // kate: indent-width 2; replace-tabs on;
KateHelpButton::KateHelpButton
KateHelpButton(QWidget *parent=0)
Definition: katehelpbutton.cpp:27
QWidget
Kate::Script::i18n
QScriptValue i18n(QScriptContext *context, QScriptEngine *engine)
i18n("text", arguments [optional])
Definition: katescripthelpers.cpp:186
katehelpbutton.h
KateHelpButton::setSection
void setSection(const QString &section)
Definition: katehelpbutton.cpp:59
KateHelpButton::IconHidden
Definition: katehelpbutton.h:34
KateHelpButton::invokeHelp
void invokeHelp()
Definition: katehelpbutton.cpp:54
QAbstractButton::setIcon
void setIcon(const QIcon &icon)
KateHelpButton::setIconState
void setIconState(IconState state)
Definition: katehelpbutton.cpp:41
QWidget::update
void update()
KateHelpButton::~KateHelpButton
virtual ~KateHelpButton()
Definition: katehelpbutton.cpp:37
QAbstractButton::clicked
void clicked(bool checked)
QString
QToolButton::setAutoRaise
void setAutoRaise(bool enable)
QToolButton
KateHelpButton::IconGrayscaled
Definition: katehelpbutton.h:33
QWidget::setToolTip
void setToolTip(const QString &)
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
KateHelpButton::IconColored
Definition: katehelpbutton.h:32
QIcon
KateHelpButton::IconState
IconState
Definition: katehelpbutton.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal