Пример #1
0
EnfuseStackList::EnfuseStackList(QWidget* const parent)
    : QTreeWidget(parent),
      d(new Private)
{
    d->progressTimer = new QTimer(this);

    setContextMenuPolicy(Qt::CustomContextMenu);
    setIconSize(QSize(64, 64));
    setSelectionMode(QAbstractItemView::SingleSelection);
    setSortingEnabled(false);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(false);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setColumnCount(3);
    setHeaderHidden(false);
    setDragEnabled(false);
    header()->setSectionResizeMode(QHeaderView::Stretch);

    QStringList labels;
    labels.append( i18nc("@title:column Saving checkbox", "Include during Saving") );
    labels.append( i18nc("@title:column Output file name", "Output") );
    labels.append( i18nc("@title:column Source file names", "Selected Inputs") );
    setHeaderLabels(labels);

    connect(this, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotItemClicked(QTreeWidgetItem*)));

    connect(this, SIGNAL(customContextMenuRequested(QPoint)),
            this, SLOT(slotContextMenu(QPoint)));

    connect(d->progressTimer, SIGNAL(timeout()),
            this, SLOT(slotProgressTimerDone()));
}
Пример #2
0
//----------------------------------------------------------------------------------------
OfsTreeWidget::OfsTreeWidget(QWidget *parent, unsigned int capabilities, QStringList initialSelection) : QTreeWidget(parent), mCapabilities(capabilities) 
{
    mSelectedItems = initialSelection;
    mRecycleBinParent = NULL;

    setColumnCount(1);
    setHeaderHidden(true);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setSelectionBehavior(QAbstractItemView::SelectItems);
    setContextMenuPolicy(Qt::CustomContextMenu);
    setDragDropOverwriteMode(false);
    setAutoScroll(true);
    
    if(capabilities & CAP_ALLOW_DROPS)
        setDragDropMode(QAbstractItemView::DragDrop);

    mUnknownFileIcon = mOgitorMainWindow->mIconProvider.icon(QFileIconProvider::File);

    mFile = Ogitors::OgitorsRoot::getSingletonPtr()->GetProjectFile();
    mFile->addTrigger(this, OFS::_OfsBase::CLBK_CREATE, &triggerCallback);
    mFile->addTrigger(this, OFS::_OfsBase::CLBK_DELETE, &triggerCallback);

    refreshWidget();

    mAddFilesThread = new AddFilesThread();
    mExtractorThread = new ExtractorThread();
    connect(mAddFilesThread, SIGNAL(finished()), this, SLOT(threadFinished()));
    connect(mExtractorThread, SIGNAL(finished()), this, SLOT(threadFinished()));
}
BracketStackList::BracketStackList(Interface* iface, QWidget* parent)
                : QTreeWidget(parent), d(new BracketStackListPriv)
{
    d->iface = iface;

    setIconSize(QSize(64, 64));
    setSelectionMode(QAbstractItemView::SingleSelection);
    setSortingEnabled(true);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(false);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setColumnCount(3);
    setHeaderHidden(false);
    setDragEnabled(false);
    header()->setResizeMode(QHeaderView::Stretch);

    QStringList labels;
    labels.append( i18n("To process") );
    labels.append( i18n("File Name") );
    labels.append( i18n("Exposure (EV)") );
    setHeaderLabels(labels);

    if (d->iface)
    {
        connect(d->iface, SIGNAL(gotThumbnail(KUrl,QPixmap)),
                this, SLOT(slotThumbnail(KUrl,QPixmap)));
    }

    d->loadRawThumb = new KPRawThumbThread(this);

    connect(d->loadRawThumb, SIGNAL(signalRawThumb(KUrl,QImage)),
            this, SLOT(slotRawThumb(KUrl,QImage)));

    sortItems(2, Qt::DescendingOrder);
}
Пример #4
0
QompPluginTreeView::QompPluginTreeView(QWidget *parent) :
	QTreeView(parent)
{
	setHeaderHidden(true);
	setItemsExpandable(true);
	setUniformRowHeights(true);
}
Пример #5
0
START_NS

