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


C++ QDialog::show方法代码示例

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


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

示例1: main

int main(int argc, char *argv[])
{
	QApplication app(argc, argv);
	QLabel *label = new QLabel("Hello Qt!");
	label->show();
	
	QDialog *dialog = new QDialog();
	Ui_Dialog *ui_dialog = new Ui_Dialog();
	ui_dialog->setupUi(dialog);
	dialog->show();

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

示例2: on_action_Find_triggered

void MainWindow::on_action_Find_triggered()
{
    QDialog *findDlg = new QDialog(this);
    findDlg->setWindowTitle(tr("查找"));
    find_textLineEdit = new QLineEdit(findDlg);
    QPushButton *find_Btn = new QPushButton(tr("查找下一个"),findDlg);
    QVBoxLayout* layout = new QVBoxLayout(findDlg);
    layout->addWidget(find_textLineEdit);
    layout->addWidget(find_Btn);
    findDlg->show();
    connect(find_Btn,SIGNAL(clicked()),this,SLOT(show_findText()));
    second_statusLabel->setText(tr("正在进行查找"));
}
开发者ID:flyi,项目名称:LDE,代码行数:13,代码来源:mainwindow.cpp

示例3: about

/*
  *点击“关于”执行此函数
  *弹出对话框
  */
void Game_main::about()
{
    QDialog *Dblack = new QDialog();
    QVBoxLayout *vlayout = new QVBoxLayout;
    Dblack->setFixedSize(300,280);
    QLabel *label = new QLabel("Copy Right @ UESTC-CCSE wytk2008.net");
    QAbstractButton *bExit = new QPushButton("back");
    vlayout->addWidget(label);
    vlayout->addWidget(bExit);
    Dblack->setLayout(vlayout);
    Dblack->show();
    Dblack->connect(bExit,SIGNAL(clicked()),Dblack,SLOT(close()));
}
开发者ID:yongjunlee,项目名称:connect-six,代码行数:17,代码来源:game_main.cpp

示例4: wait_for_subtitle_renderer

int64_t video_output_qt::wait_for_subtitle_renderer()
{
    if (_subtitle_renderer.is_initialized())
    {
        return 0;
    }
    int64_t wait_start = timer::get_microseconds(timer::monotonic);
    exc init_exception;
    QDialog *mbox = NULL;
    // Show a dialog only in GUI mode
    if (_container_is_external && !dispatch::parameters().fullscreen())
    {
        mbox = new QDialog(_container_widget);
        mbox->setModal(true);
        mbox->setWindowTitle(_("Please wait"));
        QGridLayout *mbox_layout = new QGridLayout;
        QLabel *mbox_label = new QLabel(_("Waiting for subtitle renderer initialization..."));
        mbox_layout->addWidget(mbox_label, 0, 0);
        mbox->setLayout(mbox_layout);
        mbox->show();
    }
    else
    {
        msg::wrn(_("Waiting for subtitle renderer initialization..."));
    }
    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
    try
    {
        while (!_subtitle_renderer.is_initialized())
        {
            process_events();
            usleep(10000);
        }
    }
    catch (std::exception &e)
    {
        init_exception = e;
    }
    QApplication::restoreOverrideCursor();
    if (mbox)
    {
        mbox->hide();
        delete mbox;
    }
    if (!init_exception.empty())
    {
        throw init_exception;
    }
    int64_t wait_stop = timer::get_microseconds(timer::monotonic);
    return (wait_stop - wait_start);
}
开发者ID:GiR-Zippo,项目名称:bino,代码行数:51,代码来源:video_output_qt.cpp

示例5: mousePressEvent

void MenuButton::mousePressEvent ( QGraphicsSceneMouseEvent * event ) {
    QGraphicsItem::mousePressEvent(event);
    if(event->button() != Qt::LeftButton) return;
    if(currentMenu) {
        currentMenu->setFocus(); //BUG: doesnt seem to work
        return;
    }

    QDialog *menu = new QDialog(panelWindow);
    menu->move(event->screenPos().x(), event->screenPos().y());
    QVBoxLayout *layout = new QVBoxLayout();

    QCheckBox *editModeCheck = new QCheckBox("Edit Panel", menu);
    editModeCheck->setChecked(editMode);
    connect(editModeCheck, SIGNAL(clicked(bool)), panelWindow, SLOT(setEditMode(bool)));
    connect(editModeCheck, SIGNAL(clicked(bool)), this, SLOT(setEditMode(bool)));

    layout->addWidget(editModeCheck);
    QPushButton *addButton = new QPushButton("Add Item", menu);
    connect(addButton, SIGNAL(clicked()), panelWindow, SLOT(addItem()));
    layout->addWidget(addButton);

    QPushButton *saveButton = new QPushButton("Save panel", menu);
    connect(saveButton, SIGNAL(clicked()), panelWindow, SLOT(savePanel()));
    layout->addWidget(saveButton);

    QPushButton *loadButton = new QPushButton("Load panel", menu);
    connect(loadButton, SIGNAL(clicked()), panelWindow, SLOT(loadPanel()));
    layout->addWidget(loadButton);

    QPushButton *settingsButton = new QPushButton("App Settings", menu);
    connect(settingsButton, SIGNAL(clicked()), panelWindow, SLOT(showSettings()));
    connect(settingsButton, SIGNAL(clicked()), this, SLOT(closeCurrentMenu()));
    layout->addWidget(settingsButton);

    QPushButton *closeButton = new QPushButton("Close", menu);
    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeCurrentMenu()));
    layout->addWidget(closeButton);

    QPushButton *quitButton = new QPushButton("Quit", menu);
    connect(quitButton, SIGNAL(clicked()), panelWindow, SLOT(quit()));
    layout->addWidget(quitButton);

    currentMenu = menu;
    connect(currentMenu, SIGNAL(finished(int)), this, SLOT(closeCurrentMenu()));

    menu->setLayout(layout);
    menu->setModal(false);
    menu->show();
}
开发者ID:,项目名称:,代码行数:50,代码来源:

