コード例 #1
0
ファイル: AboutDialog.cpp プロジェクト: eugenkr/robomongo
    AboutDialog::AboutDialog(QWidget *parent)
        : QDialog(parent)
    {
        setWindowIcon(GuiRegistry::instance().mainWindowIcon());

        setWindowTitle("About "PROJECT_NAME_TITLE);
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
        QGridLayout *layout = new QGridLayout(this);
        layout->setSizeConstraint(QLayout::SetFixedSize);

        QLabel *copyRightLabel = new QLabel(description);
        copyRightLabel->setWordWrap(true);
        copyRightLabel->setOpenExternalLinks(true);
        copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

        QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
        QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
        buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
        connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

        QIcon icon = GuiRegistry::instance().mainWindowIcon();
        QPixmap iconPixmap = icon.pixmap(48, 48);


        QLabel *logoLabel = new QLabel;
        logoLabel->setPixmap(iconPixmap);
        layout->addWidget(logoLabel , 0, 0, 1, 1);
        layout->addWidget(copyRightLabel, 0, 1, 4, 4);
        layout->addWidget(buttonBox, 4, 0, 1, 5);
    }
コード例 #2
0
ファイル: serverlistdialog.cpp プロジェクト: EPeillard/qgo
ServerListDialog::ServerListDialog(std::vector <ServerItem *> serverlist, int current)
{
	current_server = current;
	serverListView = constructTreeWidget(serverlist);
	
	connectButton = new QPushButton(tr("Connect"));
	connectButton->setDefault(true);
	
	cancelButton = new QPushButton(tr("&Cancel"));
	cancelButton->setAutoDefault(false);
	
	buttonBox = new QDialogButtonBox(Qt::Horizontal);
	buttonBox->addButton(cancelButton, QDialogButtonBox::ActionRole);
	buttonBox->addButton(connectButton, QDialogButtonBox::ActionRole);
	
	connect(serverListView, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slot_listDoubleClicked(QTreeWidgetItem *, int)));
	
	connect(connectButton, SIGNAL(clicked()), this, SLOT(slot_connect()));
	connect(cancelButton, SIGNAL(clicked()), this, SLOT(slot_cancel()));
	
	QGridLayout * mainLayout = new QGridLayout;
	mainLayout->setSizeConstraint(QLayout::SetFixedSize);
	mainLayout->addWidget(serverListView, 0, 0);
	mainLayout->addWidget(buttonBox, 1, 0);
	setLayout(mainLayout);
	
	setWindowTitle(tr("Choose server..."));
}
コード例 #3
0
/*!
   Create a signal box widget for the \a list of analog signals.
*/
QWidget* UiSelectSignalDialog::createAnalogSignalBox(QList<int> &list)
{

    // Deallocation:
    //   Ownership is taken over by call to w->setlayout
    QGridLayout* l = new QGridLayout();
    l->setSizeConstraint(QLayout::SetFixedSize);

    for (int i = 0; i < list.size(); i++) {
        int id = list.at(i);

        // Deallocation: "Qt Object trees" (See UiMainWindow)
        QLabel* cl = new QLabel("    ");
        QString color = Configuration::instance().analogInCableColor(id).name();
        cl->setStyleSheet(QString("QLabel { background-color : %1; }").arg(color));
        l->addWidget(cl, 0, i);

        // Deallocation: "Qt Object trees" (See UiMainWindow)
        l->addWidget(new QLabel(QString("A%1").arg(id), this), 1, i);
        // Deallocation: "Qt Object trees" (See UiMainWindow)
        QCheckBox* cb = new QCheckBox(this);
        l->addWidget(cb, 2, i);
        mAnalogSignalsMap.insert(id, cb);
    }

    // Deallocation: "Qt Object trees" (See UiMainWindow)
    QWidget* w = new QWidget(this);
    w->setLayout(l);

    return w;

}
コード例 #4
0
ファイル: input_dialog.cpp プロジェクト: fastogt/fastonosql
InputDialog::InputDialog(QWidget* parent,
                         const QString& title,
                         InputType type,
                         const QString& firstLabelText,
                         const QString& secondLabelText)
    : QDialog(parent) {
  setWindowTitle(title);
  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);  // Remove help
                                                                     // button (?)

  QGridLayout* glayout = new QGridLayout;
  QDialogButtonBox* buttonBox =
      new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
  buttonBox->setOrientation(Qt::Horizontal);
  VERIFY(connect(buttonBox, &QDialogButtonBox::accepted, this, &InputDialog::accept));
  VERIFY(connect(buttonBox, &QDialogButtonBox::rejected, this, &InputDialog::reject));
  QLabel* firstLabel = new QLabel(firstLabelText);
  firstLine_ = new QLineEdit;
  secondLine_ = new QLineEdit;

  glayout->addWidget(firstLabel, 0, 0);
  glayout->addWidget(firstLine_, 0, 1);

  if (type == DoubleLine) {
    QLabel* secondLabel = new QLabel(secondLabelText);
    glayout->addWidget(secondLabel, 1, 0);
    glayout->addWidget(secondLine_, 1, 1);
  }

  glayout->addWidget(buttonBox, 2, 1);
  glayout->setSizeConstraint(QLayout::SetFixedSize);
  setLayout(glayout);
}
コード例 #5
0
LastFmSettingsWidget::LastFmSettingsWidget(QWidget *parent) : QWidget(parent)
{
    usernameLabel = new QLabel("Username:"******"Password:"******"Active", this);

    QGridLayout *layout = new QGridLayout(this);
    layout->addWidget(active, 0, 0, 1, 2);
    layout->addWidget(usernameLabel, 1, 0, Qt::AlignRight);
    layout->addWidget(usernameTextBox, 1, 1);
    layout->addWidget(passwordLabel, 2, 0, Qt::AlignRight);
    layout->addWidget(passwordTextBox, 2, 1);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    // TODO: make this fill better the window width.

    usernameTextBox->setText(LastFmSettings::username());
    passwordTextBox->setText(LastFmSettings::password());
    active->setChecked(LastFmSettings::isActive());

    // If Last.fm is not active, disable the textboxes
    if (!active->isChecked()) {
        usernameTextBox->setDisabled(true);
        passwordTextBox->setDisabled(true);
        usernameLabel->setDisabled(true);
        passwordLabel->setDisabled(true);
    }
    connect(active, SIGNAL(toggled(bool)), this, SLOT(handleLastFmState(bool)));


}
コード例 #6
0
//Maybe a MeshDocument parameter is needed. See loadFrameContent definition
SettingDialog::SettingDialog( RichParameter* currentPar, RichParameter* defaultPar, QWidget* parent /*= 0*/ )
:QDialog(parent),frame(this),curPar(currentPar),defPar(defaultPar),tmppar(NULL)
{
	setModal(true);
	savebut = new QPushButton("Save",this);
	resetbut = new QPushButton("Reset",this);
	applybut = new QPushButton("Apply",this);
	loadbut = new QPushButton("Load",this);
	closebut = new QPushButton("Close",this);

	QGridLayout* dialoglayout = new QGridLayout(parent);
	
	dialoglayout->addWidget(savebut,1,0);
	dialoglayout->addWidget(resetbut,1,1);
	dialoglayout->addWidget(loadbut,1,2);
	dialoglayout->addWidget(applybut,1,3);
	dialoglayout->addWidget(closebut,1,4);

	RichParameterCopyConstructor cp;
	curPar->accept(cp);
	tmppar = cp.lastCreated;
	frame.loadFrameContent(tmppar);
	dialoglayout->addWidget(&frame,0,0,1,5);
	dialoglayout->setSizeConstraint(QLayout::SetFixedSize);
	setLayout(dialoglayout);
	connect(applybut,SIGNAL(clicked()),this,SLOT(apply()));
	connect(resetbut,SIGNAL(clicked()),this,SLOT(reset()));
	connect(savebut,SIGNAL(clicked()),this,SLOT(save()));
	connect(loadbut,SIGNAL(clicked()),this,SLOT(load()));
	connect(closebut,SIGNAL(clicked()),this,SLOT(close()));
}
コード例 #7
0
ファイル: mainwindow.cpp プロジェクト: radekp/qneoroid
void MainWindow::initCells()
{

  if (centralWidget() != 0) {
    delete centralWidget();
  }
  QWidget *grid = new QWidget();
  QPalette pal;
  pal.setBrush(QPalette::Active, QPalette::Window,QBrush(QColor("#b2b5c7")));
  grid->setPalette(pal);
  grid->setAutoFillBackground(true);
  grid->setBackgroundRole(QPalette::Window);

  QGridLayout* layout = new QGridLayout;
  layout->setHorizontalSpacing(0);
  layout->setVerticalSpacing(0);
  layout->setSizeConstraint(QLayout::SetNoConstraint);
  //layout->setContentsMargins(1,1,1,1);
  layout->setContentsMargins(0,0,0,0);
  for(int i = 0; i < BoardSize; i++)
  {
    for(int j = 0; j < BoardSize; j++)
    {
      int ii = i * BoardSize + j;
      board[ii] = new Cell(grid, ii);
      connect(board[ii], SIGNAL(cellClicked(int)), SLOT(cellClicked(int)));
      layout->addWidget(board[ii], i, j);
    }
  }
  
  grid->setLayout(layout); 
  setCentralWidget(grid);
  QApplication::processEvents();
  doResize();
}
コード例 #8
0
//     FrmLocalizar_cls(const QString &title, QWidget *parent=0);
  FrmCompras_cls::FrmCompras_cls(const QString &title,QWidget *parent)
     : QDialog(parent)
 {
	QWidget *formWidget = loadUiFile();
        ui_edt_idpro = qFindChild<QLineEdit*>(this, "edt_idpro");     
        ui_edt_qtdpro = qFindChild<QLineEdit*>(this, "edt_qtdpro");
	ui_edt_nomepro = qFindChild<QLineEdit*>(this, "edt_nomepro");
        ui_edt_vlrpro = qFindChild<QLineEdit*>(this, "edt_vlrpro");
        ui_edt_vlrtotal = qFindChild<QLineEdit*>(this, "edt_vlrtotal");
	ui_btn_calc = qFindChild<QPushButton*>(this, "btn_calc");
        ui_btn_sair = qFindChild<QPushButton*>(this, "btn_sair");
	ui_btn_ok = qFindChild<QPushButton*>(this, "btn_ok");
	ui_btn_localizar = qFindChild<QPushButton*>(this, "btn_localizar");
	ui_btn_comprar = qFindChild<QPushButton*>(this, "btn_comprar");
	QMetaObject::connectSlotsByName(this);
//        connect( ui_edt_vlrpro, SIGNAL(textChanged(const QString&)), this, SLOT(keyPressEvent(QKeyEvent *event)) );
        connect( ui_edt_vlrpro, SIGNAL(textChanged(const QString&)), this, SLOT(ui_edt_vlrpro_setText(const QString&)) );
	connect( ui_edt_vlrtotal, SIGNAL(textChanged(const QString&)), this, SLOT(setText(const QString&)) );
        ui_edt_vlrpro->setAlignment(Qt::AlignRight);
	ui_edt_vlrtotal->setAlignment(Qt::AlignRight);
        ui_edt_vlrpro->setMaxLength(9);
	local=0;
	//QVBoxLayout *layout = new QVBoxLayout;
	QGridLayout *layout = new QGridLayout;
	layout->setHorizontalSpacing (0);
	layout->setSizeConstraint(QLayout::SetMinAndMaxSize);
	setConfigDB();
	
	layout->addWidget(formWidget);
	setLayout(layout);	
	setWindowTitle(title);
 }
