当前位置: 首页>>代码示例>>C++>>正文


C++ QDialog::setFixedSize方法代码示例

本文整理汇总了C++中QDialog::setFixedSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialog::setFixedSize方法的具体用法?C++ QDialog::setFixedSize怎么用?C++ QDialog::setFixedSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDialog的用法示例。


在下文中一共展示了QDialog::setFixedSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: about

void MainWindow::about() {
    QDialog *dialog = new QDialog( this );

    QPushButton *qpbClose = new QPushButton( IconLoader::Load( "window-close"), tr( "&Close" ), dialog );
        connect( qpbClose, SIGNAL( clicked()), dialog, SLOT( deleteLater()));
    QPushButton *qpbCredits = new QPushButton( IconLoader::Load( "help-about"), tr( "C&redits" ), dialog );
        connect( qpbCredits, SIGNAL( clicked()), this, SLOT( aboutCredits()));
    QPushButton *qpbLicense = new QPushButton( tr( "&License" ), dialog );
        connect( qpbLicense, SIGNAL( clicked()), this, SLOT( aboutLicense()));

    QLabel *qlAbout = new QLabel( dialog );
        qlAbout->setText( tr("<center><h1>%1 %2</h1><h3>For better use of leo.org</h3>Copyright \251 2010 %3</center>")
                        .arg( APP_NAME ).arg( APP_VERSION ).arg( APP_NAME ));


    qglDialog = new QGridLayout( dialog );
        qglDialog->addWidget( qlAbout, 0, 0, 1, 3, Qt::AlignCenter );
        qglDialog->addWidget( qpbCredits, 1, 0, Qt::AlignCenter );
        qglDialog->addWidget( qpbLicense, 1, 1, Qt::AlignCenter );
        qglDialog->addWidget( qpbClose, 1, 2, Qt::AlignCenter );

        dialog->setWindowTitle( tr( "About %1").arg( APP_NAME ));
        dialog->setLayout( qglDialog );
        dialog->setFixedSize( 312, 156 );
        dialog->exec();
}
开发者ID:Azd325,项目名称:simba,代码行数:26,代码来源:mainwindow.cpp

示例2: open_volume_dialog

void QSoundProcessor::open_volume_dialog()
{
    QDialog dialog;
    dialog.setWindowTitle(tr("Volume level"));
    dialog.setFixedSize(160,80);

    QVBoxLayout Lcenter;
    QGroupBox GBbox(tr("Set volume level:"));
    QHBoxLayout layout;
    QSlider slider;
    slider.setOrientation(Qt::Horizontal);
    slider.setRange(1, VOLUME_STEPS);
    slider.setTickInterval(10);
    slider.setTickPosition(QSlider::TicksBothSides);
    QLabel lable(tr("error"));
    connect(&slider, SIGNAL(valueChanged(int)), &lable, SLOT(setNum(int)));
    if(pt_audioinput)
    {
        slider.setValue( VOLUME_STEPS * pt_audioinput->volume() );
    }
    connect(&slider, SIGNAL(sliderMoved(int)), this, SLOT(set_volume(int)));
    layout.addWidget(&slider);
    layout.addWidget(&lable, 2, Qt::AlignRight);
    GBbox.setLayout(&layout);
    Lcenter.addWidget(&GBbox);
    dialog.setLayout(&Lcenter);
    dialog.exec();
}
开发者ID:,项目名称:,代码行数:28,代码来源:

示例3: aboutLicense

void MainWindow::aboutLicense() {
    QDialog *dialog = new QDialog( this );

    QFile file( ":/GPL" );
    if(!file.open( QIODevice::ReadOnly | QIODevice::Text ))
        qCritical( "GPL LicenseFile not found" );

    QTextStream out ( &file );
    out.setFieldAlignment ( QTextStream::AlignCenter );

    QTextEdit *qteLicense = new QTextEdit ( dialog );
        qteLicense->setText ( out.readAll ());
        qteLicense->setReadOnly ( 1 );
    QPushButton *qpbClose = new QPushButton ( IconLoader::Load( "window-close" ), tr( "&Close" ), dialog );
        connect( qpbClose, SIGNAL( clicked()), dialog, SLOT( deleteLater()));

    qglDialog = new QGridLayout( dialog );
        qglDialog->addWidget( qteLicense, 0, 0 );
        qglDialog->addWidget( qpbClose, 1, 0, Qt::AlignRight );

        dialog->setLayout( qglDialog);
        dialog->setWindowTitle( "GNU General Public License" );
        dialog->setFixedSize( 550, 400 );
        dialog->exec();
}
开发者ID:Azd325,项目名称:simba,代码行数:25,代码来源:mainwindow.cpp

