コード例 #1
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());
	}
}
コード例 #2
0
ファイル: colordlg.cpp プロジェクト: amiel/jugglemaster
QLayout* ColorDlg::__initializeLayoutHorizontal() {
  QGridLayout* pL = new QGridLayout( this, 6, 5, 5, 2); 

  pL->addWidget(new QLabel(tr( "Line"), this), 0, 0);
  pL->addWidget(pCB_Line, 0, 1);

  pL->addWidget(new QLabel(tr( "Back"), this), 1, 0);
  pL->addWidget(pCB_BGColor, 1, 1);

  pL->addWidget(new QLabel(tr( "BallLine"), this), 2, 0);
  pL->addWidget(pCB_BallLine, 2, 1);

  QLabel* pTL;
  pTL = new QLabel(this);
  pTL->setFixedWidth(30);
  pL->addWidget(pTL, 0, 2);

  pL->addMultiCellWidget(pRB_UseColorList, 0, 0, 3, 4);
  pL->addMultiCellWidget(pRB_UseSameColor, 1, 1, 3, 4);

  pTL = new QLabel(this);
  pTL->setFixedWidth(60);
  pL->addWidget(pTL, 2, 3);
  pL->addWidget(pCB_BallColor, 2, 4);

  pL->addMultiCellWidget( pOK, 5, 5, 0, 4 );

  return pL;
}
コード例 #3
0
ファイル: projectwindow.cpp プロジェクト: jaisurya/picworks
/*!
  \brief Constructor.
  Creates a new instance of ProjectWindow.
  \param pro project data to show, not null.
  \param parent parent widgets of this window, default value is 0.
 */
