Esempio n. 1
0
LoadView::LoadView(QWidget* parent):DropArea( parent )
{

    QVBoxLayout *layout = new QVBoxLayout( this );

    layout->addWidget( tempAccountLbl = new QLabel(
        "<center>Ceci est un compte administrateur temporaire<br>"
        "Veuillez<ol><li>Enregistrer vos coordonnées dans le système en cliquant sur <strong>\"Ajouter\"</strong></li>"
        "<li>Vous rendre dans <strong>\"Réglages\"</strong> afin de créer votre compte administrateur</li></ol></center>"
        ));
    tempAccountLbl->setObjectName( "tempAccountLbl" );
    tempAccountLbl->hide();
    connect( &Socket::sock(), SIGNAL(loggedAsTempAdmin()), SLOT(onLoggedAsTempAdmin()) );
    connect( &Socket::sock(), SIGNAL(loggedAsUser()), SLOT(onLogged()) );
    connect( &Socket::sock(), SIGNAL(loggedAsAdmin()), SLOT(onLogged()) );

    QLabel *loadImageLbl = new QLabel( "Pour commencer" );
    loadImageLbl->setObjectName("loadImageLbl");
    layout->addWidget(loadImageLbl);

    layout->addStretch(0);

    QHBoxLayout *hLayout;
    layout->addLayout( hLayout = new QHBoxLayout() );

        QFrame *dropZone = new QFrame( this );
        dropZone->setObjectName( "dropZone" );
        hLayout->addWidget( dropZone, Qt::AlignCenter );

        QVBoxLayout *dropZoneLayout = new QVBoxLayout( dropZone );
        QLabel *deposezFichierLbl = new QLabel( dropZone );
        deposezFichierLbl->setObjectName( "deposezFichierLbl" );
        deposezFichierLbl->setText( 
        "<center>"
        "Chargez une ou plusieurs photos depuis votre ordinateur"
        "</center>"
        );
        dropZoneLayout->addWidget( deposezFichierLbl, 1, Qt::AlignCenter );

        QPushButton *browseImagesBtn = new QPushButton( dropZone );
        browseImagesBtn->setText( "Séléctionnez des Images" );
        browseImagesBtn->setObjectName( "browseImagesBtn" );
        dropZoneLayout->addWidget( browseImagesBtn, 1, Qt::AlignCenter );

        connect( browseImagesBtn, SIGNAL( clicked() ), SLOT( onBrowseImages() ) );
    
    layout->addStretch(0);

}
void QmitkToolTrackingStatusWidget::ShowStatusLabels()
{
  RemoveGuiLabels(); 

  if(m_NavigationDatas == NULL || m_NavigationDatas->size() <= 0)
    return;


  m_StatusLabels = new QVector<QLabel*>();
  mitk::NavigationData* navData;
  QLabel* label;


  for(unsigned int i = 0; i < m_NavigationDatas->size(); i++)
  {
    navData = m_NavigationDatas->at(i).GetPointer();

    QString name(navData->GetName());
   
    label = new QLabel(name, this);
    label->setObjectName(name);
    label->setAlignment(m_Alignment | Qt::AlignVCenter);
    label->setFrameStyle(QFrame::Panel | QFrame::Sunken);

    m_StatusLabels->append(label);
    if (m_Style == QmitkToolTrackingStatusWidget::VerticalUpperStyle) m_Controls->m_VerticalLayout->addWidget(m_StatusLabels->at(i));
    else m_Controls->m_GridLayout->addWidget(m_StatusLabels->at(i),0,i);
    
  }
}
QWidget *SketchAreaWidget::separator(QWidget* parent) {
	QLabel *separator = new QLabel(parent);
	separator->setPixmap(QPixmap(":/resources/images/toolbar_icons/toolbar_separator.png"));
    separator->setStyleSheet("margin-left: 1px; margin-right: 1px;");
    separator->setObjectName("ToolBarSeparator");
	return separator;
}
Esempio n. 4
0
TemplateLogoWidget::TemplateLogoWidget() {

	// Init components
	gridLayout = new QGridLayout(this);

	// Set layout
	setLayout(gridLayout);

	// Set ID
	setObjectName("templateLogoWidget");

	// Create logo
	QLabel *logoLabel = new QLabel(this);
	logoLabel->setObjectName("templateLogo");
	logoLabel->setPixmap(QPixmap(":/PowerGrid/Resources/logo.png"));

	// Configure widget
	setContentsMargins(60, 60, 60, 60);

	// Add components
	gridLayout->addWidget(logoLabel, 0, 0);

	// Resize grid
	gridLayout->setRowStretch(1, 1);
}
Esempio n. 5
0
void BGDialog::slotIdentifyScreens()
{
    // Taken from PositionTab::showIdentify in kdebase/kcontrol/kicker/positiontab_impl.cpp
    for (unsigned s = 0; s < m_numScreens; s++) {
        QLabel *screenLabel = new QLabel(0, Qt::X11BypassWindowManagerHint);
        screenLabel->setObjectName("Screen Identify");

        QFont identifyFont(KGlobalSettings::generalFont());
        identifyFont.setPixelSize(100);
        screenLabel->setFont(identifyFont);

        screenLabel->setFrameStyle(QFrame::Panel);
        screenLabel->setFrameShadow(QFrame::Plain);

        screenLabel->setAlignment(Qt::AlignCenter);
        screenLabel->setNum(int(s + 1));
        // BUGLET: we should not allow the identification to be entered again
        //         until the timer fires.
        QTimer::singleShot(1500, screenLabel, SLOT(deleteLater()));

        QPoint screenCenter(QApplication::desktop()->screenGeometry(s).center());
        QRect targetGeometry(QPoint(0, 0), screenLabel->sizeHint());
        targetGeometry.moveCenter(screenCenter);

        screenLabel->setGeometry(targetGeometry);

        screenLabel->show();
    }
}
Q_TK_USING_CONSTANTS

