示例#1
0
文件: robot.cpp 项目: Iownnoname/qt
Robot::Robot(QWidget* w)
    : QWidget(w)
    , panel(this)
    , send("Send")
    , clear("Clear")
    , screenshot("Screenshot")
{
    setWindowTitle(QStringLiteral("图灵机器人"));
    network = Network::instance();
    Answer *answer = new Answer(QStringLiteral("你好,我是机器人图灵,有什么可以帮您"),&*panel);
    panel->addDialog(answer);

    setButton();
    setLine();
    setPanel();

    QGridLayout* lay = new QGridLayout(this);
    lay->addWidget(&panel, 0, 0, 1, 3);
    lay->addWidget(&line, 1, 0, 1, 3);
    lay->addWidget(&screenshot, 2, 0);
    lay->addWidget(&clear, 2, 1);
    lay->addWidget(&send, 2, 2);

    setStyleSheet("background-color:rgb(61, 61, 61);");
    my::moveToScrCenter(this);

    connect(&send, SIGNAL(clicked()), this, SLOT(newQuestion()));
    connect(&clear, SIGNAL(clicked()), this, SLOT(clearAllContents()));
    connect(&screenshot, SIGNAL(clicked()), this, SLOT(saveScreenshot()));
    connect(network, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleDownload(QNetworkReply*)));
}
示例#2
0
	GenEchoWidget(GenEcho *module) : ModuleWidget(module) {
		setPanel(SVG::load(assetPlugin(plugin, "res/GenEcho.svg")));
   
    addParam(ParamWidget::create<RoundSmallBlackKnob>(Vec(9.883, 40.49), module, GenEcho::SLEN_PARAM, 0.01f, 1.f, 0.f));

    addParam(ParamWidget::create<RoundSmallBlackKnob>(Vec(9.883, 139.97), module, GenEcho::BPTS_PARAM, 0, 2200, 0.0));
    addParam(ParamWidget::create<RoundSmallBlackKnob>(Vec(55.883, 168.88), module, GenEcho::BPTSCV_PARAM, 0.f, 1.f, 0.0));
    
    addParam(ParamWidget::create<RoundSmallBlackKnob>(Vec(9.883, 208.54), module, GenEcho::ASTP_PARAM, 0.0, 0.6, 0.9));
    addParam(ParamWidget::create<RoundSmallBlackKnob>(Vec(55.883, 208.54), module, GenEcho::ASTPCV_PARAM, 0.f, 1.f, 0.f));
    
    addParam(ParamWidget::create<RoundSmallBlackKnob>(Vec(9.883, 277.11), module, GenEcho::DSTP_PARAM, 0.0, 0.2, 0.9));
    addParam(ParamWidget::create<RoundSmallBlackKnob>(Vec(55.883, 277.11), module, GenEcho::DSTPCV_PARAM, 0.f, 1.f, 0.f));
    
    addParam(ParamWidget::create<RoundBlackSnapKnob>(Vec(7.883, 344.25), module, GenEcho::ENVS_PARAM, 1.f, 4.f, 4.f));

    // triggers for toggling mirroring and changing probability distribution
    addParam(ParamWidget::create<CKSS>(Vec(60.789, 72.98), module, GenEcho::ACCM_PARAM, 0.f, 1.f, 0.f)); 
    addParam(ParamWidget::create<CKSS>(Vec(60.789, 103.69), module, GenEcho::MIRR_PARAM, 0.f, 1.f, 0.f)); 
    addParam(ParamWidget::create<CKSSThree>(Vec(60.789, 132.26), module, GenEcho::PDST_PARAM, 0.f, 2.f, 0.f)); 
    
    addInput(Port::create<PJ301MPort>(Vec(10.281, 69.79), Port::INPUT, module, GenEcho::WAV0_INPUT));
    addInput(Port::create<PJ301MPort>(Vec(10.281, 95.54), Port::INPUT, module, GenEcho::GATE_INPUT));
    
    addInput(Port::create<PJ301MPort>(Vec(58.281, 44.05), Port::INPUT, module, GenEcho::RSET_INPUT));
    
    addInput(Port::create<PJ301MPort>(Vec(10.281, 169.01), Port::INPUT, module, GenEcho::BPTS_INPUT));
    addInput(Port::create<PJ301MPort>(Vec(10.281, 236.72), Port::INPUT, module, GenEcho::ASTP_INPUT));
    addInput(Port::create<PJ301MPort>(Vec(10.281, 306.00), Port::INPUT, module, GenEcho::DSTP_INPUT));

    addOutput(Port::create<PJ301MPort>(Vec(50.50, 347.46), Port::OUTPUT, module, GenEcho::SINE_OUTPUT));
  }
示例#3
0
void MainWin::open_lm_cb_i()
{
    if( m_Mode != LOOPMENU )
    {
        setPanel( LOOPMENU );
        this->setDate( "Loop Menu" );
        DataPair dp( LOOP_OPEN, "");
        notifyObservers(dp);
    }
}
AutoHideBehavior::AutoHideBehavior(QWidget* panel)
: AbstractVisibilityBehavior(panel)
, m_autohideTimer(new QTimer(this))
, m_edgeHitDetector(0)
{
    m_autohideTimer->setSingleShot(true);
    m_autohideTimer->setInterval(AUTOHIDE_TIMEOUT);
    connect(m_autohideTimer, SIGNAL(timeout()), SLOT(hidePanel()));

    setPanel(panel);
}
void ArpConfigurePanel::SendSetPanel(int32 tab)
{
	BTab* tabobj = TabAt(tab);
	if( tabobj ) {
		BView* view = tabobj->View();
		if( view ) {
			BMessenger target(view);
			if( target.IsValid() ) {
				BMessage setPanel(ARP_SET_CONFIG_PANEL_MSG);
				setPanel.AddMessenger("panel", BMessenger(this));
				target.SendMessage(&setPanel);
				ArpD(cdb << ADH << "Sent config panel msg: "
						<< setPanel << endl);
			} else {
				ArpD(cdb << ADH << "Invalid messenger for view, "
						<< "couldn't send panel message!" << endl);
			}
		}
	}
}
void OSD::write_xy(uint8_t x, uint8_t y, uint8_t c){
//    extern OSD osd;
    setPanel(x,y);
    OSD::write_S(c);
}