Ui::ProjectWindow::ProjectWindow(Core::Project *pro, QWidget *parent /* = 0 */)
        : QMdiSubWindow(parent),
          project(pro)
{
    // entry conditions
    Q_CHECK_PTR(pro);

    setAttribute(Qt::WA_DeleteOnClose);

    setWindowIcon(QIcon(":/proj"));
    setWindowTitle(project->name());
    setMinimumSize(200, 200);

    // project view, the main widget
    view = new ProjectView(this);
    scene = new ProjectScene(project, this);
    view->setScene(scene);
    view->setSceneRect(0, 0, project->width(), project->height());
    QScrollArea* centerPanel = new QScrollArea(this);
    centerPanel->viewport()->setStyleSheet(QString("background-color:#C0C0C0"));
    centerPanel->setAlignment(Qt::AlignCenter);
    centerPanel->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    centerPanel->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    centerPanel->setWidget(view);

    // status bar
    statusBar = new QWidget(this);
    QHBoxLayout *statusLayout = new QHBoxLayout(statusBar);
    statusLayout->setMargin(0);
    statusBar->setLayout(statusLayout);
    QLineEdit* percentInput = new QLineEdit(statusBar);
    percentInput->setText("100");
    percentInput->setFixedSize(40, 18);
    QLabel *msgLabel = new QLabel(statusBar);
    msgLabel->setText("%");
    msgLabel->setFixedWidth(8);
    QPushButton *gridButton = new QPushButton(statusBar);
    gridButton->setText("#");
    gridButton->setCheckable(true);
    gridButton->setFixedSize(20, 18);
    QLabel *ctrlLabel = new QLabel(statusBar);
    ctrlLabel->setFixedWidth(qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent) - 6);
    statusLayout->addWidget(percentInput);
    statusLayout->addWidget(msgLabel);
    statusLayout->addWidget(gridButton);
    statusLayout->addWidget(centerPanel->horizontalScrollBar(), 100);
    statusLayout->addWidget(ctrlLabel);

    QWidget *mainPanel = new QWidget(this);
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setMargin(0);
    mainLayout->setSpacing(0);
    mainLayout->addWidget(centerPanel);
    mainLayout->addWidget(statusBar);
    mainPanel->setLayout(mainLayout);
    setWidget(mainPanel);

    connect(gridButton, SIGNAL(clicked(bool)), scene, SLOT(showGrid(bool)));
    connect(appCtx->mainWindow(), SIGNAL(antialiasingChanged(bool)), scene, SLOT(setAntialiasing(bool)));
}
コード例 #4
0
ファイル: msgdlg.cpp プロジェクト: xbackupx/showeqx
//
//
// CButDlg Class
//
// Provide a dialog to add/edit a filter button to the MsgDialog 
//
CButDlg::CButDlg(QWidget *parent, QString name, MyButton *but)
  : QDialog(parent, name, TRUE)
{
   QBoxLayout *topLayout = new QVBoxLayout(this);
   QBoxLayout *row1Layout = new QHBoxLayout(topLayout);
   QBoxLayout *row2Layout = new QHBoxLayout(topLayout);

   QFont labelFont(font());
   labelFont.setBold(true);

   QLabel *nameLabel = new QLabel ("Name", this);
   nameLabel->setFont(labelFont);
   nameLabel->setFixedHeight(nameLabel->sizeHint().height());
   nameLabel->setFixedWidth(80);
   nameLabel->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
   row1Layout->addWidget(nameLabel);
  
   QLineEdit *nameEdit = new QLineEdit (this, "Name");
   nameEdit->setText(but->text());
   nameEdit->setFont(labelFont);
   nameEdit->setFixedHeight(nameEdit->sizeHint().height());
   nameEdit->setFixedWidth(150);
   row1Layout->addWidget(nameEdit);

   QLabel *filterLabel = new QLabel ("Filter", this);
   filterLabel->setFont(labelFont);
   filterLabel->setFixedHeight(filterLabel->sizeHint().height());
   filterLabel->setFixedWidth(80);
   filterLabel->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
   row2Layout->addWidget(filterLabel);
  
   QLineEdit *filterEdit = new QLineEdit (this, "Filter");
   filterEdit->setText(but->filter());
   filterEdit->setFont(labelFont);
   filterEdit->setFixedHeight(filterEdit->sizeHint().height());
   filterEdit->setFixedWidth(150);
   row2Layout->addWidget(filterEdit);

   QPushButton *ok = new QPushButton("OK", this);
   ok->setFixedWidth(30);
   ok->setFixedHeight(30);
   topLayout->addWidget(ok, 0, AlignCenter);
 
   // connect sigs
   connect(nameEdit, SIGNAL(textChanged(const QString &)),
      but, SLOT(setText(const QString &)));  
   connect(filterEdit, SIGNAL(textChanged(const QString &)),
      but, SLOT(setFilter(const QString &)));  
   connect(ok, SIGNAL(clicked()), SLOT(accept()));

   setMaximumSize(QSize(sizeHint()));
}
コード例 #5
0
ファイル: filters.cpp プロジェクト: Kahany/acquisition
// TODO(xyz): ugh, a lot of copypasta below, perhaps this could be done
// in a nice way?
void SocketsColorsFilter::Initialize(QLayout *parent, const char* caption) {
    QWidget *group = new QWidget;
    QHBoxLayout *layout = new QHBoxLayout;
    layout->setMargin(0);
    QLabel *label = new QLabel(caption);
    label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    textbox_r_ = new QLineEdit;
    textbox_r_->setPlaceholderText("R");
    textbox_g_ = new QLineEdit;
    textbox_g_->setPlaceholderText("G");
    textbox_b_ = new QLineEdit;
    textbox_b_->setPlaceholderText("B");
    layout->addWidget(label);
    layout->addWidget(textbox_r_);
    layout->addWidget(textbox_g_);
    layout->addWidget(textbox_b_);
    group->setLayout(layout);
    parent->addWidget(group);
    textbox_r_->setFixedWidth(Util::TextWidth(TextWidthId::WIDTH_RGB));
    textbox_g_->setFixedWidth(Util::TextWidth(TextWidthId::WIDTH_RGB));
    textbox_b_->setFixedWidth(Util::TextWidth(TextWidthId::WIDTH_RGB));
    label->setFixedWidth(Util::TextWidth(TextWidthId::WIDTH_LABEL));
    QObject::connect(textbox_r_, SIGNAL(textEdited(const QString&)),
                     parent->parentWidget()->window(), SLOT(OnSearchFormChange()));
    QObject::connect(textbox_g_, SIGNAL(textEdited(const QString&)),
                     parent->parentWidget()->window(), SLOT(OnSearchFormChange()));
    QObject::connect(textbox_b_, SIGNAL(textEdited(const QString&)),
                     parent->parentWidget()->window(), SLOT(OnSearchFormChange()));
}
コード例 #6
0
void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
{
    QLabel *label = new QLabel("Qt uses standard C++, but makes extensive use of the C pre-processor to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on all major platforms, and has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, thread management, network support and a unified cross-platform API for file handling.");
    label->setWordWrap(true);
    label->setFixedWidth(200);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(label);
    layout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding));

    QWidget widget;
    widget.setLayout(layout);
    widget.show();
    QTest::qWaitForWindowShown(&widget);

    int height = label->height();

    QRect g = widget.geometry();
    g.setWidth(600);
    widget.setGeometry(g);

    QTest::qWait(50);

    QCOMPARE(label->height(), height);
}
コード例 #7
0
void CGraphicBuildingTile::display(QList<QString> _toDisplay)
{
    QDialog* infoDialog = new QDialog;//(dynamic_cast<QWidget*>(this->parent()));
    QVBoxLayout* newLayout = new QVBoxLayout();
    int q=0;
    QScrollArea* scrolArea = new QScrollArea(dynamic_cast<QWidget*>(this->parent()));
    for(int i=0;i<_toDisplay.count();i++)
    {   QLabel* newLabel = new QLabel(_toDisplay.at(i));
        newLabel->setFixedWidth(280);
        newLabel->setMinimumHeight(22);
        newLabel->setStyleSheet("border: 1px solid black");
        newLayout->addWidget(newLabel);
        q++;
    }
    QPalette pal;
    pal.setColor(QPalette::Background,QColor(230,200,167));
    infoDialog->setFixedWidth(330);
    infoDialog->setMinimumHeight(30+22*q);
    infoDialog->setLayout(newLayout);
    infoDialog->setAutoFillBackground(true);
    infoDialog->setPalette(pal);
    infoDialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setWidget(infoDialog);
    scrolArea->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setMaximumHeight(infoDialog->size().height()+2);
    scrolArea->setWindowTitle(QString("Info about"));
    scrolArea->show();
}
コード例 #8
0
QWidget *MainWindow::InstallProcessBody(){
    QString hits ="<p style='color:white; font-size:14px;'>" +
               tr("Being installed. Please wait... ") +
                  "</p>";
    QWidget *widget = new QWidget;
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setSpacing(20);
    layout->addSpacing(70);

    DWaterProgress *iconHits = new DWaterProgress;
    layout->addWidget(iconHits);
    layout->setAlignment(iconHits, Qt::AlignCenter);
    connect(this, SIGNAL(progressChanged(int)),
            iconHits, SLOT(setProgress(int)));

    connect (this,SIGNAL(progressDone()),
             iconHits, SLOT(stop()));

    iconHits->start();

    QLabel *textHits = new QLabel;
    textHits->setAlignment(Qt::AlignCenter);
    textHits->setFixedWidth(260);
    textHits->setWordWrap(true);
    textHits->setText(hits);

    layout->addWidget(textHits);
    layout->setAlignment(textHits, Qt::AlignCenter);

    widget->setLayout(layout);
    return widget;
}
コード例 #9
0
ファイル: editorcommon.cpp プロジェクト: LordMastodon/voxie
QLabel * create_label(const QString & text)
{
    QLabel * label = new QLabel(text);
    label->setFixedWidth(50);
    label->setAlignment(Qt::AlignCenter);
    return label;
}
コード例 #10
0
QLabel* MainWindow::getQLabel()
{
    QLabel *lbl = new QLabel(this);
    lbl->setAlignment(Qt::AlignRight | Qt::AlignTop);
    lbl->setFixedWidth(LBL_WIDTH);
    return lbl;
}
コード例 #11
0
ファイル: ChannelsWidgets.cpp プロジェクト: LiveMix/LiveMix
MainWidget::MainWidget(Widget* p_pMatrix) : ChannelWidget()
        , m_pMatrix(p_pMatrix)
{
    QVBoxLayout* layout = new QVBoxLayout;
    setLayout(layout);
    setFixedWidth(CHANNEL_WIDTH);
    layout->setSpacing(0);
    layout->setMargin(0);

    {
        QLabel *label = new QLabel(trUtf8("Phone"));
        label->setFixedWidth(CHANNEL_WIDTH);
        label->setAlignment(Qt::AlignHCenter);
        layout->addWidget(label);
    }

    phone = m_pMatrix->createRotary(OUT, MAIN, FADER, PFL);
    layout->addWidget(phone);

    {
        Widget::addSpacer(layout);
        m_pLabel = new QLabel(trUtf8("Main"));
        m_pLabel->setFixedWidth(CHANNEL_WIDTH);
        m_pLabel->setAlignment(Qt::AlignHCenter);
        layout->addWidget(m_pLabel);
        QFont font = m_pLabel->font();
        font.setBold(true);
        m_pLabel->setFont(font);
    }

    mute = m_pMatrix->createToggle(OUT, MAIN, MUTE);
    layout->addWidget(mute);
//    Widget::addLine(layout);
    {
        PixmapWidget *pw = new PixmapWidget(NULL);
        pw->setPixmap("separator.svg");
        pw->setFixedSize(CHANNEL_WIDTH, SEPARATOR_HEIGHT);
        layout->addWidget(pw);
    }

    mono = m_pMatrix->createRotary(OUT, MAIN, FADER, MONO);
    layout->addWidget(mono);

//    Widget::addLine(layout);
    {
        PixmapWidget *pw = new PixmapWidget(NULL);
        pw->setPixmap("separator.svg");
        pw->setFixedSize(CHANNEL_WIDTH, SEPARATOR_HEIGHT);
        layout->addWidget(pw);
    }

    bal = m_pMatrix->createRotary(OUT, MAIN, PAN_BAL);
    layout->addWidget(bal);

    afl = m_pMatrix->createToggle(OUT, MAIN, TO_AFL);
    layout->addWidget(afl);

    fader = m_pMatrix->createFader(OUT, MAIN, FADER, MAIN);
    layout->addWidget(fader);
}
コード例 #12
0
ファイル: colordlg.cpp プロジェクト: amiel/jugglemaster
QLayout* ColorDlg::__initializeLayoutVertical() {
  QGridLayout* pL = new QGridLayout( this, 8, 2, 5, 2 ); 

  pL->addWidget(new QLabel(tr( "Line"), this), 0, 0);
  pL->addWidget(pCB_Line, 0, 1);

  pL->addWidget(new QLabel(tr( "Back"), this), 1, 0);
  pL->addWidget(pCB_BGColor, 1, 1);

  pL->addWidget(new QLabel(tr( "BallLine"), this), 2, 0);
  pL->addWidget(pCB_BallLine, 2, 1);

  QLabel* pTL;
  pTL = new QLabel(this);
  pTL->setFixedHeight(20);
  pL->addMultiCellWidget(pTL, 3, 3, 0, 1);

  pL->addMultiCellWidget(pRB_UseColorList, 4, 4, 0, 1);
  pL->addMultiCellWidget(pRB_UseSameColor, 5, 5, 0, 1);

  pTL = new QLabel(this);
  pTL->setFixedWidth(60);
  pL->addWidget(pTL, 6, 0);
  pL->addWidget(pCB_BallColor, 6, 1);

  pL->addMultiCellWidget( pOK, 7, 7, 0, 1 );
  return pL;
}
コード例 #13
0
void DWindowUI::SwitchToProcessUI() {
    QLayoutItem *child;
    while ((child = actionLayout_->takeAt(0)) != 0)  {
        if (child->widget()) {
            child->widget()->setVisible(false);
        }
    }
    while ((child = selectLayout_->takeAt(0)) != 0)  {
        if (child->widget()) {
            child->widget()->setVisible(false);
        }
    }

    QLabel *processHints = new QLabel(tr("<a style='color:#ffffff; font-size:12px'>Please </a>"
                                         "<a style='color:#ebab4c; font-size:12px'>DO NOT</a>"
                                         "<a style='color:#ffffff; font-size:12px'> remove the USB flash drive or shutdown while file is writing.<a>"));
    processHints->setFixedWidth(labelMaxWidth);
    processHints->setWordWrap(true);

    selectLayout_->addStretch();
    selectLayout_->addWidget(processHints);
    selectLayout_->setAlignment(processHints, Qt::AlignVCenter);

    usbLabel_->setText("<p style='color:white; font-size:10px;'>0%  </p>");
    QMovie *processMovie = new QMovie(":/ui/images/process-active.gif");
    processLabel_->setMovie(processMovie);
    processMovie->start();

    processTimer_ = new QTimer(this);
    processTimer_->setInterval(5000);
    connect(processTimer_, SIGNAL(timeout()), this, SLOT(checkProcess()));
    processTimer_->start();

    isoLabel_->start();
}
コード例 #14
0
ファイル: StartupView.cpp プロジェクト: Zicao/OpenStudio
  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);
  }