ModelViewReadOnly::ModelViewReadOnly(QWidget * parent):
	TreeView(parent)
{
	setHeaderHidden(true);
	//header()->setResizeMode(QHeaderView::Stretch);
	setRootIsDecorated(false);
	setIndentation(0);
	setExpandsOnDoubleClick(true);
	setItemDelegateForColumn(0, new ModelTreeDelegate());
	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);

	setSelectionMode( SingleSelection );
	setSelectionBehavior(SelectRows);
	// we disable the provided dnd features,
	// as we use a proprietary solution
	setDragDropMode(QAbstractItemView::DragDrop);
	setDragEnabled(true);
	setAcceptDrops(false);


	overlay()->setText(tr("Please load a model"));

	connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(__clicked(QModelIndex)));
}
Пример #6
0
AppMenuView::AppMenuView(QWidget* parent):
  model_(new QStandardItemModel()),
  menu_cache(NULL),
  menu_cache_reload_notify(NULL),
  QTreeView(parent) {

  setHeaderHidden(true);
  setSelectionMode(SingleSelection);

  // initialize model
  // TODO: share one model among all app menu view widgets
  // ensure that we're using lxmenu-data (FIXME: should we do this?)
  QByteArray oldenv = qgetenv("XDG_MENU_PREFIX");
  qputenv("XDG_MENU_PREFIX", "lxde-");
  menu_cache = menu_cache_lookup("applications.menu");
  // if(!oldenv.isEmpty())
  qputenv("XDG_MENU_PREFIX", oldenv); // restore the original value if needed

  if(menu_cache) {
    MenuCacheDir* dir = menu_cache_dup_root_dir(menu_cache);
    menu_cache_reload_notify = menu_cache_add_reload_notify(menu_cache, _onMenuCacheReload, this);
    if(dir) { /* content of menu is already loaded */
      addMenuItems(NULL, dir);
      menu_cache_item_unref(MENU_CACHE_ITEM(dir));
    }
  }
  setModel(model_);
  connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SIGNAL(selectionChanged()));
  selectionModel()->select(model_->index(0, 0), QItemSelectionModel::SelectCurrent);
}
Пример #7
0
EnfuseStackList::EnfuseStackList(QWidget* parent)
               : QTreeWidget(parent), d(new EnfuseStackListPriv)
{
    d->progressTimer = new QTimer(this);

    setContextMenuPolicy(Qt::CustomContextMenu);
    setIconSize(QSize(64, 64));
    setSelectionMode(QAbstractItemView::SingleSelection);
    setSortingEnabled(false);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(false);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setColumnCount(3);
    setHeaderHidden(false);
    setDragEnabled(false);
    header()->setResizeMode(QHeaderView::Stretch);

    QStringList labels;
    labels.append( i18n("To Save") );
    labels.append( i18n("Target") );
    labels.append( i18n("Inputs") );
    setHeaderLabels(labels);

    connect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)),
            this, SLOT(slotItemClicked(QTreeWidgetItem*)));

    connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
            this, SLOT(slotContextMenu(const QPoint&)));

    connect(d->progressTimer, SIGNAL(timeout()),
            this, SLOT(slotProgressTimerDone()));
}
DisplayTypeTree::DisplayTypeTree()
{
  setHeaderHidden( true );

  connect(this, SIGNAL( currentItemChanged( QTreeWidgetItem*, QTreeWidgetItem* )),
          this, SLOT( onCurrentItemChanged( QTreeWidgetItem*, QTreeWidgetItem* )));
}
Пример #9
0
SideBarView::SideBarView ( QWidget* parent ) : QTreeView(parent), _model(NULL) {
    installEventFilter(this);

    _model = new SideBarModel(this);
    
    setModel(_model);
    setItemsExpandable(true);
    setHeaderHidden(true);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setContextMenuPolicy(Qt::CustomContextMenu);
    setItemDelegate(new SideBarDelegate(this));
    expandAll();
    
    connect(ArenaWidgetManager::getInstance(), SIGNAL(activated(ArenaWidget*)), this,   SLOT(activated(ArenaWidget*)));
    connect(ArenaWidgetManager::getInstance(), SIGNAL(added(ArenaWidget*)),     this,   SLOT(added(ArenaWidget*)));
    connect(ArenaWidgetManager::getInstance(), SIGNAL(removed(ArenaWidget*)),   this,   SLOT(removed(ArenaWidget*)));
    connect(ArenaWidgetManager::getInstance(), SIGNAL(activated(ArenaWidget*)), _model, SLOT(mapped(ArenaWidget*)));
    connect(ArenaWidgetManager::getInstance(), SIGNAL(toggled(ArenaWidget*)),   _model, SLOT(toggled(ArenaWidget*)));
    connect(ArenaWidgetManager::getInstance(), SIGNAL(updated(ArenaWidget*)),   _model, SLOT(updated(ArenaWidget*)));
    
    connect(this, SIGNAL(doubleClicked(QModelIndex)),           this,   SLOT(slotSideBarDblClicked(QModelIndex)));
    connect(this, SIGNAL(customContextMenuRequested(QPoint)),   this,   SLOT(slotSidebarContextMenu()));
    connect(this, SIGNAL(clicked(QModelIndex)),                 this,   SLOT(slotSidebarHook(QModelIndex)));
    connect(this, SIGNAL(clicked(QModelIndex)),                 _model, SLOT(slotIndexClicked(QModelIndex)));
   
    
    connect(GlobalTimer::getInstance(), SIGNAL(second()), _model, SLOT(redraw()));
    
    connect(_model,    SIGNAL(mapWidget(ArenaWidget*)),     ArenaWidgetManager::getInstance(),  SLOT(activate(ArenaWidget*)));
    connect(_model,    SIGNAL(selectIndex(QModelIndex)),    this,                               SLOT(slotWidgetActivated(QModelIndex)));
}
Пример #10
0
CategoryFilterWidget::CategoryFilterWidget(QWidget *parent)
    : QTreeView(parent)
{
    auto *proxyModel = new CategoryFilterProxyModel(this);
    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    proxyModel->setSourceModel(new CategoryFilterModel(this));
    setModel(proxyModel);
    setFrameShape(QFrame::NoFrame);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    setUniformRowHeights(true);
    setHeaderHidden(true);
    setIconSize(Utils::Gui::smallIconSize());
#ifdef Q_OS_MAC
    setAttribute(Qt::WA_MacShowFocusRect, false);
#endif
    m_defaultIndentation = indentation();
    if (!BitTorrent::Session::instance()->isSubcategoriesEnabled())
        setIndentation(0);
    setContextMenuPolicy(Qt::CustomContextMenu);
    sortByColumn(0, Qt::AscendingOrder);
    setCurrentIndex(model()->index(0, 0));

    connect(this, &QTreeView::collapsed, this, &CategoryFilterWidget::callUpdateGeometry);
    connect(this, &QTreeView::expanded, this, &CategoryFilterWidget::callUpdateGeometry);
    connect(this, &QWidget::customContextMenuRequested, this, &CategoryFilterWidget::showMenu);
    connect(selectionModel(), &QItemSelectionModel::currentRowChanged
            , this, &CategoryFilterWidget::onCurrentRowChanged);
    connect(model(), &QAbstractItemModel::modelReset, this, &CategoryFilterWidget::callUpdateGeometry);
}
Пример #11
0
QtTreeWidget::QtTreeWidget(UIEventStream* eventStream, SettingsProvider* settings, MessageTarget messageTarget, QWidget* parent) : QTreeView(parent),  eventStream_(eventStream), settings_(settings), messageTarget_(messageTarget) {
    model_ = new RosterModel(this, settings_->getSetting(QtUISettingConstants::USE_SCREENREADER));
    setModel(model_);
    delegate_ = new RosterDelegate(this, settings_->getSetting(QtUISettingConstants::COMPACT_ROSTER));
    setItemDelegate(delegate_);
    setHeaderHidden(true);
#ifdef SWIFT_PLATFORM_MACOSX
    setAlternatingRowColors(true);
#endif
    setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    expandAll();
    setAnimated(true);
    setIndentation(0);
#ifdef SWIFT_EXPERIMENTAL_FT
    setAcceptDrops(true);
#endif
    setDragEnabled(true);
    setRootIsDecorated(true);
    connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(handleItemActivated(const QModelIndex&)));
    connect(model_, SIGNAL(itemExpanded(const QModelIndex&, bool)), this, SLOT(handleModelItemExpanded(const QModelIndex&, bool)));
    connect(this, SIGNAL(expanded(const QModelIndex&)), this, SLOT(handleExpanded(const QModelIndex&)));
    connect(this, SIGNAL(collapsed(const QModelIndex&)), this, SLOT(handleCollapsed(const QModelIndex&)));
    connect(this, SIGNAL(clicked(const QModelIndex&)), this, SLOT(handleClicked(const QModelIndex&)));

    settings_->onSettingChanged.connect(boost::bind(&QtTreeWidget::handleSettingChanged, this, _1));

    QFont lato = font();
    lato.setFamily("Lato");
    setFont(lato);
}
Пример #12
0
CategoryFilterWidget::CategoryFilterWidget(QWidget *parent)
    : QTreeView(parent)
{
    CategoryFilterProxyModel *proxyModel = new CategoryFilterProxyModel(this);
    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    proxyModel->setSourceModel(new CategoryFilterModel(this));
    setModel(proxyModel);
    setFrameShape(QFrame::NoFrame);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    setUniformRowHeights(true);
    setHeaderHidden(true);
    setIconSize(Utils::Misc::smallIconSize());
#if defined(Q_OS_MAC)
    setAttribute(Qt::WA_MacShowFocusRect, false);
#endif
    setContextMenuPolicy(Qt::CustomContextMenu);
    sortByColumn(0, Qt::AscendingOrder);
    setCurrentIndex(model()->index(0, 0));

    connect(this, SIGNAL(collapsed(QModelIndex)), SLOT(callUpdateGeometry()));
    connect(this, SIGNAL(expanded(QModelIndex)), SLOT(callUpdateGeometry()));
    connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showMenu(QPoint)));
    connect(selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex))
            , SLOT(onCurrentRowChanged(QModelIndex,QModelIndex)));
    connect(model(), SIGNAL(modelReset()), SLOT(callUpdateGeometry()));
}
Пример #13
0
ProgressTreeView::ProgressTreeView( QWidget* parent )
    : QTreeView( parent )
{
    s_instance = this; //FIXME: should assert when s_instance gets written and it wasn't nullptr

    setFrameShape( QFrame::NoFrame );
    setContentsMargins( 0, 0, 0, 0 );

    setHeaderHidden( true );
    setRootIsDecorated( true );
    setExpandsOnDoubleClick( true );

    setSelectionMode( QAbstractItemView::NoSelection );
    setDragDropMode( QAbstractItemView::NoDragDrop );
    setAcceptDrops( false );
    setUniformRowHeights( false );

    setIndentation( 0 );
    setSortingEnabled( false );

    m_delegate = new ProgressTreeDelegate( this );
    setItemDelegate( m_delegate );

    QPalette plt = palette();
    plt.setColor( QPalette::Base, Calamares::Branding::instance()->
        styleString( Calamares::Branding::SidebarBackground ) );
    setPalette( plt );
}
Пример #14
0
/*!
 * \brief SimulationOutputTree::SimulationOutputTree
 * \param pSimulationOutputWidget
 */