示例6: QDialog

LVRRemoveOutliersDialog::LVRRemoveOutliersDialog(LVRPointCloudItem* pc, LVRModelItem* parent, QTreeWidget* treeWidget, vtkRenderWindow* window) :
   m_pc(pc), m_parent(parent), m_treeWidget(treeWidget), m_renderWindow(window)
{
    // Setup DialogUI and events
    QDialog* dialog = new QDialog(m_treeWidget);
    m_dialog = new RemoveOutliersDialog;
    m_dialog->setupUi(dialog);

    connectSignalsAndSlots();

    dialog->show();
    dialog->raise();
    dialog->activateWindow();
}
开发者ID:Degot,项目名称:Las-Vegas-Reconstruction,代码行数:14,代码来源:LVRFilteringRemoveOutliersDialog.cpp

示例7: duplicate_clicked

void QgsComposerManager::duplicate_clicked()
{
  QListWidgetItem* item = mComposerListWidget->currentItem();
  if ( !item )
  {
    return;
  }

  QgsComposer* currentComposer = 0;
  QString currentTitle;
  QMap<QListWidgetItem*, QgsComposer*>::iterator it = mItemComposerMap.find( item );
  if ( it != mItemComposerMap.end() )
  {
    currentComposer = it.value();
    currentTitle = it.value()->title();
  }
  else
  {
    return;
  }

  QString newTitle = QgisApp::instance()->uniqueComposerTitle( this, false, currentTitle + tr( " copy" ) );
  if ( newTitle.isNull() )
  {
    return;
  }

  // provide feedback, since loading of template into duplicate composer will be hidden
  QDialog* dlg = currentComposer->busyIndicatorDialog( tr( "Duplicating composer..." ), this );
  dlg->show();

  QgsComposer* newComposer = QgisApp::instance()->duplicateComposer( currentComposer, newTitle );
  dlg->close();

  if ( newComposer )
  {
    // extra activation steps for Windows
    hide();
    newComposer->activate();

    // no need to add new composer to list widget, if just closing this->exec();
    close();
  }
  else
  {
    QMessageBox::warning( this, tr( "Duplicate Composer" ),
                          tr( "Composer duplication failed." ) );
  }
}
开发者ID:jacklibj,项目名称:readqgis,代码行数:49,代码来源:qgscomposermanager.cpp

示例8: main

int main(int argc, char *argv[])
{
  QApplication app(argc, argv);
  
  QDialog *dia = new QDialog;
  dia->setLayout(new QBoxLayout(QBoxLayout::TopToBottom, dia));

  dia->layout()->addWidget(new iLineEdit("First Name", dia));
  dia->layout()->addWidget(new iLineEdit("Last Name", dia));
  dia->layout()->addWidget(new QPushButton("Profit!", dia));
  
  dia->show();
  
  return app.exec();
}
开发者ID:jesper,项目名称:ilineedit,代码行数:15,代码来源:main.cpp