void mfRecovererThread::saveRecoveringFile( mfObject * mfo )
{
     if ( !mfo ) return;

     // Only one recovery at time
     if ( isRunning() ) return;
     stopped = false;
     m_Object = mfo;

     // put an icon into statusbar
     if ( !iconSetted )
     {
          iconSetted = true;
          QLabel * lbl = new QLabel ( mfCore::mainWindow() );
          lbl->setObjectName( "crashicon" );
          lbl->setPixmap( tkTheme::icon(ICONCRASHRECOVER).pixmap(16,16) );
          lbl->setToolTip( QCoreApplication::translate( "mfRecovererThread",
                           "Crash recovering is in action.\n"
                           "Recover your datas after a system or software crash." ) );
          mfCore::mainWindow()->statusBar()->addPermanentWidget( lbl, 0 );
     }

     // Let's go with low priority
     start( LowPriority );
}
Esempio n. 7
0
void MainWindow::refreshData()
{
  MultimeterAdapter::ReadingsList readings = adapter->getCurrentReadings();

  QList<QLabel *> labels = ui->currentReadings->findChildren<QLabel*>("reading");

  while(readings.count() > labels.count())
  {
    QLabel *label = new QLabel();
    label->setObjectName("reading");
    ui->currentReadings->layout()->addWidget(label);
    labels.append(label);
  }

  while(readings.count() < labels.count())
  {
    delete labels.takeLast();
  }

  for (int i = 0; i < labels.count(); i++)
  {
      QLabel* label = labels.at(i);

      label->setText(QString("%1 %2").arg(readings.at(i).second,5,'f',4).arg(SampleSeries::toString(readings.at(i).first)));

      QPalette palette;

      palette.setColor(QPalette::WindowText, getColor(readings.at(i).first));
      label->setPalette(palette);
  }

  ui->plot->replot();
}
void CollapsibleInspectorHeader::createLayout()
{
  setContentsMargins(0,0,0,0);
  setFixedHeight(50);
  setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
  setObjectName("CollapsibleInspectorHeader");
  setCheckable(true);

  QHBoxLayout * mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(0,0,0,0);
  mainHLayout->setSpacing(10);
  setLayout(mainHLayout);

  // Arrow
  m_arrowLabel = new QLabel();
  mainHLayout->addWidget(m_arrowLabel);

  // Name
  QLabel * textLabel = new QLabel(m_text);
  textLabel->setWordWrap(false);
  textLabel->setObjectName("H2");
  mainHLayout->addWidget(textLabel);

  // Stretch
  mainHLayout->addStretch();

  bool isConnected = connect(this,SIGNAL(toggled(bool)),
                             this,SLOT(on_toggled(bool)));
  OS_ASSERT(isConnected);

  setChecked(false);
}
blProjectNewFormWidgetLabel::blProjectNewFormWidgetLabel(QWidget *parent) :
    QWidget(parent)
{

    layout = new QVBoxLayout;

    // title
    QLabel *title = new QLabel(tr("Label Extraction"));
    title->setObjectName("blLabelFormHeader1");
    layout->addWidget(title);

    // CheckBoxes
    m_checkBoxFolders = new QCheckBox(tr("Folders"));
    m_checkBoxDate = new QCheckBox(tr("Created Date"));

    layout->addWidget(m_checkBoxDate);
    layout->addWidget(m_checkBoxFolders);

    // View
    QPushButton *viewButton = new QPushButton(tr("View"));
    viewButton->setObjectName("btnPrimary");
    layout->addWidget(viewButton,0, Qt::AlignRight);
    connect(viewButton, SIGNAL(clicked()), this, SLOT(emitView()));

    this->setLayout(layout);
}
Esempio n. 10
0
URLWatcherPlugin::URLWatcherPlugin()
{
	viewer_ = new QWidget();
	QVBoxLayout *vboxLayout;
	QFrame *frame;
	QLabel *label;
	vboxLayout = new QVBoxLayout(viewer_);
	vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
	frame = new QFrame(viewer_);
	frame->setObjectName(QString::fromUtf8("frame"));
	frame->setFrameShape(QFrame::StyledPanel);
	frame->setFrameShadow(QFrame::Raised);
	viewerText_ = new QTextEdit(frame);
	viewerText_->setObjectName(QString::fromUtf8("text"));
	viewerText_->setReadOnly(true);

	

	label = new QLabel(viewer_);
	label->setObjectName(QString::fromUtf8("label"));
	label->setText("URLs");
	vboxLayout->addWidget(label);
	vboxLayout->addWidget(viewerText_);
	viewer_->show();
}
Esempio n. 11
0
ImportDialog::ImportDialog(QWidget* parent) :
    QFileDialog(parent, WINDOW_NAME, DESKTOP_LOCATION, NULL),
    _importButton(IMPORT_BUTTON_NAME, this),
    _cancelButton(CANCEL_BUTTON_NAME, this),
    fileAccepted(false) {

    setOption(QFileDialog::DontUseNativeDialog, true);
    setFileMode(QFileDialog::ExistingFile);
    setViewMode(QFileDialog::Detail);

#ifdef Q_OS_MAC
    QString cmdString = ("Command");
#else
    QString cmdString = ("Control");
#endif
    QLabel* infoLabel = new QLabel(QString(INFO_LABEL_TEXT).arg(cmdString));
    infoLabel->setObjectName("infoLabel");

    QGridLayout* gridLayout = (QGridLayout*) layout();
    gridLayout->addWidget(infoLabel, 2, 0, 2, 1);
    gridLayout->addWidget(&_cancelButton, 2, 1, 2, 1);
    gridLayout->addWidget(&_importButton, 2, 2, 2, 1);

    setImportTypes();
    setLayout();

    connect(&_importButton, SIGNAL(pressed()), SLOT(import()));
    connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));

    connect(&_cancelButton, SIGNAL(pressed()), SLOT(close()));
    connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
}
void CollapsibleInspectorHeader::createLayout()
{
  setContentsMargins(0,0,0,0);
  setFixedHeight(50);
  setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
  setObjectName("CollapsibleInspectorHeader");
  setCheckable(true);

  QHBoxLayout * mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(10,0,10,0);
  mainHLayout->setSpacing(7);
  setLayout(mainHLayout);

  // Arrow
  m_arrowLabel = new QLabel();
  mainHLayout->addWidget(m_arrowLabel, 0, Qt::AlignLeft);

  // Name
  QLabel * textLabel = new QLabel(m_text);
  textLabel->setWordWrap(false);
  textLabel->setObjectName("H2");
  mainHLayout->addWidget(textLabel, 0, Qt::AlignLeft);

  // Stretch
  mainHLayout->addStretch();

  connect(this, &CollapsibleInspectorHeader::toggled, this, &CollapsibleInspectorHeader::on_toggled);

  setChecked(false);
}
Esempio n. 13
0
QWidget *PartsEditorViewsWidget::addZoomControlsAndBrowseButton(PartsEditorView *view) {
    QFrame *container1 = new QFrame(this);
    QVBoxLayout *lo1 = new QVBoxLayout(container1);
    lo1->setSpacing(1);
    lo1->setMargin(0);

    QLabel *button = new QLabel(QString("<a href='#'>%1</a>").arg(tr("Load image..")), this);
    button->setObjectName("browseButton");
    button->setMinimumWidth(85);
    button->setMaximumWidth(85);
    button->setFixedHeight(20);
    button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);

    connect(button, SIGNAL(linkActivated(const QString&)), view, SLOT(loadFile()));
    QHBoxLayout *lo2 = new QHBoxLayout();
    lo2->setSpacing(1);
    lo2->setMargin(0);
    lo2->addWidget(button);
    lo2->addWidget(new ZoomControls(view,container1));

    lo1->addWidget(view);
    lo1->addLayout(lo2);

    return container1;
}
Esempio n. 14
0
/**
 * @brief MainWindow::lendMedium fügt Ausleih-Relation in Datenbank ein und passt UI an
 * @param mediumID ID des auszuleihenden Mediums
 * @param personID ID der Person, die Medium ausleiht
 */
