File indexing completed on 2024-04-28 16:30:28

0001 /***************************************************************************
0002  * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr
0003  * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  ***************************************************************************/
0006 /** @file
0007  * A tree view with more features (qt designer plugin).
0008  *
0009  * @author Stephane MANKOWSKI / Guillaume DE BURE
0010  */
0011 #include "skgtreeviewdesignerplugin.h"
0012 
0013 #include <qicon.h>
0014 
0015 #include "skgtreeview.h"
0016 
0017 SKGTreeViewDesignerPlugin::SKGTreeViewDesignerPlugin(QObject* iParent)
0018     : QObject(iParent)
0019 {
0020     m_initialized = false;
0021 }
0022 
0023 void SKGTreeViewDesignerPlugin::initialize(QDesignerFormEditorInterface*  iCore)
0024 {
0025     Q_UNUSED(iCore)
0026     if (m_initialized) {
0027         return;
0028     }
0029 
0030     m_initialized = true;
0031 }
0032 
0033 bool SKGTreeViewDesignerPlugin::isInitialized() const
0034 {
0035     return m_initialized;
0036 }
0037 
0038 QWidget* SKGTreeViewDesignerPlugin::createWidget(QWidget* iParent)
0039 {
0040     return new SKGTreeView(iParent);
0041 }
0042 
0043 QString SKGTreeViewDesignerPlugin::name() const
0044 {
0045     return QStringLiteral("SKGTreeView");
0046 }
0047 
0048 QString SKGTreeViewDesignerPlugin::group() const
0049 {
0050     return QStringLiteral("SKG Widgets");
0051 }
0052 
0053 QIcon SKGTreeViewDesignerPlugin::icon() const
0054 {
0055     return SKGServices::fromTheme(QStringLiteral("quickopen"));
0056 }
0057 
0058 QString SKGTreeViewDesignerPlugin::toolTip() const
0059 {
0060     return QStringLiteral("A tree view with more features");
0061 }
0062 
0063 QString SKGTreeViewDesignerPlugin::whatsThis() const
0064 {
0065     return QStringLiteral("A tree view with more features");
0066 }
0067 
0068 bool SKGTreeViewDesignerPlugin::isContainer() const
0069 {
0070     return true;
0071 }
0072 
0073 QString SKGTreeViewDesignerPlugin::domXml() const
0074 {
0075     return QStringLiteral("<widget class=\"SKGTreeView\" name=\"SKGTreeView\">\n"
0076                           " <property name=\"geometry\">\n"
0077                           "  <rect>\n"
0078                           "   <x>0</x>\n"
0079                           "   <y>0</y>\n"
0080                           "   <width>100</width>\n"
0081                           "   <height>100</height>\n"
0082                           "  </rect>\n"
0083                           " </property>\n"
0084                           "</widget>\n");
0085 }
0086 
0087 QString SKGTreeViewDesignerPlugin::includeFile() const
0088 {
0089     return QStringLiteral("skgtreeview.h");
0090 }
0091