Example #1
0
void MainWindow::aboutLicense() {
    QDialog *dialog = new QDialog( this );

    QFile file( ":/GPL" );
    if(!file.open( QIODevice::ReadOnly | QIODevice::Text ))
        qCritical( "GPL LicenseFile not found" );

    QTextStream out ( &file );
    out.setFieldAlignment ( QTextStream::AlignCenter );

    QTextEdit *qteLicense = new QTextEdit ( dialog );
        qteLicense->setText ( out.readAll ());
        qteLicense->setReadOnly ( 1 );
    QPushButton *qpbClose = new QPushButton ( IconLoader::Load( "window-close" ), tr( "&Close" ), dialog );
        connect( qpbClose, SIGNAL( clicked()), dialog, SLOT( deleteLater()));

    qglDialog = new QGridLayout( dialog );
        qglDialog->addWidget( qteLicense, 0, 0 );
        qglDialog->addWidget( qpbClose, 1, 0, Qt::AlignRight );

        dialog->setLayout( qglDialog);
        dialog->setWindowTitle( "GNU General Public License" );
        dialog->setFixedSize( 550, 400 );
        dialog->exec();
}
Example #2
0
void MainWindow::openAboutDialogue()
{
    QString message = "<b>Flocus 0.1.0 (opensource)</b><br><br>"
            "Flocus stands for <b>F</b>ull needle <b>LOC</b>alization in <b>U</b>ltra<b>S</b>ound images.<br><br>"
            "Flocus applies various image processing algorithms <br>to data acquired by a SonixTouch ultrasound machine.<br><br>"
            "This project is included in the CAMI labex.";

    QString title = "About Flocus";
    QDialog *msg = new QDialog(this);
    msg->setWindowTitle(title);
    QVBoxLayout *layoutMsg = new QVBoxLayout;

    QLabel *iconLabel = new QLabel;
    QImage icon("../../fig/flocus_icon.png");
    iconLabel->setPixmap(QPixmap::fromImage(icon));
    iconLabel->setAlignment(Qt::AlignCenter);
    layoutMsg->addWidget(iconLabel);

    QLabel *text = new QLabel;
    text->setText(message);
    text->setAlignment(Qt::AlignCenter);
    layoutMsg->addWidget(text);

    QPushButton *buttonOK = new QPushButton("OK");
    buttonOK->setMaximumWidth(50);
    layoutMsg->addWidget(buttonOK,0,Qt::AlignCenter);

    msg->setLayout(layoutMsg);

    connect(buttonOK,SIGNAL(clicked()),msg,SLOT(accept()));

    msg->exec();
}
Example #3
0
void MainWindow::about()
{
    QLabel *label = new QLabel;
    QLabel *pix   = new QLabel;
    label->setText(tr("<p><b>关于</b></p> "
                      "<p>版本:    1.0</p>"
                      "<p>库:      Qt 4.8.1</p>"
                      "<p>数据库:  Sqlite</p>"
                      "<p>作者:    唐昊</p> "
                      "<p>Email:thddaniel92gmail.com</p>"));
    pix->setPixmap(QPixmap("images/money.png"));
    QToolButton *btn = new QToolButton;
    btn->setMinimumSize(60,40);
    btn->setText(tr("关闭"));
    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(pix);
    layout->addWidget(label);
    QHBoxLayout *layout2 = new QHBoxLayout;
    //layout2->addStretch(12);
    layout2->addWidget(btn,Qt::AlignHCenter);
    //layout2->addStretch(12);
    QVBoxLayout *layout3 = new QVBoxLayout;
    layout3->addLayout(layout);
    layout3->addLayout(layout2);
    QDialog *dlg = new QDialog;
    connect(btn,SIGNAL(clicked()),dlg,SLOT(close()));
    dlg->setWindowTitle(tr("关于"));
    dlg->setAttribute(Qt::WA_DeleteOnClose);
    dlg->setLayout(layout3);
    dlg->exec();


}
void GameBoard::Menu()
{
    QDialog *menu = new QDialog;
    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);

    menu->setLayout(lay);
    menu->show();

    config->flush();
    mOut.flush();
    config->close();

}
Example #5
0
void VcsEventWidgetPrivate::diffToPrevious()
{
    KDevelop::VcsEvent ev = m_logModel->eventForIndex( m_contextIndex );
    KDevelop::VcsRevision prev = KDevelop::VcsRevision::createSpecialRevision(KDevelop::VcsRevision::Previous);
    KDevelop::VcsJob* job = m_iface->diff( m_url, prev, ev.revision() );

    VcsDiffWidget* widget = new VcsDiffWidget( job );
    widget->setRevisions( prev, ev.revision() );
    QDialog* dlg = new QDialog( q );

    widget->connect(widget, &VcsDiffWidget::destroyed, dlg, &QDialog::deleteLater);

    dlg->setWindowTitle( i18n("Difference To Previous") );

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
    auto mainWidget = new QWidget;
    QVBoxLayout *mainLayout = new QVBoxLayout;
    dlg->setLayout(mainLayout);
    mainLayout->addWidget(mainWidget);
    QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setDefault(true);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    dlg->connect(buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept);
    dlg->connect(buttonBox, &QDialogButtonBox::rejected, dlg, &QDialog::reject);
    mainLayout->addWidget(widget);
    mainLayout->addWidget(buttonBox);

    dlg->show();
}
Example #6
0
void JBlockerMainWindow::slt_loadingStart()
{
    this->statusBar()->showMessage(tr("LOADING MESSAGES ..."));
    // QMessageBox::information(this, QString(), QString("PROGRAM NEED TO LOAD MESSAGES"), QMessageBox::Ok);
    /* Create dialog */
    QDialog dialog;
    dialog.setWindowTitle(tr("Account Selection"));
    QHBoxLayout* layout = new QHBoxLayout();
    /* Label for dialog */
    QLabel* dialogLabel = new QLabel(tr("Select An Account:"));
    layout->addWidget(dialogLabel, 0, Qt::AlignHCenter);
    /* Combo box for selecting account */
    QComboBox* accountComboBox = new QComboBox();
    accountComboBox->setFixedWidth(280);
    /* Get account name list from message core */
    accountComboBox->addItems(p_messageCore->getAccountNameList());
    layout->addWidget(accountComboBox, 0, Qt::AlignHCenter);
    /* Button for dialog */
    QPushButton* dialogButton = new QPushButton(tr("Confirm"));
    layout->addWidget(dialogButton, 0, Qt::AlignHCenter);
    dialog.setLayout(layout);
    QObject::connect(dialogButton, SIGNAL(clicked()), &dialog, SLOT(accept()));
    dialog.exec();
    if(dialog.result())
    {
        /* Set selected account id */
        p_messageCore->setSelectedAccountId(accountComboBox->currentIndex());
    }

    this->statusBar()->addPermanentWidget(p_progressBar, 0);
    p_progressBar->setValue(0);
    p_progressBar->show();
    /* Core runs */
    p_messageCore->run();
}
Example #7
0
int main(int argc,char *argv[])
{
    if (argc < 1)
        return 1;
    const QString skinFile = QString::fromUtf8(argv[1]);
    QApplication app(argc,argv);
    QMainWindow mw;

    DeviceSkinParameters params;
    QString errorMessage;
    if (!params.read(skinFile, DeviceSkinParameters::ReadAll, &errorMessage)) {
	qWarning() << errorMessage;
	return 1;
    }
    DeviceSkin ds(params, &mw);
    // View Dialog
    QDialog *dialog = new QDialog();
    QHBoxLayout *dialogLayout = new QHBoxLayout();
    dialog->setLayout(dialogLayout);
    QDialogButtonBox *dialogButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
    QObject::connect(dialogButtonBox, SIGNAL(rejected()), dialog, SLOT(reject()));
    QObject::connect(dialogButtonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
    dialogLayout->addWidget(dialogButtonBox);
    dialog->setFixedSize(params.screenSize());
    dialog->setParent(&ds, Qt::SubWindow);
    dialog->setAutoFillBackground(true);
    ds.setView(dialog);

    QObject::connect(&ds, SIGNAL(popupMenu()), &mw, SLOT(close()));
    QObject::connect(&ds, SIGNAL(skinKeyPressEvent(int,QString,bool)), &mw, SLOT(close()));
    mw.show();
    return app.exec();
}
void TagValueConfigurableSplitter::configureWithGUI()
{
    QDialog* dialog = new QDialog(qApp->activeWindow());
    dialog->setWindowTitle(QString("Configure"));
    QVBoxLayout* mainLayout = new QVBoxLayout();
    dialog->setLayout(mainLayout);
    dialog->setMinimumWidth(500);

    // Create tag selectors
    ::fwDicomIOFilterQt::widget::QTagSelectorWidget* tagSelector =
        new ::fwDicomIOFilterQt::widget::QTagSelectorWidget();
    tagSelector->setTagValue(m_tag);
    mainLayout->addWidget(tagSelector);

    // Create buttons
    QDialogButtonBox* buttonBox = new QDialogButtonBox(dialog);
    mainLayout->addWidget(buttonBox);
    QPushButton* okButton     = buttonBox->addButton(QDialogButtonBox::Ok);
    QPushButton* cancelButton = buttonBox->addButton(QDialogButtonBox::Cancel);

    QObject::connect(okButton, SIGNAL(clicked(void)), dialog, SLOT(accept(void)));
    QObject::connect(cancelButton, SIGNAL(clicked(void)), dialog, SLOT(reject(void)));


    int result = dialog->exec();
    if(result == QDialog::Accepted)
    {
        m_tag = tagSelector->getTag();
    }
}
Example #9
0
void UserFiles::showDelete(QList<QString> deleteInformation)
{
    QDialog *deleteDialog = new QDialog;
    QVBoxLayout *deleteLayout = new QVBoxLayout;
    QLabel *information = new QLabel;
    QPushButton *ok = new QPushButton("Ok");

    QString path = deleteInformation.at(0);
    QString name = deleteInformation.at(1);
    QString status = deleteInformation.at(2);

    if(status == "0") information->setText("Arquivo deletado com sucesso!");
    if(status == "1") information->setText("Voce nao esta logado!");
    if(status == "2") information->setText("Ocorreu erro no servidor!");

    deleteLayout->addWidget(information);
    deleteLayout->addWidget(ok);
    deleteDialog->setLayout(deleteLayout);

    connect(ok,SIGNAL(clicked()),deleteDialog,SLOT(close()));

    deleteDialog->exec();

    listWidget->removeItemWidget(currentFile);

}
Example #10
0
	void OpenSettingsDialog (Util::XmlSettingsDialog *xsd, const QString& name)
	{
		QDialog dia;
		dia.setWindowTitle (name);

		dia.setLayout (new QVBoxLayout ());
		dia.layout ()->addWidget (xsd);

		auto box = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
		QObject::connect (box,
				SIGNAL (accepted ()),
				&dia,
				SLOT (accept ()));
		QObject::connect (box,
				SIGNAL (rejected ()),
				&dia,
				SLOT (reject ()));
		QObject::connect (box,
				SIGNAL (accepted ()),
				xsd,
				SLOT (accept ()));
		QObject::connect (box,
				SIGNAL (rejected ()),
				xsd,
				SLOT (reject ()));
		dia.layout ()->addWidget (box);

		dia.exec ();
		xsd->setParent (0);
	}
Example #11
0
void Fix8Log::aboutSlot()
{

    QDialog *aboutDialog = new QDialog();
    QVBoxLayout *aboutLayout = new QVBoxLayout(0);

    QDialogButtonBox *dialogButtonBox = new QDialogButtonBox();

    dialogButtonBox->addButton(QDialogButtonBox::Ok);
    connect(dialogButtonBox,SIGNAL(clicked(QAbstractButton*)),
            aboutDialog,SLOT(close()));

    QQuickView *aboutView = new QQuickView(QUrl("qrc:qml/helpAbout.qml"));
    QQuickItem *qmlObject = aboutView->rootObject();
    qmlObject->setProperty("color",aboutDialog->palette().color(QPalette::Window));
    qmlObject->setProperty("bgColor",aboutDialog->palette().color(QPalette::Window));
    qmlObject->setProperty("version",QString::number(Globals::version));

    aboutView->setResizeMode(QQuickView::SizeRootObjectToView);

    QWidget *aboutWidget = QWidget::createWindowContainer(aboutView,0);
    aboutWidget->setPalette(aboutDialog->palette());
    aboutWidget->setAutoFillBackground(false);
    aboutDialog->setLayout(aboutLayout);

    aboutLayout->addWidget(aboutWidget,1);
    aboutLayout->addWidget(dialogButtonBox,0);
    aboutDialog->resize(500,400);
    aboutDialog->setWindowTitle(GUI::Globals::appName);
    aboutDialog->exec();
    aboutDialog->deleteLater();

}
Example #12
0
void MainWindow::about()
{
   QDialog *aboutdialog = new QDialog();
   int pSize = aboutdialog->font().pointSize();
   aboutdialog->setWindowTitle("About");
   aboutdialog->setFixedSize(pSize*27,pSize*17);

   QVBoxLayout *templayout = new QVBoxLayout();
   templayout->setMargin(5);

   QLabel *projectname = new QLabel(QString(APP_NAME) +"\t"+ QString(APP_VERSION));
   projectname->setFrameStyle(QFrame::Box | QFrame::Raised);
   projectname->setAlignment(Qt::AlignCenter);
   QLabel *projectauthors = new QLabel(QString(APP_DESIGNER) + "\n\nBMSTU\n\nNovember of 2015");
   projectauthors->setWordWrap(true);
   projectauthors->setAlignment(Qt::AlignCenter);
   QLabel *hyperlink = new QLabel("<a href='mailto:[email protected]?subject=Pointmetry'>Contact us at [email protected]");
   hyperlink->setOpenExternalLinks(true);
   hyperlink->setAlignment(Qt::AlignCenter);

   templayout->addWidget(projectname);
   templayout->addWidget(projectauthors);
   templayout->addWidget(hyperlink);

   aboutdialog->setLayout(templayout);
   aboutdialog->exec();

   delete hyperlink;
   delete projectauthors;
   delete projectname;
   delete templayout;
   delete aboutdialog;
}
Example #13
0
 void MapNetwork::proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator)
 {
     qDebug() << "Proxy Aut req" << proxy.hostName() << &authenticator;
     QDialog dialog;
     QGridLayout layout;
     QLabel username, password;
     username.setText("Username:"******"Password:"******"OK");
     connect(&button, SIGNAL(clicked()), &dialog, SLOT(accept()));
     layout.addWidget(&button, 2, 0, 1, 2, Qt::AlignCenter);
     dialog.setLayout(&layout);
     dialog.exec();
     authenticator->setUser(user.text());
     authenticator->setPassword(pass.text());
 }
