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


C++ QSpinBox::setToolTip方法代码示例

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


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

示例1: createWidgetForInt

QWidget* PropertyEditor::createWidgetForInt(const QString& name, int value, const QString& detail, QWidget* parent)
{
    mProperties[name] = value;
    QSpinBox *box = new QSpinBox(parent);
    if (!detail.isEmpty())
        box->setToolTip(detail);
    box->setObjectName(name);
    box->setValue(value);
    connect(box, SIGNAL(valueChanged(int)), SLOT(onIntChange(int)));
    return box;
}
开发者ID:baoniu,项目名称:QtAV,代码行数:11,代码来源:PropertyEditor.cpp

示例2: retranslateUi

    void retranslateUi(SAPenSetWidget *par)
    {
        par->setWindowTitle(QApplication::translate("SAPenSetWidget", "Form", 0));
        labelColor->setText(QApplication::translate("SAPenSetWidget", "Color", 0));
#ifndef QT_NO_TOOLTIP
        pushButtonColor->setToolTip(QApplication::translate("SAPenSetWidget", "<html><head/><body><p>set curve line color</p></body></html>", 0));
#endif // QT_NO_TOOLTIP
        pushButtonColor->setText(QString());
        labelWidth->setText(QApplication::translate("SAPenSetWidget", "Width", 0));
#ifndef QT_NO_TOOLTIP
        spinBoxPenWidth->setToolTip(QApplication::translate("SAPenSetWidget", "<html><head/><body><p>set curve line width</p></body></html>", 0));
#endif // QT_NO_TOOLTIP
        labelStyle->setText(QApplication::translate("SAPenSetWidget", "Style", 0));
#ifndef QT_NO_TOOLTIP
        comboBoxPenStyle->setToolTip(QApplication::translate("SAPenSetWidget", "<html><head/><body><p>set curve line style</p></body></html>", 0));
#endif // QT_NO_TOOLTIP
    } // retranslateUi
开发者ID:czyt1988,项目名称:sa,代码行数:17,代码来源:SAPenSetWidget.cpp

示例3: createStatesBox

/*!
    Create and return the box used to modify number of states.
*/
QSpinBox* UiDigitalGenerator::createStatesBox()
{
    GeneratorDevice* device = DeviceManager::instance().activeDevice()
            ->generatorDevice();

    // Deallocation:
    //   Toolbar takes ownership when adding this box by call to
    //   toolBar->addWidget(mStatesBox) in createToolBar
    QSpinBox* box = new QSpinBox();
    box->setToolTip(tr("The number of digital states to use"));


    box->setRange(2, device->maxNumDigitalStates());

    connect(box, SIGNAL(valueChanged(int)), this, SLOT(setNumStates(int)));

    return box;
}
开发者ID:AlexandreN7,项目名称:Liqui_lense,代码行数:21,代码来源:uidigitalgenerator.cpp

示例4: make_pair

std::pair<QWidget *, QWidget *> CSMPrefs::IntSetting::makeWidgets (QWidget *parent)
{
    QLabel *label = new QLabel (QString::fromUtf8 (getLabel().c_str()), parent);

    QSpinBox *widget = new QSpinBox (parent);
    widget->setRange (mMin, mMax);
    widget->setValue (mDefault);

    if (!mTooltip.empty())
    {
        QString tooltip = QString::fromUtf8 (mTooltip.c_str());
        label->setToolTip (tooltip);
        widget->setToolTip (tooltip);
    }

    connect (widget, SIGNAL (valueChanged (int)), this, SLOT (valueChanged (int)));

    return std::make_pair (label, widget);
}
开发者ID:A1-Triard,项目名称:openmw,代码行数:19,代码来源:intsetting.cpp

示例5: QMainWindow

VPiano::VPiano() : QMainWindow()
{
	QWidget *central = new QWidget(this);
	QVBoxLayout *vb = new QVBoxLayout;
	QHBoxLayout *octaves = new QHBoxLayout;

	QSignalMapper *octaveSignalMapper = new QSignalMapper(this);

	for(int i = 0; i < 9; i++)
	{
		QString title;
		title.setNum(i);
		QPushButton *o = new QPushButton(title, central);
		o->setFixedSize(fontMetrics().width(title)*4, o->height());
		QString shortcut;
		shortcut.setNum(i+1);
		o->setShortcut(QKeySequence(QString("F") + shortcut));
		octaves->addWidget(o);

		connect(o, SIGNAL(clicked()), octaveSignalMapper, SLOT(map()));
		octaveSignalMapper->setMapping(o, i);
	}

	OctaveRangeWidget *octRange = new OctaveRangeWidget(central);
	octaves->addWidget(octRange);

	QSlider *velocity = new QSlider(Qt::Horizontal, central);
	velocity->setMinimum(1);
	velocity->setMaximum(127);
	velocity->setValue(96); // TODO: read prev value from config
	velocity->setToolTip(tr("Velocity"));
	octaves->addWidget(velocity);

	QSpinBox *channel = new QSpinBox(central);
	channel->setPrefix(tr("Ch ", "Midi Channel number"));
	channel->setMinimum(0);
	channel->setMaximum(127);
	channel->setValue(0); // TODO: read prev value from config
	channel->setToolTip(tr("Select MIDI channel number to send messages to"));
	octaves->addWidget(channel);

	vb->addLayout(octaves);

	QHBoxLayout *keyarea = new QHBoxLayout;

	KeyboardWidget *kw = new KeyboardWidget(central);
	keyarea->addWidget(kw);

	QVBoxLayout *rightside = new QVBoxLayout;

	QSlider *pitchWheel = new QSlider(Qt::Vertical, central);
	pitchWheel->setMinimum(-64);
	pitchWheel->setMaximum(63);
	pitchWheel->setValue(0); // TODO: read prev value from config
	pitchWheel->setToolTip(tr("Pitch wheel"));

	rightside->addWidget(pitchWheel);

	QCheckBox *porta = new QCheckBox(central);
	porta->setToolTip(tr("Enable portamento"));

	rightside->addWidget(porta);
	keyarea->addLayout(rightside);

	vb->addLayout(keyarea);

	central->setLayout(vb);
	setCentralWidget(central);
	setWindowTitle(tr("Virtual MIDI keyboard"));

	// TODO: connect pitchWheel
	connect(octaveSignalMapper, SIGNAL(mapped(int)), kw, SLOT(octaveSelected(int)));
	connect(channel, SIGNAL(valueChanged(int)), kw, SLOT(midiChannelSelected(int)));
	connect(kw, SIGNAL(highlightOctaves(int,int)), octRange, SLOT(highlightOctaves(int,int)));

	kw->octaveSelected(0); // TODO: use value read from config
}
开发者ID:berkus,项目名称:vpiano,代码行数:77,代码来源:mainwindow.cpp

