Example #1
0
void MainWindow::on_actionQueue3_triggered()  //Show Sky Map
{
    /*QDialog * dial = new QDialog;
    dial->setBaseSize(1300,800);
    dial->setWindowTitle("Sky map");
    //dial->setStyleSheet("background: url(:/new/prefix1/skymap_source.png)");*/

    QLabel *image = new QLabel();
    image->setPixmap( QPixmap( ":/new/prefix1/skymap_source.png" ) );

    image->setBackgroundRole(QPalette::Base);
    image->setBaseSize(1200,800);
    image->setScaledContents(true);

    QScrollArea * scrollArea = new QScrollArea;
    //scrollArea->setBackgroundRole(QPalette::Dark);
    scrollArea->setBaseSize(1200,800);
    scrollArea->setWidget(image);
    scrollArea->setWindowTitle("Sky map");
    scrollArea->show();
    //setCentralWidget(scrollArea);

    /*QVBoxLayout * mainLayout = new QVBoxLayout();

    dial->setLayout(mainLayout);

    dial->exec();*/

}
Example #2
0
//Add a input for dynamic construction later.
codeFrame::codeFrame(level l,QWidget *parent, dragStorage *s): QWidget(parent){
   lvl = l;
   setFixedSize(616, 461);
   //default orientation
   defX = 20;
   defY = 20;
   //codeList = code;
   store = s;
   //used in pages
   //pages.push_back(0);
   curPage = 0;


   for(int i=0; i< lvl.ordered.size(); i++){
      
      if(lvl.codeBlocks.find(i) != lvl.codeBlocks.end()){
	 dropZone *z = new dropZone("Drop Code Here", i,this);
	 z->setDragStorage(store);
	 connect(z, SIGNAL(newSize()), this, SLOT(resize()));
	 zones.insert(i,z);
      }
      if(lvl.fixedBlocks.find(i) != lvl.fixedBlocks.end()){
	 QLabel *r = new QLabel( lvl.fixedBlocks[i] , this);
	 r->setBaseSize(152,12);
	 others.insert(i,r);
      }
   }
   buildPage();
}
Example #3
0
/*! Adds a progress bar to the bottom of the layout */
void ProgressWidget::addProgressBar(unsigned int timeStep, unsigned int stepsCompleted, unsigned int totalSteps){
	if(progressBarMap.contains(timeStep)){
		qCritical()<<"Attempting to add a progress bar for time step "<<timeStep<<" that already exists.";
		return;
	}

	//Progress bar
	QProgressBar* progBar = new QProgressBar();
	progBar->setMinimumSize(100, 15);
	progBar->setBaseSize(100, 15);
	progBar->setRange(0, totalSteps);
	progBar->setValue(stepsCompleted);
	gridLayout->addWidget(new QLabel("Time step " + QString::number(timeStep) + ": "), progressBarMap.size(), 0);
	gridLayout->addWidget(progBar, progressBarMap.size(), 1);
	progressBarMap[timeStep] = progBar;

	//Progress details
	QLabel* progDetails = new QLabel();
	progDetails->setMinimumSize(300, 15);
	progDetails->setBaseSize(300, 15);
	gridLayout->addWidget(progDetails, progressDetailsMap.size(), 2);
	progressDetailsMap[timeStep] = progDetails;
}
Example #4
0
void coEditorTextValueWidget::setValue(const QString &valueName, const QString &value,
                                       const QString &readableAttrRule,
                                       const QString &attributeDescription,
                                       bool, const QRegExp &rx)
{
    fvariable = valueName;
    fvalue = value;

    QHBoxLayout *layout;
    QLabel *valueLabel;
    QSpacerItem *spacerItem;

    setObjectName(widgetName);
    setMaximumSize(QSize(16777215, 100));
    setBaseSize(QSize(400, 25));
    setToolTip(attributeDescription);

    layout = new QHBoxLayout(this);
    layout->setSpacing(0);
    layout->setMargin(0);
    layout->setObjectName(QString::fromUtf8("layout"));
    valueLabel = new QLabel(this);
    valueLabel->setText(valueName);
    valueLabel->setObjectName(QString::fromUtf8("valueLabel"));
    valueLabel->setBaseSize(QSize(150, 22));

    QSizePolicy labelSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    labelSizePolicy.setHorizontalStretch(1);
    labelSizePolicy.setVerticalStretch(0);
    labelSizePolicy.setHeightForWidth(valueLabel->sizePolicy().hasHeightForWidth());
    valueLabel->setSizePolicy(labelSizePolicy);

    spacerItem = new QSpacerItem(30, 20, QSizePolicy::Preferred, QSizePolicy::Minimum);

    valueLineEdit = new coEditorValidatedQLineEdit(this);
    valueLineEdit->setObjectName(valueName);
    valueLineEdit->setStatusTip(readableAttrRule);
    QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(0));
    sizePolicy.setHorizontalStretch(2);
    sizePolicy.setVerticalStretch(0);
    sizePolicy.setHeightForWidth(valueLineEdit->sizePolicy().hasHeightForWidth());
    valueLineEdit->setSizePolicy(sizePolicy);
    valueLineEdit->setMaximumSize(QSize(16777215, 22));
    valueLineEdit->setBaseSize(QSize(200, 22));
    valueLineEdit->setAlignment(Qt::AlignRight);
    valueLineEdit->setDragEnabled(true);

    if (!rx.isEmpty())
    {
        QValidator *validator = new QRegExpValidator(rx, this);
        valueLineEdit->setValidator(validator);
    }
    // returnPressed is only send, if expression is valid. then we need to call coConfigEntry->setValue
    // connect(valueLineEdit, SIGNAL(returnPressed()), this, SLOT(commitNewEntryValueData()));
    valueLineEdit->setText(value); //setText does not call validate
    valueLineEdit->setModified(false);

    //create Contextmenu - Delete value
    deleteValueAction = new QAction(tr("Delete this Value ?"), valueLabel);
    deleteValueAction->setStatusTip(tr("Delete this value ?"));
    addAction(deleteValueAction);
    setContextMenuPolicy(Qt::ActionsContextMenu);

    if (getType() == coEditorValueWidget::Info || getType() == coEditorValueWidget::InfoName
                                                  /*value.isEmpty() &&*/ /*&& !required*/)
    {
        defaultValue = value;
        //
        valueLineEdit->setStyleSheet("background-color: aliceblue");
        connect(deleteValueAction, SIGNAL(triggered()), this, SLOT(explainShowInfoButton()));
    }
    else
    {
        //is valid checks, and sets background color to red if check fails
        /* if (!empty)*/
        valueLineEdit->isValid();
        connect(deleteValueAction, SIGNAL(triggered()), this, SLOT(suicide()));
    }

    valueLineEdit->adjustSize();

    QSize size(250, 45);
    size = size.expandedTo(minimumSizeHint());
    resize(size);

    //connect to save
    connect(valueLineEdit, SIGNAL(editingFinished()), this, SLOT(save()));
    //    connect ( valueLineEdit, SIGNAL (returnPressed() ), this, SLOT (save() ) );
    //NOTE if we want a nasty nagscreen, connect it here
    //connect ( valueLineEdit, SIGNAL (notValid() ),  , SLOT ( ) );
    connect(valueLineEdit, SIGNAL(notValid()), this, SIGNAL(notValid()));

    layout->addWidget(valueLabel);
    layout->addItem(spacerItem);
    layout->addWidget(valueLineEdit);

    setLayout(layout);
}