コード例 #1
62
ファイル: game_main.cpp プロジェクト: yongjunlee/connect-six
/*
  *点击“关于”执行此函数
  *弹出对话框
  */
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()));
}
コード例 #2
0
ファイル: main.cpp プロジェクト: TonyLittleBoy/Practice
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();
}
コード例 #3
0
ファイル: video_output_qt.cpp プロジェクト: GiR-Zippo/bino
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);
}
コード例 #4
0
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();
}
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();
}
コード例 #6
0
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." ) );
  }
}
コード例 #7
0
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();
}
コード例 #8
0
ファイル: main.cpp プロジェクト: jesper/ilineedit
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();
}
コード例 #9
0
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;
}
コード例 #10
0
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{
コード例 #11
0
ファイル: main.cpp プロジェクト: protoman/rockbot
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();
}
コード例 #12
0
ファイル: quetzalrequest.cpp プロジェクト: euroelessar/qutim
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);
}
コード例 #13
0
ファイル: GtfReader.cpp プロジェクト: marshallds/skittle
/**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();
		}
	}
}
コード例 #14
0
ファイル: main.cpp プロジェクト: ChampagneYo/qtsolutions
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();
}
コード例 #15
0
void
MarControlGUI::showVectorTable()
{
  // if(control_->getType() != 5) //if not a vector, do nothing
  // return;
	
	realvec vec = control_->to<mrs_realvec>();

	if(vec.getSize() == 0)
	{
		QMessageBox::information(this, "Empty vector!",QString::fromStdString(cname_),QMessageBox::Ok,
			 										QMessageBox::NoButton,QMessageBox::NoButton);
		return;
	}

	int rows = (int)(vec.getRows());
	int cols = (int)(vec.getCols());
	
	vecTable_ = new QTableWidget(rows, cols, NULL);
	vecTable_->setWindowTitle(QString::fromStdString(cname_));
	vecTable_->setAttribute(Qt::WA_DeleteOnClose, true);
	
	for(int r = 0; r < rows; r++)
		for(int c = 0; c < cols; c++)
		{
			QString svalue = QString::number(vec(r,c));
			QTableWidgetItem *cell = new QTableWidgetItem(svalue);
			//cell->setFlags(Qt::ItemFlags(cell->flags() & (!Qt::ItemIsEditable))); //[!]
			vecTable_->setItem(r, c, cell);
		}

	vecTable_->resizeColumnsToContents();

	connect(vecTable_, SIGNAL(itemChanged(QTableWidgetItem*)),
										this, SLOT(toMarControl(QTableWidgetItem*)));

	connect(vecTable_, SIGNAL(destroyed(QObject*)),
		this, SLOT(vecTableDestroyed()));

	QDialog* vecDialog = new QDialog(this);
	QGridLayout* layout = new QGridLayout(vecDialog);
	layout->addWidget(vecTable_);
	vecDialog->show();
}
コード例 #16
0
ファイル: main.cpp プロジェクト: descent/qtermwidget
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setApplicationName(app.translate("main", "Browser Window"));
#ifdef Q_WS_MAC
    app.setCursorFlashTime(0);
#endif

    if (int error = enableNetworkProxying())
        return error;

    QWebSettings *webSettings = QWebSettings::globalSettings();
    webSettings->setAttribute(QWebSettings::AutoLoadImages, true);
    webSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
    webSettings->setAttribute(QWebSettings::PluginsEnabled, true);
#if QT_VERSION >= 0x040500
    webSettings->setAttribute(QWebSettings::ZoomTextOnly, true);
#endif
#ifdef DEBUG
    webSettings->setAttribute(QWebSettings::DeveloperExtrasEnabled,
                              true);
#endif

    QString url("en.wikipedia.org/wiki/Main_Page");
    if (argc > 1)
        url = argv[1];
    QDialog dialog;
    BrowserWindow *browser = new BrowserWindow(url);
    if (argc > 2) browser->showToolBar(false); // For testing; don't quote
    QDialogButtonBox *buttonBox = new QDialogButtonBox;
    QPushButton *quitButton = buttonBox->addButton(
            app.translate("main", "&Quit"),
            QDialogButtonBox::AcceptRole);
    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(browser, 1);
    layout->addWidget(buttonBox);
    dialog.setLayout(layout);
    QObject::connect(quitButton, SIGNAL(clicked()),
                     &dialog, SLOT(accept()));
    dialog.setWindowTitle(app.applicationName());
    dialog.setWindowFlags(Qt::WindowSystemMenuHint);
    dialog.show();
    return app.exec();
}
コード例 #17
0
ファイル: mainwindow.cpp プロジェクト: Team-2502/CodeTools
void MainWindow::showPlot()
{
    if(!currentImageSteps->at(currentImageSteps->size()-2))
        return;
//    if(!fp)
//        delete fp;
    QDialog* dlg = new QDialog(this);
//    QHBoxLayout* mainLayout = new QHBoxLayout(dlg);

//    fp = new FitnessPlot(currentImageSteps->at(currentImageSteps->size()-2));
//    fp->activate(currentImageSteps->at(currentImageSteps->size()-2),ui->rBox->value());
//    fp->resize(800,600);

//    mainLayout->addWidget(fp);
//    dlg->setLayout(mainLayout);
    dlg->setAttribute(Qt::WA_DeleteOnClose);
    dlg->resize(800,600);
    dlg->show();
}
コード例 #18
0
void AlbumCoverChoiceController::ShowCover(const Song& song) {
  QDialog* dialog = new QDialog(this);
  dialog->setAttribute(Qt::WA_DeleteOnClose, true);

  // Use (Album)Artist - Album as the window title
  QString title_text(song.effective_albumartist());
  if (!song.effective_album().isEmpty())
    title_text += " - " + song.effective_album();

  QLabel* label = new QLabel(dialog);
  label->setPixmap(AlbumCoverLoader::TryLoadPixmap(
      song.art_automatic(), song.art_manual(), song.url().toLocalFile()));

  // add (WxHpx) to the title before possibly resizing
  title_text += " (" + QString::number(label->pixmap()->width()) + "x" +
                QString::number(label->pixmap()->height()) + "px)";

  // if the cover is larger than the screen, resize the window
  // 85% seems to be enough to account for title bar and taskbar etc.
  QDesktopWidget desktop;
  int current_screen = desktop.screenNumber(this);
  int desktop_height = desktop.screenGeometry(current_screen).height();
  int desktop_width = desktop.screenGeometry(current_screen).width();

  // resize differently if monitor is in portrait mode
  if (desktop_width < desktop_height) {
    const int new_width = (double)desktop_width * 0.95;
    if (new_width < label->pixmap()->width()) {
      label->setPixmap(
          label->pixmap()->scaledToWidth(new_width, Qt::SmoothTransformation));
    }
  } else {
    const int new_height = (double)desktop_height * 0.85;
    if (new_height < label->pixmap()->height()) {
      label->setPixmap(label->pixmap()->scaledToHeight(
          new_height, Qt::SmoothTransformation));
    }
  }

  dialog->setWindowTitle(title_text);
  dialog->setFixedSize(label->pixmap()->size());
  dialog->show();
}
コード例 #19
0
ファイル: Plot.cpp プロジェクト: Fantasticer/qttrader
void Plot::markerDialog ()
{
  if (_plotSettings.selected){
      Entity *e = _plotSettings.selected->settings();
      if (e){
          QVariant *plugin = e->get(QString("plugin"));
          if (plugin){
              IMarkerPlugin *plug =dynamic_cast<IMarkerPlugin*>(((PluginFactory*)PluginFactory::getPluginFactory())->loadPlugin(plugin->toString()));
              if (plug){
                  QDialog* pDialog = plug->getDialog(this, e);
                  if (pDialog){
                      connect(pDialog, SIGNAL(accepted()), this, SLOT(markerDialog2()));
                      pDialog->show();
                  }
              }
          }
      }
  }
}
コード例 #20
0
void AlbumCoverChoiceController::ShowCover(const Song& song) {
  QDialog* dialog = new QDialog(this);
  dialog->setAttribute(Qt::WA_DeleteOnClose, true);

  // Use Artist - Album as the window title
  QString title_text(song.albumartist());
  if (title_text.isEmpty()) title_text = song.artist();

  if (!song.album().isEmpty()) title_text += " - " + song.album();

  dialog->setWindowTitle(title_text);

  QLabel* label = new QLabel(dialog);
  label->setPixmap(AlbumCoverLoader::TryLoadPixmap(
      song.art_automatic(), song.art_manual(), song.url().toLocalFile()));

  dialog->resize(label->pixmap()->size());
  dialog->show();
}
コード例 #21
0
void GameBoard::Settings()
{
    QDialog *ajuste = new QDialog;


    QPushButton *mudar = new QPushButton("Mudar Parametros");

    connect(mudar, SIGNAL(clicked()), SLOT(change()));



    QLabel *texto = new QLabel;
    QLabel *title = new QLabel("<b><big>Atalhos</big></b>");

    QFile *config = new QFile("/home/vinicius/svn/unball/estrategia/visualization/Visualization Last Version/Visualization_last/Tabela.txt");//Colocar o diretório ao qual se encontra o arquivo Tabela.txt

    if(!config->open(QFile::ReadOnly | QFile::Text))
    {
        return;
    }
    QTextStream mOut(config);
    QString mTexto = mOut.readAll();

    texto->setText(mTexto);



    QVBoxLayout *lay =new QVBoxLayout;
    lay->addWidget(title);
    lay->addWidget(texto);
    lay->addWidget(mudar);

    ajuste->setLayout(lay);
    config->flush();
    mOut.flush();
    config->close();



    ajuste->show();

}
コード例 #22
0
ファイル: tscontroller.cpp プロジェクト: AmurSU/TSProject
void TSController::startExam()
{
    readerThread->setReadingType(ReadAll);
    recordingStarted = true;
    readerThread->startRead();
    tempInScaleRate = 1.0/5000;
    tempOutScaleRate = 1.0/5000;
    volumeScaleRate = 1.0/5000;
    horizontalStep = 1.0;
    initPaintDevices();
    plotingTimer.start(100);
    QDialog *mvlDialog = new QDialog(this);
    volWidget = new Ui::TSVolSignalWidget();
    volWidget->setupUi(mvlDialog);
    volWidget->MVL->setText("50%");
    mvlDialog->setModal(false);
    mvlDialog->show();
    ui->startExam->setEnabled(false);
    ui->horizontalScrollBar->setEnabled(false);
}
コード例 #23
0
ファイル: qirda.cpp プロジェクト: makhtardiouf/qirda
void Qirda::SelectRcvDir(void) {
  QDialog *dialog = new QDialog(this);
  rcvDirPopUp.setupUi(dialog);

  newRcvDir = QFileDialog::getExistingDirectory(this, tr("Select a \
                directory"));

  if (!newRcvDir.isEmpty()) {
    rcvDirPopUp.rcvDirWidget->setText(newRcvDir);
    dialog->show();
    rcvDir = strdup(newRcvDir.toStdString().c_str());
    ShowStatMsg(
        QString(tr("Received files will be stored in ")).append(newRcvDir));

    workingDir.cd(rcvDir);
    workingDir.setCurrent(workingDir.absolutePath());
    qirdaReceiver->terminate();
    qirdaWin.rcvBt->setCheckState(Qt::Unchecked);
  }
}
コード例 #24
0
ファイル: UtmpWebView.cpp プロジェクト: 2life/BrowserCore
void UtmpWebView::SetFrameWindow(int flag)
{
    switch(flag)
    {
        case 0:
            this->close();
            break;
        case 1:
            this->showMinimized();
            break;
        case 2:
        {
            //全局也就只能有一个
            QDialog* d = new QDialog(this,(Qt::WindowMinimizeButtonHint|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint));
            d->setAttribute(Qt::WA_DeleteOnClose, true);
            QWebInspector* wi = new QWebInspector(d);
            wi->setPage(this->page());
            d->setLayout(new QVBoxLayout());
            d->layout()->setMargin(0);
            d->layout()->addWidget(wi);
            d->show();
            d->resize(600,350);
            break;
        }
        case 3:
        {
            QMessageBox::StandardButton rb = QMessageBox::information(NULL, "from QT", "这是网页让QT弹出的对话框", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
            if(rb == QMessageBox::Yes)
            {
                //这样直接调用,执行速度异常慢
                //this->page()->mainFrame()->evaluateJavaScript("Ext.Msg.alert('from ext','这是QT让网页弹出的对话框');");
                this->page()->mainFrame()->evaluateJavaScript("testFun();");
            }
            break;
        }
        case 4:
        {
            this->reload();
        }
    }
}
コード例 #25
0
void ctkCmdLineModuleExplorerShowXmlAction::run()
{
  QDialog* dialog = new QDialog();
  try
  {
    dialog->setWindowTitle(this->ModuleRef.description().title());
  }
  catch (const ctkCmdLineModuleXmlException&)
  {
    dialog->setWindowTitle(this->ModuleRef.location().toString());
  }

  dialog->setLayout(new QVBoxLayout());

  QHBoxLayout* buttonLayout = new QHBoxLayout();
  buttonLayout->addStretch(1);
  QPushButton* closeButton = new QPushButton(tr("Close"), dialog);
  buttonLayout->addWidget(closeButton);

  QTextEdit* textEdit = new QTextEdit(dialog);
  textEdit->setPlainText(this->ModuleRef.rawXmlDescription().data());

  QLabel* statusLabel = new QLabel(dialog);
  statusLabel->setWordWrap(true);
  if (this->ModuleRef.xmlValidationErrorString().isEmpty())
  {
    statusLabel->setText(tr("No validation errors."));
  }
  else
  {
    statusLabel->setText(this->ModuleRef.xmlValidationErrorString());
  }
  dialog->layout()->addWidget(statusLabel);
  dialog->layout()->addWidget(textEdit);
  dialog->layout()->addItem(buttonLayout);

  connect(closeButton, SIGNAL(clicked()), dialog, SLOT(close()));

  dialog->resize(800, 600);
  dialog->show();
}
コード例 #26
0
QWebView *QgsIdentifyResultsWebView::createWindow( QWebPage::WebWindowType type )
{
  QDialog *d = new QDialog( this );
  QLayout *l = new QVBoxLayout( d );

  QWebView *wv = new QWebView( d );
  l->addWidget( wv );

  wv->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
  wv->page()->setNetworkAccessManager( QgsNetworkAccessManager::instance() );
  wv->settings()->setAttribute( QWebSettings::LocalContentCanAccessRemoteUrls, true );
  wv->settings()->setAttribute( QWebSettings::JavascriptCanOpenWindows, true );
#ifdef QGISDEBUG
  wv->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
#endif

  d->setModal( type != QWebPage::WebBrowserWindow );
  d->show();

  return wv;
}
コード例 #27
0
ファイル: quetzalrequest.cpp プロジェクト: euroelessar/qutim
void *quetzal_request_action(const char *title, const char *primary,
                             const char *secondary, int default_action,
                             PurpleAccount *account, const char *who,
                             PurpleConversation *conv, void *user_data,
                             size_t action_count, va_list actions)
{
    qDebug() << Q_FUNC_INFO;
    Q_UNUSED(account);
    Q_UNUSED(who);
    Q_UNUSED(conv);
    QuetzalRequestActionList uiActions;
    while (action_count --> 0) {
        QString str = va_arg(actions, gchararray);
        PurpleRequestActionCb cb = va_arg(actions, PurpleRequestActionCb);
        uiActions << qMakePair(str, cb);
    }
    QDialog *dialog = new QuetzalActionDialog(title, primary, secondary,
            default_action, uiActions, user_data, NULL);
    dialog->show();
    return quetzal_request_guard_new(dialog);
}
コード例 #28
0
void MainWindow::showAbout()
{
    QDialog *about = new QDialog(this);
    about->setAttribute(Qt::WA_DeleteOnClose);
    about->setWindowTitle("About");

    QVBoxLayout *aboutLayout = new QVBoxLayout;
    QLabel *appName = new QLabel("BootLogo Changer 1.0", about);
    QFont font = appName->font();
    font.setPointSize(32);
    font.setBold(true);
    appName->setFont(font);
    appName->setAlignment(Qt::AlignCenter);
    aboutLayout->addWidget(appName);

    QLabel *aboutText = new QLabel("(c) 2013 Sergey Savkin", about);
    aboutLayout->addWidget(aboutText);

    about->setLayout(aboutLayout);
    about->show();
}
コード例 #29
0
ファイル: PlotWidget.cpp プロジェクト: Fantasticer/qttrader
void PlotWidget::editIndicator2 (QString name)
{
  Entity *e = _settings.value(name);
  if (! e)
    return;

  QVariant *plugin = e->get(QString("plugin"));
  if (! plugin)
    return;

  IIndicatorPlugin *pPlugin = dynamic_cast<IIndicatorPlugin*>(((PluginFactory*)PluginFactory::getPluginFactory())->loadPlugin(plugin->toString()));
  if (! pPlugin)
    return;

  QDialog* pDialog = pPlugin->dialog(this, e);
  if (!pDialog)
    return;
  
  connect(pDialog, SIGNAL(accepted()), this, SLOT(refresh()));
  pDialog->show();
}
コード例 #30
-1
ファイル: mainwindow.cpp プロジェクト: flyi/LDE
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("正在进行查找"));
}