Пример #1
0
AboutDialog::AboutDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AboutDialog)
{
    ui->setupUi(this);
   QLabel* versionLabel = new QLabel(QString("%1 v. %2")
                   .arg(qApp->applicationName())
                   .arg(qApp->applicationVersion()));

    QHBoxLayout * upper = new QHBoxLayout();
    upper->setAlignment(Qt::AlignHCenter);
    upper->addWidget(versionLabel);

    QHBoxLayout * down = new QHBoxLayout();
    down->addWidget(ui->OKpushButton);
    down->setAlignment(Qt::AlignHCenter);


    QVBoxLayout * mainLayout = new QVBoxLayout();
    mainLayout->addLayout(upper);
    mainLayout->addLayout(down);


    setLayout(mainLayout);

}
DHeaderWidget::DHeaderWidget(QWidget *parent) :
    QWidget(parent)
{
    QHBoxLayout *btlayout = new QHBoxLayout();
    m_CloseButton = new DCloseButton();
    connect(m_CloseButton, SIGNAL(clicked()), this, SIGNAL(closeClicked()));
    btlayout->setMargin(0);
    btlayout->addWidget(m_CloseButton);
    btlayout->setAlignment(m_CloseButton, Qt::AlignRight);

    QHBoxLayout *logolayout = new QHBoxLayout();
    QLabel *logolabel = new QLabel();
    logolabel->setPixmap(QPixmap(":/fontend/images/logo.png"));
    logolayout->addStretch();
    logolayout->addWidget(logolabel);
    logolayout->setAlignment(logolabel, Qt::AlignBottom);
    QLabel *versionlabel = new QLabel(QString("<a style='color:white; font-size:11px;'>%1</a>").arg(DeepinInstaller::Version));
    versionlabel->setIndent(2);
    logolayout->addSpacing(2);
    logolayout->addWidget(versionlabel);
    logolayout->setAlignment(versionlabel, Qt::AlignBottom);
    logolayout->addStretch();

    QVBoxLayout *layout = new QVBoxLayout;
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addLayout(btlayout);
    layout->addLayout(logolayout);
    this->setLayout(layout);
    this->setFixedHeight(80);
}
Пример #3
0
KoPageLayoutHeader::KoPageLayoutHeader(QWidget *parent, KoUnit unit, const KoKWHeaderFooter &kwhf)
    : QWidget(parent)
{
    m_headerFooters = kwhf;
    
    m_headerSpacing = new KoUnitDoubleSpinBox( grpHeader, 0.0, 999.0, 0.5, kwhf.ptHeaderBodySpacing, unit );
    m_footerSpacing = new KoUnitDoubleSpinBox( grpFooter, 0.0, 999.0, 0.5, kwhf.ptFooterBodySpacing, unit );
    m_footnoteSpacing = new KoUnitDoubleSpinBox( grpFootEndnote, 0.0, 999.0, 0.5, kwhf.ptFootNoteBodySpacing, unit );

    QHBoxLayout* lay = new QHBoxLayout( grpHeader );
    lay->addWidget( lblHeaderDesc );
    lay->addWidget( m_headerSpacing );
    lay->setAlignment( m_headerSpacing, Qt::AlignRight );
    
    lay = new QHBoxLayout( grpFooter );
    lay->addWidget( lblFooterDesc );
    lay->addWidget( m_footerSpacing );
    lay->setAlignment( m_footerSpacing, Qt::AlignRight );
    
    lay = new QHBoxLayout( grpFootEndnote );
    lay->addWidget( lblFootEndnoteDesc );
    lay->addWidget( m_footnoteSpacing );
    lay->setAlignment( m_footnoteSpacing, Qt::AlignRight );
   
    if ( kwhf.header == HF_FIRST_DIFF || kwhf.header == HF_FIRST_EO_DIFF )
        rhFirst->setChecked( true );
    if ( kwhf.header == HF_EO_DIFF || kwhf.header == HF_FIRST_EO_DIFF )
        rhEvenOdd->setChecked( true );
    if ( kwhf.footer == HF_FIRST_DIFF || kwhf.footer == HF_FIRST_EO_DIFF )
        rfFirst->setChecked( true );
    if ( kwhf.footer == HF_EO_DIFF || kwhf.footer == HF_FIRST_EO_DIFF )
        rfEvenOdd->setChecked( true );

    setupUi( this );
}
Пример #4
0
void StudentMainWidget::initializeTable()
{
    QHBoxLayout *tableHeader = new QHBoxLayout;
    tableHeader->setAlignment(Qt::AlignLeft);


    QLabel *lessonsLabel = new QLabel(tr("Available Lessons"));
    lessonsLabel->setFont(QFont(NULL, 20));
    lessonsLabel->setAlignment(Qt::AlignLeft);
    lessonsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    tableHeader->addWidget(lessonsLabel);

    mainLayout->addLayout(tableHeader);

    mainTable = new QTableWidget;
    mainTable->setRowCount(0);
    mainTable->setColumnCount(3);
    QStringList headers;
    headers << "Topic" << "Lessons" << "Marks";
    mainTable->setHorizontalHeaderLabels(headers);

    QHeaderView *tempHeader = mainTable->horizontalHeader();
    tempHeader->setResizeMode(0, QHeaderView::Stretch);

    QHBoxLayout *table = new QHBoxLayout;
    table->setAlignment(Qt::AlignCenter);
    table->addWidget(mainTable);

    mainLayout->addLayout(table);
}
Пример #5
0
void MainWindow::initSwitchFrame()
{
    leftFrame = new FloatFrame(this);
    leftFrame->setFillBackground(false);
    leftFrame->setHideInterval(400);
    connect(leftFrame, SIGNAL(mouseClicked()), viewer, SLOT(prePic()));

    QLabel *lb = new QLabel(leftFrame);
    lb->setPixmap(QPixmap(":/Left2.png"));
    leftFrame->addWidget(lb);

    QHBoxLayout *hlayout = new QHBoxLayout(leftFrame);
    hlayout->setAlignment(Qt::AlignCenter);
    hlayout->addWidget(lb);
    leftFrame->setLayout(hlayout);


    rightFrame = new FloatFrame(this);
    rightFrame->setFillBackground(false);
    rightFrame->setHideInterval(400);
    connect(rightFrame, SIGNAL(mouseClicked()), viewer, SLOT(nextPic()));

    lb = new QLabel(rightFrame);
    lb->setPixmap(QPixmap(":/Right2.png"));
    rightFrame->addWidget(lb);

    hlayout = new QHBoxLayout(rightFrame);
    hlayout->setAlignment(Qt::AlignCenter);
    hlayout->addWidget(lb);
    rightFrame->setLayout(hlayout);


    leftFrame->installEventFilter(this);
    rightFrame->installEventFilter(this);
}
Пример #6
0
void Kinect::KinectWindow::configureWindow( void )
{
	setModal( false );
	resize( 400,260 );
	setWindowTitle( tr( "Kinect Recognition" ) );

	mWindowLabel = new QLabel( "",this,0 );
	mWindowLabel->setFixedWidth( 320 );
	mWindowLabel->setFixedHeight( 240 );

	mKinectPause=new QPushButton( tr( "Start" ) );
	connect( mKinectPause,SIGNAL( clicked() ),this,SLOT( pausewindows() ) );

	mDisableCursor = new QCheckBox( tr( "Turn off cursor" ) );
	connect( mDisableCursor,SIGNAL( clicked() ),this,SLOT( stopMovingCursor() ) );
	mDisableZoomCursor = new QCheckBox( tr( "Turn off zoom" ) );
	connect( mDisableZoomCursor,SIGNAL( clicked() ),this,SLOT( stopZoom() ) );

	mSpeed= new QSlider( Qt::Vertical );
	mSpeed->setRange( 5,20 );
	mSpeed->setValue( 10 );
	mSpeed->setPageStep( 1 );
	mSpeed->setFocusPolicy( Qt::NoFocus );
	mSpeed->setToolTip( "Modify speed of movement" );
	connect( mSpeed,SIGNAL( valueChanged( int ) ),this,SLOT( setSpeedKinect( int ) ) );


	//TODO add two different options for view kinect video
	mKinectColor = new QRadioButton( tr( "Color Map" ) );
	mKinectDepthMap = new QRadioButton( tr( "Depth map" ) );


	QHBoxLayout* buttonsLayout = new QHBoxLayout;
	QVBoxLayout* buttonsLayout_2 = new QVBoxLayout;
	QHBoxLayout* frameLayout = new QHBoxLayout;
	QHBoxLayout* mainLayout = new QHBoxLayout;


	buttonsLayout->setAlignment( Qt::AlignTop );
	buttonsLayout->setAlignment( Qt::AlignTop );
	buttonsLayout_2->addWidget( mKinectPause );
	buttonsLayout_2->addWidget( mDisableCursor );
	buttonsLayout_2->addWidget( mDisableZoomCursor );
	buttonsLayout_2->addWidget( mSpeed );
	frameLayout->setAlignment( Qt::AlignCenter );
	frameLayout->addWidget( mWindowLabel );

	buttonsLayout->addLayout( buttonsLayout_2 );
	mainLayout->addLayout( buttonsLayout );
	mainLayout->addLayout( frameLayout );
	setLayout( mainLayout );

	adjustSize();

}
Пример #7
0
void SearchControl::initialize()
{
	QHBoxLayout * layoutSearch = new QHBoxLayout();
	QVBoxLayout * layout = new QVBoxLayout();
	QHBoxLayout * layoutTracks = new QHBoxLayout();
	QHBoxLayout * layoutAnnotations = new QHBoxLayout();
	
	QPushButton * clearButton = new QPushButton("Clear");
	QCheckBox * caseCheckBox = new QCheckBox("Match case");
	lineEdit = new QLineEdit();
	labelResultsTracks = new StatusLabel();
	labelResultsAnnotations = new StatusLabel();
	
	QLabel * labelTracks = new QLabel(tr("tracks"));
	QLabel * labelAnnotations = new QLabel(tr("annotations"));
	
	labelResultsAnnotations->setMinimumWidth(100);
	labelResultsAnnotations->setMaximumWidth(100);
	labelAnnotations->setMinimumWidth(100);
	labelAnnotations->setMaximumWidth(100);
	labelResultsTracks->setMinimumWidth(100);
	labelResultsTracks->setMaximumWidth(100);
	labelTracks->setMinimumWidth(100);
	labelTracks->setMaximumWidth(100);
	labelResultsTracks->setMinimumHeight(19);
	labelResultsAnnotations->setMinimumHeight(19);
	
	layoutSearch->addWidget(lineEdit);
	layoutSearch->addWidget(clearButton);
	layout->addLayout(layoutSearch);
	layout->addWidget(caseCheckBox);
	layoutTracks->addWidget(labelResultsTracks);
	layoutTracks->addWidget(labelTracks);
	layoutTracks->setAlignment(Qt::AlignLeft);
	layoutAnnotations->addWidget(labelResultsAnnotations);
	layoutAnnotations->addWidget(labelAnnotations);
	layoutAnnotations->setAlignment(Qt::AlignLeft);
	layout->addLayout(layoutTracks);
	layout->addLayout(layoutAnnotations);
	
	qDeleteAll(children());
	delete this->layout();
	setLayout(layout);
	
	connect(lineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &)));
	connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
	connect(caseCheckBox, SIGNAL(stateChanged(int)), this, SLOT(matchCaseChaged(int)));
	
	matchCase = false;
	setWindowTitle("Find");
	adjustSize();
}
Пример #8
0
VolControl::VolControl(OBSSource source_)
	: source        (source_),
	  signalChanged (true),
	  lastMeterTime (0),
	  levelTotal    (0.0f),
	  levelCount    (0.0f)
{
	QVBoxLayout *mainLayout = new QVBoxLayout();
	QHBoxLayout *textLayout = new QHBoxLayout();
	int         vol         = int(obs_source_get_volume(source) * 100.0f);

	nameLabel = new QLabel();
	volLabel  = new QLabel();
	volMeter  = new VolumeMeter();
	slider    = new QSlider(Qt::Horizontal);

	QFont font = nameLabel->font();
	font.setPointSize(font.pointSize()-1);

	nameLabel->setText(obs_source_get_name(source));
	nameLabel->setFont(font);
	volLabel->setText(QString::number(vol));
	volLabel->setFont(font);
	slider->setMinimum(0);
	slider->setMaximum(100);
	slider->setValue(vol);
//	slider->setMaximumHeight(13);

	textLayout->setContentsMargins(0, 0, 0, 0);
	textLayout->addWidget(nameLabel);
	textLayout->addWidget(volLabel);
	textLayout->setAlignment(nameLabel, Qt::AlignLeft);
	textLayout->setAlignment(volLabel,  Qt::AlignRight);

	mainLayout->setContentsMargins(4, 4, 4, 4);
	mainLayout->setSpacing(2);
	mainLayout->addItem(textLayout);
	mainLayout->addWidget(volMeter);
	mainLayout->addWidget(slider);

	setLayout(mainLayout);

	signal_handler_connect(obs_source_get_signal_handler(source),
			"volume", OBSVolumeChanged, this);

	signal_handler_connect(obs_source_get_signal_handler(source),
		"volume_level", OBSVolumeLevel, this);

	QWidget::connect(slider, SIGNAL(valueChanged(int)),
			this, SLOT(SliderChanged(int)));
}
Пример #9
0
void DockPanel::onDockModeChanged(Dock::DockMode, Dock::DockMode)
{
    reloadStyleSheet();

    m_pluginLayout->setLayoutSpacing(m_dockModeData->getAppletsItemSpacing());
    m_pluginLayout->setFixedHeight(m_pluginLayout->sizeHint().height());
    QHBoxLayout *mLayout = qobject_cast<QHBoxLayout *>(layout());
    if (m_dockModeData->getDockMode() == Dock::FashionMode) {
        mLayout->setAlignment(m_pluginLayout, Qt::AlignTop);
    }
    else {
        mLayout->setAlignment(m_pluginLayout, Qt::AlignVCenter);
    }
}
Пример #10
0
DWIDGET_USE_NAMESPACE