示例6: initializeItems

void ToolBar::initializeItems()
{
    mCursorButton = createToolButton(mActMap[CURSOR]);
    mEraserButton = createToolButton(mActMap[ERASER]);
    mPenButton = createToolButton(mActMap[PEN]);
    mLineButton = createToolButton(mActMap[LINE]);
    mColorPickerButton = createToolButton(mActMap[COLORPICKER]);
    mMagnifierButton = createToolButton(mActMap[MAGNIFIER]);
    mSprayButton = createToolButton(mActMap[SPRAY]);
    mFillButton = createToolButton(mActMap[FILL]);
    mRectangleButton = createToolButton(mActMap[RECTANGLE]);
    mEllipseButton = createToolButton(mActMap[ELLIPSE]);
    mCurveButton = createToolButton(mActMap[CURVELINE]);
    mTextButton = createToolButton(mActMap[TEXT]);

    QGridLayout *bLayout = new QGridLayout();
    bLayout->setMargin(3);
    bLayout->addWidget(mCursorButton, 0, 0);
    bLayout->addWidget(mEraserButton, 0, 1);
    bLayout->addWidget(mColorPickerButton, 1, 0);
    bLayout->addWidget(mMagnifierButton, 1, 1);
    bLayout->addWidget(mPenButton, 2, 0);
    bLayout->addWidget(mLineButton, 2, 1);
    bLayout->addWidget(mSprayButton, 3, 0);
    bLayout->addWidget(mFillButton, 3, 1);
    bLayout->addWidget(mRectangleButton, 4, 0);
    bLayout->addWidget(mEllipseButton, 4, 1);
    bLayout->addWidget(mCurveButton, 5, 0);
    bLayout->addWidget(mTextButton, 5, 1);

    QWidget *bWidget = new QWidget();
    bWidget->setLayout(bLayout);

    mPColorChooser = new ColorChooser(0, 0, 0, this);
    mPColorChooser->setStatusTip(tr("Primary color"));
    mPColorChooser->setToolTip(tr("Primary color"));
    connect(mPColorChooser, SIGNAL(sendColor(QColor)), this, SLOT(primaryColorChanged(QColor)));
    connect(mPColorChooser, SIGNAL(colorDialogClosed()), this, SIGNAL(colorDialogClosed()));

    mSColorChooser = new ColorChooser(255, 255, 255, this);
    mSColorChooser->setStatusTip(tr("Secondary color"));
    mSColorChooser->setToolTip(tr("Secondary color"));
    connect(mSColorChooser, SIGNAL(sendColor(QColor)), this, SLOT(secondaryColorChanged(QColor)));
    connect(mSColorChooser, SIGNAL(colorDialogClosed()), this, SIGNAL(colorDialogClosed()));

    QSpinBox *penSizeSpin = new QSpinBox();
    penSizeSpin->setRange(1, 20);
    penSizeSpin->setValue(1);
    penSizeSpin->setStatusTip(tr("Pen size"));
    penSizeSpin->setToolTip(tr("Pen size"));
    connect(penSizeSpin, SIGNAL(valueChanged(int)), this, SLOT(penValueChanged(int)));

    QGridLayout *tLayout = new QGridLayout();
    tLayout->setMargin(3);
    tLayout->addWidget(mPColorChooser, 0, 0);
    tLayout->addWidget(mSColorChooser, 0, 1);
    tLayout->addWidget(penSizeSpin, 1, 0, 1, 2);

    QWidget *tWidget = new QWidget();
    tWidget->setLayout(tLayout);

    addWidget(bWidget);
    addSeparator();
    addWidget(tWidget);
}
开发者ID:athenaie,项目名称:EasyPaint,代码行数:65,代码来源:toolbar.cpp

示例7: createLayout