コード例 #9
0
ファイル: carmanagepage.cpp プロジェクト: zhygit/QtTestGui
QWidget* CarManagePage::CreateSettingsWidget()
{
	QWidget* settings = new QWidget();
	QGridLayout* layout = new QGridLayout();
	layout->setSizeConstraint( QLayout::SetFixedSize );

	QGroupBox* safeRegions = new QGroupBox( tr("Safe Regions") );
	QGridLayout* layout1 = new QGridLayout();
	layout1->addWidget( new QListWidget() );
	safeRegions->setLayout( layout1 );

	QGroupBox* safePathes = new QGroupBox( tr("Safe Pathes") );
	QGridLayout* layout2 = new QGridLayout();
	layout2->addWidget( new QListWidget() );
	safePathes->setLayout( layout2 );

	QGroupBox* overspeed = new QGroupBox( tr("Over speed") );

	QGroupBox* oilSettings = new QGroupBox( tr( "Oil Settings") );

	layout->addWidget( safeRegions, 0, 0 );
	layout->addWidget( safePathes, 0, 1 );
	layout->addWidget( overspeed, 1, 0 );
	layout->addWidget( oilSettings, 1, 1 );
	settings->setLayout( layout );
	return settings;
}
コード例 #10
0
ファイル: AVFilterConfigPage.cpp プロジェクト: peckjerry/QtAV
AVFilterConfigPage::AVFilterConfigPage(QWidget *parent)
    : ConfigPageBase(parent)
{
    setObjectName(QString::fromLatin1("avfilter"));
    QGridLayout *gl = new QGridLayout();
    setLayout(gl);
    gl->setSizeConstraint(QLayout::SetFixedSize);
    int r = 0;
    m_ui[0].type = tr("Video");
    m_ui[1].type = tr("Audio");
    const int mw = 300;
    for (size_t i = 0; i < sizeof(m_ui)/sizeof(m_ui[0]); ++i) {
        m_ui[i].enable = new QCheckBox(tr("Enable") + QString::fromLatin1(" ") + m_ui[i].type);
        gl->addWidget(m_ui[i].enable, r++, 0);
        m_ui[i].name = new QComboBox();
        m_ui[i].name->setToolTip(QString::fromLatin1("%1 %2 %3").arg(tr("Registered")).arg(m_ui[i].type).arg(tr("filters")));
        gl->addWidget(m_ui[i].name, r++, 0);
        m_ui[i].description = new QLabel();
        m_ui[i].description->setMaximumWidth(mw);
        gl->addWidget(m_ui[i].description, r++, 0);
        gl->addWidget(new QLabel(tr("Parameters")), r++, 0);
        m_ui[i].options = new QTextEdit();
        m_ui[i].options->setMaximumWidth(mw);
        m_ui[i].options->setMaximumHeight(mw/6);
        gl->addWidget(m_ui[i].options, r++, 0);
    }
    m_ui[0].options->setToolTip(QString::fromLatin1("example: negate"));
    m_ui[1].options->setToolTip(QString::fromLatin1("example: volume=volume=2.0"));
    connect(m_ui[0].name, SIGNAL(currentIndexChanged(QString)), SLOT(videoFilterChanged(QString)));
    m_ui[0].name->addItems(QtAV::LibAVFilter::videoFilters());
    connect(m_ui[1].name, SIGNAL(currentIndexChanged(QString)), SLOT(audioFilterChanged(QString)));
    m_ui[1].name->addItems(QtAV::LibAVFilter::audioFilters());
}
コード例 #11
0
ファイル: flowersgui.cpp プロジェクト: Pio1962/fondinfo
void FlowersGui::createButtons()
{
    if (centralWidget() != NULL) {
        delete centralWidget();
    }
    setCentralWidget(new QWidget());

    buttons = new RightButtonGroup(centralWidget());
    QGridLayout* layout = new QGridLayout();

    for (int y = 0; y < puzzle->getRows(); ++y) {
        for (int x = 0; x < puzzle->getCols(); ++x) {
            RightPushButton *b = new RightPushButton();
            b->setStyleSheet("background: yellow");
            b->setFixedSize(20, 20);
            buttons->addButton(b, y * puzzle->getCols() + x);
            layout->addWidget(b, y, x);
        }
    }
    layout->setSpacing(0);
    layout->setSizeConstraint(QLayout::SetFixedSize);
    centralWidget()->setLayout(layout);
    centralWidget()->setStyleSheet("background: green");
    updateAllButtons();
    adjustSize();

    connect(buttons, SIGNAL(buttonClicked(int)),
                     this, SLOT(controlButtons(int)));
    connect(buttons, SIGNAL(buttonRightClicked(int)),
                     this, SLOT(controlRightButtons(int)));
}
コード例 #12
0
ファイル: imagebounds.cpp プロジェクト: fundies/PolyEditQT
ImageBounds::ImageBounds(QWidget *parent) : QWidget(parent)
{
    QGridLayout *layout = new QGridLayout();
    layout->setSizeConstraint(QLayout::SetFixedSize);

    ///Todo: make this align top
    layout->setAlignment(Qt::AlignTop);
    setLayout(layout);

    btnAlpha = new QPushButton("Alpha", this);
    layout->addWidget(btnAlpha, 0,1);
    layout->addWidget(new QLabel("Rows: ", this, 0),1,0);
    layout->addWidget(new QLabel("Columns: ", this, 0),2,0);
    layout->addWidget(new QLabel("X Seperation: ", this, 0),3,0);
    layout->addWidget(new QLabel("Y Seperation: ", this, 0),4,0);

    spnRows = new QSpinBox(this);
    spnRows->setValue(1);
    spnColumns = new QSpinBox(this);
    spnColumns->setValue(1);
    spnXsep = new QSpinBox(this);
    spnYsep = new QSpinBox(this);

    layout->addWidget(spnRows,1,1);
    layout->addWidget(spnColumns,2,1);
    layout->addWidget(spnXsep,3,1);
    layout->addWidget(spnYsep,4,1);

    btnImport = new QPushButton("Import", this);
    layout->addWidget(btnImport, 5,0);
    layout->addWidget(new QPushButton("Cancel", this), 5,1);
}
コード例 #13
0
ファイル: AVFormatConfigPage.cpp プロジェクト: lipy77/QtAV
AVFormatConfigPage::AVFormatConfigPage(QWidget *parent) :
    ConfigPageBase(parent)
{
    setObjectName("avformat");
    QGridLayout *gl = new QGridLayout();
    setLayout(gl);
    gl->setSizeConstraint(QLayout::SetFixedSize);
    int r = 0;
    m_direct = new QCheckBox(tr("Reduce buffering"));
    gl->addWidget(m_direct, r++, 0);
    gl->addWidget(new QLabel(tr("Probe size")), r, 0, Qt::AlignRight);
    m_probeSize = new QSpinBox();
    m_probeSize->setMaximum(std::numeric_limits<int>::max());
    m_probeSize->setMinimum(0);
    m_probeSize->setToolTip("0: auto");
    gl->addWidget(m_probeSize, r++, 1, Qt::AlignLeft);
    gl->addWidget(new QLabel(tr("Max analyze duration")), r, 0, Qt::AlignRight);
    m_analyzeDuration = new QSpinBox();
    m_analyzeDuration->setMaximum(std::numeric_limits<int>::max());
    m_analyzeDuration->setToolTip("0: auto. how many microseconds are analyzed to probe the input");
    gl->addWidget(m_analyzeDuration, r++, 1, Qt::AlignLeft);

    gl->addWidget(new QLabel(tr("Extra")), r, 0, Qt::AlignRight);
    m_extra = new QLineEdit();
    m_extra->setToolTip("key1=value1 key2=value2 ...");
    gl->addWidget(m_extra, r++, 1, Qt::AlignLeft);
    applyToUi();
}
コード例 #14
0
ファイル: versiondialog.cpp プロジェクト: mcu786/OpenPilot-1
VersionDialog::VersionDialog(QWidget *parent)
    : QDialog(parent)
{
    // We need to set the window icon explicitly here since for some reason the
    // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
    setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png"));

    setWindowTitle(tr("About OpenPilot GCS"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    QString version = QLatin1String(GCS_VERSION_LONG);
    version += QDate(2007, 25, 10).toString(Qt::SystemLocaleDate);

    QString ideRev;
#ifdef GCS_REVISION
     //: This gets conditionally inserted as argument %8 into the description string.
     ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(GCS_REVISION_STR).left(10));
#endif

     const QString description = tr(
        "<h3>OpenPilot GCS %1</h3>"
        "Based on Qt %2 (%3 bit)<br/>"
        "<br/>"
        "Built on %4 at %5<br />"
        "<br/>"
        "%8"
        "<br/>"
        "Copyright 2008-%6 %7. All rights reserved.<br/>"
        "<br/>"
         "<small>This program is free software; you can redistribute it and/or modify<br/>"
         "it under the terms of the GNU General Public License as published by<br/>"
         "the Free Software Foundation; either version 3 of the License, or<br/>"
         "(at your option) any later version.<br/><br/>"
        "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
        "PARTICULAR PURPOSE.</small><br/>")
        .arg(version, QLatin1String(QT_VERSION_STR), QString::number(QSysInfo::WordSize),
             QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(GCS_YEAR), 
             (QLatin1String(GCS_AUTHOR)), ideRev);

    QLabel *copyRightLabel = new QLabel(description);
    copyRightLabel->setWordWrap(true);
    copyRightLabel->setOpenExternalLinks(true);
    copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    QTC_ASSERT(closeButton, /**/);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

    QLabel *logoLabel = new QLabel;
    logoLabel->setPixmap(QPixmap(QLatin1String(":/core/images/openpilot_logo_128.png")));
    layout->addWidget(logoLabel , 0, 0, 1, 1);
    layout->addWidget(copyRightLabel, 0, 1, 4, 4);
    layout->addWidget(buttonBox, 4, 0, 1, 5);
}
コード例 #15
0
//! [1]
ImageComposer::ImageComposer()
{
    sourceButton = new QToolButton;
    sourceButton->setIconSize(resultSize);

    operatorComboBox = new QComboBox;
    addOp(QPainter::CompositionMode_SourceOver, tr("SourceOver"));
    addOp(QPainter::CompositionMode_DestinationOver, tr("DestinationOver"));
    addOp(QPainter::CompositionMode_Clear, tr("Clear"));
    addOp(QPainter::CompositionMode_Source, tr("Source"));
    addOp(QPainter::CompositionMode_Destination, tr("Destination"));
    addOp(QPainter::CompositionMode_SourceIn, tr("SourceIn"));
    addOp(QPainter::CompositionMode_DestinationIn, tr("DestinationIn"));
    addOp(QPainter::CompositionMode_SourceOut, tr("SourceOut"));
    addOp(QPainter::CompositionMode_DestinationOut, tr("DestinationOut"));
    addOp(QPainter::CompositionMode_SourceAtop, tr("SourceAtop"));
    addOp(QPainter::CompositionMode_DestinationAtop, tr("DestinationAtop"));
    addOp(QPainter::CompositionMode_Xor, tr("Xor"));
//! [1]

//! [2]
    destinationButton = new QToolButton;
    destinationButton->setIconSize(resultSize);

    equalLabel = new QLabel(tr("="));

    resultLabel = new QLabel;
    resultLabel->setMinimumWidth(resultSize.width());
//! [2]

//! [3]
    connect(sourceButton, SIGNAL(clicked()), this, SLOT(chooseSource()));
    connect(operatorComboBox, SIGNAL(activated(int)),
            this, SLOT(recalculateResult()));
    connect(destinationButton, SIGNAL(clicked()),
            this, SLOT(chooseDestination()));
//! [3]

//! [4]
    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(sourceButton, 0, 0, 3, 1);
    mainLayout->addWidget(operatorComboBox, 1, 1);
    mainLayout->addWidget(destinationButton, 0, 2, 3, 1);
    mainLayout->addWidget(equalLabel, 1, 3);
    mainLayout->addWidget(resultLabel, 0, 4, 3, 1);
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);
    setLayout(mainLayout);
//! [4]

//! [5]
    resultImage = QImage(resultSize, QImage::Format_ARGB32_Premultiplied);

    loadImage(":/images/butterfly.png", &sourceImage, sourceButton);
    loadImage(":/images/checker.png", &destinationImage, destinationButton);

    setWindowTitle(tr("Image Composition"));
}
コード例 #16
0
ConnectionDiagnosticDialog::ConnectionDiagnosticDialog(ConnectionSettings *connection) :
    _connection(connection),
    _connectionStatusReceived(false),
    _authStatusReceived(false)
{
    setWindowTitle("Diagnostic");
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)

    _yesIcon = GuiRegistry::instance().yesMarkIcon();
    _noIcon = GuiRegistry::instance().noMarkIcon();
    _yesPixmap = _yesIcon.pixmap(24, 24);
    _noPixmap = _noIcon.pixmap(24, 24);

    QPushButton *closeButton = new QPushButton("&Close");
    connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()));
    _connectionIconLabel = new QLabel;
    _authIconLabel = new QLabel;
    _connectionLabel = new QLabel;
    _authLabel = new QLabel;

    _loadingMovie = new QMovie(":robomongo/icons/loading.gif", QByteArray(), this);
    _loadingMovie->start();

    _connectionIconLabel->setMovie(_loadingMovie);
    _authIconLabel->setMovie(_loadingMovie);

    _connectionLabel->setText(QString("Connecting to <b>%1</b>...").arg(_connection->getFullAddress()));

    if (_connection->hasEnabledPrimaryCredential()) {
        _authLabel->setText(QString("Authorizing on <b>%1</b> database as <b>%2</b>...")
            .arg(_connection->primaryCredential()->databaseName())
            .arg(_connection->primaryCredential()->userName()));
    } else {
        _authLabel->setText("Authorization skipped by you");
    }

    QGridLayout *layout = new QGridLayout();
    layout->setContentsMargins(20, 20, 20, 10);
    layout->addWidget(_connectionIconLabel, 0, 0);
    layout->addWidget(_connectionLabel,     0, 1, Qt::AlignLeft);
    layout->addWidget(_authIconLabel,       1, 0);
    layout->addWidget(_authLabel,           1, 1, Qt::AlignLeft);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    QVBoxLayout *box = new QVBoxLayout;
    box->addLayout(layout);
    box->addSpacing(10);
    box->addWidget(closeButton, 0, Qt::AlignRight);
    setLayout(box);

    ConnectionDiagnosticThread *thread = new ConnectionDiagnosticThread(_connection);
    connect(thread, SIGNAL(connectionStatus(QString, bool)), this, SLOT(connectionStatus(QString, bool)));
    connect(thread, SIGNAL(authStatus(QString, bool)), this, SLOT(authStatus(QString, bool)));
    connect(thread, SIGNAL(completed()), this, SLOT(completed()));
    connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
    thread->start();
}
コード例 #17
0
VersionDialog::VersionDialog(QWidget *parent)
    : QDialog(parent)
{
    // We need to set the window icon explicitly here since for some reason the
    // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
    setWindowIcon(QIcon(QLatin1String(Constants::ICON_QTLOGO_128)));

    setWindowTitle(tr("About Qt Creator"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    QString ideRev;
#ifdef IDE_REVISION
     //: This gets conditionally inserted as argument %8 into the description string.
     ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(Constants::IDE_REVISION_STR).left(14));
#endif

     const QString description = tr(
        "<h3>%1</h3>"
        "%2<br/>"
        "<br/>"
        "Built on %3 at %4<br />"
        "<br/>"
        "%5"
        "<br/>"
        "Copyright 2008-%6 %7. All rights reserved.<br/>"
        "<br/>"
        "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
        "PARTICULAR PURPOSE.<br/>")
        .arg(ICore::versionString(),
             ICore::buildCompatibilityString(),
             QLatin1String(__DATE__), QLatin1String(__TIME__),
             ideRev,
             QLatin1String(Constants::IDE_YEAR),
             QLatin1String(Constants::IDE_AUTHOR));

    QLabel *copyRightLabel = new QLabel(description);
    copyRightLabel->setWordWrap(true);
    copyRightLabel->setOpenExternalLinks(true);
    copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    QTC_CHECK(closeButton);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

    QLabel *logoLabel = new QLabel;
    logoLabel->setPixmap(QPixmap(QLatin1String(Constants::ICON_QTLOGO_128)));
    layout->addWidget(logoLabel , 0, 0, 1, 1);
    layout->addWidget(copyRightLabel, 0, 1, 4, 4);
    layout->addWidget(buttonBox, 4, 0, 1, 5);
}
コード例 #18
0
AboutDialog::AboutDialog(QWidget *parent)
    : QDialog(parent)
{
    // We need to set the window icon explicitly here since for some reason the
    // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
    //setWindowIcon(QIcon(QLatin1String(Constants::ICON_QTLOGO_128)));

    setWindowTitle("About MMMLauncher");
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    QString ideRev;
#ifdef IDE_REVISION
     //: This gets conditionally inserted as argument %8 into the description string.
     ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(Constants::IDE_REVISION_STR).left(10));
#endif

     const QString description = tr(
        "<h3>MMMLauncher %1</h3>"
        "%2<br/>"
        "Built on %3 at %4<br />"
        "<br/>"
        "Crafted by: %5 (%6)<br/>"
        "Thanks to: %7 (%8)<br/>"    
        "<br />"
        "Support: <a href='irc://nyanch.at/#mmm'>irc://nyanch.at/#mmm</a><br />"
        "<br />"
        "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
        "PARTICULAR PURPOSE.<br/>")
        .arg(
                 QApplication::applicationVersion(),
                 MMMLUtils::buildCompatibilityString(),
                 QLatin1String(__DATE__), QLatin1String(__TIME__),
                 QApplication::organizationName(), "<a href='"+ QApplication::organizationDomain() +"'>"+ QApplication::organizationDomain() +"</a>",
                 "Endres", "For the old MMMLauncher"
        );

    QLabel *copyRightLabel = new QLabel(description);
    copyRightLabel->setWordWrap(true);
    copyRightLabel->setOpenExternalLinks(true);
    copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

    QLabel *logoLabel = new QLabel;
    logoLabel->setPixmap(QPixmap(QLatin1String(":/images/images/about.png")));
    layout->addWidget(logoLabel , 0, 0, 1, 1);
    layout->addWidget(copyRightLabel, 0, 1, 4, 4);
    layout->addWidget(buttonBox, 4, 0, 1, 5);
}
コード例 #19
0
ファイル: searchdialog.cpp プロジェクト: AlanLZY/textroom
SearchDialog::SearchDialog(QWidget *parent,
			const QString &lstSearch) : QDialog(parent)

