コード例 #1
0
ImportItemPropertiesSideBarImport::ImportItemPropertiesSideBarImport(QWidget* const parent,
                                                         SidebarSplitter* const splitter,
                                                         Qt::Edge side,
                                                         bool mimimizedDefault)
    : Sidebar(parent, splitter, side, mimimizedDefault),
      d(new Private)
{
    d->cameraItemTab = new ImportItemPropertiesTab(parent);
    d->metadataTab   = new ItemPropertiesMetadataTab(parent);

    appendTab(d->cameraItemTab, QIcon::fromTheme(QLatin1String("configure")),             i18n("Properties"));
    appendTab(d->metadataTab,   QIcon::fromTheme(QLatin1String("format-text-code")),              i18n("Metadata")); // krazy:exclude=iconnames

#ifdef HAVE_MARBLE
    d->gpsTab        = new ItemPropertiesGPSTab(parent);
    appendTab(d->gpsTab,        QIcon::fromTheme(QLatin1String("globe")), i18n("Geolocation"));
#endif // HAVE_MARBLE

    // ----------------------------------------------------------

    connect(this, SIGNAL(signalChangedTab(QWidget*)),
            this, SLOT(slotChangedTab(QWidget*)));
}
コード例 #2
0
ファイル: katemdi.cpp プロジェクト: azat-archive/kate
  ToolView *Sidebar::addWidget (const QPixmap &icon, const QString &text, ToolView *widget)
  {
    static int id = 0;

    if (widget)
    {
      if (widget->sidebar() == this)
        return widget;

      widget->sidebar()->removeWidget (widget);
    }

    int newId = ++id;

    appendTab (icon, newId, text);

    if (!widget)
    {
      widget = new ToolView (m_mainWin, this, m_ownSplit);
      widget->hide ();
      widget->icon = icon;
      widget->text = text;
    }
    else
    {
      widget->hide ();
      widget->setParent (m_ownSplit);
      widget->m_sidebar = this;
    }

    // save its pos ;)
    widget->persistent = false;

    m_idToWidget.insert (newId, widget);
    m_widgetToId.insert (widget, newId);
    m_toolviews.push_back (widget);

    // widget => size, for correct size restoration after hide/show
    // starts with invalid size
    m_widgetToSize.insert (widget, QSize());

    show ();

    connect(tab(newId), SIGNAL(clicked(int)), this, SLOT(tabClicked(int)));
    tab(newId)->installEventFilter(this);

    return widget;
  }