本文整理汇总了C++中QSpinBox::setAlignment方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::setAlignment方法的具体用法?C++ QSpinBox::setAlignment怎么用?C++ QSpinBox::setAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSpinBox
的用法示例。
在下文中一共展示了QSpinBox::setAlignment方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: int
void
pcl::modeler::IntParameter::setEditorData(QWidget *editor)
{
QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
spinBox->setAlignment(Qt::AlignHCenter);
int value = int (*this);
spinBox->setValue(value);
}
示例2: createEditor
QWidget* QrkDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &item, const QModelIndex &index) const
{
if (this->type == SPINBOX) {
QSpinBox *spinbox = new QSpinBox(parent);
spinbox->setMinimum(-99999);
spinbox->setMaximum(99999);
spinbox->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect( spinbox , SIGNAL( valueChanged(int) ), this , SLOT( commitAndCloseEditor() ) ) ;
return spinbox;
} else if (this->type == DOUBLE_SPINBOX) {
示例3: QSpinBox
QWidget *CantitateDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option, const QModelIndex &index) const
{
Q_UNUSED(option);
Q_UNUSED(index);
QSpinBox *editor = new QSpinBox(parent);
editor->setMinimum(1);
editor->setMaximum(999);
editor->setAlignment(Qt::AlignRight);
return editor;
}
示例4: QWidget
StimConfigTab::StimConfigTab (QWidget *parent)
: QWidget(parent)
{
QGridLayout *layout = new QGridLayout;
layout->addWidget(new QLabel("Number of pulse trains"), 0, 0,
Qt::AlignRight | Qt::AlignVCenter);
QSpinBox *nTrainsSpinBox = new QSpinBox();
nTrainsSpinBox->setAlignment(Qt::AlignRight);
nTrainsSpinBox->setDecimals(1);
nTrainsSpinBox->setRange(1,200);
layout->addWidget(nTrainsSpinBox, 0, 1);
QPushButton *continuousButton = new QPushButton("Contiuous");
layout->addWidget(continuousButton,0,2);
layout->addWidget(new QLabel("Inter-train Interval"), 1, 0,
Qt::AlignRight | Qt::AlignVCenter);
QSpinBox *trainIntervalSpinBox = new QSpinBox();
trainIntervalSpinBox->setAlignment(Qt::AlignRight);
trainIntervalSpinBox->setSuffix(" ms");
trainIntervalSpinBox->setRange(500, 50000);
layout->addWidget(trainIntervalSpinBox, 1, 1);
QPushButton *stimSingleButton = new QPushButton("Trigger Single Pulse Sequence");
layout->addWidget(stimSingleButton,2,0);
QPushButton *startStimButton = new QPushButton("Start Pulse Sequence");
layout->addWidget(stimSingleButton,2,1);
QPushButton *abortStimButton = new QPushButton("Abort");
layout->addWidget(abortSingleButton,2,2);
setLayout(layout);
}
示例5: VESPERSScanConfigurationView
VESPERSEXAFSScanConfigurationView::VESPERSEXAFSScanConfigurationView(VESPERSEXAFSScanConfiguration *config, QWidget *parent)
: VESPERSScanConfigurationView(parent)
{
config_ = config;
AMTopFrame *frame = new AMTopFrame("VESPERS EXAFS Configuration");
// Regions setup
regionsView_ = new AMRegionsView(config_->regions());
regionsView_->setMinimumWidth(300);
regionsLineView_ = new AMEXAFSLineView(config_->exafsRegions());
// The fluorescence detector setup
QGroupBox *fluorescenceDetectorGroupBox = addFluorescenceDetectorSelectionView();
connect(fluorescenceButtonGroup_, SIGNAL(buttonClicked(int)), this, SLOT(onFluorescenceChoiceChanged(int)));
connect(config_->dbObject(), SIGNAL(fluorescenceDetectorChanged(int)), this, SLOT(updateFluorescenceDetector(int)));
fluorescenceButtonGroup_->button((int)config_->fluorescenceDetector())->setChecked(true);
// Ion chamber selection
QGroupBox *ItGroupBox = addItSelectionView();
connect(ItGroup_, SIGNAL(buttonClicked(int)), this, SLOT(onItClicked(int)));
connect(config_->dbObject(), SIGNAL(transmissionChoiceChanged(int)), this, SLOT(updateItButtons(int)));
QGroupBox *I0GroupBox = addI0SelectionView();
connect(I0Group_, SIGNAL(buttonClicked(int)), this, SLOT(onI0Clicked(int)));
connect(config_->dbObject(), SIGNAL(incomingChoiceChanged(int)), this, SLOT(updateI0Buttons(int)));
I0Group_->button((int)config_->incomingChoice())->click();
ItGroup_->button((int)config_->transmissionChoice())->click();
QHBoxLayout *ionChambersLayout = new QHBoxLayout;
ionChambersLayout->addWidget(I0GroupBox);
ionChambersLayout->addWidget(ItGroupBox);
// Scan name selection
scanName_ = addScanNameView(config_->name());
connect(scanName_, SIGNAL(editingFinished()), this, SLOT(onScanNameEdited()));
connect(config_, SIGNAL(nameChanged(QString)), scanName_, SLOT(setText(QString)));
onScanNameEdited();
QFormLayout *scanNameLayout = new QFormLayout;
scanNameLayout->addRow("Scan Name:", scanName_);
// Energy (Eo) selection
energy_ = new QDoubleSpinBox;
energy_->setSuffix(" eV");
energy_->setMinimum(0);
energy_->setMaximum(30000);
connect(energy_, SIGNAL(editingFinished()), this, SLOT(setEnergy()));
elementChoice_ = new QToolButton;
connect(elementChoice_, SIGNAL(clicked()), this, SLOT(onElementChoiceClicked()));
lineChoice_ = new QComboBox;
connect(lineChoice_, SIGNAL(currentIndexChanged(int)), this, SLOT(onLinesComboBoxIndexChanged(int)));
if (config_->edge().isEmpty()){
elementChoice_->setText("Cu");
fillLinesComboBox(AMPeriodicTable::table()->elementBySymbol("Cu"));
lineChoice_->setCurrentIndex(0);
}
// Resets the view for the view to what it should be. Using the saved for the energy in case it is different from the original line energy.
else
onEdgeChanged();
connect(config_, SIGNAL(edgeChanged(QString)), this, SLOT(onEdgeChanged()));
QCheckBox *useFixedTime = new QCheckBox("Use fixed time (EXAFS)");
useFixedTime->setEnabled(config_->useFixedTime());
connect(config_->exafsRegions(), SIGNAL(regionsHaveKSpaceChanged(bool)), useFixedTime, SLOT(setEnabled(bool)));
connect(useFixedTime, SIGNAL(toggled(bool)), config_, SLOT(setUseFixedTime(bool)));
QSpinBox *numberOfScans = new QSpinBox;
numberOfScans->setMinimum(1);
numberOfScans->setValue(config_->numberOfScans());
numberOfScans->setAlignment(Qt::AlignCenter);
connect(numberOfScans, SIGNAL(valueChanged(int)), config_, SLOT(setNumberOfScans(int)));
connect(config_, SIGNAL(numberOfScansChanged(int)), this, SLOT(onEstimatedTimeChanged()));
QFormLayout *numberOfScansLayout = new QFormLayout;
numberOfScansLayout->addRow("Number of Scans:", numberOfScans);
QFormLayout *energySetpointLayout = new QFormLayout;
energySetpointLayout->addRow("Energy:", energy_);
QHBoxLayout *energyLayout = new QHBoxLayout;
energyLayout->addLayout(energySetpointLayout);
energyLayout->addWidget(elementChoice_);
energyLayout->addWidget(lineChoice_);
// Setting the scan position.
QGroupBox *goToPositionGroupBox = addGoToPositionView(config_->goToPosition(), config_->x(), config_->y());
connect(config_, SIGNAL(gotoPositionChanged(bool)), goToPositionCheckBox_, SLOT(setChecked(bool)));
connect(goToPositionCheckBox_, SIGNAL(toggled(bool)), config_, SLOT(setGoToPosition(bool)));
connect(goToPositionCheckBox_, SIGNAL(toggled(bool)), setCurrentPositionButton_, SLOT(setEnabled(bool)));
connect(goToPositionCheckBox_, SIGNAL(toggled(bool)), savedXPosition_, SLOT(setEnabled(bool)));
connect(goToPositionCheckBox_, SIGNAL(toggled(bool)), savedYPosition_, SLOT(setEnabled(bool)));
connect(goToPositionCheckBox_, SIGNAL(toggled(bool)), positionsSaved_, SLOT(setEnabled(bool)));
connect(setCurrentPositionButton_, SIGNAL(clicked()), this, SLOT(setScanPosition()));
//.........这里部分代码省略.........
示例6: rx
Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings, firmware)
{
QGridLayout * gridLayout = new QGridLayout(this);
bool minimize = false;
int col = 1;
if (firmware->getCapability(ChannelsName)) {
minimize=true;
addLabel(gridLayout, tr("Name"), col++);
}
addLabel(gridLayout, tr("Subtrim"), col++, minimize);
addLabel(gridLayout, tr("Min"), col++, minimize);
addLabel(gridLayout, tr("Max"), col++, minimize);
addLabel(gridLayout, tr("Direction"), col++, minimize);
if (IS_TARANIS(GetEepromInterface()->getBoard()))
addLabel(gridLayout, tr("Curve"), col++, minimize);
if (firmware->getCapability(PPMCenter))
addLabel(gridLayout, tr("PPM Center"), col++, minimize);
if (firmware->getCapability(SYMLimits))
addLabel(gridLayout, tr("Linear Subtrim"), col++, true);
for (int i=0; i<firmware->getCapability(Outputs); i++) {
col = 0;
// Channel label
QLabel *label = new QLabel(this);
label->setText(tr("Channel %1").arg(i+1));
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
gridLayout->addWidget(label, i+1, col++, 1, 1);
// Channel name
int nameLen = firmware->getCapability(ChannelsName);
if (nameLen > 0) {
QLineEdit * name = new QLineEdit(this);
name->setProperty("index", i);
name->setMaxLength(nameLen);
QRegExp rx(CHAR_FOR_NAMES_REGEX);
name->setValidator(new QRegExpValidator(rx, this));
name->setText(model.limitData[i].name);
connect(name, SIGNAL(editingFinished()), this, SLOT(nameEdited()));
gridLayout->addWidget(name, i+1, col++, 1, 1);
}
// Channel offset
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].offset, -1000, 1000, 0);
// Channel min
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
// Channel max
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
// Channel inversion
QComboBox * invCB = new QComboBox(this);
invCB->insertItems(0, QStringList() << tr("---") << tr("INV"));
invCB->setProperty("index", i);
invCB->setCurrentIndex((model.limitData[i].revert) ? 1 : 0);
connect(invCB, SIGNAL(currentIndexChanged(int)), this, SLOT(invEdited()));
gridLayout->addWidget(invCB, i+1, col++, 1, 1);
// Curve
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
QComboBox * curveCB = new QComboBox(this);
curveCB->setProperty("index", i);
int numcurves = firmware->getCapability(NumCurves);
for (int j=-numcurves; j<=numcurves; j++) {
curveCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, j).toString(), j);
}
curveCB->setCurrentIndex(model.limitData[i].curve.value+numcurves);
connect(curveCB, SIGNAL(currentIndexChanged(int)), this, SLOT(curveEdited()));
gridLayout->addWidget(curveCB, i+1, col++, 1, 1);
}
// PPM center
if (firmware->getCapability(PPMCenter)) {
QSpinBox * center = new QSpinBox(this);
center->setProperty("index", i);
center->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
center->setSuffix("us");
center->setMinimum(1375);
center->setMaximum(1625);
center->setValue(1500);
center->setValue(model.limitData[i].ppmCenter + 1500);
connect(center, SIGNAL(editingFinished()), this, SLOT(ppmcenterEdited()));
gridLayout->addWidget(center, i+1, col++, 1, 1);
}
// Symetrical limits
if (firmware->getCapability(SYMLimits)) {
QCheckBox * symlimits = new QCheckBox(this);
symlimits->setProperty("index", i);
symlimits->setChecked(model.limitData[i].symetrical);
connect(symlimits, SIGNAL(toggled(bool)), this, SLOT(symlimitsEdited()));
gridLayout->addWidget(symlimits, i+1, col++, 1, 1);
}
}
示例7: iconPixmap
QFrame *AbstractController::telexFrame()
{
/**
* Telextext QFrame
**/
QFrame *telexFrame = new QFrame( this );
QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 );
CONNECT( THEMIM->getIM(), teletextPossible( bool ),
telexFrame, setVisible( bool ) );
/* On/Off button */
QToolButton *telexOn = new QToolButton;
setupButton( telexOn );
BUTTON_SET_BAR2( telexOn, toolbar/tv, qtr( "Teletext Activation" ) );
telexOn->setEnabled( false );
telexOn->setCheckable( true );
telexLayout->addWidget( telexOn );
/* Teletext Activation and set */
CONNECT( telexOn, clicked( bool ),
THEMIM->getIM(), activateTeletext( bool ) );
CONNECT( THEMIM->getIM(), teletextPossible( bool ),
telexOn, setEnabled( bool ) );
/* Transparency button */
QToolButton *telexTransparent = new QToolButton;
setupButton( telexTransparent );
BUTTON_SET_BAR2( telexTransparent, toolbar/tvtelx,
qtr( "Toggle Transparency " ) );
telexTransparent->setEnabled( false );
telexTransparent->setCheckable( true );
telexLayout->addWidget( telexTransparent );
/* Transparency change and set */
CONNECT( telexTransparent, clicked( bool ),
THEMIM->getIM(), telexSetTransparency( bool ) );
CONNECT( THEMIM->getIM(), teletextTransparencyActivated( bool ),
telexTransparent, setChecked( bool ) );
/* Page setting */
QSpinBox *telexPage = new QSpinBox( telexFrame );
telexPage->setRange( 100, 899 );
telexPage->setValue( 100 );
telexPage->setAccelerated( true );
telexPage->setWrapping( true );
telexPage->setAlignment( Qt::AlignRight );
telexPage->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum );
telexPage->setEnabled( false );
telexLayout->addWidget( telexPage );
/* Contextual & Index Buttons */
QSignalMapper *contextButtonMapper = new QSignalMapper( this );
QToolButton *contextButton = NULL;
int i_iconminsize = __MAX( 16, telexOn->minimumHeight() );
QPixmap iconPixmap( i_iconminsize, i_iconminsize );
iconPixmap.fill( Qt::transparent );
QPainter iconPixmapPainter( &iconPixmap );
QLinearGradient iconPixmapPainterGradient( iconPixmap.rect().center() / 2,
iconPixmap.rect().center() );
#define CREATE_CONTEXT_BUTTON(color, key) \
iconPixmapPainterGradient.setColorAt( 0, QColor( color ).lighter(150) );\
iconPixmapPainterGradient.setColorAt( 1.0, QColor( color ) );\
iconPixmapPainter.setBrush( iconPixmapPainterGradient );\
iconPixmapPainter.drawEllipse( iconPixmap.rect().adjusted( 4, 4, -5, -5 ) );\
contextButton = new QToolButton();\
setupButton( contextButton );\
contextButton->setIcon( iconPixmap );\
contextButton->setEnabled( false );\
contextButtonMapper->setMapping( contextButton, key << 16 );\
CONNECT( contextButton, clicked(), contextButtonMapper, map() );\
CONNECT( contextButtonMapper, mapped( int ),\
THEMIM->getIM(), telexSetPage( int ) );\
CONNECT( THEMIM->getIM(), teletextActivated( bool ), contextButton, setEnabled( bool ) );\
telexLayout->addWidget( contextButton )
CREATE_CONTEXT_BUTTON("grey", 'i'); /* index */
CREATE_CONTEXT_BUTTON("red", 'r');
CREATE_CONTEXT_BUTTON("green", 'g');
CREATE_CONTEXT_BUTTON("yellow", 'y');
CREATE_CONTEXT_BUTTON("blue", 'b');
#undef CREATE_CONTEXT_BUTTON
/* Page change and set */
CONNECT( telexPage, valueChanged( int ),
THEMIM->getIM(), telexSetPage( int ) );
CONNECT( THEMIM->getIM(), newTelexPageSet( int ),
telexPage, setValue( int ) );
CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexPage, setEnabled( bool ) );
CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexTransparent, setEnabled( bool ) );
CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexOn, setChecked( bool ) );
return telexFrame;
}
示例8: buildConfigureQueueList
QWidget* XletQueuesConfigure::buildConfigureQueueList(QWidget *parent)
{
QWidget *root = new QWidget(parent);
QGridLayout *layout = new QGridLayout(root);
root->setLayout(layout);
layout->addWidget(new QLabel(tr("Queue"), root), 0, 0, Qt::AlignLeft);
QLabel *label_qos = new QLabel(tr("Qos - X (s)"), root);
label_qos->setToolTip(tr(
"This is the threshold in seconds to consider that the answer to a "
"call was too late to be accounted as an answer of quality."));
layout->addWidget(label_qos, 0, 1, Qt::AlignLeft);
QLabel *label_window = new QLabel(tr("Window (s)"), root);
label_window->setToolTip(tr(
"The window is the period of time used to compute the statistics"));
layout->addWidget(label_window, 0, 2, Qt::AlignLeft);
QCheckBox *displayQueue;
QSpinBox *spinBox;
int row;
int column;
QVariantMap statConfig = b_engine->getConfig("guioptions.queuespanel").toMap();
QString xqueueid;
row = 1;
QHashIterator<QString, XInfo *> i = \
QHashIterator<QString, XInfo *>(b_engine->iterover("queues"));
while (i.hasNext()) {
column = 0;
i.next();
QueueInfo * queueinfo = (QueueInfo *) i.value();
xqueueid = queueinfo->xid();
displayQueue = new QCheckBox(queueinfo->queueName(), root);
displayQueue->setProperty("xqueueid", xqueueid);
displayQueue->setProperty("param", "visible");
displayQueue->setChecked(statConfig.value("visible" + xqueueid, true).toBool());
layout->addWidget(displayQueue, row, column++);
connect(displayQueue, SIGNAL(stateChanged(int)),
this, SLOT(changeQueueStatParam(int)));
spinBox = new QSpinBox(root);
spinBox->setAlignment(Qt::AlignCenter);
spinBox->setMaximum(240);
spinBox->setProperty("xqueueid", xqueueid);
spinBox->setProperty("param", "xqos");
spinBox->setValue(statConfig.value("xqos" + xqueueid, 60).toInt());
layout->addWidget(spinBox, row, column++);
connect(spinBox, SIGNAL(valueChanged(int)),
this, SLOT(changeQueueStatParam(int)));
spinBox = new QSpinBox(root);
spinBox->setAlignment(Qt::AlignCenter);
spinBox->setMaximum(3600*3);
spinBox->setProperty("xqueueid", xqueueid);
spinBox->setProperty("param", "window");
spinBox->setValue(statConfig.value("window" + xqueueid, 3600).toInt());
layout->addWidget(spinBox, row, column++);
connect(spinBox, SIGNAL(valueChanged(int)),
this, SLOT(changeQueueStatParam(int)));
row++;
}
return root;
}
示例9: QFrame
QFrame *AbstractController::telexFrame()
{
/**
* Telextext QFrame
**/
QFrame *telexFrame = new QFrame( this );
QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 );
CONNECT( THEMIM->getIM(), teletextPossible( bool ),
telexFrame, setVisible( bool ) );
/* On/Off button */
QToolButton *telexOn = new QToolButton;
setupButton( telexOn );
BUTTON_SET_BAR2( telexOn, toolbar/tv, qtr( "Teletext Activation" ) );
telexOn->setEnabled( false );
telexOn->setCheckable( true );
telexLayout->addWidget( telexOn );
/* Teletext Activation and set */
CONNECT( telexOn, clicked( bool ),
THEMIM->getIM(), activateTeletext( bool ) );
CONNECT( THEMIM->getIM(), teletextPossible( bool ),
telexOn, setEnabled( bool ) );
/* Transparency button */
QToolButton *telexTransparent = new QToolButton;
setupButton( telexTransparent );
BUTTON_SET_BAR2( telexTransparent, toolbar/tvtelx,
qtr( "Toggle Transparency " ) );
telexTransparent->setEnabled( false );
telexTransparent->setCheckable( true );
telexLayout->addWidget( telexTransparent );
/* Transparency change and set */
CONNECT( telexTransparent, clicked( bool ),
THEMIM->getIM(), telexSetTransparency( bool ) );
CONNECT( THEMIM->getIM(), teletextTransparencyActivated( bool ),
telexTransparent, setChecked( bool ) );
/* Page setting */
QSpinBox *telexPage = new QSpinBox( telexFrame );
telexPage->setRange( 0, 999 );
telexPage->setValue( 100 );
telexPage->setAccelerated( true );
telexPage->setWrapping( true );
telexPage->setAlignment( Qt::AlignRight );
telexPage->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum );
telexPage->setEnabled( false );
telexLayout->addWidget( telexPage );
/* Page change and set */
CONNECT( telexPage, valueChanged( int ),
THEMIM->getIM(), telexSetPage( int ) );
CONNECT( THEMIM->getIM(), newTelexPageSet( int ),
telexPage, setValue( int ) );
CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexPage, setEnabled( bool ) );
CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexTransparent, setEnabled( bool ) );
CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexOn, setChecked( bool ) );
return telexFrame;
}
示例10: cancel
//.........这里部分代码省略.........
item = new QTableWidgetItem(tr(qPrintable(fid)));
item->setData(Qt::UserRole, fid);
item->setFlags(Qt::ItemIsEnabled);
m_table->setItem(r, 0, item);
item = new QTableWidgetItem;
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
item->setCheckState(fmt.weight == QFont::Bold ? Qt::Checked : Qt::Unchecked);
item->setToolTip(m_table->horizontalHeaderItem(1)->toolTip());
m_table->setItem(r, 1, item);
item = new QTableWidgetItem;
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
item->setCheckState(fmt.italic ? Qt::Checked : Qt::Unchecked);
item->setToolTip(m_table->horizontalHeaderItem(2)->toolTip());
m_table->setItem(r, 2, item);
item = new QTableWidgetItem;
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
item->setCheckState(fmt.underline ? Qt::Checked : Qt::Unchecked);
item->setToolTip(m_table->horizontalHeaderItem(3)->toolTip());
m_table->setItem(r, 3, item);
item = new QTableWidgetItem;
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
item->setCheckState(fmt.overline ? Qt::Checked : Qt::Unchecked);
item->setToolTip(m_table->horizontalHeaderItem(4)->toolTip());
m_table->setItem(r, 4, item);
item = new QTableWidgetItem;
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
item->setCheckState(fmt.strikeout ? Qt::Checked : Qt::Unchecked);
item->setToolTip(m_table->horizontalHeaderItem(5)->toolTip());
m_table->setItem(r, 5, item);
item = new QTableWidgetItem;
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
item->setCheckState(fmt.waveUnderline ? Qt::Checked : Qt::Unchecked);
item->setToolTip(m_table->horizontalHeaderItem(6)->toolTip());
m_table->setItem(r, 6, item);
m_table->setCellWidget(r, 7, new QSimpleColorPicker(fmt.foreground));
m_table->cellWidget(r, 7)->setToolTip(m_table->horizontalHeaderItem(7)->toolTip());
//m_table->cellWidget(i, 7)->setMaximumSize(22, 22);
m_table->setCellWidget(r, 8, new QSimpleColorPicker(fmt.background));
m_table->cellWidget(r, 8)->setToolTip(m_table->horizontalHeaderItem(8)->toolTip());
//m_table->cellWidget(i, 8)->setMaximumSize(22, 22);
m_table->setCellWidget(r, 9, new QSimpleColorPicker(fmt.linescolor));
m_table->cellWidget(r, 9)->setToolTip(m_table->horizontalHeaderItem(9)->toolTip());
//m_table->cellWidget(i, 9)->setMaximumSize(22, 22);
//item = new QTableWidgetItem;
QFontComboBox *fcmb=new QFontComboBox();
fcmb->insertItem(0, "<default>");
int ind=fcmb->findText(fmt.fontFamily);
if(ind>-1) fcmb->setCurrentIndex(ind);
else fcmb->setCurrentIndex(0);
//int ind=fcmb->findText(fmt.fontFamily);
//if(ind>-1) fcmb->setCurrentIndex(ind);
//else fcmb->setCurrentIndex(0);
//QComboBox *fcmb=new QComboBox();
//fcmb->addItems(fonts);
//int ind=fcmb->findText(fmt.fontFamily);
//if(ind>-1) fcmb->setCurrentIndex(ind);
//else fcmb->setCurrentIndex(0);
m_table->setCellWidget(r, 10, fcmb);
fcmb->setToolTip(m_table->horizontalHeaderItem(10)->toolTip());
QDoubleSpinBox* sb = new QDoubleSpinBox();
sb->setMaximum(100000);
sb->setMinimum(1);
sb->setDecimals(0);
sb->setSuffix("%");
sb->setAlignment(Qt::AlignRight);
sb->setFrame(false);
double v = fmt.pointSize?100.0*fmt.pointSize/basePointSize:100;
sb->setValue(v);
sb->setToolTip(m_table->horizontalHeaderItem(11)->toolTip());
m_table->setCellWidget(r, 11, sb);
QSpinBox *psb = new QSpinBox();
psb->setMaximum(100);
psb->setMinimum(-1);
psb->setAlignment(Qt::AlignRight);
psb->setFrame(false);
psb->setValue(fmt.priority);
psb->setToolTip(m_table->horizontalHeaderItem(12)->toolTip());
m_table->setCellWidget(r, 12, psb);
r++;
}
}
}
m_table->resizeColumnsToContents();
qDebug () << T.elapsed();
}