Ejemplo n.º 1
0
Board::Board(QWidget *parent) :
    QWidget(parent), nHSqueres(DEFAULT_NUMBER_OF_HSQUARES), nVSqueres(DEFAULT_NUMBER_OF_WSQUARES),
    nAliveCells(0)
{

    readSettings();

    int width = nHSqueres;
    int height = nVSqueres;

    for(int i=0; i<height; i++)
        for(int j=0; j<width; j++)
        {
            squaresVec.append(new Square(this,i,j));
        }

    QGridLayout *gridLayout = new QGridLayout(this);

    int k=0;
    for(int i=0; i<height; i++)
        for(int j=0; j<width; j++)
        {
            gridLayout->addWidget(squaresVec[k++],i,j);
        }

    gridLayout->setSpacing(0); // aby som vynuloval miesto medzi stvorcekmi
    this->setFixedSize(this->sizeHint().width() , this->sizeHint().height());

    createConnections();
}
Ejemplo n.º 2
0
Archivo: tia.cpp Proyecto: hackdiy/TIA
TIA::TIA(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::TIA)
{
    ui->setupUi(this);
    this->showMaximized();
    setDockNestingEnabled(true);

    m_TIAPtr = this;


    m_StatusBar = this->statusBar();
    m_Style = new HStyle;


    createModels();
    createWidgets();
    createViews();

    createActions();
    createConnections();
    createDialogs();

    m_VLog->start();

}
Ejemplo n.º 3
0
/** Sets up window, loads settings and creates connections.
  * \sa setupUi() loadSettings() createConnections()
  */