SimulationOutputTree::SimulationOutputTree(SimulationOutputWidget *pSimulationOutputWidget)
  : QTreeView(pSimulationOutputWidget), mpSimulationOutputWidget(pSimulationOutputWidget)
{
  setItemDelegate(new ItemDelegate(this, true));
  setTextElideMode(Qt::ElideNone);
  setIndentation(Helper::treeIndentation);
  setExpandsOnDoubleClick(false);
  setHeaderHidden(true);
  setMouseTracking(true); /* important for Debug more links. */
  setSelectionMode(QAbstractItemView::ExtendedSelection);
  setContextMenuPolicy(Qt::CustomContextMenu);
  connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showContextMenu(QPoint)));
  connect(header(), SIGNAL(sectionResized(int,int,int)), SLOT(callLayoutChanged(int,int,int)));
  // create actions
  mpSelectAllAction = new QAction(tr("Select All"), this);
  mpSelectAllAction->setShortcut(QKeySequence("Ctrl+a"));
  mpSelectAllAction->setStatusTip(tr("Selects all the Messages"));
  connect(mpSelectAllAction, SIGNAL(triggered()), SLOT(selectAllMessages()));
  mpCopyAction = new QAction(QIcon(":/Resources/icons/copy.svg"), Helper::copy, this);
  mpCopyAction->setShortcut(QKeySequence("Ctrl+c"));
  mpCopyAction->setStatusTip(tr("Copy the Message"));
  connect(mpCopyAction, SIGNAL(triggered()), SLOT(copyMessages()));
  mpExpandAllAction = new QAction(Helper::expandAll, this);
  mpExpandAllAction->setStatusTip(tr("Copy the Message"));
  connect(mpExpandAllAction, SIGNAL(triggered()), SLOT(expandAll()));
  mpCollapseAllAction = new QAction(Helper::collapseAll, this);
  mpCollapseAllAction->setStatusTip(tr("Copy the Message"));
  connect(mpCollapseAllAction, SIGNAL(triggered()), SLOT(collapseAll()));
}
/**
 * @brief Creates an empty dialogs tree view.
 * @param parent The parent object or nullptr.
 */