void DkDisplayPreference::createLayout() {

	// zoom settings
	QCheckBox* invertZoom = new QCheckBox(tr("Invert mouse wheel behaviour for zooming"), this);
	invertZoom->setObjectName("invertZoom");
	invertZoom->setToolTip(tr("If checked, the mouse wheel behaviour is inverted while zooming."));
	invertZoom->setChecked(Settings::param().display().invertZoom);

	QLabel* interpolationLabel = new QLabel(tr("Show pixels if zoom level is above"), this);

	QSpinBox* sbInterpolation = new QSpinBox(this);
	sbInterpolation->setObjectName("interpolationBox");
	sbInterpolation->setToolTip(tr("nomacs will not interpolate images if the zoom level is larger."));
	sbInterpolation->setSuffix("%");
	sbInterpolation->setMinimum(0);
	sbInterpolation->setMaximum(10000);
	sbInterpolation->setValue(Settings::param().display().interpolateZoomLevel);

	DkGroupWidget* zoomGroup = new DkGroupWidget(tr("Zoom"), this);
	zoomGroup->addWidget(invertZoom);
	zoomGroup->addWidget(interpolationLabel);
	zoomGroup->addWidget(sbInterpolation);

	// keep zoom radio buttons
	QVector<QRadioButton*> keepZoomButtons;
	keepZoomButtons.resize(DkSettings::zoom_end);
	keepZoomButtons[DkSettings::zoom_always_keep] = new QRadioButton(tr("Always keep zoom"), this);
	keepZoomButtons[DkSettings::zoom_keep_same_size] = new QRadioButton(tr("Keep zoom if the size is the same"), this);
	keepZoomButtons[DkSettings::zoom_keep_same_size]->setToolTip(tr("If checked, the zoom level is only kept, if the image loaded has the same level as the previous."));
	keepZoomButtons[DkSettings::zoom_never_keep] = new QRadioButton(tr("Never keep zoom"), this);

	QCheckBox* cbZoomToFit = new QCheckBox(tr("Always zoom to fit"), this);
	cbZoomToFit->setObjectName("zoomToFit");
	cbZoomToFit->setChecked(Settings::param().display().zoomToFit);

	// check wrt the current settings
	keepZoomButtons[Settings::param().display().keepZoom]->setChecked(true);

	QButtonGroup* keepZoomButtonGroup = new QButtonGroup(this);
	keepZoomButtonGroup->setObjectName("keepZoom");
	keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_always_keep], DkSettings::zoom_always_keep);
	keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_keep_same_size], DkSettings::zoom_keep_same_size);
	keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_never_keep], DkSettings::zoom_never_keep);

	DkGroupWidget* keepZoomGroup = new DkGroupWidget(tr("When Displaying New Images"), this);
	keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_always_keep]);
	keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_keep_same_size]);
	keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_never_keep]);
	keepZoomGroup->addWidget(cbZoomToFit);
	
	// icon size
	QSpinBox* sbIconSize = new QSpinBox(this);
	sbIconSize->setObjectName("iconSizeBox");
	sbIconSize->setToolTip(tr("Define the icon size in pixel."));
	sbIconSize->setSuffix(" px");
	sbIconSize->setMinimum(16);
	sbIconSize->setMaximum(1024);
	sbIconSize->setValue(Settings::param().display().iconSize);

	DkGroupWidget* iconGroup = new DkGroupWidget(tr("Icon Size"), this);
	iconGroup->addWidget(sbIconSize);

	// slideshow
	QLabel* fadeImageLabel = new QLabel(tr("Image Transition"), this);

	QComboBox* cbTransition = new QComboBox(this);
	cbTransition->setObjectName("transition");
	cbTransition->setToolTip(tr("Choose a transition when loading a new image"));

	for (int idx = 0; idx < DkSettings::trans_end; idx++) {

		QString str = tr("Unknown Transition");

		switch (idx) {
		case DkSettings::trans_appear:	str = tr("Appear"); break;
		case DkSettings::trans_swipe:	str = tr("Swipe");	break;
		case DkSettings::trans_fade:	str = tr("Fade");	break;
		}

		cbTransition->addItem(str);
	}
	cbTransition->setCurrentIndex(Settings::param().display().transition);

	QDoubleSpinBox* fadeImageBox = new QDoubleSpinBox(this);
	fadeImageBox->setObjectName("fadeImageBox");
	fadeImageBox->setToolTip(tr("Define the image transition speed."));
	fadeImageBox->setSuffix(" sec");
	fadeImageBox->setMinimum(0.0);
	fadeImageBox->setMaximum(3);
	fadeImageBox->setSingleStep(.2);
	fadeImageBox->setValue(Settings::param().display().animationDuration);

	QCheckBox* cbAlwaysAnimate = new QCheckBox(tr("Always Animate Image Loading"), this);
	cbAlwaysAnimate->setObjectName("alwaysAnimate");
	cbAlwaysAnimate->setToolTip(tr("If unchecked, loading is only animated if nomacs is fullscreen"));
	cbAlwaysAnimate->setChecked(Settings::param().display().alwaysAnimate);

	QLabel* displayTimeLabel = new QLabel(tr("Display Time"), this);
	
	QDoubleSpinBox* displayTimeBox = new QDoubleSpinBox(this);
//.........这里部分代码省略.........
开发者ID:Messna,项目名称:nomacs,代码行数:101,代码来源:DkPreferenceWidgets.cpp