OptionsDialog::OptionsDialog(QWidget * parent, Qt::WindowFlags f)
    : QDialog(parent, f)
{
    setupUi();
    loadSettings();
    createConnections();
}
Ejemplo n.º 4
0
MainWindow::MainWindow(QWidget *parent)
	: QMainWindow(parent),

	  scene(new QGraphicsScene(this)),
	  view(new QGraphicsView(scene, this)),

	  pbLoadFile(new QPushButton("Load Input", this)),
	  lbLoadFile(new QLabel("<input file>", this)),

	  pbLoadLog(new QPushButton("Load Log", this)),
	  lbLoadLog(new QLabel("<input log>", this)),

	  pbLoadMap(new QPushButton("Load Map", this)),
	  lbLoadMap(new QLabel("<input map>", this)),

	  pbSaveMap(new QPushButton("Save Map", this)),
	  lbSaveMap(new QLabel("<output map>", this)),

	  pbDumpLog(new QPushButton("Save Log", this)),
	  lbDumpLog(new QLabel("<output log>", this)),

	  pbRun(new QPushButton("Run", this)),
	  pbCancel(new QPushButton("Cancel", this)),
	  pbSave(new QPushButton("Save", this)),

	  prog(new QProgressBar(this)),

	  mapper(prog)
{
	initWidgets();
	createForm();
	createConnections();
}
PerceptronController::PerceptronController(PerceptronWidget& perceptronWidget, PerceptronWeightWidget& perceptronWeightWidget, PerceptronJsonModel& perceptronJsonModel)
    : m_perceptronWidget(perceptronWidget)
    , m_perceptronWeightWidget(perceptronWeightWidget)
    , m_perceptronJsonModel(perceptronJsonModel)
{
    createConnections();
}
Ejemplo n.º 6
0
FormMain::FormMain(QWidget *parent)
  : QMainWindow(parent),
    m_statusProgress(new QProgressBar(this)),
    m_statusLabel(new QLabel(this)),
    m_centralArea(new QScrollArea(this)),
    m_centralLayout(new QVBoxLayout(m_centralArea)),
    m_firstTimeShow(true),
    m_ui(new Ui::FormMain),
    m_simulatorWindow(NULL) {
  m_ui->setupUi(this);

  m_normalTitle = APP_LONG_NAME;
  m_unsavedTitle = m_normalTitle + " *";

  m_statusProgress->setFixedHeight(m_ui->m_statusBar->sizeHint().height());

  // Addd necessary widgets to status.
  m_ui->m_statusBar->addWidget(m_statusProgress);
  m_ui->m_statusBar->addWidget(m_statusLabel, 1);
  m_statusLabel->setVisible(false);
  m_statusProgress->setVisible(false);

  setWindowTitle(m_normalTitle);

  // Disable "maximize" button.
  setWindowFlags(windowFlags() & ~Qt::WindowMaximizeButtonHint);

  m_centralArea->setFrameStyle(QFrame::NoFrame);

  setCentralWidget(m_centralArea);
  setupSimulatorWindow();
  setupActionShortcuts();
  setupIcons();
  setupTrayMenu();
  setupToolbar();
  loadSizeAndPosition();
  createConnections();

  //#if !defined(DEBUG)
#if defined(DISABLE_STORE)
  m_ui->m_actionUploadApplicationToStore->setVisible(false);
#else
  if (!qApp->settings()->value(APP_CFG_GEN, "enable_store", true).toBool()) {
    m_ui->m_actionUploadApplicationToStore->setVisible(false);
  }
#endif

#if defined(DISABLE_APK_GENERATION)
  m_ui->m_actionGenerateMobileApplication->setVisible(false);
#else
  if (!qApp->settings()->value(APP_CFG_GEN, "enable_apk_generation", true).toBool()) {
    m_ui->m_actionGenerateMobileApplication->setVisible(false);
  }
#endif
  //#endif

  // Make sure simulator window is displayed.
  m_ui->m_actionViewSimulatorWindow->setChecked(m_simulatorWindow->isVisibleOnStartup());
  m_ui->m_actionStickSimulatorWindow->setChecked(m_simulatorWindow->isSticked());
}
Ejemplo n.º 7
0
View::Report::PriceListReport::PriceListReport(int companyId, QList<Model::Domain::Product *> *products, QWidget *parent) : QWidget(parent), _companyId(companyId)
{
    createWidgets(products);
    createConnections();
    setWindowTitle(tr("Price List Report"));
    setAttribute(Qt::WA_DeleteOnClose);
}
Ejemplo n.º 8
0
LabelingWidgetQt::LabelingWidgetQt(QWidget *parent) :
    QWidget(parent)
{
    setObjectName(tr("Labeling"));
    createWidgets();
    createConnections();
}
Ejemplo n.º 9
0
int main( int argc, char *argv[] )
{
    QApplication app( argc, argv );

    if ( createConnections() ) {
	QSqlCursor staffCursor( "staff" );

	QDataTable		*staffTable	= new QDataTable( &staffCursor );
	QSqlPropertyMap		*propMap	= new QSqlPropertyMap();
	CustomSqlEditorFactory	*editorFactory	= new CustomSqlEditorFactory();
	propMap->insert( "StatusPicker", "statusid" );
	staffTable->installPropertyMap( propMap );
	staffTable->installEditorFactory( editorFactory );

	app.setMainWidget( staffTable );

	staffTable->addColumn( "forename", "Forename" );
	staffTable->addColumn( "surname",  "Surname" );
	staffTable->addColumn( "salary",   "Annual Salary" );
	staffTable->addColumn( "statusid", "Status" );

	QStringList order = QStringList() << "surname" << "forename";
	staffTable->setSort( order );

	staffTable->refresh();
	staffTable->show();

	return app.exec();
    }

    return 1;
}
Ejemplo n.º 10
0
SummaryWidget::SummaryWidget(QSharedPointer<WeekSummary> ws, SessionPainter* const sp, Week w, QWidget* parent)
    : ScheduleCellWidget(w, parent),
      summary(ws),
      spainter(sp)
{
    createConnections();
}
Ejemplo n.º 11
0
SyncStatusWidget::SyncStatusWidget(QWidget *parent) :
    QWidget(parent)
{
    init();
    createConnections();
    updateStatus();
}
Ejemplo n.º 12
0
XmlEdit::XmlEdit(QWidget *parent)
    : QPlainTextEdit(parent), completedAndSelected(false)
{
    createWidgets();
    createConnections();
    highlightCurrentLine();
}
Ejemplo n.º 13
0
Results::Results(QWidget *parent) :
    QWidget(parent)
{
    createWidgetItems();
    setWidgetLayout();
    createConnections();
}
Ejemplo n.º 14
0
void C_BCI_Package::Run()
{
    //Initialize the System
    bciState = BCI_INITIALIZATION;

    //Keep Track of the Mission Time
    stopwatch.start();

    //Make Connections to peripherals
    createConnections();

    //Configure Repetitive Visual Stimulus and send to Flasher
    pRVS->Generate();
    pFlasherIO->SendRVS();

    //Record our TM to an output file
    pTelemetryManager->RecordTMToFile(TM_DATA_OUTPUTFILE_BIN);
    pEEG_IO->RecordTMToFile(EEG_DATA_OUTPUTFILE_BIN);

    //Begin Thread Execution for EEG and BRS IO
    startThreads();

    debugLog->println(BCI_LOG, "Initialization Complete, Moving to STANDBY..." , true );

    //Move to Standby
    bciState = BCI_STANDBY;
    //This is all we need to do here, the Signals and Slots will
    //take care of notifying us for remote commands and Emergency Stops
    return;
}
Ejemplo n.º 15
0
MyRoutesAddDialog::MyRoutesAddDialog(QWidget* parent)
    : QDialog(parent)
{
    createWidgets();
    createLayout();
    createConnections();
}
QCustomWindowLevelEditWidget::QCustomWindowLevelEditWidget(QWidget *parent)
 : QDialog(parent)
{
    setupUi(this);
    createConnections();
    loadCustomWindowLevelPresets();
}
Ejemplo n.º 17
0
PhysVector::PhysVector(CartesianGraph *pParent, const QString Name, PhysParticle *pStart, PhysParticle *pEnd) :
    QGraphicsLineItem(pParent), PhysBaseItem() {
    m_pLabel = NULL;
    m_pParent = pParent;
    m_pDataObj = new PhysVectorDataObj(Name);
    m_Color = Qt::black;
    m_arrowSize = 20;
    m_dragIndex = DI_VECTORLINE;
    m_pDataObj ->Magnitude(50.0);
    m_bUseNewThetaAngle = false;
    m_Theta.bAboveAxis = true;
    m_Theta.degrees = 45.0;
    m_Theta.axisOrientation = AXIS_HORIZ;
    m_pStartParticle = NULL;
    m_pEndParticle = NULL;
    m_pLabel = new CartesianLabel(this);
    m_bDraw = true;

    if (pStart)
        StartParticle(pStart);
    if (pEnd)
        EndParticle(pEnd);
    m_pParent = pParent;
    init();
    createConnections();
}
Ejemplo n.º 18
0
int main( int argc, char *argv[] )
{
    QApplication app( argc, argv, FALSE );

    if ( createConnections() ) {
	QSqlCursor cur( "creditors" );

	QStringList orderFields = QStringList() << "surname" << "forename";
	QSqlIndex order = cur.index( orderFields );

	QStringList filterFields = QStringList() << "surname" << "city";
	QSqlIndex filter = cur.index( filterFields );
	cur.setValue( "surname", "Chirac" );
	cur.setValue( "city", "Paris" );

	cur.select( filter, order );

	while ( cur.next() ) {
	    int id = cur.value( "id" ).toInt();
	    QString name = cur.value( "forename" ).toString() + " " +
			   cur.value( "surname" ).toString();
	    qDebug( QString::number( id ) + ": " + name );
	}
    }

    return 0;
}
Ejemplo n.º 19
0
int main( int argc, char *argv[] )
{
    QApplication app( argc, argv );

    if ( createConnections() ) {
	QSqlCursor staffCursor( "staff" );

	QDataTable *staffTable = new QDataTable( &staffCursor );

	app.setMainWidget( staffTable );

	staffTable->addColumn( "forename", "Forename" );
	staffTable->addColumn( "surname",  "Surname" );
	staffTable->addColumn( "salary",   "Annual Salary" );

	QStringList order = QStringList() << "surname" << "forename";
	staffTable->setSort( order );

	staffTable->refresh();
	staffTable->show();

	return app.exec();
    }

    return 1;
}
Ejemplo n.º 20
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    setupUi(this);

    m_unitOfLengthActions = new QActionGroup(m_menuSettings);

    m_actionLoadInputImage->setShortcuts(
        QList<QKeySequence>() << (Qt::CTRL + Qt::Key_L) << (Qt::CTRL + Qt::Key_O));
    m_actionSavePoster->setShortcut(Qt::CTRL + Qt::Key_S);
    m_actionExit->setShortcut(Qt::CTRL + Qt::Key_Q);
    m_actionPosteRazorManual->setShortcut(Qt::Key_F1);
    m_actionLoadInputImage->setIcon(QApplication::style()->standardPixmap(QStyle::SP_DirOpenIcon));
    m_actionSavePoster->setIcon(QApplication::style()->standardPixmap(QStyle::SP_DialogSaveButton));
    m_actionSavePoster->setEnabled(false);

    setWindowIcon(QIcon(QLatin1String(":/Icons/posterazor.png")));

    setWindowTitle(applicationNameWithVersion());
    createConnections();
    populateUI();
    retranslateUi();

    setAcceptDrops(true);
}
Ejemplo n.º 21
0
milxQtPythonConsole::milxQtPythonConsole(QWidget* parent, const PythonQtObjectPtr& context, Qt::WindowFlags windowFlags)
        : QTextEdit(parent)
{

    setWindowFlags(windowFlags);

    _defaultTextCharacterFormat = currentCharFormat();
    _context                    = context;
    _historyPosition            = 0;
    _hadError                   = false;

    _completer = new QCompleter(this);
    _completer->setWidget(this);
    QObject::connect(_completer, SIGNAL(activated(const QString&)),
                     this, SLOT(insertCompletion(const QString&)));

    QTextEdit::clear();
    consoleMessage("milxQt Python Console\nMain window is 'MainWindow' and displayed windows are 'rnd_<name>', 'img_<name>' and 'mdl_<name>'\nFile IO can be done using 'milxQtFile'.");
    appendCommandPrompt();

    createActions();

    createConnections();

    readSettings();
}
Ejemplo n.º 22
0
WeekSchedule::WeekSchedule(QXmlStreamReader &xmlReader) {
    xmlReader.readNext();
    while(!xmlReader.atEnd()) {
        if (xmlReader.isEndElement()) {
            xmlReader.readNext();
            break;
        }
        if (xmlReader.isStartElement()) {
            if (xmlReader.name() == "week") {
                Week w(xmlReader);
                week = w;
            } else if (xmlReader.name() == "dayschedule") {
                DaySchedule* ds = new DaySchedule(xmlReader);
                days.push_back(QSharedPointer<DaySchedule>(ds));
            } else {
                Helper::skipUnknownElements(xmlReader);
            }
        } else {
            xmlReader.readNext();
        }
    }
    summary = QSharedPointer<WeekSummary>(new WeekSummary());
    summary->setDays(&days);
    summary->update();
    createConnections();
}
/*!
   widget is created using AD/docml
*/
NmRecipientField::NmRecipientField(
        QObject *parent, HbDocumentLoader &docLoader, const QString &objPrefix):
    QObject(parent),
    mDocumentLoader(docLoader),
    mObjectPrefix(objPrefix),
    mLabel(NULL),
    mRecipientsEditor(NULL),
    mLaunchContactsPickerButton(NULL),
    mAiwRequest(NULL)
    