コード例 #15
0
ファイル: dvdialog.cpp プロジェクト: PsmithG/opentoonz
/*! Add a pair [label,layout] to main part of dialog, label is created from
		\b QString \b nameLabel.
\n	Recall \b addWidgetLayout(QWdiget* widget, QWdiget* layout).
*/
void Dialog::addLayout(QString labelName, QLayout *layout)
{
	QLabel *label = new QLabel(labelName);
	m_labelList.push_back(label);
	label->setFixedWidth(m_labelWidth);
	label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
	addWidgetLayout(label, layout);
}
コード例 #16
0
ファイル: MorePage.cpp プロジェクト: LinLinYi/kirogi
void MorePage::initializeWidget()
{
    //导航栏
    QString strTitle = tr("更多...");
    navigationBar = new NavigationBar(this);
    navigationBar->setTitleText(strTitle);

    QHBoxLayout* pHLTop = new QHBoxLayout();
    pHLTop->addWidget(navigationBar);
    pHLTop->setSpacing(0);
    pHLTop->setMargin(0);
    this->setTopbarLayout(pHLTop);


    //个人信息
    QLabel* themeWidget = new QLabel;
    QPixmap pixmap = QPixmap(ImagePath::MOREPAGE_THEME);
    pixmap.setDevicePixelRatio(2);
    themeWidget->setAutoFillBackground(true);
    themeWidget->setFixedHeight(this->screenHeight()*0.25);
    themeWidget->setFixedWidth(this->screenWidth());
    themeWidget->setPixmap(pixmap);
    themeWidget->setScaledContents(true);

    btnPersonalInfo = new QToolButton;
    btnPersonalInfo->setFixedWidth(this->screenWidth());
    btnPersonalInfo->setFixedHeight(this->screenHeight()*0.15);
    btnPersonalInfo->setIconSize(QSize(btnPersonalInfo->height()*0.7, btnPersonalInfo->height()*0.7));
    btnPersonalInfo->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    btnPersonalInfo->setStyleSheet("font:16px; color:white;background-color:rgba(0,0,0,0)");
    connect(btnPersonalInfo, SIGNAL(clicked()), SLOT(on_btnPersonal_clicked()));

    QVBoxLayout* themeLayout = new QVBoxLayout;
    themeLayout->addWidget(btnPersonalInfo);
    themeLayout->setMargin(0);
    themeWidget->setLayout(themeLayout);

    //设置
    btnSetting = new GroupButton;
    btnSetting->setStyleSheet(SheetStyle::GROUPBUTTON_BOTTOMBORDER);
    QPixmap settingPixmap(ImagePath::SETTING);
    this->setGroupButton(btnSetting, settingPixmap, tr("设置"));
    connect(btnSetting, SIGNAL(clicked()), SLOT(on_btnSetting_clicked()));

    QVBoxLayout* vblTotalLayout = new QVBoxLayout;
    vblTotalLayout->addWidget(themeWidget);
    vblTotalLayout->addSpacing(this->screenHeight()*0.026);
    vblTotalLayout->addWidget(btnSetting);
    vblTotalLayout->setAlignment(Qt::AlignTop);
    vblTotalLayout->setMargin(0);
    vblTotalLayout->setSpacing(0);
    this->setBodyPartLayout(vblTotalLayout);

    //屏幕触摸滚动设置
    this->setBodyScreenHeight(this->scrollAreaHasBottomBarHeight());
    this->installScrollViewportArea();
    this->loadLocalData(curAccountID);
}
コード例 #17
0
ファイル: MessageBar.cpp プロジェクト: RJ/lastfm-desktop
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();
}
コード例 #18
0
 foreach(const ElementTypes &elementType, getAvailableElementTypes()){
     QLabel *element = new QLabel();
     element->setPixmap(QPixmap(getElementTypeIconPath(elementType)));
     element->setFixedHeight(30);
     element->setFixedWidth(30);
     element->setScaledContents(true);
     element->setVisible(false);
     this->layout_neededElements->addWidget(element);
     this->neededElements.insert(elementType, element);
 }