示例8: setupUi

    void setupUi(QWidget *q)
    {
        groupBoxGeneral = new QGroupBox(q);
        groupBoxGeneral->setTitle(GdbOptionsPage::tr("General"));

        labelGdbWatchdogTimeout = new QLabel(groupBoxGeneral);
        labelGdbWatchdogTimeout->setText(GdbOptionsPage::tr("GDB timeout:"));
        labelGdbWatchdogTimeout->setToolTip(GdbOptionsPage::tr(
            "This is the number of seconds Qt Creator will wait before\n"
            "it terminates a non-responsive GDB process. The default value of 20 seconds\n"
            "should be sufficient for most applications, but there are situations when\n"
            "loading big libraries or listing source files takes much longer than that\n"
            "on slow machines. In this case, the value should be increased."));

        spinBoxGdbWatchdogTimeout = new QSpinBox(groupBoxGeneral);
        spinBoxGdbWatchdogTimeout->setToolTip(labelGdbWatchdogTimeout->toolTip());
        spinBoxGdbWatchdogTimeout->setSuffix(GdbOptionsPage::tr("sec"));
        spinBoxGdbWatchdogTimeout->setLayoutDirection(Qt::LeftToRight);
        spinBoxGdbWatchdogTimeout->setMinimum(20);
        spinBoxGdbWatchdogTimeout->setMaximum(1000000);
        spinBoxGdbWatchdogTimeout->setSingleStep(20);
        spinBoxGdbWatchdogTimeout->setValue(20);

        checkBoxSkipKnownFrames = new QCheckBox(groupBoxGeneral);
        checkBoxSkipKnownFrames->setText(GdbOptionsPage::tr("Skip known frames when stepping"));
        checkBoxSkipKnownFrames->setToolTip(GdbOptionsPage::tr(
            "Allows 'Step Into' to compress several steps into one step\n"
            "for less noisy debugging. For example, the atomic reference\n"
            "counting code is skipped, and a single 'Step Into' for a signal\n"
            "emission ends up directly in the slot connected to it."));

        checkBoxUseMessageBoxForSignals = new QCheckBox(groupBoxGeneral);
        checkBoxUseMessageBoxForSignals->setText(GdbOptionsPage::tr(
            "Show a message box when receiving a signal"));
        checkBoxUseMessageBoxForSignals->setToolTip(GdbOptionsPage::tr(
            "This will show a message box as soon as your application\n"
            "receives a signal like SIGSEGV during debugging."));

        checkBoxAdjustBreakpointLocations = new QCheckBox(groupBoxGeneral);
        checkBoxAdjustBreakpointLocations->setText(GdbOptionsPage::tr(
            "Adjust breakpoint locations"));
        checkBoxAdjustBreakpointLocations->setToolTip(GdbOptionsPage::tr(
            "GDB allows setting breakpoints on source lines for which no code \n"
            "was generated. In such situations the breakpoint is shifted to the\n"
            "next source code line for which code was actually generated.\n"
            "This option reflects such temporary change by moving the breakpoint\n"
            "markers in the source code editor."));

        checkBoxUseDynamicType = new QCheckBox(groupBoxGeneral);
        checkBoxUseDynamicType->setText(GdbOptionsPage::tr(
            "Use dynamic object type for display"));
        checkBoxUseDynamicType->setToolTip(GdbOptionsPage::tr(
            "This specifies whether the dynamic or the static type of objects will be"
            "displayed. Choosing the dynamic type might be slower."));

        checkBoxLoadGdbInit = new QCheckBox(groupBoxGeneral);
        checkBoxLoadGdbInit->setText(GdbOptionsPage::tr("Load .gdbinit file on startup"));
        checkBoxLoadGdbInit->setToolTip(GdbOptionsPage::tr(
            "This allows or inhibits reading the user's default\n"
            ".gdbinit file on debugger startup."));

        checkBoxWarnOnReleaseBuilds = new QCheckBox(groupBoxGeneral);
        checkBoxWarnOnReleaseBuilds->setText(GdbOptionsPage::tr(
            "Warn when debugging \"Release\" builds"));
        checkBoxWarnOnReleaseBuilds->setToolTip(GdbOptionsPage::tr(
            "Show a warning when starting the debugger "
            "on a binary with insufficient debug information."));

        labelDangerous = new QLabel(GdbOptionsPage::tr(
            "The options below should be used with care."));

        checkBoxTargetAsync = new QCheckBox(groupBoxGeneral);
        checkBoxTargetAsync->setText(GdbOptionsPage::tr(
            "Use asynchronous mode to control the inferior"));

        checkBoxAutoEnrichParameters = new QCheckBox(groupBoxGeneral);
        checkBoxAutoEnrichParameters->setText(GdbOptionsPage::tr(
            "Use common locations for debug information"));
        checkBoxAutoEnrichParameters->setToolTip(GdbOptionsPage::tr(
            "This adds common paths to locations of debug information\n"
            "at debugger startup."));

        checkBoxBreakOnWarning = new QCheckBox(groupBoxGeneral);
        checkBoxBreakOnWarning->setText(GdbOptionsPage::tr("Stop when a qWarning is issued"));

        checkBoxBreakOnFatal = new QCheckBox(groupBoxGeneral);
        checkBoxBreakOnFatal->setText(GdbOptionsPage::tr("Stop when a qFatal is issued"));

        checkBoxBreakOnAbort = new QCheckBox(groupBoxGeneral);
        checkBoxBreakOnAbort->setText(GdbOptionsPage::tr("Stop when abort() is called"));

        checkBoxEnableReverseDebugging = new QCheckBox(groupBoxGeneral);
        checkBoxEnableReverseDebugging->setText(GdbOptionsPage::tr("Enable reverse debugging"));
        checkBoxEnableReverseDebugging->setToolTip(GdbOptionsPage::tr(
            "<html><head/><body><p>Selecting this enables reverse debugging.</p><.p>"
            "<b>Note:</b> This feature is very slow and unstable on the GDB side."
            "It exhibits unpredictable behavior when going backwards over system "
            "calls and is very likely to destroy your debugging session.</p><body></html>"));

        checkBoxAttemptQuickStart = new QCheckBox(groupBoxGeneral);
//.........这里部分代码省略.........
开发者ID:KDE,项目名称:android-qt-creator,代码行数:101,代码来源:gdboptionspage.cpp

示例9: QMainWindow

Phraktalus::Phraktalus(QWidget *parent) :
        QMainWindow(parent),
        lastDir(QString()),
        ui(new Ui::Phraktalus),
        viewport(new GLViewPort(this)),
        ms(new ModelStacker(this)),
        dots(new QSpinBox(this)),
        statusLabel(new QLabel("Welcome to Phraktalus"))
{
    //Sets up the premade ui
    ui->setupUi(this);
    setWindowTitle(windowTitle());
    setStatusBar(new QStatusBar(this));
    statusBar()->addWidget(statusLabel);
    statusBar()->show();
    //Populate the menuBar
    ui->menuBar->addAction(ui->action_About);
    //Populate toolBars
    //File menu
    ui->toolBar->addAction(ui->action_New);
    ui->toolBar->addAction(ui->action_Open);
    ui->toolBar->addSeparator();
    //View Menu
    QSpinBox *gridPrecision = new QSpinBox(this);
    gridPrecision->setMinimum(1);
    gridPrecision->setMaximum(5);
    gridPrecision->setToolTip("Adjusts Grid precision");
    ui->toolBar->addWidget(gridPrecision);

    QAction* showGrids = new QAction(QIcon(":/icons/rule.png"), "Show Grids", this);
    showGrids->setCheckable(true);
    showGrids->setChecked(true);
    showGrids->setMenu(ui->menu_Grids);
    ui->toolBar->addAction(showGrids);

    ui->toolBar->addAction(ui->action_Show_Labels);
    ui->toolBar->addAction(ui->action_Surface);
    ui->toolBar->addAction(ui->action_Lighting);
    ui->toolBar->addAction(ui->action_Reset_Camera);
    ui->toolBar->addSeparator();
    //Process Menu
    dots->setMinimum(1);
    dots->setMaximum(4);
    dots->setToolTip("Adjusts number of visible dots");
    ui->toolBar->addWidget(dots);

    ui->toolBar->addAction(ui->action_Previous);
    connect(ms, SIGNAL(hasPrevious(bool)), ui->action_Previous, SLOT(setEnabled(bool)));
    ui->toolBar->addAction(ui->action_Next);
    connect(ms, SIGNAL(hasNext(bool)), ui->action_Next, SLOT(setEnabled(bool)));
    ui->toolBar->addAction(ui->action_Zoom);
    connect(ms, SIGNAL(isEmpty(bool)), ui->action_Zoom, SLOT(setDisabled(bool)));
    ms->emitSignals();

    ui->toolBar->setVisible(true);
    //Set main viewport
    setCentralWidget(viewport);
    //Connect actions relative to GL
    connect(ui->action_Lighting, SIGNAL(toggled(bool)), viewport, SLOT(setLighting(bool)));
    connect(ui->action_Reset_Camera, SIGNAL(triggered()), viewport, SLOT(resetCamera()));
    connect(ui->action_Horizontal, SIGNAL(toggled(bool)), viewport, SLOT(showHorizontalGrid(bool)));
    connect(ui->action_Vertical, SIGNAL(toggled(bool)), viewport, SLOT(showVerticalGrid(bool)));
    connect(ui->action_Surface, SIGNAL(toggled(bool)), viewport, SLOT(showSurface(bool)));
    connect(gridPrecision, SIGNAL(valueChanged(int)), viewport, SLOT(setGridPrecision(int)));
    connect(ui->action_Show_Labels, SIGNAL(toggled(bool)), viewport, SLOT(showLabels(bool)));
    connect(ms, SIGNAL(topChanged(ElevationModel*)), viewport, SLOT(setModel(ElevationModel*)));
    connect(ms, SIGNAL(topChanged(ElevationModel*)), this, SLOT(onTopChanged(ElevationModel*)));
    //Zoom region
    connect(ui->action_Zoom, SIGNAL(toggled(bool)), viewport, SLOT(zoomModeEnable(bool)));
    connect(viewport, SIGNAL(doZoom(uint,uint,uint)), this, SLOT(zoomHandle(uint, uint, uint)));
    connect(showGrids, SIGNAL(toggled(bool)), ui->action_Vertical, SLOT(setChecked(bool)));
    connect(showGrids, SIGNAL(toggled(bool)), ui->action_Horizontal, SLOT(setChecked(bool)));

    gridPrecision->setValue(GRIDPRECISION);
    dots->setValue(VISIBLEDOTS);
}
开发者ID:matiasjrossi,项目名称:phraktalus,代码行数:76,代码来源:phraktalus.cpp

示例10: QMainWindow

QSofaMainWindow::QSofaMainWindow(QWidget *parent) :
    QMainWindow(parent)
{
    setFocusPolicy(Qt::ClickFocus);

    mainViewer = new QSofaViewer(&sofaScene,this);
    setCentralWidget(mainViewer);

    QToolBar* toolbar = addToolBar(tr("Controls"));
    QMenu* fileMenu = menuBar()->addMenu(tr("&File"));
    QMenu* simulationMenu = menuBar()->addMenu(tr("&Simulation"));
    QMenu* viewMenu = menuBar()->addMenu(tr("&View"));

    // find icons at https://www.iconfinder.com/search

    // start/stop
    {
        _playPauseAct = new QAction(QIcon(":/icons/start.svg"), tr("&Play..."), this);
        _playPauseAct->setIcon(this->style()->standardIcon(QStyle::SP_MediaPlay));
        _playPauseAct->setShortcut(QKeySequence(Qt::Key_Space));
        _playPauseAct->setToolTip(tr("Play/Pause simulation"));
        connect(_playPauseAct, SIGNAL(triggered()), &sofaScene, SLOT(playpause()));
        connect(&sofaScene, SIGNAL(sigPlaying(bool)), this, SLOT(isPlaying(bool)) );
        this->addAction(_playPauseAct);
        simulationMenu->addAction(_playPauseAct);
        toolbar->addAction(_playPauseAct);
    }

    // reset
    {
        QAction* resetAct = new QAction(QIcon(":/icons/reset.svg"), tr("&Reset..."), this);
        resetAct->setIcon(this->style()->standardIcon(QStyle::SP_MediaSkipBackward));
        resetAct->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_R));
        resetAct->setToolTip(tr("Restart from the beginning, without reloading"));
        connect(resetAct, SIGNAL(triggered()), &sofaScene, SLOT(reset()));
        this->addAction(resetAct);
        simulationMenu->addAction(resetAct);
        toolbar->addAction(resetAct);
    }

    // open
    {
        QAction* openAct = new QAction(QIcon(":/icons/reset.svg"), tr("&Open..."), this);
        openAct->setIcon(this->style()->standardIcon(QStyle::SP_FileIcon));
        openAct->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_O));
        openAct->setToolTip(tr("Open new scene"));
        openAct->setStatusTip(tr("Opening scene…"));
        connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
        this->addAction(openAct);
        fileMenu->addAction(openAct);
        toolbar->addAction(openAct);
    }

    // time step
    {
        QSpinBox* spinBox = new QSpinBox(this);
        toolbar->addWidget(spinBox);
        spinBox->setValue(40);
        spinBox->setMaxValue(40000);
        spinBox->setToolTip(tr("Simulation time step (ms)"));
        connect(spinBox,SIGNAL(valueChanged(int)), this, SLOT(setDt(int)));
    }

    // reload
    {
        QAction* reloadAct = new QAction(QIcon(":/icons/reload.svg"), tr("&Reload..."), this);
        reloadAct->setIcon(this->style()->standardIcon(QStyle::SP_BrowserReload));
        reloadAct->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_R));
        reloadAct->setStatusTip(tr("Reloading scene…"));
        reloadAct->setToolTip(tr("Reload file and restart from the beginning"));
        connect(reloadAct, SIGNAL(triggered()), &sofaScene, SLOT(reload()));
        this->addAction(reloadAct);
        fileMenu->addAction(reloadAct);
        toolbar->addAction(reloadAct);
    }

    // viewAll
    {
        QAction* viewAllAct = new QAction(QIcon(":/icons/eye.svg"), tr("&ViewAll..."), this);
        viewAllAct->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_V));
        viewAllAct->setToolTip(tr("Adjust camera to view all"));
        connect(viewAllAct, SIGNAL(triggered()), mainViewer, SLOT(viewAll()));
        this->addAction(viewAllAct);
        simulationMenu->addAction(viewAllAct);
        toolbar->addAction(viewAllAct);
    }

    // print
    {
        QAction* printAct = new QAction( QIcon(":/icons/print.svg"), tr("&PrintGraph..."), this);
        printAct->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_P));
        printAct->setToolTip(tr("Print the graph on the standard output"));
        connect(printAct, SIGNAL(triggered()), &sofaScene, SLOT(printGraph()));
        this->addAction(printAct);
        simulationMenu->addAction(printAct);
        toolbar->addAction(printAct);
    }

