当前位置: 首页>>代码示例>>C++>>正文


C++ Dialog类代码示例

本文整理汇总了C++中Dialog的典型用法代码示例。如果您正苦于以下问题:C++ Dialog类的具体用法?C++ Dialog怎么用?C++ Dialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Dialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Dialog

void MainWindow::create_mat(){
    std::cout <<"Im here" << std::endl;
    Dialog* newd = new Dialog(rnum, cnum, this);
    connect(newd, SIGNAL(send_coord(int,int)), this, SLOT(create_new(int,int)));
    newd->exec();

}
开发者ID:antuan1996,项目名称:univer-2year-,代码行数:7,代码来源:mainwindow.cpp

示例2: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    Dialog dialog;
    dialog.show();
    return app.exec();
}
开发者ID:OSTcafe,项目名称:LaunchPad-part2,代码行数:7,代码来源:main.cpp

示例3: on_actionVerbindung_triggered

//öffnet den Dialog für den Verbindungsaufbau
void Steuerung::on_actionVerbindung_triggered()
{
    Dialog verbindung;
    verbindung.setModal(true);
    QObject::connect(&verbindung,SIGNAL(setServer(QString,int)),this,SLOT(setClient(QString,int)));
    verbindung.exec();
}
开发者ID:oevermann,项目名称:flaming-robot,代码行数:8,代码来源:steuerung.cpp

示例4: main

int main(int argc, char *argv[])
{
  QApplication a(argc, argv);
  Dialog w;
  w.show();
  return a.exec();
}
开发者ID:RLED,项目名称:ProjectRichelBilderbeek,代码行数:7,代码来源:main.cpp

示例5: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QTextCodec *codec = QTextCodec::codecForName("UTF-8");

    QTextCodec::setCodecForTr(codec);
    QTextCodec::setCodecForCStrings(codec);
    QTextCodec::setCodecForLocale(codec);//GB18030

    QString translatorFileName = QLatin1String("qt_");
    translatorFileName += QLocale::system().name();
    QTranslator *translator = new QTranslator(&app);
    if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
        app.installTranslator(translator);

    Dialog dialog;
#ifdef Q_OS_SYMBIAN
    dialog.showMaximized();
#else
    dialog.show();
#endif

    return app.exec();
}
开发者ID:xylin,项目名称:standarddialogs,代码行数:25,代码来源:main.cpp

示例6: itor

bool Appearance::terminateDialogs(bool terminateHeldDialogs)
{
   Os::Logger::instance().log(FAC_SAA, PRI_DEBUG,
                 "Appearance::terminateDialogs this = %p, mUri = '%s': terminating %zu dialogs",
                 this, mUri.data(), mDialogs.entries());
   UtlHashMapIterator itor(mDialogs);
   UtlString* handle;
   bool ret = false;  // nothing changed
   while ( (handle = dynamic_cast <UtlString*> (itor())) )
   {
      Dialog* pDialog = dynamic_cast <Dialog*> (itor.value());
      UtlString rendering;
      UtlString dialogState= STATE_TERMINATED;
      UtlString event;
      UtlString code;
      pDialog->getLocalParameter("+sip.rendering", rendering);
      pDialog->getState(dialogState, event, code);
      // unless told otherwise, do not terminate held dialogs:
      // they can still be picked up by another set
      if ( terminateHeldDialogs ||
            !((dialogState == STATE_CONFIRMED) && (rendering == "no"))
         )
      {
         Os::Logger::instance().log(FAC_SAA, PRI_DEBUG,
                       "Appearance::terminateDialogs dialog '%s'",
                       handle->data());
         pDialog->setState(STATE_TERMINATED, event, code);
         ret = true;
      }
   }
   return ret;
}
开发者ID:ClydeFroq,项目名称:sipxecs,代码行数:32,代码来源:Appearance.cpp

示例7: Dialog_OkCB

extern "C" void Dialog_OkCB(Widget, XtPointer clientData, XtPointer)
{
    Dialog 	      *dialog = (Dialog*)clientData;

    if (dialog->okCallback(dialog))
        dialog->unmanage();
}
开发者ID:BackupTheBerlios,项目名称:opendx2,代码行数:7,代码来源:Dialog.C

示例8: Dialog_CancelCB

extern "C" void Dialog_CancelCB(Widget, XtPointer clientData, XtPointer)
{
    Dialog 	      *dialog = (Dialog*)clientData;

    dialog->cancelCallback(dialog);
    dialog->unmanage();
}
开发者ID:BackupTheBerlios,项目名称:opendx2,代码行数:7,代码来源:Dialog.C