DSearchEdit::DSearchEdit(QWidget *parent)
    : QFrame(parent)
{
    D_THEME_INIT_WIDGET(DSearchEdit);

    initInsideFrame();

    m_searchBtn = new DImageButton;
    m_searchBtn->setObjectName("SearchIcon");
    m_clearBtn = new DImageButton;
    m_clearBtn->setObjectName("ClearIcon");
    m_clearBtn->hide();
    m_edt = new QLineEdit;
    m_edt->setObjectName("Edit");
    m_placeHolder = new QLabel;
    m_placeHolder->setObjectName("PlaceHolder");

    m_animation = new QPropertyAnimation(m_edt, "minimumWidth");

    m_size = QSize(m_searchBtn->sizeHint().width() + m_edt->sizeHint().width() + m_clearBtn->sizeHint().width() + 6,
                   qMax(m_searchBtn->sizeHint().height(), m_edt->sizeHint().height()));
    m_edt->setFixedWidth(0);
    m_edt->installEventFilter(this);

    QHBoxLayout *layout = new QHBoxLayout(m_insideFrame);
    layout->addStretch();
    layout->addWidget(m_searchBtn);
    layout->setAlignment(m_searchBtn, Qt::AlignCenter);
    layout->addWidget(m_placeHolder);
    layout->setAlignment(m_placeHolder, Qt::AlignCenter);
    layout->addWidget(m_edt);
    layout->setAlignment(m_edt, Qt::AlignCenter);
    layout->addStretch();
    layout->addWidget(m_clearBtn);
    layout->setAlignment(m_clearBtn, Qt::AlignCenter);
    layout->setSpacing(0);
    layout->setContentsMargins(3, 0, 3, 0);

    setAutoFillBackground(true);
    setFocusPolicy(Qt::StrongFocus);

    connect(m_clearBtn, &DImageButton::clicked, m_edt, static_cast<void (QLineEdit::*)()>(&QLineEdit::setFocus));
    connect(m_clearBtn, &DImageButton::clicked, this, &DSearchEdit::clear);
    connect(m_edt, &QLineEdit::textChanged, [this] {m_clearBtn->setVisible(!m_edt->text().isEmpty());});
    connect(m_edt, &QLineEdit::textChanged, this, &DSearchEdit::textChanged, Qt::DirectConnection);
    connect(m_edt, &QLineEdit::editingFinished, this, &DSearchEdit::editingFinished, Qt::DirectConnection);
    connect(m_searchBtn, &DImageButton::clicked, this, &DSearchEdit::toEditMode);
}
DesignAltHeaderView::DesignAltHeaderView(bool t_isBaseline)
  : OSHeader(new HeaderToggleButton())
{
  setFixedHeight(40);

  QHBoxLayout * mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(5,0,5,0);
  mainHLayout->setSpacing(5);
  mainHLayout->setAlignment(Qt::AlignLeft);
  setLayout(mainHLayout);

  mainHLayout->addWidget(toggleButton);

  QRegExp nameRegex("^\\S.*");
  QRegExpValidator* validator = new QRegExpValidator(nameRegex, this);

  designAltNameEdit = new QLineEdit();
  designAltNameEdit->setAcceptDrops(false);
  designAltNameEdit->setValidator(validator);
  mainHLayout->addWidget(designAltNameEdit);

  removeButton = new SofterRemoveButton();
  mainHLayout->addWidget(removeButton);

  if (t_isBaseline)
  {
    designAltNameEdit->setVisible(false);
    removeButton->setVisible(false);

    QLabel *lbl = new QLabel("Baseline and Measures Applied to All");
    lbl->setStyleSheet("color:#FFFFFF; font:italic bold");
    mainHLayout->addWidget(lbl);
  }

 }