示例4: about

void MainWindow::about()
{
   QDialog *aboutdialog = new QDialog();
   int pSize = aboutdialog->font().pointSize();
   aboutdialog->setWindowTitle("About");
   aboutdialog->setFixedSize(pSize*27,pSize*17);

   QVBoxLayout *templayout = new QVBoxLayout();
   templayout->setMargin(5);

   QLabel *projectname = new QLabel(QString(APP_NAME) +"\t"+ QString(APP_VERSION));
   projectname->setFrameStyle(QFrame::Box | QFrame::Raised);
   projectname->setAlignment(Qt::AlignCenter);
   QLabel *projectauthors = new QLabel(QString(APP_DESIGNER) + "\n\nBMSTU\n\nNovember of 2015");
   projectauthors->setWordWrap(true);
   projectauthors->setAlignment(Qt::AlignCenter);
   QLabel *hyperlink = new QLabel("<a href='mailto:[email protected]?subject=Pointmetry'>Contact us at [email protected]");
   hyperlink->setOpenExternalLinks(true);
   hyperlink->setAlignment(Qt::AlignCenter);

   templayout->addWidget(projectname);
   templayout->addWidget(projectauthors);
   templayout->addWidget(hyperlink);

   aboutdialog->setLayout(templayout);
   aboutdialog->exec();

   delete hyperlink;
   delete projectauthors;
   delete projectname;
   delete templayout;
   delete aboutdialog;
}
开发者ID:pi-null-mezon,项目名称:Interview,代码行数:33,代码来源:mainwindow.cpp

示例5: show_about

void MainWindow::show_about()
{
   QDialog *aboutdialog = new QDialog(); 
   int pSize = aboutdialog->font().pointSize();
   aboutdialog->setWindowTitle("About");
   aboutdialog->setFixedSize(pSize*30,pSize*17);

   QVBoxLayout *templayout = new QVBoxLayout();
   templayout->setMargin(APP_MARGIN);

   QLabel *projectname = new QLabel(QString(APP_NAME) +"\t"+ QString(APP_VERS));
   projectname->setFrameStyle(QFrame::Box | QFrame::Raised);
   projectname->setAlignment(Qt::AlignCenter);
   QLabel *projectauthors = new QLabel("Designed by: Taranov Alex\n\nFirst release was in 2014");
   projectauthors->setWordWrap(true);
   projectauthors->setAlignment(Qt::AlignCenter);
   QLabel *hyperlink = new QLabel("<a href='mailto:[email protected]?subject=QVideoProcessing'>Contact us at [email protected]");
   hyperlink->setToolTip("Will try to open your default mail client");
   hyperlink->setOpenExternalLinks(true);
   hyperlink->setAlignment(Qt::AlignCenter);

   templayout->addWidget(projectname);
   templayout->addWidget(projectauthors);
   templayout->addWidget(hyperlink);

   aboutdialog->setLayout(templayout);
   aboutdialog->exec();

   delete hyperlink;
   delete projectauthors;
   delete projectname;
   delete templayout;
   delete aboutdialog;
}
开发者ID:pi-null-mezon,项目名称:QVideoProcessing,代码行数:34,代码来源:mainwindow.cpp

示例6: main

