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


C++ QComboBox::move方法代码示例

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


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

示例1: Create

BOOL CComboBox::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
{
    QWidget *parentView = (QWidget *)pParentWnd->GetNSWindow();
    QComboBox *comboBox = new QComboBox(parentView);
    QRect contentRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);

    comboBox->move (contentRect.x(), contentRect.y());
    comboBox->resize(contentRect.width(), contentRect.height());

    comboBox->setAccessibleName(QString().setNum(nID));

    m_hWnd = comboBox;
    mParentWin = pParentWnd;

    return TRUE;
}
开发者ID:mdmitry1973,项目名称:CShell,代码行数:16,代码来源:CComboBox.cpp

示例2: QDialog

HardwareSettingsDialog::HardwareSettingsDialog(QWidget *parent, QString file, Hardware *module) :
    QDialog(parent),
    descriptorFile(file)
{
    hardwareModule = module;

    readDescriptorFromFile(descriptorFile);
    refreshRegisters();

    buttonOk = new QPushButton(this);
    buttonCancel = new QPushButton(this);

    buttonOk->resize(100, 25);
    buttonOk->setText(QString::fromLocal8Bit("Применить"));

    buttonCancel->resize(100, 25);
    buttonCancel->setText(QString::fromLocal8Bit("Отмена"));
    connect(buttonOk, SIGNAL(clicked()), this, SLOT(applySettings()));
    connect(buttonCancel, SIGNAL(clicked()), this, SLOT(cancelSettings()));

    // отрисовка найденых регистров на форме
    QVector<ModbusRegister*>::Iterator reg = registerVector.begin();
    int yPos = 10;
    int yStep = 30;
    int labelXsize = 200;
    int labelYsize = 25;
    int lineEditXsize = 150;
    int xDistance = 20;
    for (reg = registerVector.begin(); reg != registerVector.end(); ++reg) {
        if ((*reg)->getType() == ModbusRegister::reservType)
            continue;

        QLabel* text = new QLabel(this);

        text->show();
        text->move(5, yPos);
        text->resize(labelXsize, labelYsize);
        text->setText((*reg)->name);

        labelVector.push_back(text);

        switch ((*reg)->getType()) {
        case ModbusRegister::intType : {
                QLineEdit* edit = new QLineEdit(this);

                edit->move(labelXsize + xDistance, yPos);
                edit->resize(lineEditXsize, labelYsize);
                edit->setText(QString::number((*reg)->getData()));
                edit->show();
                lineeditVector.push_back(edit);
            }
            break;
        case ModbusRegister::textType : {
                QComboBox *box = new QComboBox(this);

                // заполняем список фозможными значениями
                int nText = (*reg)->stringText_.size();
                for (int j = 0; j < nText; j++) {
                    box->addItem((*reg)->stringText_[j]);
                }
                box->setCurrentIndex((*reg)->getData());
                // пихаем на форму
                box->move(labelXsize + xDistance, yPos);
                box->resize(lineEditXsize, labelYsize);
                box->show();
                boxVector.push_back(box);
            }
            break;
        default : break;
        }

        yPos += yStep;
    }

    yPos += yStep;
    buttonOk->move(400 - 100 - (400 - xDistance - labelXsize - lineEditXsize), yPos); // это придумал мой пьяный мозг, на самом деле нужно просто добавить компоновщик
    buttonCancel->move(400 - 100 - xDistance - 100 - (400 - xDistance - labelXsize - lineEditXsize), yPos);
    buttonCancel->show();
    buttonOk->show();
    yPos += yStep;

    this->resize(400, yPos + 25);
    this->exec();
}
开发者ID:dm-urievich,项目名称:byce_tool,代码行数:84,代码来源:hardwaresettingsdialog.cpp

示例3: dir


//.........这里部分代码省略.........

	connect( m_bufSizeSlider, SIGNAL( valueChanged( int ) ), this,
						SLOT( setBufferSize( int ) ) );

	m_bufSizeLbl = new QLabel( bufsize_tw );
	m_bufSizeLbl->setGeometry( 10, 40, 200, 24 );
	setBufferSize( m_bufSizeSlider->value() );

	QPushButton * bufsize_reset_btn = new QPushButton(
			embed::getIconPixmap( "reload" ), "", bufsize_tw );
	bufsize_reset_btn->setGeometry( 290, 40, 28, 28 );
	connect( bufsize_reset_btn, SIGNAL( clicked() ), this,
						SLOT( resetBufSize() ) );
	ToolTip::add( bufsize_reset_btn, tr( "Reset to default-value" ) );

	QPushButton * bufsize_help_btn = new QPushButton(
			embed::getIconPixmap( "help" ), "", bufsize_tw );
	bufsize_help_btn->setGeometry( 320, 40, 28, 28 );
	connect( bufsize_help_btn, SIGNAL( clicked() ), this,
						SLOT( displayBufSizeHelp() ) );


	TabWidget * misc_tw = new TabWidget( tr( "MISC" ), general );
	const int XDelta = 10;
	const int YDelta = 18;
	const int HeaderSize = 30;
	int labelNumber = 0;


	LedCheckBox * enable_tooltips = new LedCheckBox(
							tr( "Enable tooltips" ),
								misc_tw );
	labelNumber++;
	enable_tooltips->move( XDelta, YDelta*labelNumber );
	enable_tooltips->setChecked( m_toolTips );
	connect( enable_tooltips, SIGNAL( toggled( bool ) ),
					this, SLOT( toggleToolTips( bool ) ) );


	LedCheckBox * restart_msg = new LedCheckBox(
			tr( "Show restart warning after changing settings" ),
								misc_tw );
	labelNumber++;
	restart_msg->move( XDelta, YDelta*labelNumber );
	restart_msg->setChecked( m_warnAfterSetup );
	connect( restart_msg, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleWarnAfterSetup( bool ) ) );


	LedCheckBox * dbv = new LedCheckBox( tr( "Display volume as dBV " ),
								misc_tw );
	labelNumber++;
	dbv->move( XDelta, YDelta*labelNumber );
	dbv->setChecked( m_displaydBV );
	connect( dbv, SIGNAL( toggled( bool ) ),
				this, SLOT( toggleDisplaydBV( bool ) ) );


	LedCheckBox * mmpz = new LedCheckBox(
				tr( "Compress project files per default" ),
								misc_tw );
	labelNumber++;
	mmpz->move( XDelta, YDelta*labelNumber );
	mmpz->setChecked( m_MMPZ );
	connect( mmpz, SIGNAL( toggled( bool ) ),
					this, SLOT( toggleMMPZ( bool ) ) );
开发者ID:rcorre,项目名称:lmms,代码行数:67,代码来源:SetupDialog.cpp


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