DialogsTreeView::DialogsTreeView(QWidget* parent) :
  QTreeView(parent),
  model(nullptr) {

  setSelectionMode(QAbstractItemView::SingleSelection);
  setHeaderHidden(true);

  create_action = new QAction(
        QIcon(":/images/icon_add.png"), tr("New dialog..."), this);
  connect(create_action, SIGNAL(triggered()),
          this, SIGNAL(create_dialog_requested()));
  addAction(create_action);

  duplicate_action = new QAction(
        QIcon(":/images/icon_copy.png"), tr("Duplicate dialog(s)..."), this);
  connect(duplicate_action, SIGNAL(triggered()),
          this, SIGNAL(duplicate_dialog_requested()));
  addAction(duplicate_action);

  set_id_action = new QAction(
        QIcon(":/images/icon_rename.png"), tr("Change id..."), this);
  set_id_action->setShortcut(tr("F2"));
  set_id_action->setShortcutContext(Qt::WidgetShortcut);
  connect(set_id_action, SIGNAL(triggered()),
          this, SIGNAL(set_dialog_id_requested()));
  addAction(set_id_action);

  delete_action = new QAction(
        QIcon(":/images/icon_delete.png"), tr("Delete..."), this);
  delete_action->setShortcut(QKeySequence::Delete);
  delete_action->setShortcutContext(Qt::WidgetShortcut);
  connect(delete_action, SIGNAL(triggered()),
          this, SIGNAL(delete_dialog_requested()));
  addAction(delete_action);
}
Пример #16
0
configTreeView::configTreeView(DomCfgItem *config,QWidget *parent):QTreeView(parent)
{
	QAbstractItemModel *data = new ananasListViewModel(config,parent);
	QItemSelectionModel *selections = new QItemSelectionModel(data);
	m_tabEditors=0;
	//QTreeView *mdtree = new QTreeView;
	setModel(data);
	setHeaderHidden(true);
	setSelectionModel(selections);
	setUniformRowHeights(true);
	header()->setStretchLastSection(false);
	viewport()->setAttribute(Qt::WA_StaticContents);
	header()->setResizeMode(QHeaderView::Stretch);
	setAttribute(Qt::WA_MacShowFocusRect, false);
	setContextMenuPolicy(Qt::CustomContextMenu);
	setWindowFlags(Qt::Widget);
connect(this,
            SIGNAL( customContextMenuRequested(const QPoint &) ),
            this,SLOT(showmenu(const QPoint &)));
connect(this,SIGNAL(doubleClicked ( const QModelIndex & )),this,SLOT(doubleClicked ( const QModelIndex & )));
	m_tabStopWidth = 4;
	m_lineNumbers = m_selectionBorder = m_autoIndent = m_cppHighlighter = true;
	crossButton = 0;
	menuBookmarks=((MainForm*)parent->parentWidget())->menuBookmarks;
	actionActiveBookmark=menuBookmarks->activeAction();
	//setCrossButton( !m_closeButtonInTabs );
//connect(actionOptions, SIGNAL(triggered()), this, SLOT(slotOptions()));
        loadINI();

}
Пример #17
0
AssignedListView::AssignedListView(QWidget* const parent)
    : QTreeWidget(parent)
{
    setSelectionMode(QAbstractItemView::SingleSelection);
    setWhatsThis(i18n("This is the list of batch tools assigned."));
    setIconSize(QSize(ICONSIZE, ICONSIZE));

    setDragEnabled(true);
    setAcceptDrops(true);
    viewport()->setAcceptDrops(true);
    setDropIndicatorShown(true);

    setContextMenuPolicy(Qt::CustomContextMenu);
    setSortingEnabled(false);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(false);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setColumnCount(2);
    setHeaderHidden(true);
    header()->setSectionResizeMode(QHeaderView::ResizeToContents);

    connect(this, SIGNAL(itemSelectionChanged()),
            this, SLOT(slotSelectionChanged()));

    connect(this, SIGNAL(customContextMenuRequested(QPoint)),
            this, SLOT(slotContextMenu()));
}
 QgsBrowserTreeView( QWidget* parent ) : QTreeView( parent )
 {
   setDragDropMode( QTreeView::DragDrop ); // sets also acceptDrops + dragEnabled
   setSelectionMode( QAbstractItemView::ExtendedSelection );
   setContextMenuPolicy( Qt::CustomContextMenu );
   setHeaderHidden( true );
   setDropIndicatorShown( true );
 }