Пример #12
0
TreeComboFilterItemWidget::TreeComboFilterItemWidget(const QString & labelText, const int filterTag, bool removableItem, QWidget *parent)
    : FilterItemWidget(filterTag, removableItem, parent), _deleteBtn(0)
{
    QLabel * label = new QLabel(labelText);
    _comboBox = new TreeViewComboBox;
    _comboBox->setMinimumContentsLength(22);
    _comboBox->setMaxVisibleItems(40);

    _comboBox->installEventFilter(this);
    label->setBuddy(_comboBox);

    QHBoxLayout * layout = new QHBoxLayout;
    layout->setAlignment(Qt::AlignVCenter);
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addWidget(label);
    layout->addSpacing(2);
    layout->addWidget(_comboBox);
    if(removableItem){
        _deleteBtn = createDeleteButton();
        _deleteBtn->installEventFilter(this);
        connect(_deleteBtn, SIGNAL(clicked()), this, SLOT(slotDeleteItem()));
        layout->addWidget(_deleteBtn);
    }
    setLayout(layout);

    connect(_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCurrentIndexChanged(int)));
}
Пример #13
0
WeatherDataWidget::WeatherDataWidget(QWidget *parent) :
    QWidget(parent)
{
    m_data=NULL;
    m_globalSettings = GlobalSettings::getInstance();

    m_currentTemp = new QLabel();
    m_currentCity = new QLabel();
    m_currentCity->setWordWrap(true);
    m_currentIconHolderLabel = new QLabel();
    m_currentIconHolderLabel->setScaledContents(true);
    m_currentIconPixmap = new QPixmap();

    // create current layout
    QVBoxLayout *currentVLayout = new QVBoxLayout;
    currentVLayout->addWidget(m_currentTemp);
    currentVLayout->addWidget(m_currentCity);

    // add icon to current layout
    QHBoxLayout *currentHLayout = new QHBoxLayout;
    currentHLayout->addWidget(m_currentIconHolderLabel);
    currentHLayout->setAlignment(m_currentIconHolderLabel, Qt::AlignCenter);
    currentHLayout->setContentsMargins(0,0,0,0);
    currentHLayout->addLayout(currentVLayout);

    setStyleSheet("color:#ffffff;background: 0;padding:0px;");
    setLayout(currentHLayout);
    QTimer::singleShot(0, this, SLOT(scaleContents()));
}
Пример #14
0
QFrame* MainWindow::initStatusBarFrame(QWidget *parent)
{
    QFrame *frame = new QFrame(parent);
    QHBoxLayout *mainLayout = new QHBoxLayout(frame);

    filesCountLabel->setStyleSheet("QLabel {"
                                   "font: bold 12px \"Arial\";"
                                   "color: rgb(123, 123, 123);"
                                   "border: none;"
                                   "background: transparent;"
                                   "image: url(:/resources/files_count.png);"
                                   "image-position: left;"
                                   "}");

    frame->setFixedHeight(30);
    frame->setStyleSheet("QFrame {"
                         "background: qlineargradient(x1:0.5, y1:0, x2:0.5, y2:1,"
                         "stop:0 rgb(245, 245, 245),"
                         "stop:1 rgb(205, 205, 205));"
                         "border-top: 1px solid rgb(217, 217, 217);"
                         "}");

    mainLayout->setAlignment(Qt::AlignCenter);
    mainLayout->setMargin(0);
    mainLayout->addWidget(filesCountLabel);

    return frame;
}
Пример #15
0
FormWait::FormWait(QWidget *parent, const QString &cyclPath) :
    QWidget(parent),
    m_centralFrame(NULL),
    m_cycl(NULL),
    m_textLabel(NULL)
{
    setAttribute(Qt::WA_TranslucentBackground);

    if (!QPixmap(cyclPath).isNull()) {
        m_cycl = new ZCyclProgress(cyclPath, 6, this);
    } else {
        m_cycl = new ZCyclProgress(":skins/skins/rom_loading.png", 6, this);
    }
    m_cycl->setAttribute(Qt::WA_TranslucentBackground);

    m_textLabel = new QLabel(this);
    setText(tr("please wait..."));
    m_textLabel->setStyleSheet(QString("color: white; background-color: transparent"));

    m_centralFrame = new QFrame(this);
    m_centralFrame->setStyleSheet(QString("background-color: rgb(0, 0, 0, %1); border-radius: 8; font-size: 14px").arg(int(255 * 0.75)));
    QHBoxLayout *innerLayout = new QHBoxLayout(this);
    innerLayout->addWidget(m_cycl);
    innerLayout->addWidget(m_textLabel);
    m_centralFrame->setLayout(innerLayout);

    QHBoxLayout *outerLayout = new QHBoxLayout(this);
    outerLayout->setMargin(0);
    outerLayout->addWidget(m_centralFrame);
    outerLayout->setAlignment(m_centralFrame, Qt::AlignCenter);
    setLayout(outerLayout);

    hide();
}
Пример #16
0
MainWindow::MainWindow()
{
    QWidget *central = new QWidget;

    m_map.setMaximumSize(m_map.maximumSize());
    //m_controlPanel.setMaximumSize(m_controlPanel.maximumSize());

    QFrame *right_menu = new QFrame;
    QVBoxLayout *right_menu_lout = new QVBoxLayout;
    right_menu_lout->setAlignment(Qt::AlignTop);

    //    Timer Control
    QGroupBox *timer_control = new QGroupBox("Timer control");
    QPushButton *start_t = new QPushButton("start");
    connect(start_t, SIGNAL(clicked()), &m_map, SLOT(slotStartTimer()));
    QPushButton *stop_t = new QPushButton("stop");
    connect(stop_t, SIGNAL(clicked()), &m_map, SLOT(slotStopTimer()));
    QLabel *lbl = new QLabel("Delay (ms)");

    QSlider *slider_delay = new QSlider(Qt::Horizontal);
    slider_delay->setTickPosition(QSlider::TicksBelow);
    slider_delay->setTickInterval(50);
    slider_delay->setPageStep(50);
    slider_delay->setRange(50, 500);
    connect(slider_delay, SIGNAL(valueChanged(int)), &m_map, SLOT(slotChangeDelay(int)));
    QVBoxLayout *timer_lout = new QVBoxLayout;
    QHBoxLayout *timer_btn_lout = new QHBoxLayout;
    timer_btn_lout->addWidget(start_t);
    timer_btn_lout->addWidget(stop_t);
    timer_lout->addLayout(timer_btn_lout);
    timer_lout->addWidget(lbl);
    timer_lout->addWidget(slider_delay);
    timer_control->setLayout(timer_lout);
    timer_control->setMaximumSize(timer_control->sizeHint());

    //    Map control
    QGroupBox *map_control = new QGroupBox("Map control");
    QPushButton *clear_map = new QPushButton("clear map");
    connect(clear_map, SIGNAL(clicked()), &m_map, SLOT(slotClearMap()));
    QHBoxLayout *map_control_lout = new QHBoxLayout;
    map_control_lout->addWidget(clear_map);
    map_control->setLayout(map_control_lout);
    map_control->setMaximumSize((map_control->sizeHint()));

    right_menu_lout->addWidget(timer_control);
    right_menu_lout->addWidget(map_control);
    right_menu->setLayout(right_menu_lout);

    QHBoxLayout *lout = new QHBoxLayout;
    lout->setAlignment(Qt::AlignLeft | Qt::AlignTop);
    QScrollArea *scroll_map = new QScrollArea;
    scroll_map->setWidget(&m_map);
    lout->addWidget(scroll_map);
    lout->addWidget(right_menu);

    central->setLayout(lout);

    setCentralWidget(central);
    setWindowTitle("LiveCell");
}
Пример #17
0
ComboFilterItemWidget::ComboFilterItemWidget(const QString & labelText, const int filterTag, bool removableItem, QWidget *parent)
    : FilterItemWidget(filterTag, removableItem, parent),
       _deleteBtn(0), _valueColumn(-1), _valueRole(Qt::EditRole)
{
    QLabel * label = new QLabel(labelText);
    _comboBox = new QComboBox;
    _comboBox->setMaxVisibleItems(20);
    _comboBox->setStyleSheet("combobox-popup: 0;");
    _comboBox->installEventFilter(this);
    label->setBuddy(_comboBox);



    QHBoxLayout * layout = new QHBoxLayout;
    layout->setAlignment(Qt::AlignVCenter);
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addWidget(label);
    layout->addSpacing(2);
    layout->addWidget(_comboBox);
    if(removableItem){
        _deleteBtn = createDeleteButton();
        _deleteBtn->installEventFilter(this);
        connect(_deleteBtn, SIGNAL(clicked()), this, SLOT(deleteItem()));
        layout->addWidget(_deleteBtn);
    }
    setLayout(layout);
    connect(_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCurrentIndexChanged(int)));
}
Пример #18
0
/*!
  This populates the quality measure list with the currently defined quality
  measures for this grasp.  Then it populates the QM comboBox with the
  all the possible quality measure types.  Next, it creates an empty 
  settings area widget to hold the settings for the individual types of
  quality measures, and adds it to the layout.
*/
void QMDlg::init()
{
  std::list<QualityMeasure *>::iterator qp;
  Grasp *g = graspitCore->getWorld()->getCurrentHand()->getGrasp();
  int i;
  
  qmListBox->insertItem("New quality measure");
  for (qp=g->qmList.begin(),i=1;qp!=g->qmList.end();qp++,i++)
    qmListBox->insertItem((*qp)->getName());
  
  for (i=0;QualityMeasure::TYPE_LIST[i];i++)
    qmTypeComboBox->insertItem(QString(QualityMeasure::TYPE_LIST[i]));

  qmSettingsBox->setColumnLayout(0, Qt::Vertical );
  QHBoxLayout *settingsBoxLayout = new QHBoxLayout(qmSettingsBox->layout());
  settingsBoxLayout->setAlignment( Qt::AlignTop );

  qmDlgData.settingsArea = new QWidget(qmSettingsBox);
  settingsBoxLayout->addWidget(qmDlgData.settingsArea);

  qmDlgData.grasp = g;
  qmDlgData.qmTypeComboBox = qmTypeComboBox;
  qmDlgData.qmName = qmName;
  gravityBox->setChecked( g->isGravitySet() );

  qmListBox->setCurrentItem(0);
}
SensorsManagerWidget::SensorsManagerWidget(QSqlDatabase& database, QWidget *parent)
    : QWidget(parent), m_database(database), m_activeWindow(0)
{
    QGroupBox *groupBoxSensors = new QGroupBox(tr("Sets of sensors: "), this);

    m_buttonAdd    = new QPushButton(tr("Add set"), groupBoxSensors);
    m_buttonEdit   = new QPushButton(tr("Edit set"), groupBoxSensors);
    m_buttonDelete = new QPushButton(tr("Delete set"), groupBoxSensors);

    QVBoxLayout *layoutGroupBoxSensors = new QVBoxLayout;
    layoutGroupBoxSensors->setAlignment(Qt::AlignHCenter);
    layoutGroupBoxSensors->addWidget(m_buttonAdd);
    layoutGroupBoxSensors->addWidget(m_buttonEdit);
    layoutGroupBoxSensors->addWidget(m_buttonDelete);
    groupBoxSensors->setLayout(layoutGroupBoxSensors);

    QHBoxLayout *layoutWidget = new QHBoxLayout;
    layoutWidget->setAlignment(Qt::AlignHCenter);
    layoutWidget->addWidget(groupBoxSensors);

    setLayout(layoutWidget);

    connect(m_buttonAdd, SIGNAL(clicked()), this, SLOT(addSetOfSensorsDialog()));
    connect(m_buttonEdit, SIGNAL(clicked()), this, SLOT(editSetOfSensorsDialog()));
    connect(m_buttonDelete, SIGNAL(clicked()), this, SLOT(deleteSetOfSensorsDialog()));

    connect(this, SIGNAL(connexionStatusChanged()), this, SLOT(enableWidgets()));

    m_connexionEnabled = false;
    emit connexionStatusChanged();
}
Пример #20
0
tScanningDialogWidget::tScanningDialogWidget( QWidget* pParent )
    : tDialogWidget( QString(), QString(), pParent )
    , m_pSpinner( 0 )
    , m_pLabel( 0 )
    , m_Status( tFusionClient::eBluetoothPairingStatus_NotConnectedOrDisconnect )
    , m_Discovering( false )
{
    m_pSpinner = new tWaitingSpinner( this );
    m_pSpinner->start();
    m_pSpinner->hide();
    m_pSpinner->setInnerRadius( contentsRect().height()/2 );
    m_pSpinner->setLineLength( contentsRect().height()/2 );
    m_pSpinner->setColor( palette().color( QPalette::Disabled, QPalette::Text ) );

    // Create a horizontal layout to hold the image label on the left and text labels on the right
    QHBoxLayout* pLayout = new QHBoxLayout;
    pLayout->setContentsMargins( 0, 0, 0, 0 );
    pLayout->setSpacing ( 10 );
    pLayout->addWidget( m_pSpinner );
    pLayout->setAlignment( Qt::AlignLeft );

    m_pLabel = new QLabel( this );
    pLayout->addWidget( m_pLabel );

    setLayout( pLayout );

    Connect( this, SIGNAL( Triggered() ), this, SLOT( OnClicked() ) );

    updateSpinner();
}
Пример #21
0
QHBoxLayout *CreateButtonsLayout(QWidget *Parent) {
    QHBoxLayout *buttonLayout = new QHBoxLayout(Parent);
    buttonLayout->setContentsMargins(QMargins(12, 12, 12, 12));
    buttonLayout->setAlignment(Qt::AlignBottom | Qt::AlignRight);
    buttonLayout->setSpacing(10);
    return buttonLayout;
}
Пример #22
0
FindBar::FindBar(QWidget *parent)
    : QWidget(parent)
    , m_lineEdit(new KLineEdit(this))
    , m_matchCase(new QCheckBox(i18n("&Match case"), this))
    , m_highlightAll(new QCheckBox(i18n("&Highlight all"), this))
{
    QHBoxLayout *layout = new QHBoxLayout;

    // cosmetic
    layout->setContentsMargins(2, 0, 2, 0);

    // hide button
    QToolButton *hideButton = new QToolButton(this);
    hideButton->setAutoRaise(true);
    hideButton->setIcon(KIcon("dialog-close"));
    connect(hideButton, SIGNAL(clicked()), this, SLOT(hide()));
    layout->addWidget(hideButton);
    layout->setAlignment(hideButton, Qt::AlignLeft | Qt::AlignTop);

    // label
    QLabel *label = new QLabel(i18n("Find:"));
    layout->addWidget(label);

    // Find Bar signal
    connect(this, SIGNAL(searchString(QString)), this, SLOT(find(QString)));

    // lineEdit, focusProxy
    setFocusProxy(m_lineEdit);
    m_lineEdit->setMaximumWidth(250);
    connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(find(QString)));
    layout->addWidget(m_lineEdit);

    // buttons
    KPushButton *findNext = new KPushButton(KIcon("go-down"), i18n("&Next"), this);
    KPushButton *findPrev = new KPushButton(KIcon("go-up"), i18n("&Previous"), this);
    connect(findNext, SIGNAL(clicked()), this, SLOT(findNext()));
    connect(findPrev, SIGNAL(clicked()), this, SLOT(findPrevious()));
    layout->addWidget(findNext);
    layout->addWidget(findPrev);

    // Case sensitivity. Deliberately set so this is off by default.
    m_matchCase->setCheckState(Qt::Unchecked);
    m_matchCase->setTristate(false);
    connect(m_matchCase, SIGNAL(toggled(bool)), this, SLOT(matchCaseUpdate()));
    layout->addWidget(m_matchCase);

    // Hightlight All. On by default
    m_highlightAll->setCheckState(Qt::Checked);
    m_highlightAll->setTristate(false);
    connect(m_highlightAll, SIGNAL(toggled(bool)), this, SLOT(updateHighlight()));
    layout->addWidget(m_highlightAll);

    // stretching widget on the left
    layout->addStretch();

    setLayout(layout);

    // we start off hidden
    hide();
}
Пример #23
0
Select7note::Select7note(QWidget *parent) :
    QWidget(parent)
{
  QGroupBox *bGr = new QGroupBox(this);
  QLabel *seventhLab = new QLabel(tr("7th note is:"),this);
  QButtonGroup *bButtGr = new QButtonGroup(this);
  isBRadio = new QRadioButton("B",this);
  isBRadio->setStatusTip(tr("7th note is <b>B</b> and with flat is <b>Bb</b> or <b>bes</b> or <b>bs</b>"));
  bButtGr->addButton(isBRadio);
  isHRadio = new QRadioButton("H",this);
  isHRadio->setStatusTip(tr("7th note is <b>H</b> and with flat is <b>Hb</b> or <b>B</b>"));
  bButtGr->addButton(isHRadio);
  QHBoxLayout *bLay = new QHBoxLayout;
    bLay->setAlignment(Qt::AlignCenter);
//     bLay->addStretch(1);
    bLay->addWidget(seventhLab);
    bLay->addSpacing(15);
    bLay->addWidget(isBRadio);
    bLay->addSpacing(15);
    bLay->addWidget(isHRadio);
//     bLay->addStretch(1);
  bGr->setLayout(bLay);
  
  QVBoxLayout *lay = new QVBoxLayout;
    lay->addWidget(bGr);

  setLayout(lay);

  connect(bButtGr, SIGNAL(buttonClicked(int)), this, SLOT(namechanged()));

}
Пример #24
0
TMonthCalendarControl::TMonthCalendarControl()
   {
      QHBoxLayout *MainLayout = new QHBoxLayout;
      MainLayout->setContentsMargins(QMargins());

      const int Side = style()->pixelMetric(QStyle::PM_ToolBarIconSize) / 1.1;
      const QSize IconSize(Side, Side);

      TBPrint = new QToolButton;
      TBPrint->setIcon(QIcon(Constants::ICON_PRINT));
      TBPrint->setToolTip(tr("Print..."));
      TBPrint->setIconSize(IconSize);
      MainLayout->addWidget(TBPrint);

      //MainLayout->addSpacing(30);

      TBGoToCurrent = new QToolButton;
      TBGoToCurrent->setIcon(QIcon(Constants::ICON_HOME));
      TBGoToCurrent->setToolTip(tr("Go to current date"));
      TBGoToCurrent->setIconSize(IconSize);
      MainLayout->addWidget(TBGoToCurrent);

      MainLayout->addStretch();

      QLabel *LNumberOfRows = new QLabel(tr("Number of rows"));
      MainLayout->addWidget(LNumberOfRows);

      SBNumberOfRows = new QSpinBox;
      SBNumberOfRows->setMinimum(2);
      SBNumberOfRows->setMaximum(11);
      MainLayout->addWidget(SBNumberOfRows);

      MainLayout->setAlignment(Qt::AlignLeft);
      setLayout(MainLayout);
   }
