/*! Constructor */
StateBasedPhiWidget::StateBasedPhiWidget(QWidget *parent) : AbstractAnalysisWidget(parent){
	QVBoxLayout *mainVerticalBox = new QVBoxLayout(this);

	//Create a state based phi analysis dao to be used by this class
	stateDao = new StateBasedPhiAnalysisDao(Globals::getAnalysisDao()->getDBInfo());

	//Initialize analysis parameters and other variables
	initializeAnalysisInfo();

	//Set up analysis runner with function to create threads to analyze for state-based phi
	analysisRunner->setTimeStepThreadCreationFunction(&createAnalysisTimeStepThread);

	//Add tool bar to top of widget
	toolBar = getDefaultToolBar();
	checkToolBarEnabled();//Can only carry out analysis if a network and archive are loaded
	mainVerticalBox->addWidget(toolBar);

	//Create a tabbed widget to hold progress and results
	QTabWidget* tabWidget = new QTabWidget(this);

	//Add the model and view displaying the current analysis
	fullResultsModel = new FullResultsModel(&analysisInfo, stateDao);
	QTableView* fullResultsTableView = new FullResultsTableView(this, fullResultsModel);
	fullResultsTableView->setMinimumSize(500, 500);
	tabWidget->addTab(fullResultsTableView, "Results");

	//Add widget displaying progress
	progressWidget = new ProgressWidget(this);
	connect(analysisRunner, SIGNAL(progress(const QString&, unsigned int, unsigned int, unsigned int)), progressWidget, SLOT(updateProgress(const QString&, unsigned int, unsigned int, unsigned int)), Qt::QueuedConnection);
	connect(analysisRunner, SIGNAL(timeStepComplete(unsigned int)), progressWidget, SLOT(timeStepComplete(unsigned int)), Qt::QueuedConnection);
	progressWidget->setMinimumSize(500, 500);
	QScrollArea* progressScrollArea = new QScrollArea(this);
	progressScrollArea->setWidget(progressWidget);
	tabWidget->addTab(progressScrollArea, "Progress");
	mainVerticalBox->addWidget(tabWidget);

	mainVerticalBox->addStretch(5);
}
//-----------------------------------------------------------------------------
// Function: ComponentEditorSettingsPage::createWorkspacePages()
//-----------------------------------------------------------------------------
QStackedWidget* ComponentEditorSettingsPage::createWorkspacePages(QString currentWorkspaceName, 
	QStringList workspaceNames)
{
	SettingsPage::settings().beginGroup("Workspaces");

	SettingsPage::settings().beginGroup(currentWorkspaceName + "/ComponentEditorFilters/HW/Flat");
	QStringList hwCheckBoxNames = SettingsPage::settings().childKeys();
	SettingsPage::settings().endGroup(); // workspaceName/ComponentEditorFilters/HW

	SettingsPage::settings().beginGroup(currentWorkspaceName + "/ComponentEditorFilters/SW");
	QStringList swCheckBoxNames = SettingsPage::settings().childKeys();
	SettingsPage::settings().endGroup(); // workspaceName/ComponentEditorFilters/SW

	SettingsPage::settings().endGroup(); // Workspaces
	
	QStringList hierarchyNames = getHierarchyNames();
	hwCheckBoxNames = changeNameSeparators(hwCheckBoxNames);
	swCheckBoxNames = changeNameSeparators(swCheckBoxNames);
	QStackedWidget* workspaces = new QStackedWidget;

	for (int workspaceIndex = 0; workspaceIndex < workspaceNames.size(); ++workspaceIndex)
	{
	    QTableWidget* hwTable = new QTableWidget (hwCheckBoxNames.size(), hierarchyNames.size(), this);
		setHwTable(hwTable, hierarchyNames, hwCheckBoxNames, workspaceIndex);

		QTableWidget* swTable = new QTableWidget (swCheckBoxNames.size(), 1, this);
		QStringList swHeader("Global");
		setSwTable(swTable, swHeader, swCheckBoxNames, workspaceIndex);
		
		QTabWidget* wareTab = new QTabWidget;
	    wareTab->addTab(hwTable, "Hardware");
    	wareTab->addTab(swTable, "Software");

		workspaces->addWidget(wareTab);
	}

	return (workspaces);
}
Example #3
0
void Dialog::ouvrirAbout()
{
    QDialog *APropos = new QDialog(this, Qt::WindowCloseButtonHint);
    APropos->setFixedSize(300, 200);
    APropos->setWindowTitle("A Propos de QColor Slider RGB");

    QTabWidget *tab = new QTabWidget(APropos);      //QTABWIDGET incluant un QLabel et deux QTextEdit
    tab->setGeometry(5, 5, 290, 190);

    QLabel *infos = new QLabel(APropos);
    infos->setTextFormat(Qt::RichText); //format texte RTF
    infos->setText("<P><h3>QColor Slider RGB</h3></p><p>Créer par Pierre Leroux</p><p>Compilé le 12/01/2012<p><p>Version 1.0</p>");
    infos->setAlignment(Qt::AlignCenter);

    QTextEdit *Alire = new QTextEdit(APropos);
    Alire->setText("Ce programme est fournit « EN L'ÉTAT », SANS GARANTIE D'AUCUNE SORTE, INCLUANT, SANS S'Y LIMITER, LES GARANTIES D'ABSENCE DE DÉFAUT, DE QUALITÉ MARCHANDE, D'ADÉQUATION À UN USAGE PARTICULIER.");
    Alire->setReadOnly(true);

    QTextEdit *licence = new QTextEdit(APropos);
    licence->setText("<p>This program is free software: you can redistribute it and/or modify"
                     "it under the terms of the GNU General Public License as published by"
                     "the Free Software Foundation, either version 3 of the License, or"
                     "(at your option) any later version."
                     "This program is distributed in the hope that it will be useful,"
                     "but WITHOUT ANY WARRANTY; without even the implied warranty of"
                     "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the"
                     "GNU General Public License for more details."
                     "You should have received a copy of the GNU General Public License"
                     "along with this program. If not, see http://www.gnu.org/licenses/.</p>");

    licence->setReadOnly(true);

    tab->addTab(infos, "Information");
    tab->addTab(Alire, "A lire");
    tab->addTab(licence, "GNU General Public License");

    APropos->exec();    //ouverture de la fenetre
}
Example #4
0
void Monofin::configurate()
{
    int nbLayers = _projectFile->getHowManyLayers();
    _paramDiag->setNbLayers(nbLayers);
    for (int i=0; i < nbLayers; ++i) {
        _paramDiag->updateLayerDensity(i, _projectFile->getLayerConfigRho(i));
        _paramDiag->updateLayerPoissonRatio(i, _projectFile->getLayerConfigPoisson(i));
        _paramDiag->updateLayerYoungModulus(i, _projectFile->getLayerConfigYoung(i));
    }
    if(_paramDiag->exec()) {
        QTabWidget *qtw = _paramDiag->layerTabWidget;
        if (qtw->count() > 0) {
            _projectFile->startHistory(Data::MonofinLayerConfig);
            for(int i = 0; i<qtw->count(); ++i) {
                LayerParameters * ll = static_cast<LayerParameters*> (qtw->widget(i));
                _projectFile->setLayerConfigPoisson(i, ll->poissonDoubleSpinBox->value());
                _projectFile->setLayerConfigRho(i, ll->densityDoubleSpinBox->value());
                _projectFile->setLayerConfigYoung(i, ll->youngDoubleSpinBox->value());
            }
            _projectFile->stopHistory(Data::MonofinLayerConfig);
        }
    }
}
Example #5
0
/**
 * Sets up the documentation group.
 * @param margin  The margin of the group.
 */