コード例 #19
0
ファイル: prefsdialog.cpp プロジェクト: DHaylock/fritzing-app
QWidget* PrefsDialog::createOtherForm() 
{
	QGroupBox * formGroupBox = new QGroupBox(tr("Clear Settings"));
    QHBoxLayout *layout = new QHBoxLayout();
    layout->setSpacing(SPACING);

    QFrame * frame = new QFrame;
    QVBoxLayout * vlayout = new QVBoxLayout();
    vlayout->setMargin(0);
    vlayout->setSpacing(0);

    QLabel * clearLabel = new QLabel(QObject::tr("Clear all saved settings and close this dialog immediately."));
    clearLabel->setWordWrap(true);
    clearLabel->setFixedWidth(FORMLABELWIDTH);
    vlayout->addWidget(clearLabel);

    vlayout->addSpacing(SPACING);

    clearLabel = new QLabel(QObject::tr("This action does not delete any files; it restores settings to their default values."));
    clearLabel->setWordWrap(true);
    clearLabel->setFixedWidth(FORMLABELWIDTH);
    vlayout->addWidget(clearLabel);

    vlayout->addSpacing(SPACING);

    clearLabel = new QLabel(QObject::tr("There is no undo for this action, and no further warning!!!!"));
    clearLabel->setWordWrap(true);
    clearLabel->setFixedWidth(FORMLABELWIDTH);
    vlayout->addWidget(clearLabel);

    frame->setLayout(vlayout);
    layout->addWidget(frame);

	QPushButton * clear = new QPushButton(QObject::tr("Clear Settings"), this);
	clear->setMaximumWidth(220);
	connect(clear, SIGNAL(clicked()), this, SLOT(clear()));

	layout->addWidget(clear);	

	formGroupBox->setLayout(layout);
	return formGroupBox;
}
コード例 #20
0
ファイル: expectations.cpp プロジェクト: cmercier/UTProfiler
void Expectations::loadSemesters() const
{
    Utilities::clearLayout(semestersLayout_);
    // Create semesters
    for(int i = 0; i < exp_->semesters().size(); i++)
    {
        const Semester* semester = exp_->semesters().at(i);
        QGroupBox* semesterBox = new QGroupBox(semester->title());

        // Create and populate new uvs layout
        QHBoxLayout* uvsLayout = new QHBoxLayout;
        QVBoxLayout* codeCol = new QVBoxLayout;
        QVBoxLayout* titleCol = new QVBoxLayout;
        QVBoxLayout* creditsCol = new QVBoxLayout;

        QMapIterator<QString, Grade> it(semester->uvs());
        while (it.hasNext()) {
            it.next();

            const Uv* uv = UTManager::instance().uvFromCode(it.key()) ;

            QLabel* code = new QLabel(uv->code());
            code->setFixedWidth(50);
            codeCol->addWidget(code);
            QLabel* title = new QLabel(uv->title());
            titleCol->addWidget(title);
            QLabel* credits = new QLabel(QString::number(uv->credits()));
            credits->setFixedWidth(50);
            creditsCol->addWidget(credits);
        }

        // Refresh uvs layout
        uvsLayout->addLayout(codeCol);
        uvsLayout->addLayout(titleCol);
        uvsLayout->addLayout(creditsCol);
        semesterBox->setLayout(uvsLayout);

        semestersLayout_->addWidget(semesterBox);
    }
    semestersLayout_->insertStretch(-1);
}
コード例 #21
0
ファイル: kstatusbar.cpp プロジェクト: fluxer/kdelibs
void KStatusBar::setItemFixed(int id, int w)
{
    QLabel *label = qobject_cast<QLabel*>(d->items[id]);
    if ( label ) {
        if ( w == -1 ) {
            w = fontMetrics().boundingRect(label->text()).width()+3;
        }

        label->setFixedWidth(w);
    } else {
        kDebug() << "KStatusBar::setItemFixed: bad item id: " << id;
    }
}
コード例 #22
0
ファイル: tabbar.cpp プロジェクト: char101/qupzilla
TabBar::TabBar(BrowserWindow* window, TabWidget* tabWidget)
    : ComboTabBar()
    , m_window(window)
    , m_tabWidget(tabWidget)
    , m_tabPreview(new TabPreview(window, window))
    , m_showTabPreviews(false)
    , m_hideTabBarWithOneTab(false)
    , m_showCloseOnInactive(0)
    , m_clickedTab(0)
    , m_normalTabWidth(0)
    , m_activeTabWidth(0)
{
    setObjectName("tabbar");
    setContextMenuPolicy(Qt::CustomContextMenu);
    setElideMode(Qt::ElideRight);
    setFocusPolicy(Qt::NoFocus);
    setTabsClosable(false);
    setMouseTracking(true);
    setDocumentMode(true);
    setAcceptDrops(true);
    setDrawBase(false);
    setMovable(true);

    connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
    connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));

    m_tabPreviewShowTimer = new QTimer(this);
    m_tabPreviewShowTimer->setInterval(300);
    m_tabPreviewShowTimer->setSingleShot(true);
    connect(m_tabPreviewShowTimer, SIGNAL(timeout()), this, SLOT(showTabPreview()));

    m_tabPreviewHideTimer = new QTimer(this);
    m_tabPreviewHideTimer->setInterval(300);
    m_tabPreviewHideTimer->setSingleShot(true);
    connect(m_tabPreviewHideTimer, SIGNAL(timeout()), m_tabPreview, SLOT(hideAnimated()));

    // ComboTabBar features
    setUsesScrollButtons(true);
    setCloseButtonsToolTip(BrowserWindow::tr("Close Tab"));
    connect(this, SIGNAL(scrollBarValueChanged(int)), this, SLOT(hideTabPreview()));
    connect(this, SIGNAL(overFlowChanged(bool)), this, SLOT(overflowChanged(bool)));

    if (mApp->isPrivate()) {
        QLabel* privateBrowsing = new QLabel(this);
        privateBrowsing->setObjectName(QSL("private-browsing-icon"));
        privateBrowsing->setPixmap(IconProvider::privateBrowsingIcon().pixmap(16, 16));
        privateBrowsing->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
        privateBrowsing->setFixedWidth(30);
        addCornerWidget(privateBrowsing, Qt::TopLeftCorner);
    }
}
コード例 #23
0
ファイル: CloudDialog.cpp プロジェクト: CraigCasey/OpenStudio
void AmazonProviderWidget::createLoginWidget()
{
  m_leftLoginLayout->setContentsMargins(QMargins(0,0,0,0));

  QLabel * label = 0;

  // LEFT LOGIN PAGE
  
  label = new QLabel;
  label->setOpenExternalLinks(true);
  label->setText("To create an account go to <a href=\"http://aws.amazon.com\">aws.amazon.com</a>");
  m_leftLoginLayout->addWidget(label,0,Qt::AlignTop | Qt::AlignLeft);

  label = new QLabel;
  label->setObjectName("H2");
  label->setText("Access Key");
  m_leftLoginLayout->addWidget(label,0,Qt::AlignTop | Qt::AlignLeft);

  m_accessKeyLineEdit = new QLineEdit();
  m_accessKeyLineEdit->setMinimumWidth(KEY_WIDTH);
  m_accessKeyLineEdit->setMaxLength(20);
  m_leftLoginLayout->addWidget(m_accessKeyLineEdit,0,Qt::AlignTop | Qt::AlignLeft);
  
  label = new QLabel;
  label->setObjectName("H2");
  label->setText("Secret Key");
  m_leftLoginLayout->addWidget(label,0,Qt::AlignTop | Qt::AlignLeft);

  m_secretKeyLineEdit = new QLineEdit();
  m_secretKeyLineEdit->setMinimumWidth(KEY_WIDTH);
  m_secretKeyLineEdit->setEchoMode(QLineEdit::PasswordEchoOnEdit);
  m_secretKeyLineEdit->setMaxLength(40);
  m_leftLoginLayout->addWidget(m_secretKeyLineEdit,0,Qt::AlignTop | Qt::AlignLeft);

  m_leftLoginLayout->addSpacing(30);

  label = new QLabel;
  label->setFixedWidth(TEXT_WIDTH);
  label->setWordWrap(true);
  label->setObjectName("H1");
  label->setOpenExternalLinks(true);
  label->setText("<FONT COLOR = RED>PAT cloud support with Amazon EC2 is a new feature, and is still under active development to improve interprocess reliability and performance. The user assumes all responsibility for orphaned EC2 processes, and it is strongly recommended that you monitor EC2 cloud usage at <a href=\"http://aws.amazon.com\">aws.amazon.com</a> to avoid any unwanted charges.");
  label->setAlignment(Qt::AlignTop);
  m_leftLoginLayout->addWidget(label,0,Qt::AlignTop | Qt::AlignLeft);

  m_leftLoginLayout->addStretch();

  // RIGHT LOGIN PAGE

  // m_rightLoginLayout N/A
}
コード例 #24
0
ファイル: row.cpp プロジェクト: anisart/myStudyTimeTable
Row::Row(QSqlQuery dataQuery, int wday, QWidget *parent) :
    QWidget(parent)
{
    QGridLayout *gl = new QGridLayout();


    stime = QTime(dataQuery.value(0).toInt(),dataQuery.value(1).toInt());
    etime = QTime(dataQuery.value(2).toInt(),dataQuery.value(3).toInt());
    subj = dataQuery.value(4).toString();
    prof = dataQuery.value(5).toString();
    type = dataQuery.value(6).toString();
    loc = dataQuery.value(7).toString();
    _id = dataQuery.value(8).toString();
    weekday = wday;

    QLabel *stimeLab = new QLabel(stime.toString("H:mm"));
    QLabel *etimeLab = new QLabel("~" + etime.toString("H:mm"));
    QLabel *subjLab = new QLabel(subj);
    QLabel *profLab = new QLabel(prof);
    QLabel *typeLab = new QLabel(type);
    QLabel *locLab = new QLabel(loc);

    typeLab->setFixedWidth(70);
    locLab->setFixedWidth(70);

    gl->addWidget(stimeLab,0,0);
    gl->addWidget(etimeLab,1,0);
    gl->addWidget(subjLab,0,1);
    gl->addWidget(profLab,1,1);
    gl->addWidget(typeLab,0,2);
    gl->addWidget(locLab,1,2);

    gl->setColumnStretch(.1,.1);
    setLayout(gl);
    setMaximumHeight(70);

    parentW=parent;
}
コード例 #25
0
void BlocksDisplay::addTrack(Track *t)
{
    QLabel *l = new QLabel(this);
    l->setFixedWidth(32);
    l->setFixedHeight(16);
    l->setText(QString::number(nextTrack+1).append(':'));
    ui->gridLayout->addWidget(l, nextTrack, 0);
    int numSectors = Track_numSectors(t);
    for (int i = 0; i < numSectors;)
    {
        BlockStatus s = Track_blockStatus(t, i);
        int status = 0;
        if (s & BS_ALLOCATED) status = 2;
        else if (s & BS_RESERVED) status = 1;

        l = new QLabel(this);
        l->setFixedWidth(16);
        l->setFixedHeight(16);
        l->setPixmap(statusIcons[status]);
        ui->gridLayout->addWidget(l, nextTrack, ++i);
    }
    ++nextTrack;
}
コード例 #26
0
ファイル: minesrankingwidget.cpp プロジェクト: tsenmu/mines
void MinesRankingWidget::initUi()
{
    QVBoxLayout* vl = new QVBoxLayout();
    this->setLayout(vl);
    int wNumber = 30;
    int wPlayer = 200;
    int wScore = 60;
    QHBoxLayout* hhl = new QHBoxLayout();
    QLabel* hNumber = new QLabel("#");
    hNumber->setStyleSheet("color:#3366FF");
    hNumber->setFont(QFont("Arial", 16, QFont::Bold));
    hNumber->setFixedWidth(wNumber);
    hNumber->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);

    QLabel* hPlayer = new QLabel("Player");
    hPlayer->setStyleSheet("color:#3366FF");
    hPlayer->setFont(QFont("Arial", 16, QFont::Bold));
    hPlayer->setFixedWidth(wPlayer);
    hPlayer->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);

    QLabel* hScore = new QLabel("Score");
    hScore->setStyleSheet("color:#3366FF");
    hScore->setFont(QFont("Arial", 16, QFont::Bold));
    hScore->setFixedWidth(wScore);
    hScore->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
    hhl->addWidget(hNumber);
    hhl->addWidget(hPlayer);
    hhl->addWidget(hScore);
    vl->addLayout(hhl);
    for(int i = 0; i < 10; ++i)
    {
        QHBoxLayout* hl = new QHBoxLayout();
        QLabel* numberLabel = new QLabel(QString::number(i + 1));
        numberLabel->setStyleSheet("color:#ffffff");
        numberLabel->setFont(QFont("Arial", 16, 20));
        numberLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
        numberLabel->setFixedWidth(wNumber);
        QLabel* playerLabel = new QLabel("");
        playerLabel->setStyleSheet("color:#ffffff");
        playerLabel->setFont(QFont("Arial", 16, 20));
        playerLabel->setFixedWidth(wPlayer);
        playerLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
        playerLabels.append(playerLabel);

        QLabel* scoreLabel = new QLabel("");
        scoreLabel->setStyleSheet("color:#ffffff");
        scoreLabel->setFont(QFont("Arial", 16, 20));
        scoreLabel->setFixedWidth(wScore);
        scoreLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
        scoreLabels.append(scoreLabel);

        hl->addWidget(numberLabel);
        hl->addWidget(playerLabel);
        hl->addWidget(scoreLabel);
        vl->addLayout(hl);
    }
}
コード例 #27
0
ファイル: dvdialog.cpp プロジェクト: PsmithG/opentoonz
void Dialog::resizeEvent(QResizeEvent *e)
{
	if (Preferences::instance()->getCurrentLanguage() != "english") {
		QSize t = this->size();
		QLabel *s;
		foreach (s, m_labelList)
			s->setFixedWidth(t.width() * .35);
	}

	if (m_name == QString())
		return;

	QRect r = geometry();
	m_settings->setValue(m_name, QString::number(r.left()) + " " + QString::number(r.top()) + " " + QString::number(r.width()) + " " + QString::number(r.height()));
}
コード例 #28
0
ファイル: filters.cpp プロジェクト: Kahany/acquisition
void BooleanFilter::Initialize(QLayout *parent) {
    QWidget *group = new QWidget;
    QHBoxLayout *layout = new QHBoxLayout;
    layout->setMargin(0);
    QLabel *label = new QLabel(caption_.c_str());
    label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    checkbox_ = new QCheckBox;
    layout->addWidget(label);
    layout->addWidget(checkbox_);
    group->setLayout(layout);
    parent->addWidget(group);
    label->setFixedWidth(Util::TextWidth(TextWidthId::WIDTH_LABEL));
    QObject::connect(checkbox_, SIGNAL(stateChanged(int)),
                     parent->parentWidget()->window(), SLOT(OnSearchFormChange()));
}
コード例 #29
0
ファイル: bitcoingui.cpp プロジェクト: Crowndev/crowncoin
void BitcoinGUI::createToolBars()
{
    if(walletFrame)
    {
        toolbar = new QToolBar(tr("Tabs toolbar"));
        toolbar->setObjectName("toolbar");
        addToolBar(Qt::LeftToolBarArea, toolbar);
        toolbar->setMovable(false);
        toolbar->setFixedWidth(200);
        toolbar->setMinimumHeight(500);
        toolbar->setIconSize(QSize(16, 16));

        QLabel *labelLogo = new QLabel(toolbar);
        labelLogo->setFixedWidth(200);
        labelLogo->setFixedHeight(110);
        labelLogo->setPixmap(QPixmap(":css/logo"));
        labelLogo->setObjectName("labelLogo");

        QWidget* spacer1 = new QWidget();
        spacer1->setFixedWidth(20);
        spacer1->setObjectName("spacer1");
        spacer1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);

        toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
        toolbar->addWidget(labelLogo);
        toolbar->addAction(overviewAction);
        toolbar->addAction(sendCoinsAction);
        toolbar->addAction(receiveCoinsAction);
        toolbar->addAction(historyAction);
        toolbar->setMovable(false); // remove unused icon in upper left corner
        overviewAction->setChecked(true);

        /** Create additional container for toolbar and walletFrame and make it the central widget.
            This is a workaround mostly for toolbar styling on Mac OS but should work fine for every other OSes too.
        */
        QWidget *containerWidget = new QWidget();
        QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight, containerWidget);
        layout->addWidget(toolbar);
        layout->addWidget(spacer1);
        layout->addWidget(walletFrame);
        layout->setSpacing(0);
        layout->setContentsMargins(QMargins());
        containerWidget->setLayout(layout);
        setCentralWidget(containerWidget);
    }
}
コード例 #30
0
ファイル: ygwidget.cpp プロジェクト: JandunCN/AllInGithub
YGWidget::YGWidget(int timeSecs, UISetting::FontType fontType, quint8 btnsFlag, QWidget *parent /*= 0*/):
    QWidget(parent),
    LanguageResAid(true),
    m_timerLbl(0),
    m_bgImage(QImage()),
    m_winPos(QPoint(0,0)),
    m_mousePos(QPoint(0,0)),
    m_deltaPos(QPoint(0,0)),
    m_closable(false),
    m_movable(false)
{
    setTransparentAndFrameless();
    internalInitial();

    if(timeSecs != -1)
    {
        QString txt = tr("倒计时: ");
        QLabel *lblTimerTip = new QLabel(txt, this);
        lblTimerTip->setFixedHeight(QFontMetrics(ygApp->font()).height()+5);  // 没有加5,绘制时中文会截断下面一点点,待搞明白为什么;
        lblTimerTip->setFixedWidth(QFontMetrics(ygApp->font()).width(txt));
        lblTimerTip->setStyleSheet(QString("color:#7a828c; font-size:18px;"));
        lblTimerTip->move(YGW_TIMER_POS - QPoint(90, -15));
        lblTimerTip->show();

        m_timerLbl = new YGTimerLabel(YGW_TIMER_POS, timeSecs,
                                      UISetting::font(fontType),
                                               QColor(Qt::red), Qt::AlignHCenter|Qt::AlignVCenter, this);
        QFont ft = font();
        ft.setPixelSize(34);
        QFontMetrics fontMtr(ft);
        m_timerLbl->setFixedWidth(fontMtr.width(QString("999")));
        m_timerLbl->setFixedHeight(fontMtr.height());
        connect(m_timerLbl, SIGNAL(timeout()), this, SLOT(sltShowTimeout()));
        m_timerLbl->startTimer(true);

        g_timer = m_timerLbl;
    }

    if(btnsFlag != ToolBar::Show_None)
    {
        ToolBar *bar = new ToolBar(YGW_BOTTOM_BAR_SIZE, YGW_BOTTOM_BAR_POS, btnsFlag, this);
        //connect(bar, SIGNAL(sglToolBarCmd(quint8)), this, SLOT(sltToolbarCmd(quint8)));
        connect(bar, SIGNAL(sglToolBarCmd(/*ToolBar::ToolBarCmd*/quint8)), this, SIGNAL(sglToolBarCmd(/*ToolBar::ToolBarCmd*/quint8)));
    }
    connect(this, SIGNAL(sglToolBarCmd(quint8)), this, SLOT(sltToolbarCmd(quint8)));
}