示例9: progressDialog

void ImageViewer::progressDialog() {
    QDialog *dialog = new QDialog(this);
    dialog->setModal(false);
    dialog->setFixedSize(QSize(700, 400));
    QGridLayout *dialogLayout = new QGridLayout(dialog);
    dialogLayout->setAlignment(Qt::AlignCenter);
    dialogLayout->addWidget(new QLabel("Generating Thumbnail", dialog));
    QProgressBar *progress = new QProgressBar(dialog);
    progress->setMaximum(100);
    progress->setValue(0);
    connect(this, SIGNAL(setProgress(int)), progress, SLOT(setValue(int)));
    dialogLayout->addWidget(progress);
    dialog->setLayout(dialogLayout);
    dialog->show();
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例10: createWindow

DirectoryWebView* DirectoryWebView::createWindow(QWebEnginePage::WebWindowType type)
{
	Q_UNUSED(type)

	QDialog *popup = new QDialog(this);
	QVBoxLayout *layout = new QVBoxLayout;

	DirectoryWebView *webview = new DirectoryWebView(this);
	layout->addWidget(webview);

	popup->setLayout(layout);
	popup->setWindowTitle(tr("ZIMA-CAD-Parts Technical Specifications"));
	popup->setWindowFlags(popup->windowFlags() | Qt::WindowMinMaxButtonsHint);
	popup->show();
	return webview;
}
开发者ID:ZIMA-Engineering,项目名称:ZIMA-CAD-Parts,代码行数:16,代码来源:directorywebview.cpp

示例11: main

int main(int argc, char *argv[])
{
	std::string EXEC_NAME;
	#ifndef WIN32
		EXEC_NAME = "editor";
    #else
		EXEC_NAME = "editor.exe";
	#endif

	std::string argvString = std::string(argv[0]);
    GAMEPATH = argvString.substr(0, argvString.size()-EXEC_NAME.size());
    std::cout << " *** EXEC_NAME: " << EXEC_NAME << ", FILEPATH: " << FILEPATH << ", SAVEPATH: " << SAVEPATH << " ***" << std::endl;

    FILEPATH = "";

    init_enum_names();
    assert_enum_items(); // check that stringfy variables are OK


    QApplication a(argc, argv);

    std::vector<std::string> game_list = Mediator::get_instance()->fio.read_game_list();

    MainWindow w;
    w.setWindowState(Qt::WindowMaximized);


    if (game_list.size() < 1) {
        NewGameDialog *new_game_dialog = new NewGameDialog();
        QObject::connect(new_game_dialog, SIGNAL(on_accepted(QString)), &w, SLOT(on_new_game_accepted(QString)));
        new_game_dialog->show();
    } else if (game_list.size() == 1) {
        FILEPATH = GAMEPATH + std::string("/games/") + game_list.at(0) + std::string("/");
        GAMENAME = game_list.at(0);
        Mediator::get_instance()->load_game();
        w.reload();
        w.show();
    } else {
        QDialog *open = new loadGamePicker();
        QObject::connect(open, SIGNAL(game_picked()), &w, SLOT(on_load_game_accepted()));
        open->show();
    }

	remove_duplicated();

    return a.exec();
}
开发者ID:protoman,项目名称:rockbot,代码行数:47,代码来源:main.cpp

示例12: start

void ApplicationManager::start(){
	//LOGO DISPLAY
	QDialog dialog;
	Ui::Dialog ui;
	ui.setupUi(&dialog);
	ui.hrIconLabel->setPixmap(QPixmap(":Sample/Resources/appIcon.png"));
	dialog.setWindowIcon(QIcon(":Sample/Resources/appIcon.ico"));
	dialog.show();
	QApplication::processEvents();

	//VARIABLE INITIALIZATION
	bool firstTime;
	std::string camera;
	float threshold;
	if (Utils::readPropertiesFile(firstTime, camera, threshold)){
		FIRSTTIME = firstTime;
		CAMERA = camera;
		THRESHOLD = threshold;
	}
	else{
		//error reading file or wrong parameters
		std::cout << "Exiting..." << std::endl;
		exit(0);
	}

	//SDK VARIABLE CREATION
	//In order to create use the Facial Recognition SDk you need to create the HrDLib variable.
	HrDLib hrd("./config", "./config/hrd_publicKey.txt", true);
		
	// Now that the sdk variable is created we need to tell him what camera are we going to use, \
	and to do so, we do one of the following:
	int license = hrd.getLicenseType();
	if (license != 2 && license != 3){		
		QMessageBox::critical(NULL, "Error!", "Invalid license.\n Please purchase a license to use this software.", QMessageBox::Close);
		return;
	}

	
	if (isdigit(camera[0])){
		//To use a USB camera or a webcam, we need to select what device is going to be used.
		//We use the device read in the properties file,\
		but for simplicity use 0, as it uses the first camera available in the computer.
		//It's also needed a pointer to the image so we can access it at any time (img).
		int device = atoi(&camera[0]);
		hrd.easySetImgFromDevice(device, img);
	}
	else{
开发者ID:incredibleye,项目名称:Facial-Recognition-Sample,代码行数:47,代码来源:ApplicationManager.cpp

示例13: addBookmark

/**SLOTS**/
void GtfReader::addBookmark()//int start, int end)
{
	QDialog parent;
	Ui_BookmarkDialog dialog;
	dialog.setupUi(&parent);
	
	std::stringstream ss;
	ss << ui.startDial->value();
	dialog.start->setText( QString( ss.str().c_str() ) );
	std::stringstream ss2;
	ss2 << ui.startDial->value() + ui.sizeDial->value();
	dialog.end->setText( QString(ss2.str().c_str() ) );
	dialog.sequence->setText( QString(chrName.c_str()) );
	
	parent.show();
	
	int result = parent.exec();
	if(result == QDialog::Accepted)
	{
		
		ofstream outFile;
		outFile.open(outputFilename.c_str(), ios::app);
		if(!outFile.fail())
		{
			outFile << dialog.sequence->text().toStdString()<<"\t";
			outFile << dialog.source->text().toStdString()<<"\t";
			outFile << dialog.feature->text().toStdString()<<"\t";
			outFile << dialog.start->text().toStdString() <<"\t";
			outFile << dialog.end->text().toStdString() << "\t";
			outFile << dialog.score->text().toStdString() << "\t";
			outFile << (dialog.strand->isChecked() ? "+" : "-") << "\t";//QCheckBox
			outFile << dialog.frame->currentText().toStdString() << "\t";//QComboBox
			outFile << dialog.note->toPlainText().toStdString() << "\t";//QPlainTextEdit
			outFile << "\n";
			outFile.close();
		
			track_entry entry = track_entry(dialog.start->text().toInt(), dialog.end->text().toInt(), color_entry(), dialog.note->toPlainText().toStdString());
			emit BookmarkAdded(entry, outputFilename);	
		}
		else
		{
			ErrorBox msg("Could not read the file.");
			outFile.close();
		}
	}
}
开发者ID:marshallds,项目名称:skittle,代码行数:47,代码来源:GtfReader.cpp

示例14: quetzal_request_guard_new

void *quetzal_request_choice(const char *title, const char *primary,
                             const char *secondary, int default_value,
                             const char *ok_text, GCallback ok_cb,
                             const char *cancel_text, GCallback cancel_cb,
                             PurpleAccount *account, const char *who,
                             PurpleConversation *conv, void *user_data,
                             va_list choices)
{
    qDebug() << Q_FUNC_INFO;
    Q_UNUSED(account);
    Q_UNUSED(who);
    Q_UNUSED(conv);
    QDialog *dialog = new QuetzalChoiceDialog(title, primary, secondary, default_value, ok_text, ok_cb,
            cancel_text, cancel_cb, user_data, choices);
    dialog->show();
    return quetzal_request_guard_new(dialog);
}
开发者ID:euroelessar,项目名称:qutim,代码行数:17,代码来源:quetzalrequest.cpp

示例15: main

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

    QtThumbWheel *wheel = new QtThumbWheel(&dialog);
    wheel->setRange(-100, 100);

    QLCDNumber *lcd = new QLCDNumber(&dialog);
    QObject::connect(wheel, SIGNAL(valueChanged(int)), lcd, SLOT(display(int)));

    QVBoxLayout *vbox = new QVBoxLayout(&dialog);
    vbox->addWidget(wheel);
    vbox->addWidget(lcd);

    dialog.show();
    return app.exec();
}
开发者ID:ChampagneYo,项目名称:qtsolutions,代码行数:18,代码来源:main.cpp


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