//    {
//        QAction* toggleFullScreenAct = new QAction( tr("&FullScreen"), this );
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例11: settings

TimeControls::TimeControls(QWidget* parent) : QToolBar(parent) {

	QSettings settings("Pencil","Pencil");

	//QFrame* frame = new QFrame();

	QSpinBox* fpsBox = new QSpinBox();
	//fpsBox->setFixedWidth(50);
	fpsBox->setFont( QFont("Helvetica", 10) );
	fpsBox->setFixedHeight(22);
	fpsBox->setValue(settings.value("fps").toInt());
	fpsBox->setMinimum(1);
	fpsBox->setMaximum(50);
	fpsBox->setToolTip("Frames per second");
	fpsBox->setFocusPolicy(Qt::NoFocus);

	QPushButton* playButton = new QPushButton();
	loopButton = new QPushButton();
	soundButton = new QPushButton();
	QLabel* separator = new QLabel();
	separator->setPixmap(QPixmap(":icons/controls/separator.png"));
	separator->setFixedSize(QSize(37,31));
	QLabel* spacingLabel = new QLabel(""); spacingLabel->setIndent(6);
	QLabel* fpsLabel = new QLabel(tr("Fps: ")); fpsLabel->setIndent(6);

	QIcon playIcon(":icons/controls/play.png");
	QIcon loopIcon(":icons/controls/loop.png");
	QIcon soundIcon(":icons/controls/sound.png");
#ifdef Q_WS_MAC
	/*loopButton->setFixedSize( QSize(35,30) );
	loopButton->setIconSize( QSize(35,30) );
	loopIcon.addFile (":icons/controls/loopOn.png", QSize(35,20), QIcon::Normal, QIcon::On );
	loopIcon.addFile (":icons/controls/loopOff.png", QSize(35,20), QIcon::Normal, QIcon::Off);
	loopIcon.addFile (":icons/controls/loopOn.png", QSize(35,20), QIcon::Disabled, QIcon::On );
	loopIcon.addFile (":icons/controls/loopOff.png", QSize(35,20), QIcon::Disabled, QIcon::Off);
	loopIcon.addFile (":icons/controls/loopOn.png", QSize(35,20), QIcon::Active, QIcon::On );
	loopIcon.addFile (":icons/controls/loopOff.png", QSize(35,20), QIcon::Active, QIcon::Off);*/
#endif
	playButton->setIcon(playIcon);
	loopButton->setIcon(loopIcon);
	soundButton->setIcon(soundIcon);

	playButton->setToolTip(tr("Play"));
	loopButton->setToolTip(tr("Loop"));
	soundButton->setToolTip(tr("Sound on/off"));

	loopButton->setCheckable(true);
	soundButton->setCheckable(true);
	soundButton->setChecked(true);

	addWidget(separator);
	addWidget(playButton);
	addWidget(loopButton);
	addWidget(soundButton);
	addWidget(fpsLabel);
	addWidget(fpsBox);
	
	/*QHBoxLayout* frameLayout = new QHBoxLayout();
	frameLayout->setMargin(0);
	frameLayout->setSpacing(0);
	frameLayout->addWidget(separator);
	frameLayout->addWidget(playButton);
	frameLayout->addWidget(loopButton);
	frameLayout->addWidget(soundButton);
	frameLayout->addWidget(fpsLabel);
	frameLayout->addWidget(fpsBox);
	frameLayout->addWidget(spacingLabel);
	
	setLayout(frameLayout);
	setFixedSize(300,32);*/
	
	//QHBoxLayout* layout = new QHBoxLayout();
	//layout->setAlignment(Qt::AlignRight);
	//layout->addWidget(frame);
	//layout->setMargin(0);
	//layout->setSizeConstraint(QLayout::SetNoConstraint);
	
	//setLayout(frameLayout);
	
	connect(playButton, SIGNAL(clicked()), this, SIGNAL(playClick()));
	connect(loopButton, SIGNAL(clicked()), this, SIGNAL(loopClick()));
	connect(soundButton, SIGNAL(clicked()), this, SIGNAL(soundClick()));
	connect(fpsBox,SIGNAL(valueChanged(int)), this, SIGNAL(fpsClick(int)));
	
	//updateButtons(false);
}
开发者ID:kushdua,项目名称:ece1724-pencil,代码行数:86,代码来源:timecontrols.cpp

