Ejemplo n.º 1
0
TreeView::TreeView() :
    QTreeView(),
    m_pOsgWidget(nullptr),
    m_pModel(nullptr),
    m_mutex()
{
    // connect for clicks to show/hide stuff
    QObject::connect(this,
                     SIGNAL(clicked(QModelIndex)),
                     this,
                     SLOT(clicked(QModelIndex)));

    // connet to expand to resize the column width
    QObject::connect(this,
                     SIGNAL(expanded(QModelIndex)),
                     this,
                     SLOT(expanded(QModelIndex)));

    // connect to collaps to resize the column width
    QObject::connect(this,
                     SIGNAL(collapsed(QModelIndex)),
                     this,
                     SLOT(collapsed(QModelIndex)));

    // make the qmodel
    m_mutex.lock();
    m_pModel = new QStandardItemModel();

    // add the model
    setModel( m_pModel );
    header()->hide();
    setAllColumnsShowFocus(true);
    m_mutex.unlock();
};
//--------------------------------------------------------------------------------
void AttendManagerTree::applySettingsFromData()
{
    disconnect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(itemExpandedSlot(QModelIndex)));
    disconnect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(itemCollapsedSlot(QModelIndex)));


    QList<QModelIndex> indexList = this->allIndexesFromModel(this->model(), QModelIndex());

    foreach(const QModelIndex &index, indexList)
        this->setExpanded(index, index.data(34).toBool());

    connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(itemExpandedSlot(QModelIndex)), Qt::UniqueConnection);
    connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(itemCollapsedSlot(QModelIndex)), Qt::UniqueConnection);
}
Ejemplo n.º 3
0
CheckDirTree::CheckDirTree( QWidget* parent )
    : QTreeView( parent )
{
    m_dirModel.setFilter( QDir::Dirs | QDir::NoDotAndDotDot );
    m_dirModel.setRootPath( "/" );

    m_dirModel.setNameFilters( QStringList() << "[^\\.]*" );

    setModel( &m_dirModel );
    setColumnHidden( 1, true );
    setColumnHidden( 2, true );
    setColumnHidden( 3, true );
    //header()->hide();

    connect( &m_dirModel, SIGNAL( dataChangedByUser( QModelIndex ) ),
                            SLOT( updateNode( QModelIndex ) ) );
    connect( &m_dirModel, SIGNAL( dataChangedByUser( const QModelIndex& ) ),
                          SIGNAL( changed() ) );
    connect( &m_dirModel, SIGNAL( modelReset() ),
                            SLOT( modelReset() ) );

    connect( this, SIGNAL( collapsed( QModelIndex ) ),
                     SLOT( onCollapse( QModelIndex ) ) );
    connect( this, SIGNAL( expanded( QModelIndex ) ),
                     SLOT( onExpand( QModelIndex ) ) );
}
Ejemplo n.º 4
0
FLUIQ::CollapsibleWidget::CollapsibleWidget( Qt::Orientation _or,
							Widget * _parent ) :
	Widget( _parent ),
	m_orientation( _or ),
	m_origMinSize(),
	m_origMaxSize(),
	m_masterLayout( NULL )
{
	if( m_orientation == Qt::Horizontal )
	{
		m_masterLayout = new QHBoxLayout( this );
	}
	else
	{
		m_masterLayout = new QVBoxLayout( this );
	}
	m_masterLayout->setMargin( 0 );
	m_masterLayout->setSpacing( 0 );
	setSizePolicy( QSizePolicy::Expanding,
					QSizePolicy::Expanding );
	m_header = new CollapsibleWidgetHeader( this );

	m_masterLayout->addWidget( m_header );
	m_masterLayout->insertStretch( 100, 0 );

	connect( m_header, SIGNAL( expanded() ),
			this, SLOT( expand() ) );
	connect( m_header, SIGNAL( collapsed() ),
			this, SLOT( collapse() ) );
}
Ejemplo n.º 5
0
void FLUIQ::CollapsibleWidgetHeader::mouseReleaseEvent( QMouseEvent * _ev )
{
	if( _ev->button() == Qt::LeftButton && m_pressed )
	{
		QApplication::restoreOverrideCursor();
		m_pressed = false;
		update();
		_ev->accept();

		if( m_moved == false )
		{
			if( m_collapsed )
			{
				m_collapsed = false;
				emit expanded();
			}
			else
			{
				m_collapsed = true;
				emit collapsed();
			}
		}
	}
	else
	{
		Widget::mousePressEvent( _ev );
	}
}
Ejemplo n.º 6
0
void TreeCtrlTestCase::CollapseExpandEvents()
{
    m_tree->CollapseAll();

    EventCounter collapsed(m_tree, wxEVT_TREE_ITEM_COLLAPSED);
    EventCounter collapsing(m_tree, wxEVT_TREE_ITEM_COLLAPSING);
    EventCounter expanded(m_tree, wxEVT_TREE_ITEM_EXPANDED);
    EventCounter expanding(m_tree, wxEVT_TREE_ITEM_EXPANDING);

    wxUIActionSimulator sim;

    wxRect pos;
    m_tree->GetBoundingRect(m_root, pos, true);

    // We move in slightly so we are not on the edge
    wxPoint point = m_tree->ClientToScreen(pos.GetPosition()) + wxPoint(4, 4);

    sim.MouseMove(point);
    wxYield();

    sim.MouseDblClick();
    wxYield();

    CPPUNIT_ASSERT_EQUAL(1, expanding.GetCount());
    CPPUNIT_ASSERT_EQUAL(1, expanded.GetCount());

    sim.MouseDblClick();
    wxYield();

    CPPUNIT_ASSERT_EQUAL(1, collapsing.GetCount());
    CPPUNIT_ASSERT_EQUAL(1, collapsed.GetCount());
}
Ejemplo n.º 7
0
bool QListView::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: selectionChanged(); break;
    case 1: selectionChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 2: currentChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 3: clicked((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 4: clicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 5: pressed((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 6: pressed((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 7: doubleClicked((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 8: doubleClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 9: returnPressed((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 10: spacePressed((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 11: rightButtonClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 12: rightButtonPressed((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 13: mouseButtonPressed((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3)),(int)static_QUType_int.get(_o+4)); break;
    case 14: mouseButtonClicked((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3)),(int)static_QUType_int.get(_o+4)); break;
    case 15: contextMenuRequested((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 16: onItem((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 17: onViewport(); break;
    case 18: expanded((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 19: collapsed((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 20: dropped((QDropEvent*)static_QUType_ptr.get(_o+1)); break;
    case 21: itemRenamed((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2),(const QString&)static_QUType_QString.get(_o+3)); break;
    case 22: itemRenamed((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    default:
	return QScrollView::qt_emit(_id,_o);
    }
    return TRUE;
}
Ejemplo n.º 8
0
TransfersView::TransfersView(QWidget * parent)
    : QTreeView(parent)
{
//     setItemsExpandable(false);
    setRootIsDecorated(false);
    setAnimated(true);
    setAllColumnsShowFocus(true);
    header()->setDefaultAlignment(Qt::AlignCenter);
    header()->setMinimumSectionSize(80);    
    header()->setContextMenuPolicy(Qt::CustomContextMenu);
    header()->setClickable(true);
    m_headerMenu = new KMenu(header());

    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setDragEnabled(true);
    setAcceptDrops(true);
    setDropIndicatorShown(true);
    setEditTriggers(QAbstractItemView::NoEditTriggers);
    setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);

    connect(header(), SIGNAL(customContextMenuRequested(QPoint)),
                      SLOT(slotShowHeaderMenu(QPoint)));
    connect(header(), SIGNAL(sectionCountChanged(int,int)), this, SLOT(populateHeaderActions()));
    connect(header(), SIGNAL(sectionMoved(int,int,int)), this, SLOT(slotSectionMoved(int,int,int)));
    connect(header(), SIGNAL(sectionResized(int,int,int)), this, SLOT(slotSaveHeader()));
    connect(this,     SIGNAL(doubleClicked(QModelIndex)),
            this,     SLOT(slotItemActivated(QModelIndex)));
    connect(this,     SIGNAL(collapsed(QModelIndex)),
            this,     SLOT(slotItemCollapsed(QModelIndex)));
    connect(KGet::model(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), 
            this,          SLOT(closeExpandableDetails(QModelIndex,int,int)));
}
    void NativeTextfieldWin::OnPaste()
    {
        if(textfield_->read_only() || !ViewDelegate::view_delegate)
        {
            return;
        }

        ui::Clipboard* clipboard = ViewDelegate::view_delegate->GetClipboard();
        if(!clipboard->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(),
            ui::Clipboard::BUFFER_STANDARD))
        {
            return;
        }

        std::wstring clipboard_str;
        clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &clipboard_str);
        if(!clipboard_str.empty())
        {
            std::wstring collapsed(CollapseWhitespace(clipboard_str, false));
            if(textfield_->style() & Textfield::STYLE_LOWERCASE)
            {
                collapsed = base::i18n::ToLower(collapsed);
            }
            // Force a Paste operation to trigger ContentsChanged, even if identical
            // contents are pasted into the text box. See http://crbug.com/79002
            ReplaceSel(L"", false);
            textfield_->SyncText();
            text_before_change_.clear();
            ReplaceSel(collapsed.c_str(), true);
        }
    }
Ejemplo n.º 10
0
size_t WHtreeProcesser::collapseBranch( const dist_t flatGap, const dist_t distLevelLimit, size_t root, const bool keepBaseNodes )
{
    if( flatGap >= 1 )
    {
        std::cerr << "ERROR @ WHtreeProcesser::flattenTree(): flattening interval must be smaller than 1" << std::endl;
        return 0;
    }

    std::vector< size_t > branchNodes( m_tree.getBranchNodes( root ) );

    //put higher hierarchy first:
    std::reverse( branchNodes.begin(), branchNodes.end() );
    // flatten levels
    for( std::vector< size_t >::iterator nodesIter( branchNodes.begin() ); nodesIter != branchNodes.end(); ++nodesIter )
    {
        if( m_tree.getNode( *nodesIter ).getDistLevel() > distLevelLimit )
        {
            collapseNode( *nodesIter, flatGap );
        }
    }

    size_t collapsed( m_tree.debinarize( keepBaseNodes ) );

    return collapsed;
} // end "collapseBranch()" -----------------------------------------------------------------
Ejemplo n.º 11
0
size_t WHtreeProcesser::collapseTree( const dist_t flatGap, const dist_t distLevelLimit, const bool keepBaseNodes )
{
    if( flatGap >= 1 )
    {
        std::cerr << "ERROR @ WHtreeProcesser::collapseTree(): flattening interval must be smaller than 1" << std::endl;
        return 0;
    }

    if( flatGap == 0 )
    {
        m_tree.forceMonotonicityDown();
    }
    else
    {
        // flatten all levels
        for( int32_t i = m_tree.getRoot().getID(); i >= 0; --i )
        {
            if( m_tree.getNode( i ).getDistLevel() > distLevelLimit )
            {
                collapseNode( i, flatGap );
            }
        }
        m_tree.m_treeName += ( "_flat" + str( boost::format( "%1.3f" ) % flatGap ) );
    }

    size_t collapsed( m_tree.debinarize( keepBaseNodes ) );

    return collapsed;
} // end "collapseTree()" -----------------------------------------------------------------
Ejemplo n.º 12
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    m_process_treemodel(nullptr),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    center();

    // build model
    m_process_treemodel = new ProcessTreeModel(this);
    // build proxy
    m_process_proxymodel = new ProcessProxyModel(this);
    m_process_proxymodel->setFilterKeyColumn(0);
    m_process_proxymodel->setFilterCaseSensitivity(Qt::CaseInsensitive);
    // proxy -> model
    m_process_proxymodel->setSourceModel(m_process_treemodel);
    // view -> proxy
    ui->treeView_process->setModel(m_process_proxymodel);
    // expand all items
    ui->treeView_process->expandAll();
    ui->treeView_process->resizeColumnToContents(0);
    connect(ui->treeView_process, SIGNAL(expanded(QModelIndex)), this, SLOT(adjustColumnSize()));
    connect(ui->treeView_process, SIGNAL(collapsed(QModelIndex)), this, SLOT(adjustColumnSize()));
    connect(m_process_treemodel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(adjustTreeView()));
    connect(ui->lineEdit_search, SIGNAL(textChanged(QString)), this, SLOT(updateFilters(QString)));
}
Ejemplo n.º 13
0
UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent),
    updatePeriod(MAXIMUM_UPDATE_PERIOD)
{
    // Create browser and configuration GUIs
    m_browser = new Ui_UAVObjectBrowser();
    m_viewoptions = new Ui_viewoptions();
    m_viewoptionsDialog = new QDialog(this);
    m_viewoptions->setupUi(m_viewoptionsDialog);
    m_browser->setupUi(this);

    // Create data model
    m_model = new UAVObjectTreeModel(this);

    // Create tree view and add to layout
    treeView = new UAVOBrowserTreeView(MAXIMUM_UPDATE_PERIOD);
    treeView->setObjectName(QString::fromUtf8("treeView"));
    m_browser->verticalLayout->addWidget(treeView);

    connect(m_browser->saveSDButton, SIGNAL(clicked()), this, SLOT(saveObject()));
    connect(m_browser->readSDButton, SIGNAL(clicked()), this, SLOT(loadObject()));
    connect(m_browser->eraseSDButton, SIGNAL(clicked()), this, SLOT(eraseObject()));
    connect(m_browser->sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
    connect(m_browser->requestButton, SIGNAL(clicked()), this, SLOT(requestUpdate()));
    connect(m_browser->viewSettingsButton,SIGNAL(clicked()),this,SLOT(viewSlot()));


    connect((QTreeView*) treeView, SIGNAL(collapsed(QModelIndex)), this, SLOT(onTreeItemCollapsed(QModelIndex) ));
    connect((QTreeView*) treeView, SIGNAL(expanded(QModelIndex)), this, SLOT(onTreeItemExpanded(QModelIndex) ));

    connect(m_browser->le_searchField, SIGNAL(textChanged(QString)), this, SLOT(searchTextChanged(QString)));
    connect(m_browser->bn_clearSearchField, SIGNAL(clicked()), this, SLOT(searchTextCleared()));

    // Set browser buttons to disabled
    enableUAVOBrowserButtons(false);
}
KShortcutsEditorDelegate::KShortcutsEditorDelegate(QTreeWidget *parent, bool allowLetterShortcuts)
    : KExtendableItemDelegate(parent),
      m_allowLetterShortcuts(allowLetterShortcuts),
      m_editor(0)
{
    Q_ASSERT(qobject_cast<QAbstractItemView *>(parent));

    QPixmap pixmap(16, 16);
    pixmap.fill(QColor(Qt::transparent));
    QPainter p(&pixmap);
    QStyleOption option;
    option.rect = pixmap.rect();

    bool isRtl = QApplication::isRightToLeft();
    QApplication::style()->drawPrimitive(isRtl ? QStyle::PE_IndicatorArrowLeft : QStyle::PE_IndicatorArrowRight, &option, &p);
    p.end();
    setExtendPixmap(pixmap);

    pixmap.fill(QColor(Qt::transparent));
    p.begin(&pixmap);
    QApplication::style()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &option, &p);
    p.end();
    setContractPixmap(pixmap);

    parent->installEventFilter(this);

    // Listen to activation signals
    // connect(parent, SIGNAL(activated(QModelIndex)), this, SLOT(itemActivated(QModelIndex)));
    connect(parent, SIGNAL(clicked(QModelIndex)), this, SLOT(itemActivated(QModelIndex)));

    // Listen to collapse signals
    connect(parent, SIGNAL(collapsed(QModelIndex)), this, SLOT(itemCollapsed(QModelIndex)));
}
Ejemplo n.º 15
0
void HelpPopup::DoInitDialog() {
    ToLog(LOGMSG_DEBUGTRACE,"IN:HelpPopup::DoInitDialog");

    if (HelpEngine) {
        ui->HelpBrowserWidget->HelpEngine=HelpEngine;
        ui->ContentWidget->InitHelpEngine(HelpEngine);
        ui->FollowInterfaceCB->setChecked(*WikiFollowInterface);
        ui->HelpSplitter->setStretchFactor(0,1);
        ui->HelpSplitter->setStretchFactor(1,3);

        connect(ui->HelpBrowserWidget,SIGNAL(historyChanged()),SLOT(PageChanged()));
        connect(ui->HelpBrowserWidget,SIGNAL(sourceChanged(QUrl)),SLOT(SourceChanged(QUrl)));
        connect(ui->ContentWidget,SIGNAL(clicked(QModelIndex)),this,SLOT(UpdateUrl(QModelIndex)));
        connect(ui->ContentWidget,SIGNAL(collapsed(QModelIndex)),this,SLOT(CollapsedOrExpanded(QModelIndex)));
        connect(ui->ContentWidget,SIGNAL(expanded(QModelIndex)),this,SLOT(CollapsedOrExpanded(QModelIndex)));
        connect(ui->ExitBT,SIGNAL(pressed()),this,SLOT(Exit()));
        connect(ui->PreviousBT,SIGNAL(pressed()),this,SLOT(Back()));
        connect(ui->NextBT,SIGNAL(pressed()),this,SLOT(Next()));
        connect(ui->CCBYSABT,SIGNAL(pressed()),this,SLOT(CCBYSABT()));
        connect(ui->HomeBT,SIGNAL(pressed()),this,SLOT(Home()));
        connect(ui->WebSiteBT,SIGNAL(pressed()),this,SLOT(WebSite()));
        connect(ui->ForumBT,SIGNAL(pressed()),this,SLOT(Forum()));
        connect(ui->FollowInterfaceCB,SIGNAL(clicked()),this,SLOT(Follow()));
        PageChanged();
    }
}
Ejemplo n.º 16
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()));
}
Ejemplo n.º 17
0
APlayer::APlayer()
{
	old = 0;

	m_fsModel = new QFileSystemModel(this);
	m_fsModel->setRootPath("/");
	m_fsModel->setFilter(QDir::Dirs | QDir::Drives | QDir::NoDotAndDotDot);

	w_fileSystemTree = new QTreeView();
	w_fileSystemTree->setModel(m_fsModel);
	w_fileSystemTree->setSelectionMode(QAbstractItemView::SingleSelection);

	w_folderContents = new QTreeWidget();
	w_folderContents->setHeaderLabels(QStringList() << "Artist" << "Title" << "Album" << "Year");

	w_splitter = new QSplitter();
	w_splitter->setOrientation(Qt::Horizontal);
	w_splitter->addWidget(w_fileSystemTree);
	w_splitter->addWidget(w_folderContents);
	w_splitter->setStretchFactor(0, 40);
	w_splitter->setStretchFactor(1, 60);

	w_playPause = new QPushButton(QIcon::fromTheme("media-playback-start"), tr(""));
	w_stop = new QPushButton(QIcon::fromTheme("media-playback-stop"), tr(""));
	w_sound = new QPushButton(QIcon::fromTheme("player-volume"), tr(""));

	w_progress = new QSlider(Qt::Horizontal);

	m_media = Phonon::createPlayer(Phonon::MusicCategory);
	m_media->setTickInterval(1000);

	la_playerButtons = new QHBoxLayout();
	la_playerButtons->addWidget(w_playPause);
	la_playerButtons->addWidget(w_stop);
	la_playerButtons->addWidget(w_sound);
	la_playerButtons->addWidget(w_progress);

	la_mainWindow = new QVBoxLayout();
	la_mainWindow->addWidget(w_splitter);
	la_mainWindow->addLayout(la_playerButtons);

	QWidget *w = new QWidget();
	w->setLayout(la_mainWindow);
	setCentralWidget(w);


	connect(w_fileSystemTree, SIGNAL(clicked(QModelIndex)), this, SLOT(treeItemClicked(QModelIndex)));

	connect(w_playPause, SIGNAL(clicked()), this, SLOT(playPause()));
	connect(w_stop, SIGNAL(clicked()), this, SLOT(stop()));

	connect(w_fileSystemTree, SIGNAL(collapsed(QModelIndex)), this, SLOT(treeChanged()));
	connect(w_fileSystemTree, SIGNAL(expanded(QModelIndex)), this, SLOT(treeChanged()));

	connect(m_media, SIGNAL(tick(qint64)), this, SLOT(setPlaybackState(qint64)));
	connect(m_media, SIGNAL(totalTimeChanged(qint64)), this, SLOT(setPlaybackMax(qint64)));

	connect(w_folderContents, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(fileDoubleClicked(QTreeWidgetItem*,int)));
}
Ejemplo n.º 18
0
void ContactListTreeView::setModel(QAbstractItemModel* model)
{
	contactListModel = qobject_cast<ContactListSortFilterProxyModel*>(model);
	QTreeView::setModel(model);
	connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(groupCollapsed(QModelIndex)));
	connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(groupExpanded(QModelIndex)));
	connect(contactListModel, SIGNAL(expandGroup(QModelIndex)), this, SLOT(expandGroup(QModelIndex)));
}
Ejemplo n.º 19
0
size_t WHtreeProcesser::flattenBranch( size_t root, const bool keepBaseNodes )
{
    collapseNode( root, 1 );

    size_t collapsed( m_tree.debinarize( keepBaseNodes ) );

    return collapsed;
} // end "flattenBranch()" -----------------------------------------------------------------
int QtTreePropertyBrowser::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QtAbstractPropertyBrowser::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: collapsed((*reinterpret_cast< QtBrowserItem*(*)>(_a[1]))); break;
        case 1: expanded((*reinterpret_cast< QtBrowserItem*(*)>(_a[1]))); break;
        case 2: d_func()->slotCollapsed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 3: d_func()->slotExpanded((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 4: d_func()->slotCurrentBrowserItemChanged((*reinterpret_cast< QtBrowserItem*(*)>(_a[1]))); break;
        case 5: d_func()->slotCurrentTreeItemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QTreeWidgetItem*(*)>(_a[2]))); break;
        default: ;
        }
        _id -= 6;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = indentation(); break;
        case 1: *reinterpret_cast< bool*>(_v) = rootIsDecorated(); break;
        case 2: *reinterpret_cast< bool*>(_v) = alternatingRowColors(); break;
        case 3: *reinterpret_cast< bool*>(_v) = isHeaderVisible(); break;
        case 4: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break;
        case 5: *reinterpret_cast< int*>(_v) = splitterPosition(); break;
        case 6: *reinterpret_cast< bool*>(_v) = propertiesWithoutValueMarked(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setIndentation(*reinterpret_cast< int*>(_v)); break;
        case 1: setRootIsDecorated(*reinterpret_cast< bool*>(_v)); break;
        case 2: setAlternatingRowColors(*reinterpret_cast< bool*>(_v)); break;
        case 3: setHeaderVisible(*reinterpret_cast< bool*>(_v)); break;
        case 4: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break;
        case 5: setSplitterPosition(*reinterpret_cast< int*>(_v)); break;
        case 6: setPropertiesWithoutValueMarked(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Ejemplo n.º 21
0
void AMActionRunnerQueueView3::collapse(bool doCollapse)
{
	bool wasCollapsed = isCollapsed();
	treeView_->setHidden(doCollapse);
	isCollapsed_ = doCollapse;

	if(isCollapsed_ != wasCollapsed)
		emit collapsed(doCollapse);
}
Ejemplo n.º 22
0
		/**
		* Add a new panel to the bottom of the stack and set its caption and the inner widget
		*/
		CollapsiblePanel* CollapsibleStack::addPanel(const QString& caption, QWidget* widget)
		{
			CollapsiblePanel *panel = new CollapsiblePanel(caption, this);
			panel->setWidget(widget);
			m_layout->addWidget(panel);
			connect(panel, SIGNAL(collapsed()), this, SLOT(updateStretch()));
			connect(panel, SIGNAL(expanded()), this, SLOT(updateStretch()));
			return panel;
		}
Ejemplo n.º 23
0
// Count collapsed nodes in tree
int DispValue::collapsedAll() const
{
    int count = 0;
    if (collapsed())
	count++;
    for (int i = 0; i < nchildren(); i++)
	count += child(i)->collapsedAll();

    return count;
}
Ejemplo n.º 24
0
void BookmarksPanel::setup()
{
    UrlPanel::setup();

    connect(panelTreeView(), SIGNAL(delKeyPressed()), this, SLOT(deleteBookmark()));
    connect(panelTreeView(), SIGNAL(collapsed(QModelIndex)), this, SLOT(onCollapse(QModelIndex)));
    connect(panelTreeView(), SIGNAL(expanded(QModelIndex)), this, SLOT(onExpand(QModelIndex)));

    loadFoldedState();
}
Ejemplo n.º 25
0
void CollapsiblePanel::collapseOrExpand(bool collapse) {
  if (!m_widget)
    return;
  if (collapse) {
    m_widget->hide();
    emit collapsed();
  } else {
    m_widget->show();
    emit expanded();
  }
}
Ejemplo n.º 26
0
void FileTreeView::setModel
(
    FileTreeModel * model
)
{
    QTreeView::setModel( model );

    connect( this, SIGNAL( expanded( QModelIndex ) ), model, SLOT( expand( QModelIndex ) ) );
    connect( this, SIGNAL( collapsed( QModelIndex ) ), model, SLOT( collapse( QModelIndex ) ) );
    connect( this, SIGNAL( removeRequest( QModelIndexList ) ), model, SLOT( remove( QModelIndexList ) ) );
}
Ejemplo n.º 27
0
void CollapsibleWidget::emitCollapsed()
{
    // Let people know that a collapsed state has changed

    for (int i = 0, iMax = mHeaders.count(); i < iMax; ++i) {
        if (mHeaders[i] == sender()) {
            emit collapsed(i, mHeaders[i]->isCollapsed());

            return;
        }
    }
}
Ejemplo n.º 28
0
ProtoTree::ProtoTree(QWidget *parent) :
    QTreeWidget(parent)
{
    setAccessibleName(tr("Packet details"));
    setUniformRowHeights(true);

    connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
            this, SLOT(updateSelectionStatus(QTreeWidgetItem*)));
    connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(expand(QModelIndex)));
    connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(collapse(QModelIndex)));
    connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),
            this, SLOT(itemDoubleClick(QTreeWidgetItem*, int)));
}
Ejemplo n.º 29
0
// -------------------------------------------------------------------------
ctkTreeComboBox::ctkTreeComboBox(QWidget* _parent):Superclass(_parent)
  , d_ptr(new ctkTreeComboBoxPrivate(*this))
{
  QTreeView* treeView = new QTreeView(this);
  treeView->setHeaderHidden(true);
  this->setView(treeView);
  // we install the filter AFTER the QComboBox installed it.
  // so that our eventFilter will be called first
  this->view()->viewport()->installEventFilter(this);
  connect(treeView, SIGNAL(collapsed(QModelIndex)),
          this, SLOT(resizePopup()));
  connect(treeView, SIGNAL(expanded(QModelIndex)),
          this, SLOT(resizePopup()));
}
Ejemplo n.º 30
0
RosterTreeView::RosterTreeView(QWidget *parent):
	QTreeView(parent)
{
	setItemDelegate(new RosterItemDelegate(this));
	//setDragEnabled(true);
	//viewport()->setAcceptDrops(true);
	//setDropIndicatorShown(true);
	//setDragDropMode(QAbstractItemView::InternalMove);

	connect(this, SIGNAL(expanded(QModelIndex)), SLOT(itemExpanded(QModelIndex)));
	connect(this, SIGNAL(collapsed(QModelIndex)), SLOT(itemCollapsed(QModelIndex)));
	connect(Core::inst()->messageQueue(), SIGNAL(messageEnqueued(quint32,KittySDK::IMessage)), SLOT(setupBlinking(quint32,KittySDK::IMessage)));
	connect(Core::inst()->messageQueue(), SIGNAL(messageDequeued(quint32)), SLOT(unblinkIcon(quint32)));
}