Example #14
0
QDialog *MainWindow::createNewFileDialog(QSpinBox *width, QSpinBox *height,
        QCheckBox *transparentBackground)
{
    QDialog *dialog = new QDialog;
    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
            QDialogButtonBox::Cancel);
    QVBoxLayout *layout = new QVBoxLayout;

    QHBoxLayout *layout_1 = new QHBoxLayout;
    QLabel *label_1 = new QLabel(tr("Width"));
    width->setMaximum(800000);
    width->setValue(800);
    width->setSuffix("px");
    layout_1->addWidget(label_1);
    layout_1->addWidget(width);

    QHBoxLayout *layout_2 = new QHBoxLayout;
    QLabel *label_2 = new QLabel(tr("Height"));
    height->setMaximum(600000);
    height->setValue(600);
    height->setSuffix("px");
    layout_2->addWidget(label_2);
    layout_2->addWidget(height);

    layout->addLayout(layout_1);
    layout->addLayout(layout_2);
    layout->addWidget(transparentBackground);
    layout->addWidget(buttonBox);
    connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject()));
    dialog->setLayout(layout);
    return dialog;
}
Example #15
0
void gesamtbild::zeitanzeige(/*int dora, int hin, int may*/)
{
			qWarning() << "Zeit";


			QDialog *zeitw = new QDialog(this);
			QVBoxLayout layout(zeitw);
			QLabel *anzeige = new QLabel(tr("Time: Day %1,").arg(GAMEDATA->gametime().day()).append(QString("%1 hours").arg(GAMEDATA->gametime().hour())), zeitw);

// 			anzeige->setText(anzeige->text().append(QString(", %2 Uhr %3").arg( gameview->stunde, gameview->minute)));gameview->stunde
// 			qWarning() << anzeige->text().append(QString(", %2 Uhr %3").arg( gameview->stunde, gameview->minute));

			QPushButton *ok = new QPushButton("Ok",zeitw);
			ok->move(50, 50);
			layout.addWidget(anzeige);
			layout.addWidget(ok);
// 			zeitw->setGeometry(width()/2,height()/2,200,100);
			zeitw->setLayout(&layout);
			zeitw->setAutoFillBackground(true);
			zeitw->move(gameview->width()/2,gameview->height()/2);
  			zeitw->raise();
			zeitw->show();

			connect(ok, SIGNAL(clicked()), gameview, SLOT(endePause()));
			connect(ok, SIGNAL(clicked()), zeitw, SLOT(close()));
			connect(ok, SIGNAL(clicked()), zeitw, SLOT(deleteLater()));
}
void ClangDiagnosticConfigsSelectionWidget::connectToClangDiagnosticConfigsDialog(QPushButton *button)
{
    connect(button, &QPushButton::clicked, [this]() {
        ClangDiagnosticConfigsWidget *widget = new ClangDiagnosticConfigsWidget(currentConfigId());
        widget->layout()->setMargin(0);
        QDialog dialog;
        dialog.setWindowTitle(ClangDiagnosticConfigsWidget::tr("Diagnostic Configurations"));
        dialog.setLayout(new QVBoxLayout);
        dialog.layout()->addWidget(widget);
        auto *buttonsBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
        dialog.layout()->addWidget(buttonsBox);
        connect(buttonsBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
        connect(buttonsBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);

        const bool previousEnableLowerClazyLevels = codeModelSettings()->enableLowerClazyLevels();
        connect(&dialog, &QDialog::accepted, [widget, previousEnableLowerClazyLevels]() {
            QSharedPointer<CppCodeModelSettings> settings = codeModelSettings();
            const ClangDiagnosticConfigs oldDiagnosticConfigs
                    = settings->clangCustomDiagnosticConfigs();
            const ClangDiagnosticConfigs currentDiagnosticConfigs = widget->customConfigs();
            if (oldDiagnosticConfigs != currentDiagnosticConfigs
                 || previousEnableLowerClazyLevels != codeModelSettings()->enableLowerClazyLevels()) {
                const ClangDiagnosticConfigsModel configsModel(currentDiagnosticConfigs);
                if (!configsModel.hasConfigWithId(settings->clangDiagnosticConfigId()))
                    settings->resetClangDiagnosticConfigId();
                settings->setClangCustomDiagnosticConfigs(currentDiagnosticConfigs);
                settings->toSettings(Core::ICore::settings());
            }
        });
        dialog.exec();
    });
}
Example #17
0
void AboutDialog::displayFile(const QString &fileName, const QString &title)
{
    QDialog *dialog = new QDialog(this);
    QLayout *layout = new QVBoxLayout(dialog);
    QTextEdit *textEdit = new QTextEdit(dialog);
    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, dialog);

    textEdit->setStyleSheet(QLatin1String("font-family: monospace"));

    QFile file(fileName);
    if (file.open(QIODevice::ReadOnly)) {
        QString text = QTextStream(&file).readAll();
        textEdit->setPlainText(text);
    }

    textEdit->setReadOnly(true);
    connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(close()));
    buttonBox->setCenterButtons(true);
    layout->addWidget(textEdit);
    layout->addWidget(buttonBox);
    layout->setMargin(6);

    dialog->setLayout(layout);
    dialog->setWindowTitle(title);
    dialog->setWindowFlags(Qt::Sheet);
    dialog->resize(600, 350);
    dialog->exec();
}
Example #18
0
void Fenetre::modifSommetForme(Sommet *sommet)
{
    //Création d'une boîte de dialogue
    QDialog fenDiag;

    //Boutons OK et Annuler
    QHBoxLayout *layoutButton=new QHBoxLayout;
    QPushButton *okFenDiag=new QPushButton("&OK");
    QPushButton *cancFenDiag=new QPushButton("&Annuler");
    layoutButton->addWidget(okFenDiag);
    layoutButton->addWidget(cancFenDiag);

    connect(okFenDiag, SIGNAL(clicked()), &fenDiag, SLOT(accept()));
    connect(cancFenDiag, SIGNAL(clicked()), &fenDiag, SLOT(reject()));

    //Champ pour choisir la forme
    QComboBox *boxFormes=new QComboBox;
    boxFormes->addItems(graphe.getListeForme());

    //Ajout de tout ça à la fenêtre de dialogue
    QVBoxLayout *layoutFenetre=new QVBoxLayout;
    layoutFenetre->addWidget(boxFormes);
    layoutFenetre->addLayout(layoutButton);
    fenDiag.setLayout(layoutFenetre);

    //On affiche la fenêtre
    fenDiag.setVisible(true);
    fenDiag.setModal(true);

    //On traîte la demande
    if(fenDiag.exec()){ //Si on a cliqué sur ok !
        QString currentText=boxFormes->currentText();
        sommet->setForme(currentText);
    }
}
void CGraphicBuildingTile::display(QList<QString> _toDisplay)
{
    QDialog* infoDialog = new QDialog;//(dynamic_cast<QWidget*>(this->parent()));
    QVBoxLayout* newLayout = new QVBoxLayout();
    int q=0;
    QScrollArea* scrolArea = new QScrollArea(dynamic_cast<QWidget*>(this->parent()));
    for(int i=0;i<_toDisplay.count();i++)
    {   QLabel* newLabel = new QLabel(_toDisplay.at(i));
        newLabel->setFixedWidth(280);
        newLabel->setMinimumHeight(22);
        newLabel->setStyleSheet("border: 1px solid black");
        newLayout->addWidget(newLabel);
        q++;
    }
    QPalette pal;
    pal.setColor(QPalette::Background,QColor(230,200,167));
    infoDialog->setFixedWidth(330);
    infoDialog->setMinimumHeight(30+22*q);
    infoDialog->setLayout(newLayout);
    infoDialog->setAutoFillBackground(true);
    infoDialog->setPalette(pal);
    infoDialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setWidget(infoDialog);
    scrolArea->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setMaximumHeight(infoDialog->size().height()+2);
    scrolArea->setWindowTitle(QString("Info about"));
    scrolArea->show();
}
    void addView()
    {
        // the new View we want to add:
        osgViewer::View* view = new osgViewer::View();

        // a widget to hold our view:
        QWidget* viewWidget = new osgEarth::QtGui::ViewWidget(view);

        // a dialog to hold the view widget:
        QDialog* win = new QDialog(this);
        win->setModal( false );
        win->setLayout( new QHBoxLayout() );
        win->layout()->addWidget( viewWidget );
        int x = osgEarth::Random().next( 1024 );
        int y = osgEarth::Random().next( 768 );
        win->setGeometry( x, y, 640, 480 );
        win->show();

        // set up the view
        view->setCameraManipulator( new osgEarth::Util::EarthManipulator );
        view->setSceneData( _scene.get() );  
        view->getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false);

        // add it to the composite viewer.
        _viewer.addView( view );
    }