Пример #19
0
CodeStructureTreeView::CodeStructureTreeView(QWidget *parent) :
    QTreeView(parent)
{
    setHeaderHidden(true);
    setUniformRowHeights(true);
    setRootIsDecorated(true);
    setSelectionBehavior(QAbstractItemView::SelectRows);
}
Пример #20
0
EventList::EventList(QWidget* parent) :
    QTreeView(parent)
{
    /** some Qt decorations */
    setRootIsDecorated(false);
    setEditTriggers(NoEditTriggers);
    setHeaderHidden(true);
}
qgis_dev_dockBrowserTreeView::qgis_dev_dockBrowserTreeView( QWidget *parent )
    : QgsBrowserTreeView( parent )
{
    setDragDropMode( QTreeView::DragDrop );
    setSelectionMode( QAbstractItemView::ExtendedSelection );
    setContextMenuPolicy( Qt::CustomContextMenu );
    setHeaderHidden( true );
    setDropIndicatorShown( true );
}
Пример #22
0
    /* 构造函数实现 */
    _CategoriesTree::_CategoriesTree(QWidget *_Parent)
        : QTreeWidget(_Parent)
        {
        /* "评分" */
        m_RatingRootItem = new QTreeWidgetItem(this, QStringList() << wxNote::g_RatingListName);
        m_RatingRootItem->setIcon(0, QIcon(":/wxNote_Icons/rating.png"));
        m_RatingRootItem->setExpanded(true);

        m_ExcellentItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << wxNote::g_ExcellentName);
        m_ExcellentItem->setIcon(0, QIcon(":/wxNote_Icons/excellent.png"));

        m_GoodItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << wxNote::g_GoodName);
        m_GoodItem->setIcon(0, QIcon(":/wxNote_Icons/good.png"));

        m_AverageItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << wxNote::g_AverageName);
        m_AverageItem->setIcon(0, QIcon(":/wxNote_Icons/average.png"));

        m_FairItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << wxNote::g_FairName);
        m_FairItem->setIcon(0, QIcon(":/wxNote_Icons/fair.png"));

        m_PoorItem = new QTreeWidgetItem(
                    m_RatingRootItem, QStringList() << ("差"));
        m_PoorItem->setIcon(0, QIcon(":/wxNote_Icons/poor.png"));

        /* "颜色标签" */
        m_ColorLabelRootItem = new QTreeWidgetItem(
                                this, QStringList() << wxNote::g_ColorLabelListName);
        m_ColorLabelRootItem->setIcon(0, QIcon(":/wxNote_Icons/colorLabel.png"));
        m_ColorLabelRootItem->setExpanded(true);

        m_ImportantItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                              QStringList() << wxNote::g_ImportantName);
        m_ImportantItem->setIcon(0, QIcon(":/wxNote_Icons/important.png"));

        m_WorkItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                         QStringList() << wxNote::g_WorkName);
        m_WorkItem->setIcon(0, QIcon(":/wxNote_Icons/work.png"));

        m_PersonalItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                             QStringList() << wxNote::g_PersonalName);
        m_PersonalItem->setIcon(0, QIcon(":/wxNote_Icons/personal.png"));

        m_ToDoItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                         QStringList() << wxNote::g_ToDoName);
        m_ToDoItem->setIcon(0, QIcon(":/wxNote_Icons/toDo.png"));

        m_LaterItem = new QTreeWidgetItem(m_ColorLabelRootItem,
                                          QStringList() << wxNote::g_LaterName);
        m_LaterItem->setIcon(0, QIcon(":/wxNote_Icons/later.png"));

        setCurrentItem(m_RatingRootItem);
        setHeaderHidden(true);
        }
PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
           : QTreeWidget( p ), p_intf(_p_intf)
{
    /* Properties */
    setFrameStyle( QFrame::NoFrame );
    setAttribute( Qt::WA_MacShowFocusRect, false );
    viewport()->setAutoFillBackground( false );
    setIconSize( QSize( 24,24 ) );
    setIndentation( 12 );
    setHeaderHidden( true );
    setRootIsDecorated( true );
    setAlternatingRowColors( false );

    /* drops */
    viewport()->setAcceptDrops(true);
    setDropIndicatorShown(true);
    invisibleRootItem()->setFlags( invisibleRootItem()->flags() & ~Qt::ItemIsDropEnabled );

#ifdef Q_OS_MAC
    setAutoFillBackground( true );
    QPalette palette;
    palette.setColor( QPalette::Window, QColor(209,215,226) );
    setPalette( palette );
#endif
    setMinimumHeight( 120 );

    /* Podcasts */
    podcastsParent = NULL;
    podcastsParentId = -1;

    /* Podcast connects */
    CONNECT( THEMIM, playlistItemAppended( int, int ),
             this, plItemAdded( int, int ) );
    CONNECT( THEMIM, playlistItemRemoved( int ),
             this, plItemRemoved( int ) );
    DCONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
              this, inputItemUpdate( input_item_t * ) );

    createItems();

    setRootIsDecorated( false );
    setIndentation( 5 );
    /* Expand at least to show level 2 */
    for ( int i = 0; i < topLevelItemCount(); i++ )
        expandItem( topLevelItem( i ) );

    /***
     * We need to react to both clicks and activation (enter-key) here.
     * We use curItem to avoid rebuilding twice.
     * See QStyle::SH_ItemView_ActivateItemOnSingleClick
     ***/
    curItem = NULL;
    CONNECT( this, itemActivated( QTreeWidgetItem *, int ),
             this, setSource( QTreeWidgetItem *) );
    CONNECT( this, itemClicked( QTreeWidgetItem *, int ),
             this, setSource( QTreeWidgetItem *) );
}
Пример #24
0
//----------------------------------------------------------------------------------------
OfsTreeWidget::OfsTreeWidget(QWidget *parent, unsigned int capabilities, std::string initialSelection) : QTreeWidget(parent), mCapabilities(capabilities) 
{
    mSelected = initialSelection;

    setColumnCount(1);
    setHeaderHidden(true);
    setSelectionMode(QAbstractItemView::SingleSelection);
    setSelectionBehavior(QAbstractItemView::SelectItems);
    setContextMenuPolicy(Qt::CustomContextMenu);
    setDragDropOverwriteMode(false);
    
    if(capabilities & CAP_ALLOW_DROPS)
        setDragDropMode(QAbstractItemView::DropOnly);

    mUnknownFileIcon = mOgitorMainWindow->mIconProvider.icon(QFileIconProvider::File);

    mFile = Ogitors::OgitorsRoot::getSingletonPtr()->GetProjectFile();

    QTreeWidgetItem* item = 0;
    QTreeWidgetItem* pItem = new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("Project")));
    pItem->setIcon(0, mOgitorMainWindow->mIconProvider.icon(QFileIconProvider::Folder));
    pItem->setTextColor(0, Qt::black);
    QFont fnt = pItem->font(0);
    fnt.setBold(true);
    pItem->setFont(0, fnt);
    pItem->setWhatsThis(0, QString("/"));
    
    addTopLevelItem(pItem);

    fillTree(pItem, "/");

    if(capabilities & CAP_SHOW_FILES)
        fillTreeFiles(pItem, "/");

    expandItem(pItem);

    if(mSelected == "/")
        setItemSelected(pItem, true);
    else
    {
        NameTreeWidgetMap::iterator it = mItemMap.find(mSelected);

        if(it != mItemMap.end())
        {
            clearSelection();
            scrollToItem(it->second);
            setItemSelected(it->second, true);
        }
    }

    connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(onSelectionChanged()));

    if(capabilities & CAP_SHOW_FILES)
    {
        connect(this, SIGNAL(itemCollapsed( QTreeWidgetItem * )), this, SLOT(onItemCollapsed( QTreeWidgetItem * )));
        connect(this, SIGNAL(itemExpanded( QTreeWidgetItem * )), this, SLOT(onItemExpanded( QTreeWidgetItem * )));
    }