Пример #25
0
void MainWindow::timerOntimesignal()
{
    subtitle* newsub = mysubs.front();

    if((player->position() >= newsub->timerange.timeBegin) && (newsub->played == false))
    {
        cout << "creating subtitle" << endl;
        for(int i = 0; i < (int) newsub->firstline.size(); ++i)
        {
            QHBoxLayout* newline = new QHBoxLayout;
            for(int j = 0; j < (int) newsub->firstline[i].size(); ++j)
            {
                QPushButton* subtitleWord = new QPushButton;
                subtitleWord->setFlat(true);
                subtitleWord->setText(newsub->firstline[i][j]);
                subtitleWord->setAttribute(Qt::WA_TranslucentBackground);
                subtitleWord->setFont(QFont( "Arial", 20, QFont::Bold));
                subtitleWord->setStyleSheet("color: rgb(220, 231, 97); padding: 1px;");
                connect(subtitleWord, SIGNAL(clicked(bool)), this, SLOT(subtitleButtonClicked()));
                newline->addWidget(subtitleWord);
            }
            subtitleLayout->addLayout(newline);
            newline->setAlignment(Qt::AlignCenter);
        }

        newsub->played = true;

    }
Пример #26
0
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget),
    currentImage(new QLabel),
    currentIndex(-1),
    thumbnailIndex(-5),
    fullScreen(false)
{
    ui->setupUi(this);
    QHBoxLayout *layout = new QHBoxLayout;
    layout->setContentsMargins(10, 0, 10, 0);
    ui->frameThumnailArea->setLayout(layout);

    layout = new QHBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    ui->viewArea->setLayout(layout);
    layout->setAlignment(Qt::AlignCenter);

    ui->viewArea->layout()->addWidget(currentImage);
    currentImage->installEventFilter(this);

    connect(&signalMapper, SIGNAL(mapped(QObject*)), this, SLOT(imageClicked(QObject*)));
    start();
    showNextThumbnails();
}
medMessage::medMessage( QWidget *parent,
                        const QString& text, 
                        unsigned int timeout) : QWidget(parent)
{
    this->timeout = timeout;

    this->setFixedWidth(400);
    icon = new QLabel(this);

    info = new QLabel(this);
    info->setText(text);

    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->setAlignment(Qt::AlignLeft);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(5);
    layout->addWidget(icon);
    layout->addWidget(info);


    this->timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(remove()));

    this->setLayout(layout);
}
Пример #28
0
  SubSection(const QString & title, const QString & description, QLabel * imageLabel) : QWidget() 
  {
    QHBoxLayout * mainHLayout = new QHBoxLayout();
    setLayout(mainHLayout);

    mainHLayout->addWidget(imageLabel);

    QVBoxLayout * mainVLayout = new QVBoxLayout();
    mainHLayout->addLayout(mainVLayout);
    QLabel * titleLabel = new QLabel(title);
    titleLabel->setStyleSheet("QLabel { font-size: 14px; font: bold; color: #242D31; }");
    titleLabel->setWordWrap(true);
    mainVLayout->addWidget(titleLabel);

    QHBoxLayout * descriptionHLayout = new QHBoxLayout();
    mainVLayout->addLayout(descriptionHLayout);
    descriptionHLayout->addSpacing(35);

    QLabel * descriptionLabel = new QLabel(description);
    descriptionLabel->setFixedWidth(700);
    descriptionLabel->setStyleSheet("QLabel { font-size: 14px; color: black; }");
    descriptionLabel->setWordWrap(true);
    descriptionHLayout->addWidget(descriptionLabel);

    mainHLayout->setAlignment(Qt::AlignLeft);
  }