int main(int argc,char *argv[])
{
    if (argc < 1)
        return 1;
    const QString skinFile = QString::fromUtf8(argv[1]);
    QApplication app(argc,argv);
    QMainWindow mw;

    DeviceSkinParameters params;
    QString errorMessage;
    if (!params.read(skinFile, DeviceSkinParameters::ReadAll, &errorMessage)) {
	qWarning() << errorMessage;
	return 1;
    }
    DeviceSkin ds(params, &mw);
    // View Dialog
    QDialog *dialog = new QDialog();
    QHBoxLayout *dialogLayout = new QHBoxLayout();
    dialog->setLayout(dialogLayout);
    QDialogButtonBox *dialogButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
    QObject::connect(dialogButtonBox, SIGNAL(rejected()), dialog, SLOT(reject()));
    QObject::connect(dialogButtonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
    dialogLayout->addWidget(dialogButtonBox);
    dialog->setFixedSize(params.screenSize());
    dialog->setParent(&ds, Qt::SubWindow);
    dialog->setAutoFillBackground(true);
    ds.setView(dialog);

    QObject::connect(&ds, SIGNAL(popupMenu()), &mw, SLOT(close()));
    QObject::connect(&ds, SIGNAL(skinKeyPressEvent(int,QString,bool)), &mw, SLOT(close()));
    mw.show();
    return app.exec();
}
开发者ID:hkahn,项目名称:qt5-qttools-nacl,代码行数:33,代码来源:deviceskin.cpp

示例7: reLabel

  /**
   * Creates and brings up the dialog box which allows the user to
   * re-label the plot various labes.
   * 
   */
  void ScatterPlotWindow::reLabel() {
    QDialog *dialog = new QDialog(p_scatterPlotWindow);
    dialog->setWindowTitle("Name Plot Labels");

    QWidget *buttons = new QWidget (dialog);
    QWidget *textAreas = new QWidget (dialog);
    QWidget *labels = new QWidget (dialog);
    QWidget *main = new QWidget (dialog);

    QVBoxLayout *layout = new QVBoxLayout();
    layout->addWidget(main,0);
    layout->addWidget(buttons,0);
    dialog->setLayout(layout);

    QToolButton *okButton = new QToolButton(dialog);
    connect(okButton,SIGNAL(released()),this,SLOT(setLabels()));
    connect(okButton,SIGNAL(released()),dialog,SLOT(hide()));
    okButton->setShortcut(Qt::Key_Enter);
    okButton->setText("Ok");

    QToolButton *cancelButton = new QToolButton(dialog);
    connect(cancelButton,SIGNAL(released()),dialog,SLOT(hide()));
    cancelButton->setText("Cancel");

    QLabel *plotLabel = new QLabel("Plot Title: ");
    QLabel *xAxisLabel = new QLabel("X-Axis Label: ");
    QLabel *yAxisLabel = new QLabel("Y-Axis Label: ");

    QVBoxLayout *vlayout = new QVBoxLayout();
    vlayout->addWidget(plotLabel);
    vlayout->addWidget(xAxisLabel);
    vlayout->addWidget(yAxisLabel);    
    labels->setLayout(vlayout);

    p_plotTitleText = new QLineEdit(p_plot->title().text(),dialog);
    p_xAxisText = new QLineEdit(p_plot->axisTitle(QwtPlot::xBottom).text(),dialog);
    p_yAxisText = new QLineEdit(p_plot->axisTitle(QwtPlot::yLeft).text(),dialog);

    QVBoxLayout *v2layout = new QVBoxLayout();
    v2layout->addWidget(p_plotTitleText);
    v2layout->addWidget(p_xAxisText);
    v2layout->addWidget(p_yAxisText);
    textAreas->setLayout(v2layout);

    QHBoxLayout *mainLayout = new QHBoxLayout();
    mainLayout->addWidget(labels);
    mainLayout->addWidget(textAreas);
    main->setLayout(mainLayout);

    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->addWidget(okButton);
    hlayout->addWidget(cancelButton);
    buttons->setLayout(hlayout);

    dialog->setFixedSize(400,190);
    dialog->show();
  }
开发者ID:assutech,项目名称:isis3,代码行数:62,代码来源:ScatterPlotWindow.cpp

示例8: on_vstPluginRequestedWindowResize

void MainControllerStandalone::on_vstPluginRequestedWindowResize(QString pluginName, int newWidht,
                                                                 int newHeight)
{
    QDialog *pluginEditorWindow = Vst::VstPlugin::getPluginEditorWindow(pluginName);
    if (pluginEditorWindow) {
        pluginEditorWindow->setFixedSize(newWidht, newHeight);
        // pluginEditorWindow->updateGeometry();
    }
}
开发者ID:CassianoViana,项目名称:JamTaba,代码行数:9,代码来源:MainControllerStandalone.cpp

示例9: ShowDepthBuffer

void ccRenderingTools::ShowDepthBuffer(ccGBLSensor* sensor, QWidget* parent)
{
	if (!sensor)
		return;

	const ccGBLSensor::DepthBuffer& depthBuffer = sensor->getDepthBuffer();
	if (!depthBuffer.zBuff)
		return;

	//determine min and max depths
	ScalarType minDist = 0, maxDist = 0;
	{
		const ScalarType *_zBuff = depthBuffer.zBuff;
		for (int x=0; x<depthBuffer.height*depthBuffer.width; ++x,++_zBuff)
		{
			if (x==0)
			{
				maxDist = minDist = *_zBuff;
			}
			else if (*_zBuff > 0)
			{
				maxDist = std::max(maxDist,*_zBuff);
				minDist = std::min(minDist,*_zBuff);
			}
		}
	}

	QImage bufferImage(depthBuffer.width,depthBuffer.height,QImage::Format_RGB32);
	{
		ccColorScale::Shared colorScale = ccColorScalesManager::GetDefaultScale();
		assert(colorScale);
		ScalarType coef = maxDist-minDist < ZERO_TOLERANCE ? 0 : static_cast<ScalarType>(ccColorScale::MAX_STEPS-1)/(maxDist-minDist);

		const ScalarType* _zBuff = depthBuffer.zBuff;
		for (int y=0; y<depthBuffer.height; ++y)
		{
			for (int x=0; x<depthBuffer.width; ++x,++_zBuff)
			{
				const colorType* col = (*_zBuff >= minDist ? colorScale->getColorByIndex(static_cast<unsigned>((*_zBuff-minDist)*coef)) : ccColor::black);
				bufferImage.setPixel(x,depthBuffer.height-1-y,qRgb(col[0],col[1],col[2]));
			}
		}
	}

	QDialog* dlg = new QDialog(parent);
	dlg->setWindowTitle(QString("%0 depth buffer [%1 x %2]").arg(sensor->getParent()->getName()).arg(depthBuffer.width).arg(depthBuffer.height));
	dlg->setFixedSize(bufferImage.size());
	QVBoxLayout* vboxLayout = new QVBoxLayout(dlg);
	vboxLayout->setContentsMargins(0,0,0,0);
	QLabel* label = new QLabel(dlg);
	label->setScaledContents(true);
	vboxLayout->addWidget(label);

	label->setPixmap(QPixmap::fromImage(bufferImage));
	dlg->show();
}
开发者ID:imight,项目名称:trunk,代码行数:56,代码来源:ccRenderingTools.cpp

示例10: whoWin

void Game_main::whoWin()//直接判断white_win,black_win弹出窗口
{
    if(white_win)
    {
        QDialog *Dblack = new QDialog();
        QVBoxLayout *vlayout = new QVBoxLayout;
        Dblack->setFixedSize(150,140);
        QLabel *label = new QLabel("白棋胜利!");
        QAbstractButton *bExit = new QPushButton("再来一局");

        bExit->setText("再来一局");

        vlayout->addWidget(label);
        vlayout->addWidget(bExit);
        Dblack->setLayout(vlayout);
        Dblack->show();
        Dblack->connect(bExit,SIGNAL(clicked()),Dblack,SLOT(close()));
        Dblack->connect(bExit,SIGNAL(clicked()),this,SLOT(start()));

        is_over = true;


    }
    if(black_win)
    {
        QDialog *Dblack = new QDialog();
        QVBoxLayout *vlayout = new QVBoxLayout;
        Dblack->setFixedSize(150,140);
        QLabel *label = new QLabel("黑棋胜利!");
        QAbstractButton *bExit = new QPushButton("再来一局");

        bExit->setText("再来一局");

        vlayout->addWidget(label);
        vlayout->addWidget(bExit);
        Dblack->setLayout(vlayout);
        Dblack->show();
        Dblack->connect(bExit,SIGNAL(clicked()),Dblack,SLOT(close()));
        Dblack->connect(bExit,SIGNAL(clicked()),this,SLOT(start()));

        is_over =true;
    }
}
开发者ID:yongjunlee,项目名称:connect-six,代码行数:43,代码来源:game_main.cpp

示例11: about

/*
  *点击“关于”执行此函数
  *弹出对话框
  */
void Game_main::about()
{
    QDialog *Dblack = new QDialog();
    QVBoxLayout *vlayout = new QVBoxLayout;
    Dblack->setFixedSize(300,280);
    QLabel *label = new QLabel("Copy Right @ UESTC-CCSE wytk2008.net");
    QAbstractButton *bExit = new QPushButton("back");
    vlayout->addWidget(label);
    vlayout->addWidget(bExit);
    Dblack->setLayout(vlayout);
    Dblack->show();
    Dblack->connect(bExit,SIGNAL(clicked()),Dblack,SLOT(close()));
}
开发者ID:yongjunlee,项目名称:connect-six,代码行数:17,代码来源:game_main.cpp

示例12: progressDialog

void ImageViewer::progressDialog() {
    QDialog *dialog = new QDialog(this);
    dialog->setModal(false);
    dialog->setFixedSize(QSize(700, 400));
    QGridLayout *dialogLayout = new QGridLayout(dialog);
    dialogLayout->setAlignment(Qt::AlignCenter);
    dialogLayout->addWidget(new QLabel("Generating Thumbnail", dialog));
    QProgressBar *progress = new QProgressBar(dialog);
    progress->setMaximum(100);
    progress->setValue(0);
    connect(this, SIGNAL(setProgress(int)), progress, SLOT(setValue(int)));
    dialogLayout->addWidget(progress);
    dialog->setLayout(dialogLayout);
    dialog->show();
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例13: on_cmdEditButton_clicked

void MainWindow::on_cmdEditButton_clicked()
{
    // Open a dialog to modify the commands
    QDialog * dialog = new QDialog(this, Qt::WindowCloseButtonHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
    QTableView * tableView = new QTableView(dialog);
    QGridLayout *layout = new QGridLayout;
    tableView->setModel(&commands);
    layout->addWidget(tableView);
    dialog->setWindowTitle(QString("Edit Commands"));
    dialog->setLayout(layout);
    // Use a bigger fixed size to hold the tableview
    //dialog->layout()->setSizeConstraint( QLayout::SetFixedSize );
    dialog->setFixedSize(600,400);
    // Call exec() so that main window will freeze
    dialog->exec();
}
开发者ID:siyuyue,项目名称:simes,代码行数:16,代码来源:mainwindow.cpp

示例14: ShowCover

void AlbumCoverChoiceController::ShowCover(const Song& song) {
  QDialog* dialog = new QDialog(this);
  dialog->setAttribute(Qt::WA_DeleteOnClose, true);

  // Use (Album)Artist - Album as the window title
  QString title_text(song.effective_albumartist());
  if (!song.effective_album().isEmpty())
    title_text += " - " + song.effective_album();

  QLabel* label = new QLabel(dialog);
  label->setPixmap(AlbumCoverLoader::TryLoadPixmap(
      song.art_automatic(), song.art_manual(), song.url().toLocalFile()));

  // add (WxHpx) to the title before possibly resizing
  title_text += " (" + QString::number(label->pixmap()->width()) + "x" +
                QString::number(label->pixmap()->height()) + "px)";

  // if the cover is larger than the screen, resize the window
  // 85% seems to be enough to account for title bar and taskbar etc.
  QDesktopWidget desktop;
  int current_screen = desktop.screenNumber(this);
  int desktop_height = desktop.screenGeometry(current_screen).height();
  int desktop_width = desktop.screenGeometry(current_screen).width();

  // resize differently if monitor is in portrait mode
  if (desktop_width < desktop_height) {
    const int new_width = (double)desktop_width * 0.95;
    if (new_width < label->pixmap()->width()) {
      label->setPixmap(
          label->pixmap()->scaledToWidth(new_width, Qt::SmoothTransformation));
    }
  } else {
    const int new_height = (double)desktop_height * 0.85;
    if (new_height < label->pixmap()->height()) {
      label->setPixmap(label->pixmap()->scaledToHeight(
          new_height, Qt::SmoothTransformation));
    }
  }

  dialog->setWindowTitle(title_text);
  dialog->setFixedSize(label->pixmap()->size());
  dialog->show();
}
开发者ID:Chemrat,项目名称:Clementine,代码行数:43,代码来源:albumcoverchoicecontroller.cpp

示例15: open_device_select_dialog

bool QSoundProcessor::open_device_select_dialog()
{
    QDialog dialog;
    dialog.setFixedSize(320,120);
    dialog.setWindowTitle(tr("Audio device"));

    QVBoxLayout Lcenter;
        QHBoxLayout Lbuttons;
        QPushButton Baccept(tr("Accept"));
        Baccept.setToolTip(tr("Selected device will be used"));
        connect(&Baccept, &QPushButton::clicked, &dialog, &QDialog::accept);
        QPushButton Bcancel(tr("Cancel"));
        Bcancel.setToolTip(tr("Default device will be used"));
        connect(&Bcancel, &QPushButton::clicked, &dialog, &QDialog::reject);
        Lbuttons.addWidget(&Baccept);
        Lbuttons.addWidget(&Bcancel);

        QGroupBox GBselect(tr("Select audio capture device"));
        QVBoxLayout Llocal;
            QComboBox CBdevice;
            QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioInput);
            for(int i = 0; i < devices.size(); ++i)
            {
                CBdevice.addItem(devices.at(i).deviceName(), qVariantFromValue(devices.at(i)));
            }
        Llocal.addWidget(&CBdevice);
        GBselect.setLayout(&Llocal);

    Lcenter.addWidget(&GBselect);
    Lcenter.addLayout(&Lbuttons);
    dialog.setLayout(&Lcenter);

    if(dialog.exec() == QDialog::Accepted)
    {
        m_device_info = CBdevice.currentData().value<QAudioDeviceInfo>();
        return true;
    }
    else
    {
        m_device_info = QAudioDeviceInfo::defaultInputDevice();
    }
    return false;
}
开发者ID:,项目名称:,代码行数:43,代码来源:


注:本文中的QDialog::setFixedSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。