{
	label = new QLabel(tr("Find &what:"));
	lineEdit = new QLineEdit;
	if (!lstSearch.isEmpty()) {
		lineEdit->setText(lstSearch);
		lineEdit->selectAll();
	}
	label->setBuddy(lineEdit);

/*
	caseCheckBox = new QCheckBox(tr("M&atch case"));
	caseCheckBox->setChecked(sCase);

	wholeWordsCheckBox = new QCheckBox(tr("&Whole words"));
	wholeWordsCheckBox->setChecked(sWords);

	backwardCheckBox = new QCheckBox(tr("Search &backward"));
	backwardCheckBox->setChecked(sBckward);
*/

	findButton = new QPushButton(tr("&Find"));
	findButton->setDefault(true);

	cancelButton = new QPushButton(tr("&Cancel"));
	cancelButton->setDefault(false);

	buttonBox = new QDialogButtonBox(Qt::Horizontal);
	buttonBox->addButton(findButton, QDialogButtonBox::ActionRole);
	buttonBox->addButton(cancelButton, QDialogButtonBox::ActionRole);

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

	QHBoxLayout *topLeftLayout = new QHBoxLayout;
	topLeftLayout->addWidget(label);
	topLeftLayout->addWidget(lineEdit);

	QVBoxLayout *leftLayout = new QVBoxLayout;
	leftLayout->addLayout(topLeftLayout);
//	leftLayout->addWidget(caseCheckBox);
//	leftLayout->addWidget(wholeWordsCheckBox);
//	leftLayout->addWidget(backwardCheckBox);
	leftLayout->addStretch(1);

	QGridLayout *mainLayout = new QGridLayout;
	mainLayout->setSizeConstraint(QLayout::SetFixedSize);
	mainLayout->addLayout(leftLayout, 0, 0);
	mainLayout->addWidget(buttonBox, 0, 1);
	setLayout(mainLayout);

	setWindowTitle(tr("Find in Text"));
}
コード例 #20
0
ファイル: MapEditor.cpp プロジェクト: karlicoss/botfight
MapEditor::MapEditor(int mapwidth, int mapheight, const QString &fileName, QWidget *parent):
    QWidget(parent),
    name("Simple map editor"),
    newBtn(new QPushButton("New")),
    loadBtn(new QPushButton("Load...")),
    saveBtn(new QPushButton("Save...")),
    randomBtn(new QPushButton("Random")),
    editArea(new EditArea(this)),
    snapRadiusSlider(new QSlider(Qt::Horizontal))
{
    connect(newBtn, SIGNAL(clicked()), this, SLOT(createNewMap()));
    connect(loadBtn, SIGNAL(clicked()), this, SLOT(loadFromFile()));
    connect(saveBtn, SIGNAL(clicked()), this, SLOT(saveToFile()));
    connect(randomBtn, SIGNAL(clicked()), this, SLOT(generateRandom()));
    
    QHBoxLayout *btnLayout = new QHBoxLayout();
    btnLayout->addWidget(newBtn);
    btnLayout->addWidget(loadBtn);
    btnLayout->addWidget(saveBtn);
    btnLayout->addWidget(randomBtn);

    editArea->move(10, 10);
    editArea->setFixedSize(mapwidth, mapheight);
    editArea->setMouseTracking(true);
    editArea->setSnapRadius(25);
    if (!fileName.isEmpty())
    {
        editArea->setMap(getMapFromFile(fileName));
        setWindowTitle(name + " - " + fileName);
        fileSaved = true;
    }
    else
    {
        createNewMap();
    }
    connect(editArea, SIGNAL(mapChanged()), this, SLOT(mapChanged()));

    snapRadiusSlider->setMaximum(50);
    snapRadiusSlider->setSliderPosition(25);
    connect(snapRadiusSlider, SIGNAL(sliderMoved(int)), editArea, SLOT(setSnapRadius(int)));

    QVBoxLayout *snapLayout = new QVBoxLayout();
    QLabel *lbl = new QLabel("Snap precision:");
    snapLayout->addWidget(lbl);
    snapLayout->addWidget(snapRadiusSlider);
    snapLayout->addStretch(1);

    QGridLayout *mainLayout = new QGridLayout();
    mainLayout->addWidget(editArea, 0, 0);
    mainLayout->addLayout(btnLayout, 1, 0);
    mainLayout->addLayout(snapLayout, 0, 1);
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);

    setLayout(mainLayout);
}
コード例 #21
0
CameraParamsWidget::CameraParamsWidget(QWidget* parent)
 : QScrollArea(parent)
{
	m_w = new QWidget(this);
	setWidget(m_w);
	setWidgetResizable(true);

	QGridLayout* layout = new QGridLayout(m_w);
	layout->setSizeConstraint(QLayout::SetMinAndMaxSize);
	m_w->setLayout(layout);
}
コード例 #22
0
ファイル: versiondialog.cpp プロジェクト: gaoxiaojun/QtRIA
VersionDialog::VersionDialog(QWidget *parent)
    : QDialog(parent)
{
    // We need to set the window icon explicitly here since for some reason the
    // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
    setWindowIcon(QIcon(QLatin1String(":/application/images/about.png")));

    setWindowTitle(tr("About %1").arg(Application::Constants::APP_NAME_STR));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    const QString versionString = tr("%1 %2").arg(Application::Constants::APP_NAME_STR,
                                            Application::Constants::APP_VERSION_STR);
    const QString buildCompatibilityString = tr("Based on Qt %1 (%2, %3 bit)").arg(QLatin1String(qVersion()),
                                                                      compilerString(),
                                                                      QString::number(QSysInfo::WordSize));
    const QString ideRev = tr("From revision %1<br/>").arg(Application::Constants::APP_VERSION_PATCH);
    const QString description = tr(
       "<h3>%1</h3>"
       "%2<br/>"
       "<br/>"
       "Built on %3 at %4<br />"
       "<br/>"
       "%5"
       "<br/>"
       "Copyright 2014 %6. All rights reserved.<br/>"
       "<br/>"
       "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
       "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
       "PARTICULAR PURPOSE.<br/>")
       .arg(versionString,
            buildCompatibilityString,
            QLatin1String(__DATE__), QLatin1String(__TIME__),
            ideRev,
            QLatin1String(Application::Constants::APP_ORGNAME_STR));

    QLabel *copyRightLabel = new QLabel(description);
    copyRightLabel->setWordWrap(true);
    copyRightLabel->setOpenExternalLinks(true);
    copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    //QTC_CHECK(closeButton);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

    QLabel *logoLabel = new QLabel;
    logoLabel->setPixmap(QPixmap(QLatin1String(":/application/images/about.png")));
    layout->addWidget(logoLabel , 0, 0, 1, 1);
    layout->addWidget(copyRightLabel, 0, 1, 4, 4);
    layout->addWidget(buttonBox, 4, 0, 1, 5);
}
コード例 #23
0
ファイル: MiscPage.cpp プロジェクト: AfterTheRainOfStars/QtAV
MiscPage::MiscPage()
{
    QGridLayout *gl = new QGridLayout();
    setLayout(gl);
    gl->setSizeConstraint(QLayout::SetFixedSize);
    int r = 0;
    m_preview_on = new QCheckBox(tr("Preview"));
    gl->addWidget(m_preview_on, r++, 0);
    m_preview_w = new QSpinBox();
    m_preview_w->setRange(1, 1920);
    m_preview_h = new QSpinBox();
    m_preview_h->setRange(1, 1080);
    gl->addWidget(new QLabel(tr("Preview") + " " + tr("size") + ": "), r, 0);
    QHBoxLayout *hb = new QHBoxLayout();
    hb->addWidget(m_preview_w);
    hb->addWidget(new QLabel("x"));
    hb->addWidget(m_preview_h);
    gl->addLayout(hb, r, 1);
    r++;
    gl->addWidget(new QLabel(tr("Force fps")), r, 0);
    m_fps = new QDoubleSpinBox();
    m_fps->setMinimum(-m_fps->maximum());
    m_fps->setToolTip("<= 0: " + tr("Ignore"));
    gl->addWidget(m_fps, r++, 1);

    gl->addWidget(new QLabel(tr("Progress update interval") + "(ms)"), r, 0);
    m_notify_interval = new QSpinBox();
    m_notify_interval->setEnabled(false);
    gl->addWidget(m_notify_interval, r++, 1);

    gl->addWidget(new QLabel(tr("Buffer frames")), r, 0);
    m_buffer_value = new QSpinBox();
    m_buffer_value->setRange(-1, 32767);
    m_buffer_value->setToolTip("-1: auto");
    gl->addWidget(m_buffer_value, r++, 1);

    gl->addWidget(new QLabel(tr("Timeout") + "(" + tr("s") +")"), r, 0);
    m_timeout = new QDoubleSpinBox();
    m_timeout->setDecimals(3);
    m_timeout->setSingleStep(1.0);
    m_timeout->setMinimum(-0.5);
    m_timeout->setToolTip("<=0: never");    
    m_timeout_abort = new QCheckBox(tr("Abort"));
    hb = new QHBoxLayout();
    hb->addWidget(m_timeout);
    hb->addWidget(m_timeout_abort);
    gl->addLayout(hb, r++, 1);

    m_angle = new QCheckBox("Force OpenGL ANGLE (Windows)");
    gl->addWidget(m_angle, r++, 0);

    applyToUi();
}
コード例 #24
0
ファイル: board.cpp プロジェクト: Program0/ZerothMarlo_CSC17B
Board::Board(QWidget *parent, Qt::WindowFlags f)
    : QWidget(parent,f) {
    // Set the default background images
    lightSquare = new QString(":/images/whiteSquare.png");
    darkSquare = new QString(":/images/greenSquare.png");

    //playableSquares = new QMap;
    //nonPlayableSquares = new QMap;
    // For layout the game board
    QGridLayout *mainLayout = new QGridLayout;

    // Start the squares at 1
    int count = 1;
    int countNonPlay=1;
    // Set the size of the board to default size
    int size = DEFAULTSIZE;

    // Fill the squares with default images and add them to the board
    for(int i = 0; i<size; i++) {
        for(int j=0; j < size; j++) {
            // Add and determine whether square will be playable
            if(i%2==0&&j%2==1) {
                BoardSquare *square = new BoardSquare(true,*darkSquare, parent);
                mainLayout->addWidget(square,i,j);
                playableSquares.insert(count,square);
                count++;
            }
            else if(i%2==1&&j%2==0) {
                BoardSquare *square = new BoardSquare(true,*darkSquare, parent);
                mainLayout->addWidget(square,i,j);
                playableSquares.insert(count,square);
                count++;
            }
            else {
                // Create a non-playable square
                BoardSquare *square = new BoardSquare(true, *lightSquare, parent);
                mainLayout->addWidget(square,i,j);
                nonPlayableSquares.insert(countNonPlay,square);
                countNonPlay++;
            }
        }
    }
    // Set the layout to a fixed size so it cannot be resized
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);

    // Set the horizontal and vertical spacing between the squares
    mainLayout->setHorizontalSpacing(0);
    mainLayout->setVerticalSpacing(0);

    // Set the layout for the board
    this->setLayout(mainLayout);
}
コード例 #25
0
ファイル: gototime.cpp プロジェクト: FLYKingdom/vlc
GotoTimeDialog::GotoTimeDialog( QWidget *parent, intf_thread_t *_p_intf)
               : QVLCDialog( parent, _p_intf )
{
    setWindowFlags( Qt::Tool );
    setWindowTitle( qtr( "Go to Time" ) );
    setWindowRole( "vlc-goto-time" );

    QGridLayout *mainLayout = new QGridLayout( this );
    mainLayout->setSizeConstraint( QLayout::SetFixedSize );

    QPushButton *gotoButton = new QPushButton( qtr( "&Go" ) );
    QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) );
    QDialogButtonBox *buttonBox = new QDialogButtonBox;

    gotoButton->setDefault( true );
    buttonBox->addButton( gotoButton, QDialogButtonBox::AcceptRole );
    buttonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );

    QGroupBox *timeGroupBox = new QGroupBox;
    QGridLayout *boxLayout = new QGridLayout( timeGroupBox );

    QLabel *timeIntro = new QLabel( qtr( "Go to time" ) + ":" );
    timeIntro->setWordWrap( true );
    timeIntro->setAlignment( Qt::AlignCenter );

    timeEdit = new QTimeEdit();
    timeEdit->setDisplayFormat( "hh : mm : ss" );
    timeEdit->setAlignment( Qt::AlignRight );
    timeEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );

    QLabel *helpFormat = new QLabel( timeEdit->displayFormat() );
    helpFormat->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred );

    QSpacerItem *spacerBox = new QSpacerItem( 20, 10, QSizePolicy::Minimum,
                                        QSizePolicy::Fixed );

    QSpacerItem *spacerItem = new QSpacerItem( 20, 3, QSizePolicy::Minimum,
                                        QSizePolicy::Expanding );

    boxLayout->addWidget( timeIntro, 0, 0, 1, 2 );
    boxLayout->addItem( spacerBox, 1, 0, 1, 2 );
    boxLayout->addWidget( timeEdit, 2, 0, 1, 1 );
    boxLayout->addWidget( helpFormat, 2, 1, 1, 1 );

    mainLayout->addWidget( timeGroupBox, 0, 0, 1, 4 );
    mainLayout->addItem( spacerItem, 1, 0 );
    mainLayout->addWidget( buttonBox, 2, 3 );

    BUTTONACT( gotoButton, close() );
    BUTTONACT( cancelButton, cancel() );
}
コード例 #26
0
void NotificationIcon::about_dialog(){
    QDialog aboutDialog(0, Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
    QLabel l("<h1>MiptTelecomBalance</h1>\
            \nThis program allows you to monitor\n\
            the balance of your personal account\n\
            in \"MIPT-TELECOM\"\n\
            Authors:");
    l.setWordWrap(true);
    QLabel l1, l2, l3;
    l1.setText("<h3>Lantsov Alexander</h3>");
    l2.setText("<h3>Kudinova Marina</h3>");
    l3.setText("<h3>Alekseeva Maria</h3>");
    
    QString img[4] = { AttentionPath, PositivePath, NegativePath, ProblemPath };
    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
    
    QLabel lp1, lp2, lp3;
    QPixmap p1(img[qrand() % 4]);
    QPixmap p2(img[qrand() % 4]);
    QPixmap p3(img[qrand() % 4]);
    lp1.setPixmap(p1);
    lp2.setPixmap(p2);
    lp3.setPixmap(p3);
    
    lp1.setFixedSize(p1.width(),p1.height());
    lp2.setFixedSize(p2.width(),p2.height());    
    lp3.setFixedSize(p3.width(),p3.height());
    



    QPushButton button("OK");

    QGridLayout layout;
    layout.addWidget(&l  , 0, 0, 1, 2);
    layout.addWidget(&lp1, 1, 0);
    layout.addWidget(&l1 , 1, 1);
    layout.addWidget(&lp2, 2, 0);
    layout.addWidget(&l2 , 2, 1);
    layout.addWidget(&lp3, 3, 0);
    layout.addWidget(&l3 , 3, 1);
    layout.addWidget(&button, 4, 0, 1, 2);
    QObject::connect(&button, SIGNAL(clicked()), &aboutDialog, SLOT(accept()));
    aboutDialog.setLayout(&layout);
	aboutDialog.setWindowTitle("About");
    //aboutDialog.setFixedSize( aboutDialog.sizeHint() );
    layout.setSizeConstraint( QLayout::SetFixedSize );
    aboutDialog.show();
    aboutDialog.exec();
}
コード例 #27
0
ファイル: deploybuildmdichild.cpp プロジェクト: gen1izh/cpp
DeployBuildMdiChild::DeployBuildMdiChild() {
  QGridLayout *grid = new QGridLayout();
  grid->setSizeConstraint( QLayout::SetDefaultConstraint );

  QWidget *wgt = getManagerWidget_FromWAPair(tr("project_manager"),
                                             tr("(PM)BF_DeployBuildForm"));

  grid->addWidget(wgt);
  grid->setContentsMargins(1,1,1,1);
  this->setContentsMargins(1,1,1,1);
  setLayout(grid);
  setWindowTitle(wgt->windowTitle());
  setWindowIcon(wgt->windowIcon());
  setMinimumSize(1000, 550);
}
コード例 #28
0
CalculatorWidget::CalculatorWidget(QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) {
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);
    setLayout(layout);

    QSizePolicy policy = sizePolicy();

    displayLabel = new QLabel(this);
    layout->addWidget(displayLabel, 0, 0, 1, 3);
    displayLabel->setAutoFillBackground(true);
    displayLabel->setBackgroundRole(QPalette::Base);
    displayLabel->setAlignment(Qt::AlignRight);
    displayLabel->setFrameStyle(QFrame::Panel | QFrame::Sunken);
    policy = displayLabel->sizePolicy();
    policy.setVerticalPolicy(QSizePolicy::Fixed);
    displayLabel->setSizePolicy(policy);

    signalMapper = new QSignalMapper(this);
    QPushButton *button = new QPushButton(QString::number(0), this);
    QObject::connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
    signalMapper->setMapping(button, 0);
    layout->addWidget(button, 4, 1);
    digitButtons.push_back(button);
    for (unsigned int i = 1; i < 10; ++i) {
        QPushButton *button = new QPushButton(QString::number(i), this);
        QObject::connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
        signalMapper->setMapping(button, i);
        layout->addWidget(button, 1+(9-i)/3, (i-1)%3);
        digitButtons.push_back(button);
    }
    QObject::connect(signalMapper, SIGNAL(mapped(int)), SLOT(buttonClicked(int)));

    clearButton = new QPushButton("C", this);
    layout->addWidget(clearButton, 1, 4);
    QObject::connect(clearButton, SIGNAL(clicked()), SLOT(clearButtonClicked()));

    additionButton = new QPushButton("+", this);
    layout->addWidget(additionButton, 2, 4);
    QObject::connect(additionButton, SIGNAL(clicked()), SLOT(addButtonClicked()));

    subtractionButton = new QPushButton("-", this);
    layout->addWidget(subtractionButton, 3, 4);
    QObject::connect(subtractionButton, SIGNAL(clicked()), SLOT(subtractButtonClicked()));

    calculateButton = new QPushButton("=", this);
    layout->addWidget(calculateButton, 4, 4);
    QObject::connect(calculateButton, SIGNAL(clicked()), SLOT(calculateButtonClicked()));
}
コード例 #29
0
ファイル: AboutDialog.cpp プロジェクト: AlPatsino/robomongo
AboutDialog::AboutDialog(QWidget *parent)
    : QDialog(parent)
{
    setWindowIcon(GuiRegistry::instance().mainWindowIcon());

    setWindowTitle("About Robomongo");
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    QString version = AppRegistry::instance().version();

     const QString description = tr(
        "<h3>Robomongo %1</h3>"
        "Shell-centric MongoDB management tool."
        "<br/>"
        "<br/>"
        "Visit Robomongo website: <a href=\"www.robomongo.org\">www.robomongo.org</a> <br/>"
        "<br/>"
        "<a href=\"https://github.com/paralect/robomongo\">Fork</a> project or <a href=\"https://github.com/paralect/robomongo/issues\">submit</a> issues/proposals on GitHub.  <br/>"
        "<br/>"
        "Copyright 2013 <a href=\"http://www.paralect.com\">Paralect</a>. All rights reserved.<br/>"
        "<br/>"
        "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
        "PARTICULAR PURPOSE.<br/>")
        .arg(version);

    QLabel *copyRightLabel = new QLabel(description);
    copyRightLabel->setWordWrap(true);
    copyRightLabel->setOpenExternalLinks(true);
    copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

    QIcon icon = GuiRegistry::instance().mainWindowIcon();
    QPixmap iconPixmap = icon.pixmap(48, 48);


    QLabel *logoLabel = new QLabel;
    logoLabel->setPixmap(iconPixmap);
    layout->addWidget(logoLabel , 0, 0, 1, 1);
    layout->addWidget(copyRightLabel, 0, 1, 4, 4);
    layout->addWidget(buttonBox, 4, 0, 1, 5);
}
コード例 #30
0
Dialog_CompilerError::Dialog_CompilerError(QWidget *parent) : QDialog(parent) {
	this->setupUi(this);

    /*
     * Initialise the most expensive dialog of all times. VIS is wasting
     * taxpayer's money(tm) ...
     */
    this->details = new Widget_CompilerError(this);
    
    QGridLayout *layout = dynamic_cast<QGridLayout *>(this->layout());
    layout->setSizeConstraint(QLayout::SetFixedSize);
    layout->addWidget(this->details, 2, 0);
    connect(btnDetails, SIGNAL(clicked()), this, SLOT(toggleDetails()));

    this->details->hide();
}