示例12: comBox

void DeviceWizardOptions::comBox()
{
    QGroupBox *gbCom = new QGroupBox();
    gbCom->setTitle("Communication");
    gbCom->setLayout(new QVBoxLayout());
    this->layout()->addWidget(gbCom);

    this->comPort = new QComboBox();

    this->comPort->setToolTip(
        "Choose the port to which your device is connected");
    gbCom->layout()->addWidget(this->comPort);

    QGridLayout *baudFlowDBits = new QGridLayout();
    dynamic_cast<QVBoxLayout *>(gbCom->layout())->addLayout(baudFlowDBits);

    QLabel *baudLabel = new QLabel("Baud Rate");
    QComboBox *baudBox = new QComboBox();
    baudBox->addItems(
        {"1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200"});
    baudBox->setCurrentText("9600");
    baudFlowDBits->addWidget(baudLabel, 0, 0);
    baudFlowDBits->addWidget(baudBox, 1, 0);

    QLabel *flowctlLabel = new QLabel("Flow Control");
    QComboBox *flowctlBox = new QComboBox();
    flowctlBox->addItems(
        {"No flow control", "Hardware flow control", "Software flow control"});
    flowctlBox->setCurrentIndex(0);
    baudFlowDBits->addWidget(flowctlLabel, 0, 1);
    baudFlowDBits->addWidget(flowctlBox, 1, 1);

    QLabel *dbitsLabel = new QLabel("Data Bits");
    QComboBox *dbitsBox = new QComboBox();
    dbitsBox->addItems({"5", "6", "7", "8"});
    dbitsBox->setCurrentText("8");
    baudFlowDBits->addWidget(dbitsLabel, 0, 2);
    baudFlowDBits->addWidget(dbitsBox, 1, 2);

    QLabel *parityLabel = new QLabel("Parity");
    QComboBox *parityBox = new QComboBox();
    parityBox->addItem("No Parity", 0);
    parityBox->addItem("Even Parity", 2);
    parityBox->addItem("Odd Parity", 3);
    parityBox->addItem("Space Parity", 4);
    parityBox->addItem("Mark Parity", 5);
    parityBox->setCurrentIndex(0);
    baudFlowDBits->addWidget(parityLabel, 2, 0);
    baudFlowDBits->addWidget(parityBox, 3, 0);

    QLabel *stopLabel = new QLabel("Stop Bits");
    QComboBox *stopBox = new QComboBox();
    stopBox->addItem("1", 1);
    stopBox->addItem("1.5", 3);
    stopBox->addItem("2", 2);
    stopBox->setCurrentIndex(0);
    baudFlowDBits->addWidget(stopLabel, 2, 1);
    baudFlowDBits->addWidget(stopBox, 3, 1);

    QLabel *pollingFreqLabel = new QLabel("Polling frequency");
    QComboBox *pollFreqBox = new QComboBox();
    pollFreqBox->setToolTip("Polling Frequency in Hertz");
    pollFreqBox->addItem("10 Hz", 100);
    pollFreqBox->addItem("5 Hz", 200);
    pollFreqBox->addItem("2 Hz", 500);
    pollFreqBox->addItem("1 Hz", 1000);
    pollFreqBox->addItem("0.5 Hz", 2000);
    pollFreqBox->addItem("0.2 Hz", 5000);
    pollFreqBox->addItem("0.1 Hz", 10000);
    pollFreqBox->setCurrentIndex(1);
    baudFlowDBits->addWidget(pollingFreqLabel, 4, 0);
    baudFlowDBits->addWidget(pollFreqBox, 5, 0);

    QLabel *sportTimeoutLabel = new QLabel("Serial port timeout");
    QSpinBox *sportTimeout = new QSpinBox();
    sportTimeout->setMinimum(1);
    sportTimeout->setMaximum(10000);
    sportTimeout->setSuffix("ms");
    sportTimeout->setValue(10);
    sportTimeout->setToolTip(
        "Time in Milliseconds the Serialport will wait \n"
        "for an answer from the device. Tuning this option \n"
        "might improve communication resulting in a higher \n"
        "polling frequency. If this value is to low you \n"
        "will encounter partial or complete data loss on \n"
        "the serial port connection.");
    baudFlowDBits->addWidget(sportTimeoutLabel, 4, 1);
    baudFlowDBits->addWidget(sportTimeout, 5, 1);

    // we need the comport string not index
    registerField("comPort", this->comPort, "currentText");
    registerField("baudBox", baudBox, "currentText");
    registerField("flowctlBox", flowctlBox);
    registerField("dbitsBox", dbitsBox, "currentText");
    registerField("parityBox", parityBox, "currentData");
    registerField("stopBox", stopBox, "currentData");
    registerField("pollFreqBox", pollFreqBox, "currentData");
    registerField("sportTimeout", sportTimeout);
}
开发者ID:crapp,项目名称:labpowerqt,代码行数:99,代码来源:devicewizardoptions.cpp