void ClassifierListPage::setupDocumentationGroup(int margin)
{
    m_docGB = new QGroupBox(i18n("Documentation"), this);
    QVBoxLayout* docLayout = new QVBoxLayout(m_docGB);
    docLayout->setSpacing(10);
    docLayout->setMargin(margin);
    if (m_itemType == UMLObject::ot_Operation) {
        m_docTE = new KTextEdit();
        m_pCodeTE = new CodeTextEdit();
#if QT_VERSION >= 0x050000
        QTabWidget* tabWidget = new QTabWidget();
#else
        KTabWidget* tabWidget = new KTabWidget();
#endif
        tabWidget->addTab(m_docTE, i18n("Comment"));
        tabWidget->addTab(m_pCodeTE, i18n("Source Code"));
        docLayout->addWidget(tabWidget);
    }
    else {
        m_docTE = new KTextEdit();
        docLayout->addWidget(m_docTE);
    }
}
AccountseditorConfigDialog::AccountseditorConfigDialog( ViewBase *view, AccountTreeView *treeview, QWidget *p)
    : KPageDialog(p),
      m_view( view ),
      m_treeview( treeview )
{
    setWindowTitle( i18n("Settings") );

    QTabWidget *tab = new QTabWidget();

    QWidget *w = ViewBase::createPageLayoutWidget( view );
    tab->addTab( w, w->windowTitle() );
    m_pagelayout = w->findChild<KoPageLayoutWidget*>();
    Q_ASSERT( m_pagelayout );

    m_headerfooter = ViewBase::createHeaderFooterWidget( view );
    m_headerfooter->setOptions( view->printingOptions() );
    tab->addTab( m_headerfooter, m_headerfooter->windowTitle() );

    KPageWidgetItem *page = addPage( tab, i18n( "Printing" ) );
    page->setHeader( i18n( "Printing Options" ) );

    connect( this, SIGNAL(accepted()), this, SLOT(slotOk()));
}
Example #7
0
MainWindow::MainWindow(ModuleLoader &moduleLoader, const ProgramLoader &programLoader, QWidget *parent)
    : QMainWindow(parent),
      moduleLoader(moduleLoader),
      programLoader(programLoader)
{
    createActions();
    createMenus();
    setAcceptDrops(true);

    treeWidget = new TreeWidget(programLoader, this);
    hexFileWidget = new HexFileWidget(this);
    logWidget = new LogWidget();

    setCentralWidget(new QWidget(this));
    QHBoxLayout* layout = new QHBoxLayout(centralWidget());

    QTabWidget* tab = new QTabWidget(centralWidget());
    tab->addTab(hexFileWidget, "hex");
    tab->addTab(logWidget, "log");

    layout->addWidget(treeWidget, 1);
    layout->addWidget(tab);
    layout->setContentsMargins(0,0,0,0);
    centralWidget()->setLayout(layout);

    QAction* search = new QAction(this);
    search->setShortcut(QKeySequence::Find);
    addAction(search);

    connect(treeWidget,SIGNAL(pathChanged(QString)), hexFileWidget, SLOT(setFile(QString)));
    connect(treeWidget,SIGNAL(positionChanged(qint64, qint64)), hexFileWidget, SLOT(gotoPosition(qint64)));
    connect(treeWidget,SIGNAL(positionChanged(qint64, qint64)), hexFileWidget, SLOT(highlight(qint64,qint64)));
    connect(treeWidget,SIGNAL(eventDropped(QDropEvent*)),this, SLOT(dropEvent(QDropEvent*)));
    connect(search, SIGNAL(triggered()), hexFileWidget, SLOT(focusSearch()));
    connect(treeWidget,SIGNAL(openFragmentedFile(Object&)), this, SLOT(openFragmentedFile(Object&)));
    connect(hexFileWidget, SIGNAL(selected(qint64)), treeWidget, SLOT(updateByFilePosition(qint64)));
}
Example #8
0
/** Geocache information dialog */
CacheInfoDialog::CacheInfoDialog(Cache * cache, QWidget * parent) :
  QDialog(parent), cache_(cache) {

  setWindowTitle(cache->name + " (" + cache->waypoint + ")");

  // Grid layout as main layout
  QGridLayout * mainLayout = new QGridLayout(this);

  // cache name
  mainLayout->addWidget(new QLabel("<big><b>" + cache->name + "</b></big>"), 0,
    0, Qt::AlignLeft);

  // cache icon
  QLabel * pic = new QLabel;
  pic->setPixmap(cacheIcon(cache));
  mainLayout->addWidget(pic, 0, 1, Qt::AlignRight);

  // tab pages
  // setup description browser
  QTextBrowser * descBrowser = new QTextBrowser();
  descBrowser->setHtml(cache->desc);
  descBrowser->setOpenExternalLinks(true);

  // prepare tab widgets
  QTabWidget * tab = new QTabWidget;
  tab->addTab(new InfoTab(cache), "General");
  tab->addTab(descBrowser, "Description");

  mainLayout->addWidget(tab, 1, 0, 1, 2);

  // button box
  QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
  connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  mainLayout->addWidget(buttonBox, 2, 0, 1, 2, Qt::AlignRight);

  setLayout(mainLayout);
}
		void setupUi(QDialog *dialog)
		{
			vbl = new QVBoxLayout(dialog);

			name = new QLabel(dialog);
			name->setTextFormat(Qt::RichText);
			name->setWordWrap(true);
			name->setTextInteractionFlags(Qt::TextSelectableByMouse|Qt::TextSelectableByKeyboard);
			vbl->addWidget(name);

			status = new QLabel(dialog);
			status->setWordWrap(true);
			status->setTextFormat(Qt::RichText);
			status->setTextInteractionFlags(Qt::TextSelectableByMouse|Qt::TextSelectableByKeyboard);
			vbl->addWidget(status);

			profileTabs = new QTabWidget(dialog);
			profileTab = new QTextEdit();
			profileTab->setReadOnly(true);
			profileTabs->addTab(profileTab, QString("Profile"));
			kinkTab = new QTextEdit();
			kinkTab->setReadOnly(true);
			profileTabs->addTab(kinkTab, QString("Kinks"));
			profileTabs->setCurrentIndex(0);
			vbl->addWidget(profileTabs);

			buttons = new QDialogButtonBox(Qt::Horizontal, dialog);
			closeButton = new QPushButton(QIcon(":/images/cross.png"), QString("Close"));
			buttons->addButton(closeButton, QDialogButtonBox::RejectRole);
			vbl->addWidget(buttons);

			dialog->setLayout(vbl);
			dialog->setWindowTitle(QString("Character Info"));

			QObject::connect(buttons, SIGNAL(rejected()), dialog, SLOT(reject()));
			QMetaObject::connectSlotsByName(dialog);
		}
