コード例 #1
0
ファイル: SearchListView.cpp プロジェクト: exten/x64dbg
SearchListView::SearchListView(QWidget* parent) :
    QWidget(parent),
    ui(new Ui::SearchListView)
{
    ui->setupUi(this);

    // Create the reference list
    mList = new SearchListViewTable();
    mList->setContextMenuPolicy(Qt::CustomContextMenu);

    // Create the search list
    mSearchList = new SearchListViewTable();
    mSearchList->setContextMenuPolicy(Qt::CustomContextMenu);
    mSearchList->hide();

    // Set global variables
    mSearchBox = ui->searchBox;
    mCurList = mList;
    mSearchStartCol = 0;

    // Create list layout
    mListLayout = new QVBoxLayout();
    mListLayout->setContentsMargins(0, 0, 0, 0);
    mListLayout->setSpacing(0);
    mListLayout->addWidget(mList);
    mListLayout->addWidget(mSearchList);

    // Create list placeholder
    mListPlaceHolder = new QWidget();
    mListPlaceHolder->setLayout(mListLayout);

    // Insert the placeholder
    ui->mainSplitter->insertWidget(0, mListPlaceHolder);

    // Set the main layout
    mMainLayout = new QVBoxLayout();
    mMainLayout->setContentsMargins(0, 0, 0, 0);
    mMainLayout->addWidget(ui->mainSplitter);
    setLayout(mMainLayout);

    // Minimal size for the search box
    ui->mainSplitter->setStretchFactor(0, 1000);
    ui->mainSplitter->setStretchFactor(0, 1);

    // Disable main splitter
    for(int i = 0; i < ui->mainSplitter->count(); i++)
        ui->mainSplitter->handle(i)->setEnabled(false);

    // Setup signals
    connect(mList, SIGNAL(keyPressedSignal(QKeyEvent*)), this, SLOT(listKeyPressed(QKeyEvent*)));
    connect(mList, SIGNAL(contextMenuSignal(QPoint)), this, SLOT(listContextMenu(QPoint)));
    connect(mList, SIGNAL(doubleClickedSignal()), this, SLOT(doubleClickedSlot()));
    connect(mSearchList, SIGNAL(keyPressedSignal(QKeyEvent*)), this, SLOT(listKeyPressed(QKeyEvent*)));
    connect(mSearchList, SIGNAL(contextMenuSignal(QPoint)), this, SLOT(listContextMenu(QPoint)));
    connect(mSearchList, SIGNAL(doubleClickedSignal()), this, SLOT(doubleClickedSlot()));
    connect(mSearchBox, SIGNAL(textChanged(QString)), this, SLOT(searchTextChanged(QString)));
}
コード例 #2
0
VGMFileListView::VGMFileListView(QWidget *parent)
        : QListView(parent)
{
    VGMFileListViewModel *vgmFileListViewModel = new VGMFileListViewModel(this);
    this->setModel(vgmFileListViewModel);
    this->setSelectionMode(QAbstractItemView::ExtendedSelection);
    this->setSelectionRectVisible(true);


//    connect(this, SIGNAL(clicked(QModelIndex)),this,SLOT(myItemSelected(QModelIndex)));
    connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(doubleClickedSlot(QModelIndex)));
}
コード例 #3
0
ファイル: gtreeview.cpp プロジェクト: MahmoudGamlTaha/ring
GTreeView::GTreeView(QWidget *parent,VM *pVM)  : QTreeView(parent)
{
	this->pVM = pVM;
	this->pParaList = ring_list_new(0);
	strcpy(this->ccollapsedEvent,"");
	strcpy(this->cexpandedEvent,"");
	strcpy(this->cactivatedEvent,"");
	strcpy(this->cclickedEvent,"");
	strcpy(this->cdoubleClickedEvent,"");
	strcpy(this->centeredEvent,"");
	strcpy(this->cpressedEvent,"");
	strcpy(this->cviewportEnteredEvent,"");

	QObject::connect(this, SIGNAL(collapsed(QModelIndex)),this, SLOT(collapsedSlot()));
	QObject::connect(this, SIGNAL(expanded(QModelIndex)),this, SLOT(expandedSlot()));
	QObject::connect(this, SIGNAL(activated(QModelIndex)),this, SLOT(activatedSlot()));
	QObject::connect(this, SIGNAL(clicked(QModelIndex)),this, SLOT(clickedSlot()));
	QObject::connect(this, SIGNAL(doubleClicked(QModelIndex)),this, SLOT(doubleClickedSlot()));
	QObject::connect(this, SIGNAL(entered(QModelIndex)),this, SLOT(enteredSlot()));
	QObject::connect(this, SIGNAL(pressed(QModelIndex)),this, SLOT(pressedSlot()));
	QObject::connect(this, SIGNAL(viewportEntered()),this, SLOT(viewportEnteredSlot()));

}