本文整理汇总了C++中colorChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ colorChanged函数的具体用法?C++ colorChanged怎么用?C++ colorChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了colorChanged函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: colorChanged
/**
*\brief Change le membre m_a . Envoie le signal colorChanged.
*/
void Color4f::changeA ( int a )
{
m_a=a/ ( float ) 100;
emit colorChanged();
}
开发者ID:matty5749,项目名称:QGLLearning,代码行数:8,代码来源:color4f.cpp
示例2: QMainWindow
TextEdit::TextEdit(QWidget *parent)
: QMainWindow(parent)
{
setToolButtonStyle(Qt::ToolButtonFollowStyle);
setupFileActions();
setupEditActions();
setupTextActions();
{
QMenu *helpMenu = new QMenu(tr("Help"), this);
menuBar()->addMenu(helpMenu);
helpMenu->addAction(tr("About"), this, SLOT(about()));
helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
}
textEdit = new QTextEdit(this);
connect(textEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)),
this, SLOT(currentCharFormatChanged(QTextCharFormat)));
connect(textEdit, SIGNAL(cursorPositionChanged()),
this, SLOT(cursorPositionChanged()));
setCentralWidget(textEdit);
textEdit->setFocus();
setCurrentFileName(QString());
fontChanged(textEdit->font());
colorChanged(textEdit->textColor());
alignmentChanged(textEdit->alignment());
connect(textEdit->document(), SIGNAL(modificationChanged(bool)),
actionSave, SLOT(setEnabled(bool)));
connect(textEdit->document(), SIGNAL(modificationChanged(bool)),
this, SLOT(setWindowModified(bool)));
connect(textEdit->document(), SIGNAL(undoAvailable(bool)),
actionUndo, SLOT(setEnabled(bool)));
connect(textEdit->document(), SIGNAL(redoAvailable(bool)),
actionRedo, SLOT(setEnabled(bool)));
setWindowModified(textEdit->document()->isModified());
actionSave->setEnabled(textEdit->document()->isModified());
actionUndo->setEnabled(textEdit->document()->isUndoAvailable());
actionRedo->setEnabled(textEdit->document()->isRedoAvailable());
connect(actionUndo, SIGNAL(triggered()), textEdit, SLOT(undo()));
connect(actionRedo, SIGNAL(triggered()), textEdit, SLOT(redo()));
actionCut->setEnabled(false);
actionCopy->setEnabled(false);
connect(actionCut, SIGNAL(triggered()), textEdit, SLOT(cut()));
connect(actionCopy, SIGNAL(triggered()), textEdit, SLOT(copy()));
connect(actionPaste, SIGNAL(triggered()), textEdit, SLOT(paste()));
connect(textEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool)));
connect(textEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool)));
#ifndef QT_NO_CLIPBOARD
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged()));
#endif
QString initialFile = "/example.html";
const QStringList args = QCoreApplication::arguments();
if (args.count() == 2)
initialFile = args.at(1);
if (!load(initialFile))
fileNew();
}
开发者ID:Giova84,项目名称:LittleWriter,代码行数:69,代码来源:textedit.cpp
示例3: colorChanged
void KisLightSource::setColor(QColor color)
{
if (m_color != color)
m_color = color;
emit colorChanged(color);
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:6,代码来源:kis_light_source.cpp
示例4: QWidget
void EnrichmentDialog::initFramePage()
{
framePage = new QWidget();
QGroupBox *gb = new QGroupBox();
QGridLayout *gl = new QGridLayout(gb);
frameBox = new QComboBox();
frameBox->addItem(tr("None"));
if (d_widget_type == Ellipse)
frameBox->addItem(tr("Line"));
else {
frameBox->addItem(tr("Rectangle"));
frameBox->addItem(tr("Shadow"));
}
connect(frameBox, SIGNAL(activated(int)), this, SLOT(frameApplyTo()));
gl->addWidget(frameBox, 0, 1);
QLabel *l1 = new QLabel("&" + tr("Shape"));
l1->setBuddy(frameBox);
gl->addWidget(l1, 0, 0);
frameColorBtn = new ColorButton();
connect(frameColorBtn, SIGNAL(colorChanged()), this, SLOT(frameApplyTo()));
gl->addWidget(frameColorBtn, 1, 1);
QLabel *l2 = new QLabel("&" + tr("Color"));
l2->setBuddy(frameColorBtn);
gl->addWidget(l2, 1, 0);
boxFrameLineStyle = new PenStyleBox();
connect(boxFrameLineStyle, SIGNAL(activated(int)), this, SLOT(frameApplyTo()));
gl->addWidget(boxFrameLineStyle, 2, 1);
QLabel *l3 = new QLabel("&" + tr("Line Style"));
l3->setBuddy(boxFrameLineStyle);
gl->addWidget(l3, 2, 0);
gl->setColumnStretch(1, 1);
boxFrameWidth = new DoubleSpinBox('f');
if (d_widget_type == Ellipse){
if (d_app)
boxFrameWidth->setLocale(d_app->locale());
boxFrameWidth->setSingleStep(0.1);
boxFrameWidth->setRange(0.1, 100);
} else {
boxFrameWidth->setRange(1, 100);
boxFrameWidth->setDecimals(0);
boxFrameWidth->setSingleStep(1.0);
}
QLabel *l4 = new QLabel("&" + tr("Width"));
l4->setBuddy(boxFrameWidth);
gl->addWidget(l4, 3, 0);
connect(boxFrameWidth, SIGNAL(valueChanged(double)), this, SLOT(frameApplyTo()));
gl->addWidget(boxFrameWidth, 3, 1);
gl->setRowStretch(4, 1);
gl->setColumnStretch(2, 1);
QVBoxLayout *vl = new QVBoxLayout();
frameDefaultBtn = new QPushButton(tr("Set As &Default"));
connect(frameDefaultBtn, SIGNAL(clicked()), this, SLOT(setFrameDefaultValues()));
vl->addWidget(frameDefaultBtn);
QLabel *l = new QLabel(tr("Apply t&o..."));
vl->addWidget(l);
frameApplyToBox = new QComboBox();
frameApplyToBox->insertItem(tr("Object"));
frameApplyToBox->insertItem(tr("Layer"));
frameApplyToBox->insertItem(tr("Window"));
frameApplyToBox->insertItem(tr("All Windows"));
vl->addWidget(frameApplyToBox);
vl->addStretch();
l->setBuddy(frameApplyToBox);
QHBoxLayout *hl = new QHBoxLayout(framePage);
hl->addWidget(gb);
hl->addLayout(vl);
tabWidget->addTab(framePage, tr( "&Frame" ) );
}
开发者ID:kuzavas,项目名称:qtiplot,代码行数:84,代码来源:EnrichmentDialog.cpp
示例5: QgsRendererV2Widget
Qgs25DRendererWidget::Qgs25DRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer )
: QgsRendererV2Widget( layer, style )
, mRenderer( nullptr )
{
if ( !layer )
return;
// the renderer only applies to point vector layers
if ( layer->geometryType() != Qgis::Polygon )
{
//setup blank dialog
QGridLayout* layout = new QGridLayout( this );
QLabel* label = new QLabel( tr( "The 2.5D renderer only can be used with polygon layers. \n"
"'%1' is not a polygon layer and cannot be rendered in 2.5D." )
.arg( layer->name() ), this );
layout->addWidget( label );
return;
}
setupUi( this );
mWallColorButton->setColorDialogTitle( tr( "Select wall color" ) );
mWallColorButton->setAllowAlpha( true );
mWallColorButton->setContext( "symbology" );
mRoofColorButton->setColorDialogTitle( tr( "Select roof color" ) );
mRoofColorButton->setAllowAlpha( true );
mRoofColorButton->setContext( "symbology" );
mShadowColorButton->setColorDialogTitle( tr( "Select shadow color" ) );
mShadowColorButton->setAllowAlpha( true );
mShadowColorButton->setContext( "symbology" );
if ( renderer )
{
mRenderer = Qgs25DRenderer::convertFromRenderer( renderer );
}
mHeightWidget->setLayer( layer );
QgsExpressionContextScope* scope = QgsExpressionContextUtils::layerScope( mLayer );
QVariant height = scope->variable( "qgis_25d_height" );
QVariant angle = scope->variable( "qgis_25d_angle" );
delete scope;
mHeightWidget->setField( height.isNull() ? "10" : height.toString() );
mAngleWidget->setValue( angle.isNull() ? 70 : angle.toDouble() );
mWallColorButton->setColor( mRenderer->wallColor() );
mRoofColorButton->setColor( mRenderer->roofColor() );
mShadowColorButton->setColor( mRenderer->shadowColor() );
mShadowEnabledWidget->setChecked( mRenderer->shadowEnabled() );
mShadowSizeWidget->setValue( mRenderer->shadowSpread() );
mWallExpositionShading->setChecked( mRenderer->wallShadingEnabled() );
connect( mAngleWidget, SIGNAL( valueChanged( int ) ), this, SLOT( updateRenderer() ) );
connect( mHeightWidget, SIGNAL( fieldChanged( QString ) ), this, SLOT( updateRenderer() ) );
connect( mWallColorButton, SIGNAL( colorChanged( QColor ) ), this, SLOT( updateRenderer() ) );
connect( mRoofColorButton, SIGNAL( colorChanged( QColor ) ), this, SLOT( updateRenderer() ) );
connect( mShadowColorButton, SIGNAL( colorChanged( QColor ) ), this, SLOT( updateRenderer() ) );
connect( mShadowEnabledWidget, SIGNAL( toggled( bool ) ), this, SLOT( updateRenderer() ) );
connect( mShadowSizeWidget, SIGNAL( valueChanged( double ) ), this, SLOT( updateRenderer() ) );
connect( mWallExpositionShading, SIGNAL( toggled( bool ) ), this, SLOT( updateRenderer() ) );
}
开发者ID:Zakui,项目名称:QGIS,代码行数:61,代码来源:qgs25drendererwidget.cpp
示例6: colorChanged
void QQuickLineItem::setColor(QColor const &color)
{
m_color = color;
this->update();
emit colorChanged();
}
开发者ID:lanixXx,项目名称:scratch,代码行数:6,代码来源:QQuickLine.cpp
示例7: switch
void TColorSelector::handleEvent(TEvent &event) {
const int width = 4;
TView::handleEvent(event);
uchar oldColor = color;
int maxCol = (selType == csBackground) ? 7 : 15;
switch (event.what) {
case evMouseDown:
do {
if (mouseInView(event.mouse.where)) {
TPoint mouse = makeLocal(event.mouse.where);
color = mouse.y * 4 + mouse.x / 3;
} else
color = oldColor;
colorChanged();
drawView();
} while (mouseEvent(event, evMouseMove));
break;
case evKeyDown:
switch (ctrlToArrow(event.keyDown.keyCode)) {
case kbLeft:
if (color > 0)
color--;
else
color = maxCol;
break;
case kbRight:
if (color < maxCol)
color++;
else
color = 0;
break;
case kbUp:
if (color > width - 1)
color -= width;
else if (color == 0)
color = maxCol;
else
color += maxCol - width;
break;
case kbDown:
if (color < maxCol - (width - 1))
color += width;
else if (color == maxCol)
color = 0;
else
color -= maxCol - width;
break;
default:
return;
}
break;
case evBroadcast:
if (event.message.command == cmColorSet) {
if (selType == csBackground)
color = event.message.infoByte >> 4;
else
color = event.message.infoByte & 0x0F;
drawView();
return ;
} else
return;
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:70,代码来源:colorsel.cpp
示例8: QWidget
void GenericTimeDataUI::initControlWidget() {
QWidget * _widget=new QWidget();//Create the widget for these controls
//setting font base dimension
QFont f=*(new QFont());
f.setPointSize(PLOTWIDGET_DEFAULT_PLOT_DIMENSION);
//Widget layout
QVBoxLayout * l=new QVBoxLayout();
l->setSizeConstraint(QLayout::SetMinimumSize);
_widget->setLayout(l);
_widget->setFont(f);
//Name the curve
QLabel * _nameLabel=new QLabel("Curve name",this);
_nameLabel->setFont(f);
_nameLabel->setAlignment(Qt::AlignCenter);
m_baseControl.lineName= new QLineEdit("m_genericTimeData->name()",this);
m_baseControl.lineName->setFont(f);
connect( m_baseControl.lineName,SIGNAL(editingFinished()), this ,SLOT(nameUpdated()));
//Show curve
m_baseControl.checkBoxShowCurve=new QCheckBox("Show curve",this);
m_baseControl.checkBoxShowCurve->setFont(f);
connect(m_baseControl.checkBoxShowCurve,SIGNAL(toggled(bool)),this,SIGNAL(showCurveUIChanged(bool)));
//Enable curve
m_baseControl.checkBoxEnableCurve=new QCheckBox("Enable curve",this);
m_baseControl.checkBoxEnableCurve->setFont(f);
connect(m_baseControl.checkBoxEnableCurve,SIGNAL(toggled(bool)),this,SIGNAL(enableCurveUIChanged(bool)));
//Curve color
m_baseControl.comboColor=new ComboBoxWidgetColor();
m_baseControl.comboColor->setFont(f);
connect(m_baseControl.comboColor, SIGNAL(colorChanged(QColor)),this,SIGNAL(colorUIChanged(QColor)));
//XML Button
m_baseControl.exportXML=new QPushButton("Export");
m_baseControl.exportXML->setFont(f);
connect(m_baseControl.exportXML ,SIGNAL(pressed()),this,SIGNAL(buttonExportXMLPressed()));
m_baseControl.importXML=new QPushButton("Import");
m_baseControl.importXML->setFont(f);
connect(m_baseControl.importXML ,SIGNAL(pressed()),this,SIGNAL(buttonImportXMLPressed()));
m_baseControl.showXML=new QPushButton("Show data");
m_baseControl.showXML->setFont(f);
// connect(m_baseControl.showXML ,SIGNAL(clicked()),this,SLOT(showXML()));
//C&P Button
m_baseControl.copy=new QPushButton("Copy");
m_baseControl.copy->setFont(f);
connect(m_baseControl.copy ,SIGNAL(pressed()),this,SIGNAL(buttonCopyPressed()));
m_baseControl.paste=new QPushButton("Paste");
m_baseControl.paste->setFont(f);
connect(m_baseControl.paste ,SIGNAL(pressed()),this,SIGNAL(buttonPastePressed()));
//Layouting XML button & C&P button
QGridLayout * _lButton=new QGridLayout();
_lButton->addWidget(m_baseControl.exportXML,0,0,1,1,Qt::AlignLeft);
_lButton->addWidget(m_baseControl.importXML,0,1,1,1,Qt::AlignLeft);
_lButton->addWidget(m_baseControl.showXML,0,2,1,1,Qt::AlignLeft);
_lButton->addWidget(m_baseControl.copy,1,0,1,1,Qt::AlignLeft);
_lButton->addWidget(m_baseControl.paste,1,1,1,1,Qt::AlignLeft);
_lButton->setSizeConstraint(QLayout::SetMaximumSize);
QWidget *_buttonWidget=new QWidget(this);
_buttonWidget->setLayout((QLayout*)_lButton);
//Lay out all the controls
l->addWidget(_nameLabel,1,Qt::AlignLeft);
l->addWidget(m_baseControl.lineName,1,Qt::AlignLeft);
l->addWidget(m_baseControl.checkBoxEnableCurve,1,Qt::AlignLeft);
l->addWidget(m_baseControl.checkBoxShowCurve,1,Qt::AlignLeft);
l->addWidget(m_baseControl.comboColor,1,Qt::AlignLeft);
l->addWidget(_buttonWidget,1,Qt::AlignLeft);
//Add the local widget to the framework widget
this->addWidget(_widget, "Generic time Controls");
}
开发者ID:lawrence-iviani,项目名称:QT_tone_generator,代码行数:81,代码来源:generictimedataui.cpp
示例9: QWidget
//.........这里部分代码省略.........
connect(toolExit, SIGNAL(clicked(bool)), this, SLOT(close()));
actionTextBold = new QAction(QIcon(":/icons/textbold.png"), tr("&Bold"), this);
actionTextBold->setShortcut(Qt::CTRL + Qt::Key_B);
QFont bold;
bold.setBold(true);
actionTextBold->setFont(bold);
connect(actionTextBold, SIGNAL(triggered()), this, SLOT(slotTextBold()));
actionTextBold->setCheckable(true);
toolBold->setDefaultAction(actionTextBold);
actionTextItalic = new QAction(QIcon(":/icons/textitalic.png"), tr("&Italic"), this);
actionTextItalic->setShortcut(Qt::CTRL + Qt::Key_I);
QFont italic;
italic.setItalic(true);
actionTextItalic->setFont(italic);
connect(actionTextItalic, SIGNAL(triggered()), this, SLOT(slotTextItalic()));
actionTextItalic->setCheckable(true);
toolItalic->setDefaultAction(actionTextItalic);
actionTextUnderline = new QAction(QIcon(":/icons/textunder.png"), tr("&Underline"), this);
actionTextUnderline->setShortcut(Qt::CTRL + Qt::Key_U);
QFont underline;
underline.setUnderline(true);
actionTextUnderline->setFont(underline);
connect(actionTextUnderline, SIGNAL(triggered()), this, SLOT(slotTextUnderline()));
actionTextUnderline->setCheckable(true);
toolUnder->setDefaultAction(actionTextUnderline);
QPixmap pix(24, 24);
pix.fill(Qt::black);
actionTextColor = new QAction(pix, tr("&Color..."), this);
connect(actionTextColor, SIGNAL(triggered()), this, SLOT(slotTextColor()));
toolColor->setDefaultAction(actionTextColor);
comboStyle->addItem("standard");
comboStyle->addItem("Bullet List (Disc)");
comboStyle->addItem("Bullet List (Circle)");
comboStyle->addItem("Bullet List (Square)");
comboStyle->addItem("Ordered List (Decimal)");
comboStyle->addItem("Ordered List (Alpha lower)");
comboStyle->addItem("Ordered List (Alpha upper)");
connect(comboStyle, SIGNAL(activated(int)), this, SLOT(slotTextStyle(int)));
QAction *a;
a = actionUndo = new QAction(QIcon(":/icons/editundo.png"), tr("&Undo"), this);
a->setShortcut(QKeySequence::Undo);
toolUndo->setDefaultAction(a);
a = actionRedo = new QAction(QIcon(":/icons/editredo.png"), tr("&Redo"), this);
a->setShortcut(QKeySequence::Redo);
toolRedo->setDefaultAction(a);
a = actionCut = new QAction(QIcon(":/icons/editcut.png"), tr("Cu&t"), this);
a->setShortcut(QKeySequence::Cut);
toolCut->setDefaultAction(a);
a = actionCopy = new QAction(QIcon(":/icons/editcopy.png"), tr("&Copy"), this);
a->setShortcut(QKeySequence::Copy);
toolCopy->setDefaultAction(a);
a = actionPaste = new QAction(QIcon(":/icons/editpaste.png"), tr("&Paste"), this);
a->setShortcut(QKeySequence::Paste);
toolPaste->setDefaultAction(a);
actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty());
actionUndo->setEnabled(textEdit->document()->isUndoAvailable());
actionRedo->setEnabled(textEdit->document()->isRedoAvailable());
connect(textEdit->document(), SIGNAL(undoAvailable(bool)), actionUndo, SLOT(setEnabled(bool)));
connect(textEdit->document(), SIGNAL(redoAvailable(bool)), actionRedo, SLOT(setEnabled(bool)));
connect(actionUndo, SIGNAL(triggered()), textEdit, SLOT(undo()));
connect(actionRedo, SIGNAL(triggered()), textEdit, SLOT(redo()));
actionCut->setEnabled(false);
actionCopy->setEnabled(false);
connect(actionCut, SIGNAL(triggered()), textEdit, SLOT(cut()));
connect(actionCopy, SIGNAL(triggered()), textEdit, SLOT(copy()));
connect(actionPaste, SIGNAL(triggered()), textEdit, SLOT(paste()));
connect(textEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool)));
connect(textEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool)));
connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slotClipboardDataChanged()));
textEdit->setFocus();
colorChanged(textEdit->textColor());
SETTINGS;
checkGeoCache->setChecked(cfg.value("diary/showGeoCaches", false).toBool());
connect(checkGeoCache, SIGNAL(clicked()), this, SLOT(slotIntReload()));
checkProfile->setChecked(cfg.value("diary/showProfiles", true).toBool());
connect(checkProfile, SIGNAL(clicked()), this, SLOT(slotIntReload()));
checkAddMap->setChecked(cfg.value("diary/addMapView", true).toBool());
}
开发者ID:Nikoli,项目名称:qlandkartegt,代码行数:101,代码来源:CDiaryEdit.cpp
示例10: ui
MainWindow::MainWindow()
: ui(new Ui::MainWindow),
editPalette(palette()),
previewPalette(palette()),
previewstyle(0)
{
ui->setupUi(this);
statusBar();
// signals and slots connections
connect(ui->fontPathLineEdit, SIGNAL(returnPressed()), SLOT(addFontpath()));
connect(ui->addFontPathButton, SIGNAL(clicked()), SLOT(addFontpath()));
connect(ui->addSubstitutionButton, SIGNAL(clicked()), SLOT(addSubstitute()));
connect(ui->browseFontPathButton, SIGNAL(clicked()), SLOT(browseFontpath()));
connect(ui->fontStyleCombo, SIGNAL(activated(int)), SLOT(buildFont()));
connect(ui->pointSizeCombo, SIGNAL(activated(int)), SLOT(buildFont()));
connect(ui->downFontpathButton, SIGNAL(clicked()), SLOT(downFontpath()));
connect(ui->downSubstitutionButton, SIGNAL(clicked()), SLOT(downSubstitute()));
connect(ui->fontFamilyCombo, SIGNAL(activated(QString)), SLOT(familySelected(QString)));
connect(ui->fileExitAction, SIGNAL(triggered()), SLOT(fileExit()));
connect(ui->fileSaveAction, SIGNAL(triggered()), SLOT(fileSave()));
connect(ui->helpAboutAction, SIGNAL(triggered()), SLOT(helpAbout()));
connect(ui->helpAboutQtAction, SIGNAL(triggered()), SLOT(helpAboutQt()));
connect(ui->mainTabWidget, SIGNAL(currentChanged(int)), SLOT(pageChanged(int)));
connect(ui->paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int)));
connect(ui->removeFontpathButton, SIGNAL(clicked()), SLOT(removeFontpath()));
connect(ui->removeSubstitutionButton, SIGNAL(clicked()), SLOT(removeSubstitute()));
connect(ui->toolBoxEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
connect(ui->doubleClickIntervalSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
connect(ui->cursorFlashTimeSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
connect(ui->wheelScrollLinesSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
connect(ui->menuEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
connect(ui->comboEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
connect(ui->toolTipEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
connect(ui->strutWidthSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
connect(ui->strutHeightSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified()));
connect(ui->effectsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified()));
connect(ui->resolveLinksCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified()));
connect(ui->fontEmbeddingCheckBox, SIGNAL(clicked()), SLOT(somethingModified()));
connect(ui->rtlExtensionsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified()));
connect(ui->inputStyleCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
connect(ui->inputMethodCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
connect(ui->guiStyleCombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString)));
connect(ui->familySubstitutionCombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString)));
connect(ui->tunePaletteButton, SIGNAL(clicked()), SLOT(tunePalette()));
connect(ui->upFontpathButton, SIGNAL(clicked()), SLOT(upFontpath()));
connect(ui->upSubstitutionButton, SIGNAL(clicked()), SLOT(upSubstitute()));
modified = true;
desktopThemeName = tr("Desktop Settings (Default)");
setWindowIcon(QPixmap(":/qt-project.org/qtconfig/images/appicon.png"));
QStringList gstyles = QStyleFactory::keys();
gstyles.sort();
ui->guiStyleCombo->addItem(desktopThemeName);
ui->guiStyleCombo->setItemData(ui->guiStyleCombo->findText(desktopThemeName),
tr("Choose style and palette based on your desktop settings."),
Qt::ToolTipRole);
ui->guiStyleCombo->addItems(gstyles);
QSettings settings(QLatin1String("QtProject"));
settings.beginGroup(QLatin1String("Qt"));
QString currentstyle = settings.value(QLatin1String("style")).toString();
if (currentstyle.isEmpty()) {
ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->findText(desktopThemeName));
currentstyle = QApplication::style()->objectName();
} else {
int index = ui->guiStyleCombo->findText(currentstyle, Qt::MatchFixedString);
if (index != -1) {
ui->guiStyleCombo->setCurrentIndex(index);
} else { // we give up
ui->guiStyleCombo->addItem(tr("Unknown"));
ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->count() - 1);
}
}
ui->buttonMainColor->setColor(palette().color(QPalette::Active, QPalette::Button));
ui->buttonWindowColor->setColor(palette().color(QPalette::Active, QPalette::Window));
connect(ui->buttonMainColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette()));
connect(ui->buttonWindowColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette()));
#ifdef Q_WS_X11
if (X11->desktopEnvironment == DE_KDE)
ui->colorConfig->hide();
else
ui->kdeNoteLabel->hide();
#else
ui->colorConfig->hide();
ui->kdeNoteLabel->hide();
#endif
QFontDatabase db;
QStringList families = db.families();
ui->fontFamilyCombo->addItems(families);
QStringList fs = families;
QStringList fs2 = QFont::substitutions();
QStringList::Iterator fsit = fs2.begin();
while (fsit != fs2.end()) {
if (!fs.contains(*fsit))
fs += *fsit;
//.........这里部分代码省略.........
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:101,代码来源:mainwindow.cpp
示例11: fontChanged
void CDiaryEdit::slotCurrentCharFormatChanged(const QTextCharFormat &format)
{
fontChanged(format.font());
colorChanged(format.foreground().color());
}
开发者ID:Nikoli,项目名称:qlandkartegt,代码行数:5,代码来源:CDiaryEdit.cpp
示例12: QWidget
ToolInstance::ToolInstance(QString filename, ToolInformation information, mcrl2::gui::qt::PersistentFileDialog* fileDialog, QWidget *parent) :
QWidget(parent),
m_filename(filename),
m_info(information),
m_fileDialog(fileDialog)
{
m_ui.setupUi(this);
connect(this, SIGNAL(colorChanged(QColor)), this, SLOT(onColorChanged(QColor)));
connect(&m_process, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(onStateChange(QProcess::ProcessState)));
connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(onStandardOutput()));
connect(&m_process, SIGNAL(readyReadStandardError()), this, SLOT(onStandardError()));
connect(m_ui.btnRun, SIGNAL(clicked()), this, SLOT(onRun()));
connect(m_ui.btnAbort, SIGNAL(clicked()), this, SLOT(onAbort()));
connect(m_ui.btnSave, SIGNAL(clicked()), this, SLOT(onSave()));
connect(m_ui.btnClear, SIGNAL(clicked()), m_ui.edtOutput, SLOT(clear()));
QFileInfo fileInfo(filename);
m_process.setWorkingDirectory(fileInfo.absoluteDir().absolutePath());
m_ui.lblDirectoryValue->setText(fileInfo.absoluteDir().absolutePath());
m_ui.lblFileValue->setText(fileInfo.fileName());
if (m_info.hasOutput())
{
QDir dir = fileInfo.absoluteDir();
QString newfile = fileInfo.baseName().append(".%1").arg(m_info.output);
int filenr = 0;
while(dir.exists(newfile))
{
filenr++;
newfile = fileInfo.baseName().append("_%1.%2").arg(filenr).arg(m_info.output);
}
m_pckFileOut = new FilePicker(m_fileDialog, m_ui.pckFileOut);
m_ui.pckFileOut->layout()->addWidget(m_pckFileOut);
m_pckFileOut->setText(newfile);
}
else
{
m_pckFileOut = NULL;
m_ui.lblFileOut->setVisible(false);
m_ui.pckFileOut->setVisible(false);
}
if (m_info.hasSecondInput())
{
m_pckFileIn = new FilePicker(m_fileDialog, m_ui.pckFileIn, false);
m_ui.pckFileIn->layout()->addWidget(m_pckFileIn);
}
else
{
m_pckFileIn = NULL;
m_ui.lblFileIn->setVisible(false);
m_ui.pckFileIn->setVisible(false);
}
QFormLayout *formLayout = new QFormLayout();
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
for (int i = 0; i < m_info.options.count(); i++)
{
ToolOption option = m_info.options.at(i);
QWidget *nameOpt = NULL;
QCheckBox* cbOpt = NULL;
QVBoxLayout *lytOpt = new QVBoxLayout();
if (option.argument.type == EnumArgument)
{
nameOpt = new QLabel("<b>"+option.nameLong+": </b>");
}
else
{
cbOpt = new QCheckBox(option.nameLong + ": ", this);
cbOpt->setChecked(option.standard);
QFont font(cbOpt->font());
font.setBold(true);
cbOpt->setFont(font);
nameOpt = cbOpt;
}
formLayout->addRow(nameOpt, lytOpt);
QLabel *lblOpt = new QLabel(option.description, this);
lblOpt->setAlignment(Qt::AlignJustify | Qt::AlignTop);
lblOpt->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
lblOpt->setWordWrap(true);
lytOpt->addWidget(lblOpt);
if (!option.hasArgument())
{
m_optionValues.append(new OptionValue(option, cbOpt));
}
else
{
switch (option.argument.type)
{
case StringArgument:
case LevelArgument:
case IntegerArgument:
case RealArgument:
//.........这里部分代码省略.........
开发者ID:gijskant,项目名称:mcrl2-pmc,代码行数:101,代码来源:toolinstance.cpp
示例13: qreal
void WeatherWallpaper::showAdvancedDialog()
{
if (m_advancedDialog == 0) {
m_advancedDialog = new KDialog;
m_advancedUi.setupUi(m_advancedDialog->mainWidget());
m_advancedDialog->mainWidget()->layout()->setMargin(0);
m_advancedDialog->setCaption(i18n("Advanced Wallpaper Settings"));
m_advancedDialog->setButtons(KDialog::Ok | KDialog::Cancel);
qreal ratio = m_size.isEmpty() ? 1.0 : m_size.width() / qreal(m_size.height());
m_model = new BackgroundListModel(ratio, this, m_advancedDialog);
m_model->setResizeMethod(m_resizeMethod);
m_model->setWallpaperSize(m_size);
m_model->reload(m_usersWallpapers);
m_advancedUi.m_wallpaperView->setModel(m_model);
m_advancedUi.m_wallpaperView->setItemDelegate(new BackgroundDelegate(m_advancedUi.m_wallpaperView->view(),
ratio, m_advancedDialog));
m_advancedUi.m_wallpaperView->view()->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
connect(m_advancedUi.m_conditionCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(conditionChanged(int)));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-clear" )), i18nc("weather condition", "Clear"), QLatin1String( "weather-clear" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-few-clouds" )), i18n("Partly Cloudy"), QLatin1String( "weather-few-clouds" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-clouds") ), i18n("Cloudy"), QLatin1String( "weather-clouds") );
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-many-clouds") ), i18n("Very Cloudy"), QLatin1String( "weather-many-clouds") );
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-showers") ), i18n("Showering"), QLatin1String( "weather-showers") );
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-showers-scattered") ), i18n("Scattered Showers"), QLatin1String( "weather-showers-scattered" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-showers") ), i18n("Rainy"), QLatin1String( "weather-rain") );
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-mist") ), i18n("Misty"), QLatin1String( "weather-mist") );
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-storm") ), i18n("Storming"), QLatin1String( "weather-storm" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-hail") ), i18n("Hailing"), QLatin1String( "weather-hail" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-snow") ), i18n("Snowing"), QLatin1String( "weather-snow" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-snow-scattered") ), i18n("Scattered Snow"), QLatin1String( "weather-snow-scattered" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-few-clouds-night") ), i18n("Partly Cloudy Night"), QLatin1String( "weather-few-clouds-night" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-clouds-night") ), i18n("Cloudy Night"), QLatin1String( "weather-clouds-night" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-clear-night") ), i18n("Clear Night"), QLatin1String( "weather-clear-night" ));
m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-snow-rain") ), i18n("Mixed Precipitation"), QLatin1String( "weather-snow-rain" ));
// Set to the current weather condition
m_advancedUi.m_conditionCombo->setCurrentIndex(m_advancedUi.m_conditionCombo->findData(m_condition));
connect(m_advancedUi.m_wallpaperView, SIGNAL(currentIndexChanged(int)), this, SLOT(pictureChanged(int)));
m_advancedUi.m_pictureUrlButton->setIcon(KIcon(QLatin1String( "document-open" )));
connect(m_advancedUi.m_pictureUrlButton, SIGNAL(clicked()), this, SLOT(showFileDialog()));
m_advancedUi.m_emailLine->setTextInteractionFlags(Qt::TextSelectableByMouse);
m_advancedUi.m_resizeMethod->addItem(i18n("Scaled & Cropped"), ScaledAndCroppedResize);
m_advancedUi.m_resizeMethod->addItem(i18n("Scaled"), ScaledResize);
m_advancedUi.m_resizeMethod->addItem(i18n("Scaled, keep proportions"), MaxpectResize);
m_advancedUi.m_resizeMethod->addItem(i18n("Centered"), CenteredResize);
m_advancedUi.m_resizeMethod->addItem(i18n("Tiled"), TiledResize);
m_advancedUi.m_resizeMethod->addItem(i18n("Center Tiled"), CenterTiledResize);
for (int i = 0; i < m_advancedUi.m_resizeMethod->count(); ++i) {
if (m_resizeMethod == m_advancedUi.m_resizeMethod->itemData(i).value<int>()) {
m_advancedUi.m_resizeMethod->setCurrentIndex(i);
break;
}
}
connect(m_advancedUi.m_resizeMethod, SIGNAL(currentIndexChanged(int)),
this, SLOT(positioningChanged(int)));
m_advancedUi.m_color->setColor(m_color);
m_advancedUi.m_newStuff->setIcon(KIcon(QLatin1String( "get-hot-new-stuff" )));
connect(m_advancedUi.m_color, SIGNAL(changed(QColor)), this, SLOT(colorChanged(QColor)));
}
开发者ID:fluxer,项目名称:kde-extraapps,代码行数:67,代码来源:weatherwallpaper.cpp
示例14: QDialog
DialogSpectrumTemplate::DialogSpectrumTemplate(Qpx::Spectrum::Template newTemplate,
std::vector<Qpx::Detector> current_dets,
bool edit, QWidget *parent) :
QDialog(parent),
current_dets_(current_dets),
ui(new Ui::DialogSpectrumTemplate)
{
ui->setupUi(this);
for (auto &q : Qpx::Spectrum::Factory::getInstance().types())
ui->comboType->addItem(QString::fromStdString(q));
ui->colPicker->setStandardColors();
connect(ui->colPicker, SIGNAL(colorChanged(QColor)), this, SLOT(colorChanged(QColor)));
QRegExp rx("^\\w*$");
QValidator *validator = new QRegExpValidator(rx, this);
ui->lineName->setValidator(validator);
if (edit) {
myTemplate = newTemplate;
ui->lineName->setEnabled(false);
ui->comboType->setEnabled(false);
Qpx::Spectrum::Template *newtemp = Qpx::Spectrum::Factory::getInstance().create_template(newTemplate.type);
if (newtemp != nullptr) {
myTemplate.description = newtemp->description;
myTemplate.input_types = newtemp->input_types;
myTemplate.output_types = newtemp->output_types;
} else
PL_WARN << "Problem with spectrum type. Factory cannot make template for " << newTemplate.type;
} else {
Qpx::Spectrum::Template *newtemp = Qpx::Spectrum::Factory::getInstance().create_template(ui->comboType->currentText().toStdString());
if (newtemp != nullptr) {
myTemplate = *newtemp;
size_t sz = current_dets_.size();
Qpx::Setting pattern;
pattern = myTemplate.generic_attributes.get(Qpx::Setting("pattern_coinc"));
pattern.value_pattern.resize(sz);
myTemplate.generic_attributes.replace(pattern);
pattern = myTemplate.generic_attributes.get(Qpx::Setting("pattern_anti"));
pattern.value_pattern.resize(sz);
myTemplate.generic_attributes.replace(pattern);
pattern = myTemplate.generic_attributes.get(Qpx::Setting("pattern_add"));
pattern.value_pattern.resize(sz);
myTemplate.generic_attributes.replace(pattern);
myTemplate.match_pattern.resize(sz);
myTemplate.add_pattern.resize(sz);
} else
PL_WARN << "Problem with spectrum type. Factory cannot make template for " << ui->comboType->currentText().toStdString();
myTemplate.appearance = generateColor().rgba();
}
table_model_.eat(&myTemplate.generic_attributes);
ui->tableGenericAttrs->setModel(&table_model_);
ui->tableGenericAttrs->setItemDelegate(&special_delegate_);
ui->tableGenericAttrs->verticalHeader()->hide();
ui->tableGenericAttrs->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
ui->tableGenericAttrs->horizontalHeader()->setStretchLastSection(true);
ui->tableGenericAttrs->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
ui->tableGenericAttrs->setSelectionMode(QAbstractItemView::SingleSelection);
ui->tableGenericAttrs->show();
updateData();
ui->tableGenericAttrs->resizeColumnsToContents();
}
开发者ID:ayuzer,项目名称:qpx-gamma,代码行数:70,代码来源:dialog_spectra_templates.cpp
示例15: fontChanged
void MainWindow::currentCharFormatChanged(const QTextCharFormat &format)
{
fontChanged(format.font());
colorChanged(format.foreground().color());
}
开发者ID:BerndWollenweber,项目名称:PollenCALC,代码行数:5,代码来源:mainwindow.cpp
示例16: colorChanged
void ColorWidget::colorChangedSlot(QColor color)
{
m_color = color;
emit colorChanged(m_color);
update();
}
开发者ID:Nvveen,项目名称:sproxel,代码行数:6,代码来源:PreferencesDialog.cpp
示例17: mBlogId
/** Constructor */
CreateBlogMsg::CreateBlogMsg(std::string cId ,QWidget* parent, Qt::WFlags flags)
: mBlogId(cId), QMainWindow (parent, flags)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
setupFileActions();
setupEditActions();
setupViewActions();
setupInsertActions();
setupParagraphActions();
setAcceptDrops(true);
setStartupText();
newBlogMsg();
ui.toolBar_2->addAction(ui.actionIncreasefontsize);
ui.toolBar_2->addAction(ui.actionDecreasefontsize);
ui.toolBar_2->addAction(ui.actionBlockquoute);
ui.toolBar_2->addAction(ui.actionOrderedlist);
ui.toolBar_2->addAction(ui.actionUnorderedlist);
ui.toolBar_2->addAction(ui.actionBlockquoute);
ui.toolBar_2->addAction(ui.actionCode);
ui.toolBar_2->addAction(ui.actionsplitPost);
setupTextActions();
connect(ui.actionPublish, SIGNAL(triggered()), this, SLOT(sendMsg()));
connect(ui.actionNew, SIGNAL(triggered()), this, SLOT (fileNew()));
connect(ui.actionIncreasefontsize, SIGNAL (triggered()), this, SLOT (fontSizeIncrease()));
connect(ui.actionDecreasefontsize, SIGNAL (triggered()), this, SLOT (fontSizeDecrease()));
connect(ui.actionBlockquoute, SIGNAL (triggered()), this, SLOT (blockQuote()));
connect(ui.actionCode, SIGNAL (triggered()), this, SLOT (toggleCode()));
connect(ui.actionsplitPost, SIGNAL (triggered()), this, SLOT (addPostSplitter()));
connect(ui.actionOrderedlist, SIGNAL (triggered()), this, SLOT (addOrderedList()));
connect(ui.actionUnorderedlist, SIGNAL (triggered()), this, SLOT (addUnorderedList()));
//connect(webView, SIGNAL(loadFinished(bool)),this, SLOT(updateTextEdit()));
connect( ui.msgEdit, SIGNAL( textChanged(const QString &)), this, SLOT(updateTextEdit()));
connect( ui.msgEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)),
this, SLOT(currentCharFormatChanged(QTextCharFormat)));
connect( ui.msgEdit, SIGNAL(cursorPositionChanged()),
this, SLOT(cursorPositionChanged()));
QPalette palette = QApplication::palette();
codeBackground = palette.color( QPalette::Active, QPalette::Midlight );
fontChanged(ui.msgEdit->font());
colorChanged(ui.msgEdit->textColor());
alignmentChanged(ui.msgEdit->alignment());
connect( ui.msgEdit->document(), SIGNAL(modificationChanged(bool)),
actionSave, SLOT(setEnabled(bool)));
connect( ui.msgEdit->document(), SIGNAL(modificationChanged(bool)),
this, SLOT(setWindowModified(bool)));
connect(
|
请发表评论