Example #10
0
void JabberInfo::apply()
{
    if ((m_data == NULL) && (m_client->getState() == Client::Connected)){
        QString errMsg;
        QWidget *errWidget = edtCurrent;
        if (!edtPswd1->text().isEmpty() || !edtPswd2->text().isEmpty()){
            if (edtCurrent->text().isEmpty()){
                errMsg = i18n("Input current password");
            }else{
                if (edtPswd1->text() != edtPswd2->text()){
                    errMsg = i18n("Confirm password does not match");
                    errWidget = edtPswd2;
                }else if (edtCurrent->text() != m_client->getPassword()){
                    errMsg = i18n("Invalid password");
                }
            }
        }
        if (!errMsg.isEmpty()){
            for (QWidget *p = parentWidget(); p; p = p->parentWidget()){
                QTabWidget *tb = qobject_cast<QTabWidget*>(p);
                if (!tb)
                    continue;
                tb->setCurrentIndex(tb->indexOf(this));
                break;
            }
            emit raise(this);
            BalloonMsg::message(errMsg, errWidget);
            return;
        }
        if (!edtPswd1->text().isEmpty())
            m_client->changePassword(edtPswd1->text());
        // clear Textboxes
        edtCurrent->clear();
        edtPswd1->clear();
        edtPswd2->clear();
    }
}
Example #11
0
QWidget* Sis3350UI::createTabs()
{
    QTabWidget* tabs = new QTabWidget();

    tabs->addTab(createDevCtrlTab(),tr("Dev Ctrl"));
    tabs->addTab(createTriggerTab(),tr("Trigger"));
    tabs->addTab(createGainTab(),tr("Gain"));
    tabs->addTab(createRunTab(),tr("Run"));
    tabs->addTab(createClockTab(),tr("Clock"));
    tabs->addTab(createIrqTab(),tr("Irq"));

    return tabs;
}
Example #12
0
AboutDialog::AboutDialog(QWidget *p) : QDialog(p) {
	setWindowTitle(tr("About Mumble"));

	QTabWidget *qtwTab = new QTabWidget(this);
	QVBoxLayout *vblMain = new QVBoxLayout(this);

	QTextEdit *qteLicense=new QTextEdit(qtwTab);
	qteLicense->setReadOnly(true);
	qteLicense->setPlainText(QLatin1String(licenseMumble));

	QWidget *about=new QWidget(qtwTab);

	QLabel *icon=new QLabel(about);
	icon->setPixmap(g.mw->qiIcon.pixmap(g.mw->qiIcon.actualSize(QSize(128, 128))));

	QLabel *text=new QLabel(about);
	text->setOpenExternalLinks(true);
	text->setText(tr(
	                  "<h3>Mumble (%1)</h3>"
	                  "<p>Copyright %3 Thorvald Natvig<br />[email protected]</p>"
	                  "<p><b>A voice-chat utility for gamers</b></p>"
	                  "<p><tt><a href=\"%2\">%2</a></tt></p>"
	              ).arg(QLatin1String(MUMBLE_RELEASE)).arg(QLatin1String("http://mumble.sourceforge.net/")).arg(QLatin1String("2005-2010")));
	QHBoxLayout *qhbl=new QHBoxLayout(about);
	qhbl->addWidget(icon);
	qhbl->addWidget(text);

	qtwTab->addTab(about, tr("&About Mumble"));
	qtwTab->addTab(qteLicense, tr("&License"));

	QPushButton *okButton = new QPushButton(tr("OK"), this);
	connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));

	vblMain->addWidget(qtwTab);
	vblMain->addWidget(okButton);
}
Example #13
0
QChest::QChest(MH3U_SE *mh3u, QWidget *parent) : QWidget(parent)
{
    this->mh3u = mh3u;

    QSignalMapper *signalMapper = new QSignalMapper(this);
    connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(buttonClicked(int)));

    QTabWidget *tabs = new QTabWidget(this);
    QWidget *tab;
    QGridLayout *tab_layout;
    for (uint32_t i = 0; i < 10; i++)
    {
        tab = new QWidget(this);
        tabs->addTab(tab, QString("Panel ") + QString::number(i+1));

        tab_layout = new QGridLayout(tab);
        tab->setLayout(tab_layout);

        for (uint32_t j = 0; j < 100; j++)
        {
            m_buttons[i][j] = new QPushButton(QString::number(mh3u->savedata->chest[i][j].id), tab);
            m_buttons[i][j]->setFixedHeight(32);
            m_buttons[i][j]->setFixedWidth(32);

            tab_layout->addWidget(m_buttons[i][j], j / 10, j % 10);

            signalMapper->setMapping(m_buttons[i][j], i * 100 + j);
            connect(m_buttons[i][j], SIGNAL(clicked(bool)), signalMapper, SLOT(map()));
        }
    }

    QLayout *main_layout = new QGridLayout(this);
    main_layout->addWidget(tabs);
    this->setLayout(main_layout);
    this->setWindowTitle("Chest editor");
}
Example #14
0
SettingsDialog::SettingsDialog(QWidget *parent)
    : QDialog(parent, Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint),
      sw(this)
{
    connect(&sw, SIGNAL(clickClose()), SLOT(close()));

    QTabWidget *tab = new QTabWidget(this);
    tab->addTab(&sw, tr("Common"));

    if(FileAssoc::isSupportAssociation()){
        QGridLayout *gl = new QGridLayout;

        const int CountOfColumn = 3;
        QStringList formatList = QString(SUPPORT_FORMAT).remove("*.").split(' ');
        QCheckBox *cb;
        for(int i = 0, size = formatList.size(); i < size; ++i){
            cb = new QCheckBox(formatList.at(i));
            //! before connect(). otherwise it will launch the function changeAssociation(bool).
            cb->setChecked(FileAssoc::checkAssociation(formatList.at(i)));
            connect(cb, SIGNAL(toggled(bool)),
                    SLOT(changeAssociation(bool)));

            gl->addWidget(cb, i / CountOfColumn, i % CountOfColumn);
        }

        QWidget *assocWidget = new QWidget(this);
        assocWidget->setLayout(gl);
        tab->addTab(assocWidget, tr("File Association"));
    }

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->addWidget(tab);
    setLayout(layout);

    setWindowTitle(GlobalStr::PROJECT_NAME());
}
Example #15
0
ShortcutsConfig::ShortcutsConfig(QWidget *parent, ShortcutsPlugin *plugin)
        : ShortcutsConfigBase(parent)
{
    m_plugin = plugin;
    lstKeys->setSorting(0);
    loadMenu(MenuMain, true);
    loadMenu(MenuGroup, false);
    loadMenu(MenuContact, false);
    loadMenu(MenuStatus, true);
    adjustColumns();
    selectionChanged();
    connect(lstKeys, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
    connect(edtKey, SIGNAL(changed()), this, SLOT(keyChanged()));
    connect(btnClear, SIGNAL(clicked()), this, SLOT(keyClear()));
    connect(chkGlobal, SIGNAL(toggled(bool)), this, SLOT(globalChanged(bool)));
    for (QObject *p = parent; p != NULL; p = p->parent()){
        if (!p->inherits("QTabWidget"))
            continue;
        QTabWidget *tab = static_cast<QTabWidget*>(p);
        mouse_cfg = new MouseConfig(tab, plugin);
        tab->addTab(mouse_cfg, i18n("Mouse"));
        break;
    }
}
Example #16
0
QWidget*
GUIBuilder::addTabLayout(model::gui::TabLayout *root, QWidget *parent)
{
    QTabWidget* tabWidget = new QTabWidget(parent);

    for( size_t i=0; i<root->children(); i++ ) {
        model::gui::Tab* tab = root->child( i );
        if( tab != NULL ) {
            QWidget* child = buildGUI( tab->child(), tabWidget );
            if( child != NULL ) {
                tabWidget->addTab( child,
                                   QString(prettyName(tab->key(), m_model).c_str()) );
            }
            else {
                std::cerr << __FILE__ << '@' << __LINE__<< ": ERROR: got nullptr.\n";
            }
        }
        else {
            std::cerr << __FILE__ << '@' << __LINE__<< ": ERROR: child is not tab.\n";
        }
    }
    tabWidget->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
   return tabWidget;
}
Example #17
0
void About::showAboutDialog()
{
    m_dialog = new QDialog ( QApplication::focusWidget() );
    m_dialog->setWindowTitle ( QObject::tr( "About..." ) );
    QVBoxLayout * layout = new QVBoxLayout ( m_dialog );

    QHBoxLayout * titleLayout = new QHBoxLayout ( );
    QLabel * programName = new QLabel ( QString ( "<b>" ) + QObject::tr(ApplicationName) + QString ( " " ) +QString( ZMVIEWER_VERSION_STRING ) + QString ( "</b>" ), m_dialog );
    titleLayout->addWidget ( programName );
    QLabel * programIcon = new QLabel ( m_dialog );
    programIcon->setPixmap ( qApp->windowIcon().pixmap ( 32,32 ) );
    titleLayout->addWidget ( programIcon );
    layout->addLayout ( titleLayout );

    QTabWidget * tab = new QTabWidget ( m_dialog );
    QLabel * label = new QLabel ( aboutText (), m_dialog );
    tab->addTab ( label , QObject::tr( "About" ) );

    QTextBrowser * authors = new QTextBrowser ( m_dialog );
    authors->setHtml ( authorsText () );
    authors->setReadOnly ( true );
    authors->setOpenExternalLinks ( m_dialog );

    tab->addTab ( authors , QObject::tr( "Authors and Thanks" ) );

    layout->addWidget ( tab );
    QPushButton * button = new QPushButton ( QObject::tr( "Ok" ) , m_dialog );
    QHBoxLayout * buttonLayout = new QHBoxLayout ( );
    buttonLayout->addItem ( new QSpacerItem ( 20,30, QSizePolicy::Expanding ) );
    buttonLayout->addWidget ( button );
    layout->addLayout ( buttonLayout );

    QObject::connect ( button, SIGNAL ( clicked() ),m_dialog,SLOT ( accept() ) );
    m_dialog->exec();
    m_dialog->deleteLater();
}
InspectorWindow::InspectorWindow( QWidget *parent = 0 ) : QDialog( parent ) {
    QTabWidget *tabWidget = new QTabWidget( this );

    headwayTab = new HeadwayTab( this );
    sensorsTab = new SensorsTab( this );

    tabWidget->addTab( headwayTab, tr( "Headway" ) );
    tabWidget->addTab( sensorsTab, tr( "Sensors" ) );

    QLabel *timeHeadwayBuddy = new QLabel( tr( "Time headway:" ) );
    timeHeadwayLabel = new QLabel( tr( "-" ) );

    QHBoxLayout *hLayout = new QHBoxLayout();
    hLayout->addWidget( timeHeadwayBuddy );
    hLayout->addWidget( timeHeadwayLabel );

    QVBoxLayout *vLayout = new QVBoxLayout();
    vLayout->addWidget( tabWidget );
    vLayout->addLayout( hLayout );

    setLayout( vLayout );

    setWindowTitle( tr( "Inspector" ) );
}
Example #19
0
PlotDialog::PlotDialog(const QString &properties, QWidget *parent): 
    QDialog(parent)
{
    setWindowTitle("Plot Properties");

    QLineEdit *lineEdit = new QLineEdit(properties);
    connect(lineEdit, SIGNAL(textChanged(const QString &)),
        SIGNAL(edited(const QString &)));

    QTabWidget *tabWidget = new QTabWidget(this);
    tabWidget->addTab(lineEdit, "General");

    QPushButton *closeButton = new QPushButton("Close");
    connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()));

    QHBoxLayout *buttonLayout = new QHBoxLayout;
    buttonLayout->addStretch(1);
    buttonLayout->addWidget(closeButton);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addLayout(buttonLayout);
    setLayout(mainLayout);
}
Example #20
0
CDialogMessage::CDialogMessage()
{
	m_btBack = new QPushButton();
	m_btBack->setObjectName("btCancel");
	m_btApply = new QPushButton();
	m_btApply->setObjectName("btApply");
	
	QTabWidget* tabWidget = new QTabWidget();

	QWidget* widgetDialog = new QWidget();
	tabWidget->addTab(widgetDialog, tr("ATTENTION !"));
	
	QVBoxLayout* layoutMenu = new QVBoxLayout();
	layoutMenu->addStretch();
	layoutMenu->addWidget(m_btApply);
	layoutMenu->addWidget(m_btBack);

	//assemblage du menu et du layoutGauche
	QHBoxLayout* layoutMain = new QHBoxLayout();
	m_lblMsg = new QLabel();
	layoutMain->addWidget(m_lblMsg);
	layoutMain->addLayout(layoutMenu);
	widgetDialog->setLayout(layoutMain);
	
	
	QHBoxLayout* layout = new QHBoxLayout();
    layoutMain->setContentsMargins ( 0, 0, 0, 0 );
	layout->addWidget(tabWidget);

	setLayout(layout);

	this->setObjectName("dialogModal");
	this->setWindowFlags(Qt::FramelessWindowHint);

	setConnexion();
}
Example #21
0
StartDialog::StartDialog(MainWindow *mainWindow, ProjectManager *projectManager)
		: ManagedClosableDialog(mainWindow, false)
		, mMainWindow(mainWindow)
		, mProjectManager(projectManager)
{
	setMinimumSize(mMinimumSize);
	QTabWidget *tabWidget = new QTabWidget;

	RecentProjectsListWidget *recentProjects = new RecentProjectsListWidget(this);
	tabWidget->addTab(recentProjects, tr("&Recent projects"));
	SuggestToCreateDiagramWidget *diagrams = new SuggestToCreateDiagramWidget(mMainWindow, this);
	tabWidget->addTab(diagrams, tr("&New project with diagram"));

	if (recentProjects->count() == 0) {
		tabWidget->setCurrentWidget(diagrams);
	}

	QCommandLinkButton *quitLink = new QCommandLinkButton(tr("&Quit QReal"));
	QCommandLinkButton *openLink = new QCommandLinkButton(tr("&Open existing project"));

	QHBoxLayout *commandLinksLayout = new QHBoxLayout;
	commandLinksLayout->addWidget(openLink);
	commandLinksLayout->addWidget(quitLink);

	QVBoxLayout *mainLayout = new QVBoxLayout;
	mainLayout->addWidget(tabWidget);
	mainLayout->addLayout(commandLinksLayout);

	setLayout(mainLayout);
	setWindowTitle(tr("Start page"));

	connect(openLink, SIGNAL(clicked()), this, SLOT(openExistingProject()));
	connect(quitLink, SIGNAL(clicked()), this, SLOT(exitApp()));
	connect(recentProjects, SIGNAL(userDataSelected(QString)), this, SLOT(openRecentProject(QString)));
	connect(diagrams, SIGNAL(userDataSelected(QString)), this, SLOT(createProjectWithDiagram(QString)));
}
BatteryInfoDialog::BatteryInfoDialog(QList<Solid::Battery*> batteries, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::BatteryInfoDialog)
{
    ui->setupUi(this);

    setWindowTitle(tr("Battery Info"));

    if (batteries.size() == 1)
    {
        BatteryInfoFrame *batteryInfoFrame = new BatteryInfoFrame(batteries[0]);
        ui->verticalLayout->insertWidget(0, batteryInfoFrame);
    }
    else
    {
        QTabWidget *tabWidget = new QTabWidget(this);
        ui->verticalLayout->insertWidget(0, tabWidget);
        for (Solid::Battery *const battery : qAsConst(batteries))
        {
            BatteryInfoFrame *batteryInfoFrame = new BatteryInfoFrame(battery);
            tabWidget->addTab(batteryInfoFrame, QSL("BAT"));
        }
    }
}
Example #23
0
void GCF::Components::MainWindow::hideChildWidget(QWidget* parent, QWidget* child)
{
    if(!parent || !child)
        return;

    if(parent == d->workspace)
    {
        // widgets on the workspace are not hidden or shown
    }
    else
    {
        QList<QDockWidget*> dockWidgets = d->dockWidgetMap.values();
        QDockWidget* dw = qobject_cast<QDockWidget*>(parent);
        if(dw && dockWidgets.contains(dw))
        {
            QTabWidget* tw = qobject_cast<QTabWidget*>(dw->widget());
            int index = tw->indexOf(child);
            if(index < 0)
                child->hide();
            else
                child->setEnabled(false);
        }
    }
}
Example #24
0
GpgCfg::GpgCfg(QWidget *parent, GpgPlugin *plugin)
        : GpgCfgBase(parent)
{
    m_plugin = plugin;
    m_exec   = NULL;
    m_bNew   = false;
#ifdef WIN32
    edtGPG->setText(QFile::decodeName(m_plugin->getGPG()));
    edtGPG->setFilter(i18n("GPG(gpg.exe)"));
    m_find = NULL;
#else
    lblGPG->hide();
    edtGPG->hide();
#endif
    edtHome->setText(QFile::decodeName(user_file(m_plugin->getHome()).c_str()));
    edtHome->setDirMode(true);
    edtHome->setTitle(i18n("Select home directory"));
    lnkGPG->setUrl("http://www.gnupg.org/(en)/download/index.html");
    lnkGPG->setText(i18n("Download GPG"));
    connect(btnFind, SIGNAL(clicked()), this, SLOT(find()));
    connect(edtGPG, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&)));
    textChanged(edtGPG->text());
    for (QObject *p = parent; p != NULL; p = p->parent()){
        if (!p->inherits("QTabWidget"))
            continue;
        QTabWidget *tab = static_cast<QTabWidget*>(p);
        m_adv = new GpgAdvanced(tab, plugin);
        tab->addTab(m_adv, i18n("&Advanced"));
        tab->adjustSize();
        break;
    }
    connect(btnRefresh, SIGNAL(clicked()), this, SLOT(refresh()));
    connect(cmbKey, SIGNAL(activated(int)), this, SLOT(selectKey(int)));
    fillSecret(NULL);
    refresh();
}
Example #25
0
void menuconfigproject::showsql()
{
    QTabWidget *win = new QTabWidget();

    win->addTab(new sqldatatable(QString("groupname, groupparent, type"), "project_" + this->name + "_groupe", 3), "groupe");
    win->addTab(new sqldatatable(QString("lastname, firstname, email, groupid, refbool, questionbool"), "project_" + this->name + "_project", 6), "personne");
    win->addTab(new sqldatatable(QString("question, groupid, type, note, sujet, qgroupid, typef, ref_only, splitchar"), "project_" + this->name + "_question", 9), "question");
    win->setWindowModality(Qt::ApplicationModal);
    win->show();
}
Example #26
0
void QmitkPythonView::CreateQtPartControl(QWidget* parent)
{
    d->m_PythonVariableStackTableView = new QmitkPythonVariableStackTableView;
    d->m_PythonVariableStackTableView->SetDataStorage(this->GetDataStorage());
    //d->m_PythonVariableStackTableView->horizontalHeader()->setResizeMode(QHeaderView::Interactive);

    QString snippetsFilePath = mitk::PluginActivator::m_XmlFilePath;
    MITK_DEBUG("QmitkPythonView") << "got snippetsFilePath " << snippetsFilePath.toStdString();

    d->m_PythonSnippets = new QmitkPythonSnippets(snippetsFilePath);

    MITK_DEBUG("QmitkPythonView") << "initializing varStackSnippetsTab";
    QTabWidget* varStackSnippetsTab = new QTabWidget;
    varStackSnippetsTab->addTab( d->m_PythonVariableStackTableView, "Variable Stack" );
    varStackSnippetsTab->addTab( d->m_PythonSnippets, "Snippets" );
    varStackSnippetsTab->setTabPosition( QTabWidget::South );

    MITK_DEBUG("QmitkPythonView") << "initializing m_PythonShell";
    d->m_PythonShell = new QmitkCtkPythonShell;

    MITK_DEBUG("QmitkPythonView") << "initializing m_TextEditor";
    d->m_TextEditor = new QmitkPythonTextEditor;

    MITK_DEBUG("QmitkPythonView") << "initializing tabWidgetConsoleEditor";
    QTabWidget* tabWidgetConsoleEditor = new QTabWidget;
    tabWidgetConsoleEditor->addTab( d->m_PythonShell, "Console" );
    tabWidgetConsoleEditor->addTab( d->m_TextEditor, "Text Editor" );
    tabWidgetConsoleEditor->setTabPosition( QTabWidget::South );

    QList<int> sizes;
    sizes << 1 << 3;
    QSplitter* splitter = new QSplitter;
    splitter->addWidget(varStackSnippetsTab);
    splitter->addWidget(tabWidgetConsoleEditor);
    splitter->setStretchFactor ( 0, 1 );
    splitter->setStretchFactor ( 1, 3 );

    QGridLayout* layout = new QGridLayout;
    layout->addWidget( splitter, 0, 0 );
    parent->setLayout(layout);

    MITK_DEBUG("QmitkPythonView") << "creating connections for m_PythonSnippets";
    connect( d->m_PythonSnippets, SIGNAL(PasteCommandRequested(QString)), d->m_PythonShell, SLOT(Paste(QString)) );
    connect( d->m_PythonSnippets, SIGNAL(PasteCommandRequested(QString)), d->m_TextEditor, SLOT(Paste(QString)) );
}
GameSelectionWindow::GameSelectionWindow(QWidget* parent) :
		QWidget(parent), m_selectedGameWidget(NULL) {
	this->setWindowTitle(QString(ms_gameControllerInstance->m_applicationTitle.c_str()));
	this->setMinimumWidth(900);
	this->setMinimumHeight(600);
	this->move(200, 200);

	// set text based on logged in/offline status
	QString greetingLabelText;
	QString logoutButtonText;
	if (ms_gameControllerInstance->inOnlineMode()) {
		greetingLabelText = "Welcome, "
				+ QString(ms_gameControllerInstance->m_username.c_str());
		logoutButtonText = QString(ms_onlineLogoutText.c_str());
	} else {
		greetingLabelText = QString(ms_offlineModeGreeting.c_str());
		logoutButtonText = QString(ms_offlineLogoutText.c_str());
	}

	// layout for entire window
	QVBoxLayout* windowLayout = new QVBoxLayout();

	// construct greeting label (upper rh corner)
	QLabel* greetingLabel = new QLabel(greetingLabelText);
	windowLayout->addWidget(greetingLabel, 0, Qt::AlignRight);

	// create tabbed pane, to hold main contents
	QTabWidget* tabbedPane = new QTabWidget();
	tabbedPane->setMaximumWidth(16777215);

	QWidget* gamesTab = constructGameSelectionTab();
	tabbedPane->addTab(gamesTab, QString(ms_gamesTabTitle.c_str()));

	if (ms_gameControllerInstance->inOnlineMode()) {
		QWidget* statsTab = constructStatisticsTab();
		tabbedPane->addTab(statsTab, QString(ms_statsTabTitle.c_str()));
	} else {
		int statTabId = tabbedPane->addTab(new QWidget(),
				QString(ms_statsTabTitle.c_str()));
		tabbedPane->setTabEnabled(statTabId, false);
	}

	windowLayout->addWidget(tabbedPane, 100);

	// logout button (bottom lh corner)
	QPushButton* logoutReturnButton = new QPushButton(logoutButtonText);
	QObject::connect(logoutReturnButton, SIGNAL(clicked()), this,
			SLOT(logoutAndReturn()));
	windowLayout->addWidget(logoutReturnButton, 0, Qt::AlignLeft);

	// set layout
	this->setLayout(windowLayout);
}
void DlgPreferencesImp::applyChanges()
{
    try {
        for (int i=0; i<ui->tabWidgetStack->count(); i++) {
            QTabWidget* tabWidget = (QTabWidget*)ui->tabWidgetStack->widget(i);
            for (int j=0; j<tabWidget->count(); j++) {
                QWidget* page = tabWidget->widget(j);
                int index = page->metaObject()->indexOfMethod("checkSettings()");
                try {
                    if (index >= 0) {
                        page->qt_metacall(QMetaObject::InvokeMetaMethod, index, 0);
                    }
                }
                catch (const Base::Exception& e) {
                    ui->listBox->setCurrentRow(i);
                    tabWidget->setCurrentIndex(j);
                    QMessageBox::warning(this, tr("Wrong parameter"), QString::fromAscii(e.what()));
                    throw;
                }
            }
        }
    } catch (const Base::Exception&) {
        this->invalidParameter = true;
        return;
    }

    for (int i=0; i<ui->tabWidgetStack->count(); i++) {
        QTabWidget* tabWidget = (QTabWidget*)ui->tabWidgetStack->widget(i);
        for (int j=0; j<tabWidget->count(); j++) {
            PreferencePage* page = qobject_cast<PreferencePage*>(tabWidget->widget(j));
            if (page)
                page->saveSettings();
        }
    }

    bool saveParameter = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")->
                          GetBool("SaveUserParameter", true);
    if (saveParameter) {
        ParameterManager* parmgr = App::GetApplication().GetParameterSet("User parameter");
        parmgr->SaveDocument(App::Application::Config()["UserParameter"].c_str());
    }
}
Example #29
0
	void add_tab(const std::string& fp){
		auto* fileref = new file(this, fp);
		auto* editor = new tag_editor{this, fileref};

		editors_map[fileref] = editor;
		tabs->addTab(editor, QFileInfo{fp.c_str()}.baseName());

		connect(fileref, &file::error, this, &main_window::show_error);

		connect(editor->artist, &QLineEdit::textEdited, [fileref](const QString& news){ fileref->properties["ARTIST"] = {news.toUtf8().data()}; });
		connect(editor->album, &QLineEdit::textEdited, [fileref](const QString& news){ fileref->properties["ALBUM"] = {news.toUtf8().data()}; });
		connect(editor->genre, &QLineEdit::textEdited, [fileref](const QString& news){ fileref->properties["GENRE"] = {news.toUtf8().data()}; });
		connect(editor->title, &QLineEdit::textEdited, [fileref](const QString& news){ fileref->properties["TITLE"] = {news.toUtf8().data()}; });

		connect(editor->save, &QPushButton::clicked, std::bind(&main_window::save_file, this, fileref));

		connect(editor->clear, &QPushButton::clicked, std::bind(&main_window::clear_file, this, fileref));
		connect(editor->clear, &QPushButton::clicked, editor, &tag_editor::clear_inputs);

		connect(editor->reset, &QPushButton::clicked, std::bind(&main_window::reset_file, this, fileref));
		connect(editor->reset, &QPushButton::clicked, std::bind(&tag_editor::reset_inputs, editor, std::cref(fileref->properties)));
	}
