예제 #1
0
파일: filter.cpp 프로젝트: jesper/basket
void FilterBar::reset()
{
	m_lineEdit->setText(""); // m_data->isFiltering will be set to false;
	m_lineEdit->clearFocus();
	changeFilter();
	if (m_tagsBox->currentItem() != 0) {
		m_tagsBox->setCurrentItem(0);
		tagChanged(0);
	}
	hide();
	emit newFilter(*m_data);
}
예제 #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),showLvL(0), savedFile(new QFile),
    m_Pallette(new LogPallette), m_log_count(0),
    m_time_timerID(0), m_auto_conn_timerID(0)
{
    // 初始化UI
    setupUi(this);

    //  ----初始化状态栏图标//

    linkState = new QLabel(this);
    statusbar->addWidget(linkState);
    linkState->setFixedSize(16,16);
    linkState->setPixmap(QPixmap("://res/unlinked.png").scaled(linkState->size(),
                                                               Qt::IgnoreAspectRatio, Qt::SmoothTransformation));


    // ---初始化状态栏 //
    linkStateBar =  new QLabel(this);
    statusbar->addWidget(linkStateBar);

    // --统计label
    statLabel = new QLabel(this);
    statusbar->addPermanentWidget(statLabel);

    showTimeLabel = new QLabel(this);
    statusbar->addPermanentWidget(showTimeLabel);

    // 读取配置文件//
    loadSettingFromIni();

    // 初始化接收器//
    netReceiver = new NetReceiver(this);
    netReceiver->connectToLogForwarder(m_hostName, m_port);
    connect(netReceiver, SIGNAL(singleLogComing(QString)), this, SLOT(dealWithComingLog(QString)));

    // 初始化日志级别//
    calcShowLVL();

    //连接信号槽//
    connect(m_Filter, SIGNAL(filterChanged(QString)), this, SLOT(changeFilter(QString)));
    connect(netReceiver, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
            this, SLOT(netReceiverStateChanged(QAbstractSocket::SocketState)));

    m_Pallette->filterColor = QColor(Qt::red);

    m_filter_cb->setCurrentIndex(0);
}
예제 #3
0
파일: gltrixsdl.cpp 프로젝트: mits/gltrix
void processSDLEvents()
{
	SDL_Event event;
	while ( SDL_PollEvent(&event) )
	{
		switch(event.type)
		{
			case SDL_VIDEORESIZE:
				screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 32, SDL_OPENGL|SDL_RESIZABLE);
				if (screen)
					reshape(screen->w, screen->h);
				else { /* Uh oh, we couldn't set the new video mode?? */; }
				break;
			case SDL_QUIT:
				done = 1;
				break;
			case SDL_KEYDOWN:
				switch(event.key.keysym.sym)
				{
				case SDLK_ESCAPE:
					done =1;
					break;
				case SDLK_l:
					toggleLighting();
					break;
				case SDLK_f:
					changeFilter();
					break;
				case SDLK_b:
					toggleBlending();
					break;
				case SDLK_z:
					theCamera->rotateLocal(3.14159/3,1.0,0.0f,0.0f);
				default:
					break;
				}
		}
	}
}
예제 #4
0
MStatus nodeCreatedCB::doIt( const MArgList& args )
//
//	Description:
//		implements the MEL nodeCreatedCB command.
//
{
	MStatus stat = MS::kSuccess;

	MArgDatabase argData( syntax(), args );

	// Parse command flags.
	//
	if ( argData.isFlagSet( kRegisterFlag ) ) {
		// Register a new procedure.
		//
		MString proc;
		argData.getFlagArgument( kRegisterFlag, 0, proc );
		stat = registerMelProc( proc, argData.isFlagSet( kFullDagPathFlag ) );
	} else if ( argData.isFlagSet( kUnregisterFlag ) ) {
		// Unregister a procedure.
		//
		MString proc;
		argData.getFlagArgument( kUnregisterFlag, 0, proc );
		stat = unregisterMelProc( proc );
	} else if ( argData.isFlagSet( kFilterFlag ) ) {
		// Change the filter being applied.
		//
		MString filter;
		argData.getFlagArgument( kFilterFlag, 0, filter );
		stat = changeFilter( filter );
	}
	
	if ( stat.error() ) {
		MGlobal::displayError( stat.errorString() );
	}

	return stat;
}
예제 #5
0
DTPatientListWidget::DTPatientListWidget(QWidget* parent, Qt::WindowFlags f) :
    DTAbstractMasterWidget(parent,f),
    ui(new Ui::DTPatientListWidget)
{
    ui->setupUi(this);

    mPatientListModel = new DTPatientListModel(this);
    mPatientListModel->setEditStrategy(QSqlTableModel::OnManualSubmit);

    mPatientSearchListModel = new DTPatientListModel(this);
    mPatientSearchListModel->setEditStrategy(QSqlTableModel::OnManualSubmit);

    mPatientListDelegate = new DTPatientListDelegate(this);

    mContentsMenu = new QMenu(this);
    mContentsMenu->addAction(ui->acAddPatient);
    mContentsMenu->addAction(ui->acEditPatient);
    mContentsMenu->addAction(ui->acDelPatient);
//    ui->mPatienstList->setContextMenuPolicy(Qt::CustomContextMenu);
//    connect(ui->mPatienstList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotCustomContentsMenu(QPoint)));

    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotCustomContentsMenu(QPoint)));

    connect(&gDataModule, SIGNAL(dbOpened()), this, SLOT(slotDBOpened()));
    connect(&gDataModule, SIGNAL(dbClosed()), this, SLOT(slotDBClosed()));
    connect(ui->mFilterTabs, SIGNAL(changeFilter(QString)), this, SLOT(slotApplyFilter(QString)));

    connect(ui->mPatientsList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotDoubleClicked(QModelIndex)));

    ui->mFilterTabs->setShape(QTabBar::TriangularWest);

    ui->mPatientsList->setUniformItemSizes(false);
    ui->mPatientsList->viewport()->installEventFilter(this);
    ui->mPatientsList->setItemDelegate(mPatientListDelegate);
}
예제 #6
0
파일: filter.cpp 프로젝트: jesper/basket
FilterBar::FilterBar(QWidget *parent)
 : QWidget(parent)/*, m_blinkTimer(this), m_blinkedTimes(0)*/
{
	QHBoxLayout *hBox  = new QHBoxLayout(this, /*margin*/0, /*spacing*/0);

	// Create every widgets:
	// (Aaron Seigo says we don't need to worry about the 
	//	"Toolbar group" stuff anymore.)
	
	QIcon resetIconSet = KIcon("dialog-close", KIconLoader::global());
	QIcon inAllIconSet = KIcon("edit-find", KIconLoader::global());

	m_resetButton        = new QToolButton(this);
	m_resetButton->setIconSet(resetIconSet);
	m_resetButton->setTextLabel(i18n("Reset Filter"));//, /*groupText=*/"", this, SLOT(reset()), 0);
	m_resetButton->setAutoRaise(true);
			//new KToolBarButton("locationbar_erase", /*id=*/1230, this, /*name=*/0, i18n("Reset Filter"));
	m_lineEdit = new KLineEdit(this);
	QLabel *label        = new QLabel(m_lineEdit, i18n("&Filter: "), this);
	m_tagsBox = new KComboBox(this);
	QLabel *label2       = new QLabel(m_tagsBox, i18n("T&ag: "), this);
	m_inAllBasketsButton = new QToolButton(this);
	m_inAllBasketsButton->setIconSet(inAllIconSet);
	m_inAllBasketsButton->setTextLabel(i18n("Filter All Baskets"));//, /*groupText=*/"", this, SLOT(inAllBaskets()), 0);
	m_inAllBasketsButton->setAutoRaise(true);

	// Configure the Tags combobox:
	repopulateTagsCombo();

	// Configure the Serach in all Baskets button:
	m_inAllBasketsButton->setToggleButton(true);
//	m_inAllBasketsButton->setOn(true);
//	Global::bnpView->toggleFilterAllBaskets(true);

//	m_lineEdit->setMaximumWidth(150);
	m_lineEdit->setClearButtonShown(true);

	// Layout all those widgets:
//	hBox->addStretch();
	hBox->addWidget(m_resetButton);
	hBox->addSpacing(KDialog::spacingHint());
	hBox->addWidget(label);
	hBox->addWidget(m_lineEdit);
	hBox->addSpacing(KDialog::spacingHint());
	hBox->addWidget(label2);
	hBox->addWidget(m_tagsBox);
	hBox->addSpacing(KDialog::spacingHint());
	hBox->addWidget(m_inAllBasketsButton);

	m_data = new FilterData(); // TODO: Not a pointer! and return a const &  !!

//	connect( &m_blinkTimer,         SIGNAL(timeout()),                   this, SLOT(blinkBar())                  );
	connect(  m_resetButton,        SIGNAL(clicked()),                   this, SLOT(reset())                     );
	connect(  m_lineEdit,           SIGNAL(textChanged(const QString&)), this, SLOT(changeFilter()) );
	connect(  m_tagsBox,            SIGNAL(activated(int)),              this, SLOT(tagChanged(int))             );

//	connect(  m_inAllBasketsButton, SIGNAL(clicked()),                   this, SLOT(inAllBaskets())              );
	connect(  m_inAllBasketsButton, SIGNAL(toggled(bool)), Global::bnpView, SLOT(toggleFilterAllBaskets(bool)) );

	FocusWidgetFilter *lineEditF = new FocusWidgetFilter(m_lineEdit);
	m_tagsBox->installEventFilter(lineEditF);
	connect(lineEditF, SIGNAL(escapePressed()), SLOT(reset()));
	connect(lineEditF, SIGNAL(returnPressed()), SLOT(changeFilter()));
}