void MainWindow::lendMedium(int mediumID, int personID){
    /// Zur Datenbank hinzufügen
    lendlib->addLendEntry(mediumID, personID);
    /// ins UI einfügen:
    QString mediumIDs = QString::number(mediumID);
    QString personIDs = QString::number(personID);
    QString mediumS = lendlib->getMediumEntry(mediumID)->getTitle();
    QString personS = lendlib->getPersonEntry(personID)->getFullName();
    /// - sowohl in Medienliste
    ui->allMediaScroll->findChild<QLabel*>("lendee"+mediumIDs)->setText(personS);
    ui->allMediaScroll->findChild<QPushButton*>("retlend"+mediumIDs)->setText("Zurück geben");
    ui->allMediaScroll->findChild<QPushButton*>("retlend"+mediumIDs)->setToolTip("Gebe Medium "+mediumIDs+" zurück.");
    QString type = "";
    MType mType =  lendlib->getMediumEntry(mediumID)->getType();
    switch (mType){
    case book:
        type=" (Buch)";
        break;
    case cd:
        type=" (CD)";
        break;
    case dvd:
        type=" (DVD)";
        break;
    default:
        break;
    }
    QLabel *lentItem = new QLabel(mediumS+type);
    lentItem->setObjectName("lentItem"+mediumIDs);
    /// als auch in Personenliste
    ui->allPersonsScroll->findChild<QWidget*>("lent"+personIDs)->layout()->addWidget(lentItem);
}
Esempio n. 15
0
void MainWindow::populateStore()
{

    int row = 0;
    int i = 0;
    for(auto item : store) {
        QString name(item.first.c_str());
        QString price(QString::number(item.second));
        QPushButton *button = new QPushButton(name);
        QLabel *label = new QLabel("$"+price);
        button->setObjectName(name);
        label->setObjectName(price);
        shopSignalMapper->setMapping(button, name);
        connect(button, SIGNAL(clicked()), shopSignalMapper, SLOT(map()));
        label->setAlignment(Qt::AlignCenter);
        ui->shopLayout->addWidget(button, row, i, Qt::AlignCenter);
        ui->shopLayout->addWidget(label, row+1, i, Qt::AlignCenter);
        QSize widgetSize(50, 50);
        button->setFixedSize(widgetSize);
        label->setFixedSize(widgetSize);
        i++;
        if(i == 9) {
            i = 0;
            row += 2;
        }
    }
}
void tst_QWidget_window::tst_updateWinId_QTBUG40681()
{
    QWidget w;
    QVBoxLayout *vl = new QVBoxLayout(&w);
    QLabel *lbl = new QLabel("HELLO1");
    lbl->setAttribute(Qt::WA_NativeWindow);
    lbl->setObjectName("label1");
    vl->addWidget(lbl);
    w.setMinimumWidth(200);

    w.show();

    QVERIFY(QTest::qWaitForWindowExposed(&w));

    QCOMPARE(lbl->winId(), lbl->windowHandle()->winId());

     // simulate screen change and notification
    QWindow *win = w.windowHandle();
    w.windowHandle()->destroy();
    lbl->windowHandle()->destroy();
    w.windowHandle()->create();
    lbl->windowHandle()->create();
    QWindowPrivate *p = qt_window_private(win);
    p->emitScreenChangedRecursion(win->screen());

    QCOMPARE(lbl->winId(), lbl->windowHandle()->winId());
}
void MaterialAirWallInspectorView::createLayout()
{
  QWidget* visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  QGridLayout* mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7,7,7,7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  unsigned row = 0;
  unsigned col = 0;

  // Name

  QLabel * label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,col);

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit,row++,0,1,3);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
Esempio n. 18
0
void KviIconWidget::init()
{
	setWindowTitle(__tr2qs("Icon Table"));
	setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::IconManager))));

	int iRows = KviIconManager::IconCount / 20;
	if((iRows * 20) < KviIconManager::IconCount)
		iRows++;
	
	QGridLayout * pLayout = new QGridLayout(this);
	int i;
	for(i = 0; i < 20; i++)
	{
		KviCString szTmp(KviCString::Format,"%d",i);
		QLabel * pLabel = new QLabel(szTmp.ptr(),this);
		pLayout->addWidget(pLabel,0,i + 1);
	}
	for(i = 0; i < iRows; i++)
	{
		KviCString szTmp(KviCString::Format,"%d",i * 20);
		QLabel * pLabel = new QLabel(szTmp.ptr(),this);
		pLayout->addWidget(pLabel,i + 1,0);
	}
	for(i = 0; i < KviIconManager::IconCount; i++)
	{
		KviCString szTmp(KviCString::Format,"%d",i);
		QLabel * pLabel = new QLabel(this);
		pLabel->setObjectName(szTmp.ptr());
		pLabel->setPixmap(*(g_pIconManager->getSmallIcon(i)));
		pLabel->installEventFilter(this);
		pLabel->setAcceptDrops(true);
		pLayout->addWidget(pLabel,(i / 20) + 1,(i % 20) + 1);
	}
}
Esempio n. 19
0
SketchMainHelpPrivate::SketchMainHelpPrivate (
		const QString &viewString,
		const QString &htmlText,
		SketchMainHelp *parent)
	: QFrame()
{
	setObjectName("sketchMainHelp"+viewString);
	m_parent = parent;

	QFrame *main = new QFrame(this);
	QHBoxLayout *mainLayout = new QHBoxLayout(main);

	QLabel *imageLabel = new QLabel(this);
	QLabel *imageLabelAux = new QLabel(imageLabel);
	imageLabelAux->setObjectName(QString("inviewHelpImage%1").arg(viewString));
	QPixmap pixmap(QString(":/resources/images/helpImage%1.png").arg(viewString));
	imageLabelAux->setPixmap(pixmap);
	imageLabel->setFixedWidth(pixmap.width());
	imageLabel->setFixedHeight(pixmap.height());
	imageLabelAux->setFixedWidth(pixmap.width());
	imageLabelAux->setFixedHeight(pixmap.height());

	ExpandingLabel *textLabel = new ExpandingLabel(this);
	textLabel->setLabelText(htmlText);
	textLabel->setFixedWidth(430 - 41 - pixmap.width());
	textLabel->allTextVisible();
	setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
	textLabel->setToolTip("");
	textLabel->setAlignment(Qt::AlignLeft);

	mainLayout->setSpacing(6);
	mainLayout->setMargin(2);
	mainLayout->addWidget(imageLabel);
	mainLayout->addWidget(textLabel);
	setFixedWidth(430);

	QVBoxLayout *layout = new QVBoxLayout(this);
	m_closeButton = new SketchMainHelpCloseButton(viewString,this);
	connect(m_closeButton, SIGNAL(clicked()), this, SLOT(doClose()));

	QFrame *bottomMargin = new QFrame(this);
	bottomMargin->setFixedHeight(m_closeButton->height());

	layout->addWidget(m_closeButton);
	layout->addWidget(main);
	layout->addWidget(bottomMargin);

	layout->setSpacing(0);
	layout->setMargin(2);

	m_shouldGetTransparent = false;
	//m_closeButton->doHide();

	QFile styleSheet(":/resources/styles/inviewhelp.qss");
    if (!styleSheet.open(QIODevice::ReadOnly)) {
		qWarning("Unable to open :/resources/styles/inviewhelp.qss");
	} else {
		setStyleSheet(styleSheet.readAll());
	}
}
Esempio n. 20
0
int APIENTRY wWinMain(HINSTANCE hInstance,
		      HINSTANCE /*hPrevInstance*/,
		      LPTSTR    /*lpCmdLine*/,
		      int       nCmdShow)
{
    WNDCLASSEX wcex;
    
    wcex.cbSize = sizeof(WNDCLASSEX); 
    
    wcex.style		= CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc	= (WNDPROC)WndProc;
    wcex.cbClsExtra	= 0;
    wcex.cbWndExtra	= 0;
    wcex.hInstance	= hInstance;
    wcex.hIcon		= NULL;
    wcex.hCursor	= LoadCursor(NULL, IDC_ARROW);
    wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);
    wcex.lpszMenuName	= NULL;
    wcex.lpszClassName	= L"qtest";
    wcex.hIconSm	= NULL;
    
    ATOM windowClass = RegisterClassEx(&wcex);

    HWND hWnd = CreateWindow((TCHAR*)windowClass, L"Windows Migration Framework Example", 
	WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, hInstance, 0);
    if (!hWnd)
	return FALSE;

    int argc = 0;
    QApplication a(argc, 0);

    QWinWidget win(hWnd);
    winId = win.winId();
    QHBoxLayout hbox(&win);
    hbox.setSpacing(5);
    hbox.setMargin(0);
    QPushButton *pb = new QPushButton("Qt command button", &win);
    pb->setObjectName("pb");
    hbox.addWidget(pb);
    QLabel *label = new QLabel("Some label", &win);
    label->setObjectName("label");
    hbox.addWidget(label);
    QLineEdit *le1 = new QLineEdit(&win);
    le1->setObjectName("le1");
    hbox.addWidget(le1);
    QLineEdit *le2 = new QLineEdit(&win);
    le1->setObjectName("le2");
    hbox.addWidget(le2);
    QLineEdit *le3 = new QLineEdit(&win);
    le1->setObjectName("le3");
    hbox.addWidget(le3);
    
    win.move(0, 0);
    win.show();

    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);

    return a.exec();
}
Esempio n. 21
0
DeviceSettingUnitcode::DeviceSettingUnitcode(Device *device, QWidget *parent)
 : DeviceSetting(device, parent),
	dialCode(0)
{
	QGridLayout *gridLayout = new QGridLayout(this);

	QLabel *labelCodeTitle = new QLabel(this);
	labelCodeTitle->setObjectName(QString::fromUtf8("labelCodeTitle"));
	labelCodeTitle->setAlignment(Qt::AlignCenter);
	labelCodeTitle->setText( tr("Unit code") );
	gridLayout->addWidget(labelCodeTitle, 0, 0, 1, 1);

	dialCode = new QDial(this);
	dialCode->setObjectName(QString::fromUtf8("dialCode"));
	dialCode->setMinimum(1);
	dialCode->setMaximum(4);
	dialCode->setPageStep(1);
	dialCode->setOrientation(Qt::Horizontal);
	dialCode->setNotchesVisible(true);
	gridLayout->addWidget(dialCode, 1, 0, 1, 1);
	connect(dialCode, SIGNAL(valueChanged(int)), this, SLOT(codeChanged(int) ) );


	labelCode = new QLabel(this);
	labelCode->setObjectName(QString::fromUtf8("labelCode"));
	labelCode->setAlignment(Qt::AlignCenter);
	labelCode->setText( "1" );
	gridLayout->addWidget(labelCode, 2, 0, 1, 1);

	this->setValue( "unit", device->parameter("unit", "1") );
}
OSCollapsibleItemHeader::OSCollapsibleItemHeader(const std::string & text,
                                                 const OSItemId& itemId,
                                                 OSItemType type,
                                                 QWidget * parent)
  : QWidget(parent),
    m_mouseDown(false)
{
  setFixedHeight(50);
  setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
  setObjectName("OSCollapsibleItemHeader");

  auto mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(9, 0, 9, 0);
  setLayout(mainHLayout);

  // Label

  QLabel * textLabel = new QLabel(QString::fromStdString(text));
  textLabel->setWordWrap(true);
  textLabel->setObjectName("H2");
  mainHLayout->addWidget(textLabel,10);

  mainHLayout->addStretch();

  // Arrow

  m_arrowLabel = new QLabel();
  mainHLayout->addWidget(m_arrowLabel);

  setSelected(false);

  setExpanded(false);
}
DeviceSettingArctechSelflearning::DeviceSettingArctechSelflearning(Device *device, QWidget *parent)
    : DeviceSetting(device, parent)
{
    QGridLayout *gridLayout = new QGridLayout(this);
    gridLayout->setSpacing(6);
    gridLayout->setMargin(9);
    gridLayout->setObjectName(QString::fromUtf8("gridLayout"));

    gridLayout->addItem( new QSpacerItem(20, 109, QSizePolicy::Minimum, QSizePolicy::Expanding), 0, 0 );

    QLabel *labelRemotecodeTitle = new QLabel(this);
    labelRemotecodeTitle->setObjectName(QString::fromUtf8("labelRemotecodeTitle"));
    labelRemotecodeTitle->setAlignment(Qt::AlignCenter);
    labelRemotecodeTitle->setText( tr("Remote code") );
    gridLayout->addWidget(labelRemotecodeTitle, 1, 0);

    QLabel *labelUnitcodeTitle = new QLabel(this);
    labelUnitcodeTitle->setObjectName(QString::fromUtf8("labelUnitcodeTitle"));
    labelUnitcodeTitle->setAlignment(Qt::AlignCenter);
    labelUnitcodeTitle->setText( tr("Unitcode") );
    gridLayout->addWidget(labelUnitcodeTitle, 1, 1);

    spinRemotecode = new QSpinBox(this);
    spinRemotecode->setObjectName(QString::fromUtf8("unitcode"));
    spinRemotecode->setMinimum(1);
    spinRemotecode->setMaximum(67108863);
    gridLayout->addWidget(spinRemotecode, 2, 0);

    spinUnitcode = new QSpinBox(this);
    spinUnitcode->setObjectName(QString::fromUtf8("unitcode"));
    spinUnitcode->setMinimum(1);
    spinUnitcode->setMaximum(16);
    gridLayout->addWidget(spinUnitcode, 2, 1);

    gridLayout->addItem( new QSpacerItem(20, 109, QSizePolicy::Minimum, QSizePolicy::Expanding), 3, 0 );

    spinRemotecode->setValue( device->parameter("house", "1").toInt() );
    spinUnitcode->setValue( device->parameter("unit", "1").toInt() );

    QPushButton *randomButton = new QPushButton( tr("Randomize"), this);
    connect(randomButton, SIGNAL(clicked()), this, SLOT(randomizeCode()));
    gridLayout->addWidget( randomButton, 3, 0 );

    //Seed the random number generator at widget creation
    srand( (unsigned int)time( NULL ) );

}
QWidget * LifeCycleCostsView::createNistWidget()
{
  QLabel * label = nullptr;

  QVBoxLayout * vLayout = nullptr;

  QGridLayout * gridLayout = new QGridLayout();
  gridLayout->setContentsMargins(0,0,0,0);
  gridLayout->setSpacing(10);

  QWidget * widget = new QWidget();
  widget->setLayout(gridLayout);

  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("NIST Region");
  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_nistRegionComboBox = new OSComboBox2();
  vLayout->addWidget(m_nistRegionComboBox);

  vLayout->addStretch();
  gridLayout->addLayout(vLayout,0,0,Qt::AlignLeft);


  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("NIST Sector");

  label->setObjectName("H2");
  vLayout->addWidget(label);

  m_nistSectorComboBox = new OSComboBox2();
  vLayout->addWidget(m_nistSectorComboBox);

  vLayout->addStretch();
  gridLayout->addLayout(vLayout,0,1,Qt::AlignLeft);

  gridLayout->setColumnStretch(100,100);

  return widget;

}
Esempio n. 25
0
void
MessageBar::show( const QString& message, const QString& id )
{    
    QLabel* label = findChild<QLabel*>( id );
    
    if (label && id.size()) {
        if (message.isEmpty())
        {
            QProgressBar* p = label->findChild<QProgressBar*>();
            if (p)
                p->setRange( 0, 1 ),
                p->setValue( 1 );
            QTimer::singleShot( 3000, label, SLOT(deleteLater()) );
        }
        else
            label->setText( message );
        return;
    }
    
    label = new QLabel( message, ui.papyrus );
    label->setBackgroundRole( QPalette::Base );
    label->setMargin( 8 );
    label->setIndent( 4 );
    label->setTextFormat( Qt::RichText );
    label->setOpenExternalLinks( true );
    label->setTextInteractionFlags( Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse );
    
    ImageButton* close = new ImageButton( ":/buckets/radio_clear_all_x.png" );
    QHBoxLayout* h = new QHBoxLayout( label );
    h->addStretch();
    
    if (id.size())
    {
        label->setObjectName( id );
        
        QProgressBar* p;
        h->addWidget( p = new QProgressBar );
        p->setRange( 0, 0 );
        p->setFixedWidth( 90 );
    }

    h->addWidget( close );
    h->setMargin( 4 );
    
    label->setFixedWidth( width() );
    label->adjustSize();
    label->show();
    
    ui.papyrus->move( 0, -label->height() );

    doLayout();
    
    connect( close, SIGNAL(clicked()), label, SLOT(deleteLater()) );    
    connect( label, SIGNAL(destroyed()), SLOT(onLabelDestroyed()), Qt::QueuedConnection );
        
    m_timeline->setFrameRange( height(), ui.papyrus->height() );
    m_timeline->start();
}
Esempio n. 26
0
void TitleWidget::initUi(const bool &isMainTitle)
{
	QLabel *logoLabel = new QLabel;
	QPixmap pix(":/title_images/logo");
	QSize s(25, 25);
	//		将图标缩小
	logoLabel->setPixmap(pix.scaled(s, Qt::KeepAspectRatio));

	QLabel *titleLabel = new QLabel(APP_NAME + " " + APP_VERSION);
	titleLabel->setObjectName("TitleLabel");

	ImageButton *upButton = new ImageButton(":/title_images/update_btn");
	upButton->setCursorEnable(true);
	connect(upButton, SIGNAL(clicked()), this, SIGNAL(updateClicked()));

	QWidget *titleWidget = new QWidget(this);
	QHBoxLayout *titleLayout = new QHBoxLayout(titleWidget);
	titleLayout->addWidget(logoLabel, 0, Qt::AlignVCenter);
	titleLayout->addWidget(titleLabel, 0, Qt::AlignVCenter);
	titleLayout->addWidget(upButton, 0, Qt::AlignVCenter);
	titleLayout->setContentsMargins(0, 0, 0, 0);

	ImageButton *closeButton = new ImageButton(":/title_images/close_btn");
	closeButton->setCursorEnable(true);
	connect(closeButton, SIGNAL(clicked()), this, SIGNAL(closeClicked()));

	QWidget *buttonWidget = new QWidget;
	QHBoxLayout *buttnLayout = new QHBoxLayout(buttonWidget);

	if (isMainTitle)
	{
		ImageButton *miniButton = new ImageButton(":/title_images/mini_btn");
		miniButton->setCursorEnable(true);
		connect(miniButton, SIGNAL(clicked()), this, SIGNAL(showMini()));

		ImageButton *menuButton = new ImageButton(":/title_images/menu_btn");
		menuButton->setCursorEnable(true);
		//connect(menuButton, SIGNAL(clicked()), this, SIGNAL(showMenu()));
		connect(menuButton, SIGNAL(clicked()), this, SLOT(menuVisiable()));

		ImageButton *skinButton = new ImageButton(":/title_images/skin_btn");
		skinButton->setCursorEnable(true);
		connect(skinButton, SIGNAL(clicked()), this, SIGNAL(showSkin()));

		buttnLayout->addWidget(skinButton, 0, Qt::AlignVCenter);
		buttnLayout->addWidget(miniButton, 0, Qt::AlignVCenter);
		buttnLayout->addWidget(menuButton, 0, Qt::AlignVCenter);

	}
	buttnLayout->addWidget(closeButton, 0, Qt::AlignVCenter);
	buttnLayout->setContentsMargins(0, 0, 0, 0);

	QHBoxLayout *mainLayout = new QHBoxLayout(this);
	mainLayout->addWidget(titleWidget, 0, Qt::AlignLeft | Qt::AlignTop);
	mainLayout->addStretch();
	mainLayout->addWidget(buttonWidget, 0, Qt::AlignRight | Qt::AlignVCenter);
	mainLayout->setContentsMargins(5, 5, 5, 5);
}
Esempio n. 27
0
CMainWindow::CMainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::CMainWindow),
    m_currentTab(nullptr)
{
    ui->setupUi(this);
    ui->tabWidget->setUsesScrollButtons(true);
    ui->tabWidget->setElideMode(Qt::ElideNone);
    ui->tabWidget->setTabsClosable(true);
    ui->tabWidget->setMovable(true);
    connect(ui->glView, SIGNAL(initialized()), this, SLOT(onViewerInitialized()));
    CResourceManager* resourceManager = CResourceManager::instance().get();
    connect(resourceManager, SIGNAL(newPak(CPakTreeWidget*)), this, SLOT(onNewPak(CPakTreeWidget*)));
    connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(onTabChanged()));
    connect(ui->actionLoad_Basepath, &QAction::triggered, this, &CMainWindow::_loadBasePath);
    connect(ui->glView, &CGLViewer::movementSpeedChanged, [=](float val){
        ui->horizontalSlider->setUpdatesEnabled(false);
        ui->horizontalSlider->setValue((int)((val * 100) / 1.0));
        ui->horizontalSlider->setUpdatesEnabled(true);
    });

    connect(ui->horizontalSlider, &QSlider::valueChanged, [=](int val){
        if (!ui->horizontalSlider->updatesEnabled())
            return;
        ui->horizontalSlider->setUpdatesEnabled(false);
        ui->glView->setMovementSpeed((float)(val / 100.f));
        ui->horizontalSlider->setValue((int)((ui->glView->movementSpeed() * 100) / 1.0));
        ui->horizontalSlider->setUpdatesEnabled(true);
    });

    installEventFilter(CKeyboardManager::instance());
    ui->actionMode0          ->setChecked(QSettings().value("mode0",           true ).toBool());
    ui->actionMode1          ->setChecked(QSettings().value("mode1",           true ).toBool());
    ui->actionMode2          ->setChecked(QSettings().value("mode2",           true ).toBool());
    ui->actionMode3          ->setChecked(QSettings().value("mode3",           true ).toBool());
    ui->actionMode4And5      ->setChecked(QSettings().value("mode4And5",       true ).toBool());
    ui->actionMode6          ->setChecked(QSettings().value("mode6",           true ).toBool());
    ui->actionMode7          ->setChecked(QSettings().value("mode7",           true ).toBool());
    ui->actionEnableTextures ->setChecked(QSettings().value("enableTextures",  true ).toBool());
    ui->actionDrawPoints     ->setChecked(QSettings().value("drawPoints",      false).toBool());
    ui->actionDrawJointNames ->setChecked(QSettings().value("drawJointNames",  false).toBool());
    ui->actionDrawBoundingBox->setChecked(QSettings().value("drawBoundingBox", false).toBool());
    ui->actionDrawCollision  ->setChecked(QSettings().value("drawCollision",   false).toBool());
    ui->actionWireframe      ->setChecked(QSettings().value("wireframe",       false).toBool());

    m_fpsUpdateTimer.setInterval(50);
    QMenuBar* bar = this->menuBar();
    QHBoxLayout* previewLayout = new QHBoxLayout(bar);
    previewLayout->addStretch();
    QLabel* previewLabel  = new QLabel(bar);
    previewLabel->setObjectName("previewLabel");
    previewLabel->setText("<b>UNSTABLE BUILD</b>");
    previewLayout->setContentsMargins(150, 0, 6, 0);
    previewLayout->addWidget(previewLabel);
    bar->setLayout(previewLayout);
    statusBar()->addPermanentWidget(&m_cameraPosition);
}
Esempio n. 28
0
void
ViewletView::setLabel(QString data, QString objectName, QVBoxLayout *layout)
{
    QLabel *lbl = new QLabel();
    lbl->setText(data);
    layout->addWidget(lbl);
    /* Used as CSS ID by QStyleSheet */
    lbl->setObjectName(objectName);
    viewletWidgetsList.append(lbl);
}
Esempio n. 29
0
QLabel* QSourceProperties::_create_text_label(const QString& text)
{
  QLabel* buffer = new QLabel(text);

  buffer->setObjectName("item");
  buffer->setTextFormat(Qt::RichText);
  buffer->setAlignment(Qt::AlignLeft);

  return buffer;
}
Esempio n. 30
0
QLabel * addLabel(QHBoxLayout * hboxLayout, QPixmap * pixmap) {
	QLabel * label = new QLabel();
	label->setObjectName("iconLabel");
	label->setAutoFillBackground(true);
	label->setPixmap(*pixmap);
	label->setFixedSize(pixmap->size());
	hboxLayout->addWidget(label);
	hboxLayout->addSpacing(IconSpace);

	return label;
}