Example #30
0
/// Constructor
OutputDialog::OutputDialog(QString outpath, QString result, QWidget *parent)
  : outputPath(outpath), QDialog(parent)
{
	resize(780, 580);

    QVBoxLayout *topLayout = new QVBoxLayout(this);
   
	QTabWidget * tabs = new QTabWidget(this);
	QTextEdit * outText = new QTextEdit(this);
	QTextEdit * asmText = new QTextEdit(this);
	QTextEdit * pointsText = new QTextEdit(this);
	QTextEdit * programText = new QTextEdit(this);
	QTextEdit * confText = new QTextEdit(this);
 
    outText->setFrameStyle(QFrame::NoFrame); 
	asmText->setFrameStyle(QFrame::NoFrame); 
	pointsText->setFrameStyle(QFrame::NoFrame); 
    programText->setFrameStyle(QFrame::NoFrame); 
    confText->setFrameStyle(QFrame::NoFrame); 

	outText->setReadOnly(true);
	asmText->setReadOnly(true);
	pointsText->setReadOnly(true);
    programText->setReadOnly(true);
    confText->setReadOnly(true);

	topLayout->addWidget(tabs);

	tabs->addTab(outText,     "Output");
	tabs->addTab(asmText,     "Assembly");
	tabs->addTab(pointsText,  "Patterns Memory");
	tabs->addTab(programText, "Program");
	tabs->addTab(confText,    "Configuration");

	loadFile(outputPath + "/assembly.asm", asmText);
	loadInfo("-mem", outputPath + "/patterns.mif", pointsText);
	loadInfo("-pro", outputPath + "/program.mif", programText);

	outText->setPlainText(result);
	
	 QString appdir = QApplication::applicationDirPath(); 	
    loadFile(appdir + "/configuration.ini", confText);

	setLayout(topLayout);
    setWindowTitle(tr("Estimo C Output"));
}