示例9: switch

INT_PTR Dialog::dlg_proc_proxy(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
{
Dialog* dlg = Dialog::get_instance(window);

	switch(message)
	{
	case WM_INITDIALOG:
		dlg = reinterpret_cast<Dialog*>(lParam);
		assert(dlg);
		dlg->window = window;
		Dialog::set_instance(window, dlg);
		break;
	case WM_DESTROY:
		assert(dlg);
		dlg->dlg_proc(message, wParam, lParam);
		dlg->window = NULL;
		Dialog::set_instance(window, NULL);
		return false;
	}

	if(dlg)
		return dlg->dlg_proc(message, wParam, lParam);
	else
		return false;
}
开发者ID:pezcode,项目名称:FireFly,代码行数:25,代码来源:Dialog.cpp

示例10: waitInputMessage

/*
  This function is defined here instead of PyGrxUI.cpp so that the message translations can be edited with one file
*/
std::string GrxUIMenuView::waitInputMessage(const std::string& message)
{
    Dialog dialog;
    dialog.setWindowTitle(_("Wait input message"));
    QVBoxLayout* vbox = new QVBoxLayout();
    dialog.setLayout(vbox);

    vbox->addWidget(new QLabel(message.c_str()));
    
    LineEdit* lineEdit = new LineEdit();
    connect(lineEdit, SIGNAL(returnPressed()), &dialog, SLOT(accept()));
    vbox->addWidget(lineEdit);

    PushButton* okButton = new PushButton(_("&OK"));
    okButton->setDefault(true);
    connect(okButton, SIGNAL(clicked()), &dialog, SLOT(accept()));
    vbox->addWidget(okButton);
    vbox->addStretch();
    
    dialog.show();

    MenuButtonBlock block(instance()->impl);
    QEventLoop eventLoop;
    connect(&dialog, SIGNAL(finished(int)), &eventLoop, SLOT(quit()));
    eventLoop.exec();

    return lineEdit->string();
}
开发者ID:hattorishizuko,项目名称:choreonoid,代码行数:31,代码来源:GrxUIMenuView.cpp

示例11: assert

void Screen::ShowDialog(Dialog *pDlg, bool fFade)
	{
	assert(pDlg);
	// do place console mode dialogs
	if (Application.isFullScreen || pDlg->IsViewportDialog())
		// exclusive or free dlg: center pos
		// evaluate own placement proc first
		if (!pDlg->DoPlacement(this, PreferredDlgRect))
			{
			if (pDlg->IsFreePlaceDialog())
				pDlg->SetPos((GetWidth() - pDlg->GetWidth()) / 2, (GetHeight() - pDlg->GetHeight()) / 2 + pDlg->IsBottomPlacementDialog()*GetHeight()/3);
			else if (IsExclusive())
				pDlg->SetPos((GetWidth() - pDlg->GetWidth()) / 2, (GetHeight() - pDlg->GetHeight()) / 2);
			else
				// non-exclusive mode at preferred viewport pos
				pDlg->SetPos(PreferredDlgRect.x+30, PreferredDlgRect.y+30);
			}
	// add to local component list at correct ordering
	int32_t iNewZ = pDlg->GetZOrdering(); Element *pEl; Dialog *pOtherDlg;
	for (pEl = GetFirst(); pEl; pEl = pEl->GetNext())
		if (pOtherDlg = pEl->GetDlg())
			if (pOtherDlg->GetZOrdering() > iNewZ)
				break;
	InsertElement(pDlg, pEl);
	// set as active, if not fading and on top
	if (!fFade && !pEl)
		// but not viewport dialogs!
		if (!pDlg->IsExternalDrawDialog())
			pActiveDlg = pDlg;
	// show it
	pDlg->fOK = false;
	pDlg->fShow = true;
	// mouse focus might have changed
	UpdateMouseFocus();
	}
开发者ID:lluchs,项目名称:clonk-rage,代码行数:35,代码来源:C4Gui.cpp

示例12: strtok

void MainWindow::open_dialog_1(){
    //when click start ,run no_gui app and show success/fail
    Dialog d;
    string temp,temp1;
    string exe_command = "FE_no_GUI.exe \"";
    exe_command += ui->label_5->text().toLocal8Bit().constData();
    exe_command += "\" \"";
    exe_command += ui->label_15->text().toLocal8Bit().constData();
    exe_command += "/\" \"";
    temp = ui->lineEdit_8->text().toLocal8Bit().constData();
    if(temp!=""){
    temp1 = strtok((char*)temp.c_str(),"-");
    temp1 += "\" \"";
    temp1 += strtok(NULL,"-");
    exe_command += temp1;
    }

    exe_command += "\" ";


    exe_command += ui->comboBox_5->currentText().toLocal8Bit().constData();


    if(system(exe_command.c_str())==0){
        d.changeLabel(QApplication::translate("Dialog", "Finish", 0));

    }
    else
        d.changeLabel(QApplication::translate("Dialog", "Fail", 0));
    d.setWindowFlags(Qt::WindowStaysOnTopHint);
    d.exec();
}
开发者ID:Po-haoHuang,项目名称:LED_FE_FS,代码行数:32,代码来源:mainwindow.cpp

示例13: ASSURE

BOOL CALLBACK Dialog::DlgProc(
	HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	Dialog* ptr = NULL;

	if (msg == WM_INITDIALOG)
	{
		ptr = (Dialog*) lParam;
		ASSURE(ptr != NULL)

		::SetWindowLong(hwnd, GWL_USERDATA, lParam);
		ptr->hwnd = hwnd;
	}
	else
	{
		// retrieve the lParam value which was originally pased
		// in on the initial creation of the dialog...?
		ptr = (Dialog*) ::GetWindowLong(hwnd, GWL_USERDATA);
	}

	if (ptr != NULL)
		return ptr->OnMsg(msg, wParam, lParam);
	else
		return FALSE;
}
开发者ID:Stymphalian,项目名称:RedDotForever,代码行数:25,代码来源:framework.cpp

示例14: main

int main(int argc, char *argv[])
{

    /*
    QPalette palette;
    palette.setColor(QPalette::Window, QColor(53,53,53));
    palette.setColor(QPalette::WindowText, Qt::white);
    palette.setColor(QPalette::Base, QColor(15,15,15));
    palette.setColor(QPalette::AlternateBase, QColor(53,53,53));
    palette.setColor(QPalette::ToolTipBase, Qt::white);
    palette.setColor(QPalette::ToolTipText, Qt::white);
    palette.setColor(QPalette::Text, Qt::white);
    palette.setColor(QPalette::Button, QColor(53,53,53));
    palette.setColor(QPalette::ButtonText, Qt::white);
    palette.setColor(QPalette::BrightText, Qt::red);
    palette.setColor(QPalette::Disabled, QPalette::Text, Qt::darkGray);
    palette.setColor(QPalette::Disabled, QPalette::ButtonText, Qt::darkGray);
    palette.setColor(QPalette::Highlight, QColor(142,45,197).lighter());
    palette.setColor(QPalette::HighlightedText, Qt::black);
    qApp->setPalette(palette);
    */
    QApplication a(argc, argv);
    qDebug() << QStyleFactory::keys();
    // a.setStyle(QStyleFactory::create("Fusion"));
    qApp->setStyle(QStyleFactory::create("Fusion"));
    Dialog w;
    w.show();

    return a.exec();
}
开发者ID:Rutle,项目名称:color-game,代码行数:30,代码来源:main.cpp

示例15: switch

LevelObject* LevelObjectFactory::produceLvlObj(int objID){
    switch(objID){
    case OBJ1:{
        LevelObject* lvlObj = new LevelObject(OBJ1, "Chair");
                                Dialog* dia = new Dialog(lvlObj);
                                std::shared_ptr<Dialog> ptr = std::shared_ptr<Dialog>(dia);
                                dia->setRunFunc(
                                                [ptr](){
                                                    LevelObject* parent = (*ptr).lvlObjParent;
                                                    if(parent->isPresent()){
                                                        Tools::printMsg("Hello, I am a chair!");
                                                        bool choice = Tools::printQuestion("Do you want to pick me up?");
                                                        if(choice){
                                                            parent->setPresence(false);
                                                            Game::instance()->getPlayer()->addItem(ItemFactory::produceItem(ItemFactory::ITEM1));
                                                        }
                                                    }
                                                }
                                                );
                                lvlObj->setDialog(dia);
                                return lvlObj;

    }
    default:break;
    }
    return 0;
}
开发者ID:txtadventure,项目名称:psychic-octo-lana,代码行数:27,代码来源:LevelObjectFactory.cpp


注:本文中的Dialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。