Example #21
0
//TODO: auto add new depend libraries information
void about()
{
    //we should use new because a qobject will delete it's children
    QTextBrowser *viewQtAV = new QTextBrowser;
    QTextBrowser *viewFFmpeg = new QTextBrowser;
    viewQtAV->setOpenExternalLinks(true);
    viewFFmpeg->setOpenExternalLinks(true);
    viewQtAV->setHtml(aboutQtAV_HTML());
    viewFFmpeg->setHtml(aboutFFmpeg_HTML());
    QTabWidget *tab = new QTabWidget;
    tab->addTab(viewQtAV, "QtAV");
    tab->addTab(viewFFmpeg, "FFmpeg");
    QPushButton *btn = new QPushButton(QObject::tr("Ok"));
    QHBoxLayout *btnLayout = new QHBoxLayout;
    btnLayout->addStretch();
    btnLayout->addWidget(btn);
    QDialog dialog;
    dialog.setWindowTitle(QObject::tr("About") + "  QtAV");
    QVBoxLayout *layout = new QVBoxLayout;
    dialog.setLayout(layout);
    layout->addWidget(tab);
    layout->addLayout(btnLayout);
    QObject::connect(btn, SIGNAL(clicked()), &dialog, SLOT(accept()));
    dialog.exec();
}
Example #22
0
int Busqueda_on_mui_buscar_clicked ( BlSearchWidget *busq )
{
    if ( busq->tableName() == "cliente" ) {

        QDialog *diag = new QDialog ( 0 );
        diag->setModal ( true );
        diag->setGeometry ( QRect ( 0, 0, 750, 550 ) );
        blCenterOnScreen ( diag );

        ClientsList *clients = new ClientsList ( ( BfCompany * ) busq->mainCompany(), diag, 0, BL_SELECT_MODE );
        busq->connect ( clients, SIGNAL ( selected ( QString ) ), diag, SLOT ( accept() ) );

        /// Creamos un layout donde estara el contenido de la ventana y la ajustamos al QDialog
        /// para que sea redimensionable y aparezca el titulo de la ventana.
        QHBoxLayout *layout = new QHBoxLayout;
        layout->addWidget ( clients );
        layout->setMargin ( 0 );
        layout->setSpacing ( 0 );
        diag->setLayout ( layout );
        diag->setWindowTitle ( clients->windowTitle() );

        diag->exec();

        if ( clients->idclient() != "" ) {
            busq->setId ( clients->idclient() );
        } // end if

        delete diag;
        return 1;
    } // end if

    return 0;
}
Example #23
0
/**
    \fn getProfileName  
    \brief Popup a dialog that asks the user the preset name
*/
static char *getProfileName(void)
{
  QDialog dialog;
  dialog.setWindowTitle(QString::fromUtf8("Save Profile"));
  QDialogButtonBox *buttonBox = new QDialogButtonBox();  
  QVBoxLayout *vboxLayout = new QVBoxLayout();
  buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);

  QObject::connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
  QObject::connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));

  QLineEdit *text=new QLineEdit;