Пример #25
0
BookmarksFolderView::BookmarksFolderView(QWidget * parent)
        : QTreeView(parent)
{
    setHeaderHidden(true);

    m_model = new BookmarksFolderModel(this);
    setModel(m_model);
    setCurrentIndex(model()->index(0, 0, QModelIndex()));
    expand(model()->index(0, 0, QModelIndex()));
}
Пример #26
0
CategorizedTreeWidget::CategorizedTreeWidget(QWidget *parent)
  : QTreeWidget(parent)
{
  setItemDelegate(new KateColorTreeDelegate(this));
  setHeaderHidden(true);
  setRootIsDecorated(false);
  setIndentation(25);
  setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
  setHorizontalScrollMode(QAbstractItemView::ScrollPerItem);
}
Пример #27
0
InboxView::InboxView( QWidget* parent ) :
    TrackView( parent )
{
    proxyModel()->setStyle( PlayableProxyModel::SingleColumn );

    TrackView::setGuid( "inbox" );
    setHeaderHidden( true );
    setUniformRowHeights( false );
    setIndentation( 0 );
}
Пример #28
0
InboxView::InboxView( QWidget* parent ) :
    TrackView( parent )
{
    proxyModel()->setStyle( PlayableProxyModel::Large );
    setEmptyTip( tr( "No listening suggestions here." ) );

    TrackView::setGuid( "inbox" );
    setHeaderHidden( true );
    setUniformRowHeights( false );
    setIndentation( 0 );
}
Пример #29
0
void ArchiveViewer::rebuild(int){
    readArch();
    clear();
    buildTree(nullptr, 0);
    setEditTriggers(QTreeWidget::NoEditTriggers);
    setAlternatingRowColors(false);
    setSortingEnabled(false);
    setSelectionBehavior(QTreeWidget::SelectRows);
    setHeaderHidden(true);
    setColumnWidth(0, 280);
}
Пример #30
0
StackedDocumentTreeView::StackedDocumentTreeView( QWidget* parent )
    : QTreeView( parent ),
        mStacker( 0 )
{
    setEditTriggers( QAbstractItemView::NoEditTriggers );
    setAlternatingRowColors( false );
    setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );
    setRootIsDecorated( false );
    setUniformRowHeights( true );
    setHeaderHidden( true );
}