{
    NM_FUNCTION;

    // Load the widgets from nmeditorview.docml. The names match to the definitions in that docml.
    mWidget = qobject_cast<HbWidget *>
        (mDocumentLoader.findWidget(mObjectPrefix + "Field"));

    mLabel = qobject_cast<HbLabel *>
        (mDocumentLoader.findWidget(mObjectPrefix + "Label"));

    mRecipientsEditor = qobject_cast<NmRecipientLineEdit *>
        (mDocumentLoader.findWidget(mObjectPrefix + "Edit"));
    if (mRecipientsEditor) {
        mRecipientsEditor->setMaxRows(NmMaxRows);
    }

    mLaunchContactsPickerButton = qobject_cast<HbPushButton *>
        (mDocumentLoader.findWidget(mObjectPrefix + "Button"));
    if (mLaunchContactsPickerButton) {
        mLaunchContactsPickerButton->setIcon(NmIcons::getIcon(NmIcons::NmIconContacts));
    }

    createConnections();
}
Ejemplo n.º 24
0
QInputOutputPacsWidget::QInputOutputPacsWidget(QWidget *parent)
 : QWidget(parent)
{
    setupUi(this);

    createContextMenuQStudyTreeWidget();

    Settings settings;
    settings.restoreColumnsWidths(InputOutputSettings::PACSStudyListColumnsWidth, m_studyTreeWidget->getQTreeWidget());

    QStudyTreeWidget::ColumnIndex sortByColumn = (QStudyTreeWidget::ColumnIndex) settings.getValue(InputOutputSettings::PACSStudyListSortByColumn).toInt();
    Qt::SortOrder sortOrderColumn = (Qt::SortOrder) settings.getValue(InputOutputSettings::PACSStudyListSortOrder).toInt();
    m_studyTreeWidget->setSortByColumn (sortByColumn, sortOrderColumn);

    m_statsWatcher = new StatsWatcher("QueryInputOutputPacsWidget", this);
    m_statsWatcher->addClicksCounter(m_retrievAndViewButton);
    m_statsWatcher->addClicksCounter(m_retrieveButton);

    // Preparem el QMovie per indicar quan s'estan fent consultes al PACS
    QMovie *operationAnimation = new QMovie(this);
    operationAnimation->setFileName(":/images/loader.gif");
    m_queryAnimationLabel->setMovie(operationAnimation);
    operationAnimation->start();

    setQueryInProgress(false);

    createConnections();
}
Ejemplo n.º 25
0
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent),
   m_toolBar(this),
   m_aboutDialog(this),
   m_helpBrowser(this),
   m_viewerModel(this),
   m_viewerView(this),
   m_undoStack(this),
   m_undoStackView(&m_undoStack, this),
   m_viewer(m_viewerModel, this),
   m_viewerSelectionModel(&m_viewerModel, this),
   m_logMessageDialog(0),
   m_preferencesBrowser(this),
   m_quiInputDialog(0),
   m_shaderDialog(0)
{
   setStatusBar(0);
   setWindowTitle("IQmol");
   setWindowModified(false);
   setAcceptDrops(false);
   setWindowIcon(QIcon(":/resources/icons/iqmol.png"));

   createMenus();
   createLayout();
   createConnections(); 

   m_undoStack.setUndoLimit(Preferences::UndoLimit());
   m_undoStackView.setEmptyLabel("History:");
   m_viewerView.setModel(&m_viewerModel);
   m_viewerView.setSelectionModel(&m_viewerSelectionModel);
   m_viewer.setActiveViewerMode(Viewer::BuildAtom);

   m_viewer.setDefaultSceneRadius();
   m_viewer.resetView();
}
Ejemplo n.º 26
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setWindowTitle(tr("Emily"));
    ui->okButton->setFocus();

    m_storage = NULL;
    m_changeVoice = NULL;

    //Waiting for readSettings is too slow
    //So clipboard settings are read first
    QSettings settings("Emily", "Emily");
    //bool clip = settings.value("Clipboard").toBool();
    //setUseClipboard(clip);

    createActions();
    createTrayAndIcons();
    createAndInitializeObjects();
    createShortcuts();
    createConnections();
    startMaryServer();
    //readSettings();
    installAddon();
}
AutoBarcodeScanner::AutoBarcodeScanner(QObject * parent)
    : QObject(parent)
    , m_decoder(new BarcodeDecoder(this))
    , m_camera(new QCamera(this))
    , m_imageCapture(new QCameraImageCapture(m_camera, this))
    , m_flagComponentComplete(false)
    , m_flagScanRunning(false)
    , m_flagScanAbort(false)
    , m_flashState(false)
    , m_timeoutTimer(new QTimer(this))
    , m_markerColor(QColor(0, 255, 0)) // default green
{
    qDebug() << "start init AutoBarcodeScanner";

    m_camera->exposure()->setExposureCompensation(1.0);
    m_camera->exposure()->setExposureMode(QCameraExposure::ExposureAuto);
    m_camera->exposure()->setFlashMode(QCameraExposure::FlashOff);

    m_camera->focus()->zoomTo(1.0, 3.0);
    m_camera->focus()->setFocusMode(QCameraFocus::ContinuousFocus);
    m_camera->focus()->setFocusPointMode(QCameraFocus::FocusPointAuto);

    createConnections();
    m_timeoutTimer->setSingleShot(true);
    connect(m_timeoutTimer, SIGNAL(timeout()), this, SLOT(slotScanningTimeout()));
}
Ejemplo n.º 28
0
FileBrowser::FileBrowser(QWidget *parent)
	: QMainWindow(parent)
{
    createWidgets();
    createLayout();
    createActions();
    createConnections();
}
Ejemplo n.º 29
0
Admin::Admin(QWidget *parent) :
    QWidget(parent)
{
    qDebug() << "admin constructed";
    createWidgets();
    createLayout();
    createConnections();
}
milxQtDiffusionTensorModel::milxQtDiffusionTensorModel(QWidget *theParent) : milxQtModel(theParent)
{
    milxQtWindow::prefix = "DTI: ";

    createActions();

    createConnections();
}