//  text->setAcceptRichText(false);
  
  text->setText("my profile");
  text->selectAll();

  vboxLayout->addWidget(text);
  vboxLayout->addWidget(buttonBox);

  dialog.setLayout(vboxLayout);

  if(dialog.exec()!=QDialog::Accepted)
  {
        ADM_info("Canceled");
        return NULL;
  }
  QString fileName=text->text();
  const char *out=fileName.toUtf8().constData();
  return ADM_strdup(out);
}
void GeoRSSQtComponent::_displayGeoRSSItemGUI ( GeoRSSItem& item, Usul::Interfaces::IUnknown* caller )
{
  QDialog dialog ( 0x0 );
  
  // Make page to edit geoRSS values.
  GeoRSSItemWidget *page ( new GeoRSSItemWidget ( &dialog ) );
  page->title ( item.name() );
  page->description ( item.description() );
  
  const QDialogButtonBox::StandardButtons buttons ( QDialogButtonBox::NoButton|QDialogButtonBox::Ok );
  QDialogButtonBox *buttonBox ( new QDialogButtonBox ( buttons, Qt::Horizontal, &dialog ) );
  
  QObject::connect ( buttonBox, SIGNAL ( accepted() ), &dialog, SLOT ( accept() ) );
  
  QVBoxLayout *topLayout ( new QVBoxLayout );
  dialog.setLayout ( topLayout );
  
  topLayout->addWidget ( page );
  topLayout->addWidget ( buttonBox );
  
  // Set the title.
  dialog.setWindowTitle ( QString ( item.name().c_str() ) );
  
	dialog.exec();
}
Example #25
0
void UserFiles::showNewDir(QList<QString> newDirList)
{
    QDialog *newDirDialog = new QDialog;
    QPushButton *ok = new QPushButton("Ok");
    QLabel *information = new QLabel;
    QVBoxLayout *informationLayout = new QVBoxLayout;

    QString path = newDirList.at(0);
    QString name = newDirList.at(1);
    QString status = newDirList.at(2);

    if(status == "0") information->setText("Diretorio criado com sucesso!");
    if(status == "1") information->setText("Voce nao esta logado!");
    if(status == "2") information->setText("Ocorreu erro no servidor!");


    informationLayout->addWidget(information);
    informationLayout->addWidget(ok);
    newDirDialog->setLayout(informationLayout);

    connect(ok,SIGNAL(clicked()),newDirDialog,SLOT(close()));

    newDirDialog->exec();

    QListWidgetItem *item = new QListWidgetItem(QIcon(":/images/folder.jpeg"),name,listWidget,2);
}
Example #26
0
void MainWindow::about() {
    QDialog *dialog = new QDialog( this );

    QPushButton *qpbClose = new QPushButton( IconLoader::Load( "window-close"), tr( "&Close" ), dialog );
        connect( qpbClose, SIGNAL( clicked()), dialog, SLOT( deleteLater()));
    QPushButton *qpbCredits = new QPushButton( IconLoader::Load( "help-about"), tr( "C&redits" ), dialog );
        connect( qpbCredits, SIGNAL( clicked()), this, SLOT( aboutCredits()));
    QPushButton *qpbLicense = new QPushButton( tr( "&License" ), dialog );
        connect( qpbLicense, SIGNAL( clicked()), this, SLOT( aboutLicense()));

    QLabel *qlAbout = new QLabel( dialog );
        qlAbout->setText( tr("<center><h1>%1 %2</h1><h3>For better use of leo.org</h3>Copyright \251 2010 %3</center>")
                        .arg( APP_NAME ).arg( APP_VERSION ).arg( APP_NAME ));


    qglDialog = new QGridLayout( dialog );
        qglDialog->addWidget( qlAbout, 0, 0, 1, 3, Qt::AlignCenter );
        qglDialog->addWidget( qpbCredits, 1, 0, Qt::AlignCenter );
        qglDialog->addWidget( qpbLicense, 1, 1, Qt::AlignCenter );
        qglDialog->addWidget( qpbClose, 1, 2, Qt::AlignCenter );

        dialog->setWindowTitle( tr( "About %1").arg( APP_NAME ));
        dialog->setLayout( qglDialog );
        dialog->setFixedSize( 312, 156 );
        dialog->exec();
}
unsigned StManagerStudyListComp::getSeriesIndex( const SerieInfoVector info )
{
  // no resize, just exit button - reject, result code is 0 -> returned value will be 0
  QDialog *seriesSelectorDialog = new QDialog( this, Qt::WindowTitleHint | Qt::WindowSystemMenuHint| Qt::MSWindowsFixedSizeDialogHint );
  seriesSelectorDialog->setWindowTitle( tr( "Series Selector" ) );

  QVBoxLayout *mainLayout = new QVBoxLayout;

  QLabel *seriesLabel = new QLabel( tr( "Series in selected study:\n(their descriptions)" ) );
  mainLayout->addWidget( seriesLabel );

  QSpacerItem *verticalSpacer = new QSpacerItem( 2, 10, QSizePolicy::Minimum, 
                                                 QSizePolicy::Minimum );
  mainLayout->addItem( verticalSpacer );

  QTableWidget *seriesTable = createSeriesSelectionTable();
  seriesTable->setRowCount( info.size() );
  for ( unsigned i = 0; i < info.size(); i++ ) {
    seriesTable->setItem( i, 0, new QTableWidgetItem( QString( info[i].description.c_str() ) ) );
  }
  connect( seriesTable, SIGNAL(cellClicked( int, int )), seriesSelectorDialog, SLOT(done( int )) );
  mainLayout->addWidget( seriesTable );

  seriesSelectorDialog->setLayout( mainLayout );

  return seriesSelectorDialog->exec();
}
Example #28
0
void QEbuMainWindow::actionAbout()
{
    QDialog *aboutDialog = new QDialog(this);
    aboutDialog->setWindowTitle(tr("About QEbu"));

    QHBoxLayout *hLayout = new QHBoxLayout;

    QPixmap logo(":/images/qebu-icon_256.png");
    QLabel *imageLabel = new QLabel;
    imageLabel->setPixmap(logo);
    hLayout->addWidget(imageLabel, Qt::AlignTop);

    QLabel *text = new QLabel(tr("<h2>About QEbu</h2><br>QEbu is a full-fledged graphical editor that supports creation and editing of documents following the EbuCore metadata specification."
                                 "<br><br>More information on EBU metadata activities is provided on the <a href=\"http://tech.ebu.ch/metadata\">EBU TECHNICAL website</a>."
                                 "<br><br>This program is licensed to you under terms of the GNU General Public License Version 3 as published by Free Software Foundation."
                                 "<br><br>The program is provided AS IS with NO WARRANTY OF ANY KIND."
                                 ));
    text->setOpenExternalLinks(true);
    text->setWordWrap(true);
    text->setAlignment(Qt::AlignJustify);
    QVBoxLayout *vLayout = new QVBoxLayout;
    vLayout->addWidget(text);
    QDialogButtonBox *dialogButtonBox = new QDialogButtonBox(
                QDialogButtonBox::Ok,
                Qt::Horizontal);
    vLayout->addWidget(dialogButtonBox, Qt::AlignRight);
    hLayout->addLayout(vLayout);
    aboutDialog->setLayout(hLayout);
    dialogButtonBox->button(QDialogButtonBox::Ok)->setDefault(true);
    QObject::connect(dialogButtonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
                     aboutDialog, SLOT(close()));
    aboutDialog->exec();
}
void MainWindow::show_about()
{
   QDialog *aboutdialog = new QDialog(); 
   int pSize = aboutdialog->font().pointSize();
   aboutdialog->setWindowTitle("About");
   aboutdialog->setFixedSize(pSize*30,pSize*17);

   QVBoxLayout *templayout = new QVBoxLayout();
   templayout->setMargin(APP_MARGIN);

   QLabel *projectname = new QLabel(QString(APP_NAME) +"\t"+ QString(APP_VERS));
   projectname->setFrameStyle(QFrame::Box | QFrame::Raised);
   projectname->setAlignment(Qt::AlignCenter);
   QLabel *projectauthors = new QLabel("Designed by: Taranov Alex\n\nFirst release was in 2014");
   projectauthors->setWordWrap(true);
   projectauthors->setAlignment(Qt::AlignCenter);
   QLabel *hyperlink = new QLabel("<a href='mailto:[email protected]?subject=QVideoProcessing'>Contact us at [email protected]");
   hyperlink->setToolTip("Will try to open your default mail client");
   hyperlink->setOpenExternalLinks(true);
   hyperlink->setAlignment(Qt::AlignCenter);

   templayout->addWidget(projectname);
   templayout->addWidget(projectauthors);
   templayout->addWidget(hyperlink);

   aboutdialog->setLayout(templayout);
   aboutdialog->exec();

   delete hyperlink;
   delete projectauthors;
   delete projectname;
   delete templayout;
   delete aboutdialog;
}
Example #30
-1
void MainWindow::aboutCredits() {
    QDialog *dialog = new QDialog( this );

    QTextEdit *qteCreditsWritten = new QTextEdit( dialog );
        qteCreditsWritten->setReadOnly( 1 );
        qteCreditsWritten->setLineWrapMode( QTextEdit::NoWrap );
        qteCreditsWritten->setText( "Tim Kleinschmidt <*****@*****.**>" );

    QTextEdit *qteCreditsArtwork = new QTextEdit( dialog );
        qteCreditsArtwork->setReadOnly( 1 );
        qteCreditsArtwork->setLineWrapMode( QTextEdit::NoWrap );
        qteCreditsArtwork->setText( "Elementary Theme\n" );

    QTabWidget *qtwCredits = new QTabWidget( dialog );
        qtwCredits->addTab( qteCreditsWritten, tr( "Written by" ));
        qtwCredits->addTab( qteCreditsArtwork, tr( "Artwork by" ));
        qtwCredits->setElideMode( Qt::ElideRight );

    QPushButton *qpbClose = new QPushButton( IconLoader::Load( "window-close"), tr( "&Close" ), dialog );
        connect( qpbClose, SIGNAL( clicked()), dialog, SLOT( close()));

    qglDialog = new QGridLayout( dialog );
    qglDialog->addWidget( qtwCredits, 0, 0,Qt::AlignCenter );
    qglDialog->addWidget( qpbClose, 1, 0, Qt::AlignRight );

    dialog->setWindowTitle( tr( "Credits" ));
    dialog->setLayout( qglDialog );
    dialog->setFixedSize( 250, 200 );
    dialog->exec();
}