示例13: createLayout

void DkDisplayPreference::createLayout() {

	// zoom settings
	QCheckBox* invertZoom = new QCheckBox(tr("Invert zoom wheel behaviour"), this);
	invertZoom->setObjectName("invertZoom");
	invertZoom->setChecked(Settings::param().display().invertZoom);

	QLabel* interpolationLabel = new QLabel(tr("Show pixels if zoom level is above"), this);

	QSpinBox* sbInterpolation = new QSpinBox(this);
	sbInterpolation->setObjectName("interpolationBox");
	sbInterpolation->setToolTip(tr("nomacs will not interpolate images if the zoom level is larger."));
	sbInterpolation->setSuffix("%");
	sbInterpolation->setMinimum(0);
	sbInterpolation->setMaximum(10000);
	sbInterpolation->setValue(Settings::param().display().interpolateZoomLevel);

	DkGroupWidget* zoomGroup = new DkGroupWidget(tr("Zoom"), this);
	zoomGroup->addWidget(invertZoom);
	zoomGroup->addWidget(interpolationLabel);
	zoomGroup->addWidget(sbInterpolation);

	// keep zoom radio buttons
	QVector<QRadioButton*> keepZoomButtons;
	keepZoomButtons.resize(DkSettings::zoom_end);
	keepZoomButtons[DkSettings::zoom_always_keep] = new QRadioButton(tr("Always keep zoom"), this);
	keepZoomButtons[DkSettings::zoom_keep_same_size] = new QRadioButton(tr("Keep zoom if the size is the same"), this);
	keepZoomButtons[DkSettings::zoom_keep_same_size]->setToolTip(tr("If checked, the zoom level is only kept, if the image loaded has the same level as the previous."));
	keepZoomButtons[DkSettings::zoom_never_keep] = new QRadioButton(tr("Never keep zoom"), this);

	// check wrt the current settings
	keepZoomButtons[Settings::param().display().keepZoom]->setChecked(true);

	QButtonGroup* keepZoomButtonGroup = new QButtonGroup(this);
	keepZoomButtonGroup->setObjectName("keepZoom");
	keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_always_keep], DkSettings::zoom_always_keep);
	keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_keep_same_size], DkSettings::zoom_keep_same_size);
	keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_never_keep], DkSettings::zoom_never_keep);

	DkGroupWidget* keepZoomGroup = new DkGroupWidget(tr("When Displaying New Images"), this);
	keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_always_keep]);
	keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_keep_same_size]);
	keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_never_keep]);
	
	// icon size
	QSpinBox* sbIconSize = new QSpinBox(this);
	sbIconSize->setObjectName("iconSizeBox");
	sbIconSize->setToolTip(tr("Define the icon size in pixel."));
	sbIconSize->setSuffix(" px");
	sbIconSize->setMinimum(16);
	sbIconSize->setMaximum(1024);
	sbIconSize->setValue(Settings::param().display().iconSize);

	DkGroupWidget* iconGroup = new DkGroupWidget(tr("Icon Size"), this);
	iconGroup->addWidget(sbIconSize);

	// slideshow
	QLabel* fadeImageLabel = new QLabel(tr("Image Transition"), this);

	QDoubleSpinBox* fadeImageBox = new QDoubleSpinBox(this);
	fadeImageBox->setObjectName("fadeImageBox");
	fadeImageBox->setToolTip(tr("Define the image transition speed."));
	fadeImageBox->setSuffix(" sec");
	fadeImageBox->setMinimum(0.0);
	fadeImageBox->setMaximum(3);
	fadeImageBox->setSingleStep(.2);
	fadeImageBox->setValue(Settings::param().display().fadeSec);

	QLabel* displayTimeLabel = new QLabel(tr("Display Time"), this);

	QDoubleSpinBox* displayTimeBox = new QDoubleSpinBox(this);
	displayTimeBox->setObjectName("displayTimeBox");
	displayTimeBox->setToolTip(tr("Define the time an image is displayed."));
	displayTimeBox->setSuffix(" sec");
	displayTimeBox->setMinimum(0.0);
	displayTimeBox->setMaximum(30);
	displayTimeBox->setSingleStep(.2);
	displayTimeBox->setValue(Settings::param().slideShow().time);

	DkGroupWidget* slideshowGroup = new DkGroupWidget(tr("Slideshow"), this);
	slideshowGroup->addWidget(fadeImageLabel);
	slideshowGroup->addWidget(fadeImageBox);
	slideshowGroup->addWidget(displayTimeLabel);
	slideshowGroup->addWidget(displayTimeBox);

	// left column
	QWidget* leftWidget = new QWidget(this);
	QVBoxLayout* leftLayout = new QVBoxLayout(leftWidget);
	leftLayout->setAlignment(Qt::AlignTop);
	leftLayout->addWidget(zoomGroup);
	leftLayout->addWidget(keepZoomGroup);
	leftLayout->addWidget(iconGroup);
	leftLayout->addWidget(slideshowGroup);

	// right column
	QWidget* rightWidget = new QWidget(this);
	QVBoxLayout* rightLayout = new QVBoxLayout(rightWidget);
	rightLayout->setAlignment(Qt::AlignTop);

	QHBoxLayout* layout = new QHBoxLayout(this);