Пример #29
0
QHBoxLayout* Shortcut::setUpBottomPanel(){
    QHBoxLayout *bottomPanel = new QHBoxLayout;
    editBut = new QPushButton("Edit Shortcut");
    delBut = new QPushButton("Delete");
    exitBut = new QPushButton("Exit");
    searchBox = new QLineEdit;
    searchBox->setFocus();
    searchBox->setMaximumWidth(120);
    QLabel *searchLabel = new QLabel(tr("Search:"));

    bottomPanel->addWidget(searchLabel);
    bottomPanel->addWidget(searchBox);
    bottomPanel->addStretch(1);
    bottomPanel->addWidget(editBut);
    bottomPanel->addWidget(delBut);
    bottomPanel->addWidget(exitBut);

    bottomPanel->setAlignment(Qt::AlignLeft);
    connect(delBut,SIGNAL(clicked()),this, SLOT(slotDeleteShortcut()));
    connect(exitBut,SIGNAL(clicked()),this, SLOT(slotExit()));
    connect(editBut,SIGNAL(clicked()),this, SLOT(slotEditShortcutButton()));
    connect(searchBox,SIGNAL(textEdited(QString)),this,SLOT(slotFind()));
    connect(searchBox,SIGNAL(textChanged(QString)),this,SLOT(slotSearchBoxTextChanged()));

    return bottomPanel;
}
Пример #30
0
PlayConfigWindow::PlayConfigWindow(QWidget *parent, Project *project)
	: QDialog(parent), _project(project) {
		
		_tabs = new QTabWidget(this);

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

		createLocationTab();
		createPartyTab();
		createInventoryTab();

		setModal(true);
		setFixedSize(800, 600);

		loadLocationTab();
		loadPartyTab();
		loadInventoryTab();

		QFrame *buttonFrame = new QFrame(this);
		QPushButton *acceptButton = new QPushButton("Play", buttonFrame);
		acceptButton->setDefault(true);
		QPushButton *cancelButton = new QPushButton("Close", buttonFrame);
		QHBoxLayout *buttonLayout = new QHBoxLayout(buttonFrame);
		buttonLayout->setAlignment(Qt::AlignRight);
		buttonLayout->addWidget(acceptButton);
		buttonLayout->addWidget(cancelButton);
		layout->addWidget(buttonFrame);

		connect(acceptButton, SIGNAL(clicked()), this, SLOT(accept()));
		connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
}