//.........这里部分代码省略.........
开发者ID:007durgesh219,项目名称:nomacs,代码行数:101,代码来源:DkPreferenceWidgets.cpp

示例14: cancel

/*!
	\brief Reset the subcontrols to reflect the data of the format scheme being edited

	The name can be a bit misleading at first, it has been chosen
	because it directly maps to the effect a "cancel" button would
	have on the widget
*/
void QFormatConfig::cancel()
{
	m_table->clearContents();

	QTime T; T.start();
	QFontDatabase database;
	QStringList fonts = database.families();
	fonts.insert(0, tr("<default>"));
	
	if ( m_currentScheme )
	{
		if (m_categories.isEmpty()) {
			QList<QString> &temp=addCategory("");
			for ( int i = 0; i < m_currentScheme->formatCount(); i++ )
				temp.append(m_currentScheme->id(i));
		}


		int n = 0;
		foreach ( const QList<QString> c, m_categories)
			n+=c.size();
		n+=m_categories.size()-1;
		m_table->setRowCount(n);

		int r = 0;
		for ( int c = 0; c < m_categories.size(); c++ ) {
			if (c!=0) {
				m_table->setItem(r, 0, new QTableWidgetItem());
				m_table->setSpan(r++, 0, 1, 13);
			}
			QTableWidgetItem *item = new QTableWidgetItem(m_categories[c][0]);
			QFont f = item->font(); f.setBold(true); item->setFont(f); item->setBackground(QApplication::palette().mid());
			m_table->setItem(r, 0, item);
			m_table->setSpan(r++, 0, 1, 13);

			for ( int f = 1; f < m_categories[c].size(); f++ ) {
				QString fid = m_categories[c][f];
				const QFormat& fmt = m_currentScheme->format(fid);

				QTableWidgetItem *item;

				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);
//.........这里部分代码省略.........
开发者ID:svn2github,项目名称:texstudio,代码行数:101,代码来源:qformatconfig.cpp


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