void StringBody::setAppearance(int appearance) { this->appearance = appearance; switch (appearance) { case PLAIN: setFlat(true); setEnabled(false); { // Use the same background color as Form's qwidget setBackgroundColor(parentWidget()->palette().active().background()); // Make sure that text is displayed with active color values QPalette curPalette = palette(); QColorGroup curActive = curPalette.active(); setPalette(QPalette(curActive, curActive, curActive)); } PAD = 0; break; case HYPERLINK: setFlat(true); setEnabled(true); PAD = 2; break; case BUTTON: setFlat(false); setEnabled(true); PAD = 5; break; } }
void TdbCustomButton::pressedConfig() { if (_bPressed) { _bPressed = !_bPressed; setFlat(false); } else { _bPressed = !_bPressed; setFlat(true); } }
// MyButton MyButton::MyButton(const QString &text, QWidget *parent) : QPushButton(text, parent) { setFlat(true); setFocusPolicy(Qt::NoFocus); connect(this, SIGNAL(clicked()), this, SLOT(onClicked())); }
TabButton::TabButton(QWidget *parent) : QPushButton(parent), isLeftBtnHold(false) { setFlat(true); setCheckable(true); setAutoExclusive(true); setAutoDefault(false); setAcceptDrops(true); parentHeight = QPushButton::sizeHint().height(); label = new QLabel(this); label->setPixmap(WulforUtil::getInstance()->getPixmap(WulforUtil::eiEDITDELETE).scaled(CLOSEPXWIDTH, CLOSEPXWIDTH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); label->setFixedSize(QSize(LABELWIDTH, LABELWIDTH)); label->setAlignment(Qt::AlignCenter | Qt::AlignVCenter); px_label = new QLabel(this); px_label->setFixedSize(QSize(LABELWIDTH, LABELWIDTH)); px_label->setAlignment(Qt::AlignCenter | Qt::AlignVCenter); installEventFilter(this); label->installEventFilter(this); updateGeometry(); }
void QgsCollapsibleGroupBox::setCollapsed( bool collapse ) { mCollapsed = collapse; if ( !isVisible() ) return; // for consistent look/spacing across platforms when collapsed if ( ! mInitFlat ) // skip if initially set to flat in Designer setFlat( collapse ); // avoid flicker in X11 QApplication::processEvents(); // set maximum height to hide contents - does this work in all envs? // setMaximumHeight( collapse ? 25 : 16777215 ); setMaximumHeight( collapse ? titleRect().bottom() + 6 : 16777215 ); mCollapseButton->setIcon( collapse ? mExpandIcon : mCollapseIcon ); // if expanding and is in a QScrollArea, scroll down to make entire widget visible if ( mShown && mScrollOnExpand && !collapse && mParentScrollArea ) { // process events so entire widget is shown QApplication::processEvents(); mParentScrollArea->ensureWidgetVisible( this ); } emit collapsedStateChanged( this ); }
ByteSourceGuiButton::ByteSourceGuiButton(ByteSourceAbstract *bytesource, GuiHelper *nguiHelper, QWidget *parent) : QPushButton(parent) { byteSource = bytesource; guiHelper = nguiHelper; guidia = nullptr; localAction = nullptr; localAction = new(std::nothrow) QAction(tr(""), this); if (localAction == nullptr) { qFatal("Cannot allocate memory for QAction X{"); } localAction->setCheckable(true); setCheckable(true); setToolTip(tr("Configuration panel")); setIcon(QIcon(":/Images/icons/configure-5.png")); setMaximumWidth(25); //setDefaultAction(localAction); setFlat(true); gui = byteSource->getGui(); if (gui != nullptr) { connect(localAction, &QAction::toggled, this, &ByteSourceGuiButton::onToggle,Qt::UniqueConnection); connect(this, &ByteSourceGuiButton::toggled, this, &ByteSourceGuiButton::onToggle,Qt::UniqueConnection); } else { localAction->setToolTip(tr("No settings available for this source")); setDisabled(true); setVisible(false); } }
SelectionButton::SelectionButton( const QString &text, Selection target, iscore::SelectionDispatcher &disp, QWidget *parent): QPushButton{text, parent}, m_dispatcher{disp} { auto icon = makeIcons(":/icons/next_on.png", ":/icons/next_off.png"); setObjectName("SelectionButton"); setIcon(icon); setStyleSheet ( "margin: 5px;" "margin-left: 10px;" "text-align: left;" "text-decoration: underline;" "border: none;" ); setFlat(true); connect(this, &QPushButton::clicked, this, [=] () { m_dispatcher.setAndCommit(target); }); }
ElementGroup::ElementGroup(std::string key, bool showLabel, boost::shared_ptr<model::ExposedModel> model, QWidget *parent) : QGroupBox(parent), m_key(key), m_model(model) { /* // setLayout(new QHBoxLayout(this)); m_model->addStateListener(m_key, this); connect(this, SIGNAL(setVisibleFromExposedModel(bool)), this, SLOT(setVisible(bool))); if(showLabel) { setTitle(prettyName(m_key, m_model).c_str()); } // Should we show ourselves? bool show; m_model->getElementValue(m_key, show); if(!show) { setVisible(false); } */ // We don't want frames setFlat(true); }
Ui::CustomButton::CustomButton(QWidget* _parent, const QString& _imageName) : QPushButton(_parent), x_(0), y_(0), xForActive_(NO_VALUE), yForActive_(NO_VALUE), align_(Qt::AlignCenter), fillColor_(QColor()) { pixmapDefault_ = QPixmap(Utils::parse_image_name(_imageName)); pixmapToDraw_ = pixmapDefault_; setFlat(true); };
TabSettingsWidget::TabSettingsWidget(QWidget *parent) : QWidget(parent), ui(new Ui::TabSettingsWidget) { ui->setupUi(this); connect(ui->insertSpaces, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged())); connect(ui->insertSpaces, SIGNAL(toggled(bool)), this, SLOT(updateWidget())); connect(ui->autoInsertSpaces, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged())); connect(ui->autoIndent, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged())); connect(ui->smartBackspace, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged())); connect(ui->tabSize, SIGNAL(valueChanged(int)), this, SLOT(slotSettingsChanged())); connect(ui->indentSize, SIGNAL(valueChanged(int)), this, SLOT(slotSettingsChanged())); connect(ui->tabKeyBehavior, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSettingsChanged())); connect(ui->continuationAlignBehavior, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSettingsChanged())); setFlat(false); }
void MacToolButton::setAutoRaise(bool enable) { m_autoRise = enable; setFlat(enable); if (enable) { setFixedSize(m_buttonFixedSize); } }
KBBTutorial::KBBTutorial(QWidget* parent) : QGroupBox(i18n("Tutorial"), parent) { m_marker = 0; m_gameWidget = 0; setMinimumSize(QSize(WIDTH, WIDTH)); setFixedWidth(WIDTH); QVBoxLayout *tutorialLayout = new QVBoxLayout(); setLayout(tutorialLayout); setFlat(true); m_progression = new QProgressBar(this); m_progression->setTextVisible(true); m_progression->setFormat("%v / %m"); m_progression->setMinimum(FIRST_STEP-1); m_progression->setMaximum(LAST_STEP); m_progression->setWhatsThis(i18n("Displays the progress of the tutorial.")); tutorialLayout->addWidget(m_progression); m_title = new QLabel(this); tutorialLayout->addWidget(m_title, 0, Qt::AlignHCenter); m_explanation = new KTextEdit(this); m_explanation->setReadOnly(true); m_explanation->setFrameStyle(QFrame::NoFrame); m_explanation->setAlignment(Qt::AlignJustify); tutorialLayout->addWidget(m_explanation); tutorialLayout->addStretch(); QHBoxLayout *actionLayout = new QHBoxLayout(); tutorialLayout->addLayout(actionLayout); QLabel* iconLabel = new QLabel(this); iconLabel->setFixedSize(24, 24); iconLabel->setPixmap(KIcon( QLatin1String( "go-next" )).pixmap(24, 24)); actionLayout->addWidget(iconLabel, 0, Qt::AlignVCenter); m_playerAction = new QLabel(this); m_playerAction->setWhatsThis(i18n("Describes what you should do to reach the next tutorial step.")); m_playerAction->setAlignment(Qt::AlignLeft); m_playerAction->setWordWrap(true); m_playerAction->setFrameStyle(QFrame::StyledPanel); m_playerAction->setStyleSheet("border-style: none"); actionLayout->addWidget(m_playerAction, 0, Qt::AlignVCenter); QHBoxLayout *buttonLayout = new QHBoxLayout(); tutorialLayout->addLayout(buttonLayout); m_buttonPrevious = new KPushButton(KIcon( QLatin1String( "go-previous") ), i18nc("Previous tutorial step", "&Previous"), this); m_buttonPrevious->setWhatsThis(i18n("Go back to the previous tutorial step.")); connect(m_buttonPrevious, SIGNAL(clicked()), this, SLOT(previousStep())); buttonLayout->addWidget(m_buttonPrevious); m_buttonNext = new KPushButton(KIcon( QLatin1String( "go-next")) , i18nc("Next tutorial step", "&Next"), this); m_buttonNext->setWhatsThis(i18n("Go to the next tutorial step.")); connect(m_buttonNext, SIGNAL(clicked()), this, SLOT(nextStep())); m_buttonNext->setDefault(true); buttonLayout->addWidget(m_buttonNext); }
FCheckabelButton::FCheckabelButton(const QString& text) { setFlat(true); setCheckable(true); setFixedSize(80, 60); setText(text); setFocusPolicy(Qt::NoFocus); setObjectName("checkable"); }
HomeButton::HomeButton(QWidget *parent) : QPushButton(parent) { changeIconOnConnectorType( Polyplexer::connectorType() ); setText(""); setIconSize( QSize(this->width(), this->height()) ); //setGeometry(0,0,160,160); setFlat( true ); }
void charicon::enterEvent(QEvent * e) { //ui->char_selector.char_selector.move(10, 10); //Courtroom.char_selector.show(); char_selector->raise(); char_selector->show(); setFlat(false); QPushButton::enterEvent(e); }
AssemblyCreateAndDrag::AssemblyCreateAndDrag( QString newType , QScriptValue newScriptValue , QPixmap newIcon , QWidget *parent) : QPushButton(parent) { scriptValue = newScriptValue; type = newType; icon = newIcon; setIcon( icon ); setFlat(true); connect( this , SIGNAL(pressed()) , this , SLOT(createAndDrag()) ); }
void ScoreButton::leaveEvent(QEvent * e) { setFlat(true); if(learningMode) { learningShow = false; setScore(score); } QPushButton::leaveEvent(e); }
void ScoreButton::enterEvent(QEvent * e) { setFlat(false); if(learningMode) { learningShow = true; setScore(score); } QPushButton::enterEvent(e); }
DetachTabButton::DetachTabButton(TabAbstract * tab) : QPushButton(tab) { curtab = tab; setIcon(QIcon(":/Images/icons/tab-duplicate-2.png")); setFlat(true); setMaximumWidth(25); setToolTip(tr("Detach/attach tab")); connect(this, SIGNAL(clicked()), curtab, SLOT(onDetach())); }
// DkTabEntryWidget -------------------------------------------------------------------- DkTabEntryWidget::DkTabEntryWidget(const QIcon& icon, const QString& text, QWidget* parent) : QPushButton(text, parent) { setObjectName("DkTabEntryWidget"); QPixmap pm = DkImage::colorizePixmap(icon.pixmap(QSize(32, 32)), QColor(255, 255, 255)); setIcon(pm); setIconSize(QSize(24, 24)); setFlat(true); setCheckable(true); }
ClearAllMarkingsButton::ClearAllMarkingsButton(ByteSourceAbstract *bytesource, QWidget *parent) : QPushButton(parent) { setIcon(QIcon(":/Images/icons/irc-close-channel.png")); setFlat(true); setMaximumWidth(25); setToolTip(tr("Clear all markings")); setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M)); byteSource = bytesource; connect(this, &ClearAllMarkingsButton::clicked, byteSource, &ByteSourceAbstract::clearAllMarkings); }
DeleteHandle::DeleteHandle( HandleItem * parent ): QPushButton(parent), m_handleItemRoot(parent), m_isHover(false) { setFixedWidth(Config::VisualAspect::widthHandleControl); setFixedHeight(Config::VisualAspect::widthHandleControl); setContentsMargins(0,0,0,0); setDefaultColor(parent->defaultColor()); setFlat(true); hide(); }
PacketRangeGroupBox::PacketRangeGroupBox(QWidget *parent) : QGroupBox(parent), pr_ui_(new Ui::PacketRangeGroupBox), range_(NULL), syntax_state_(SyntaxLineEdit::Empty) { pr_ui_->setupUi(this); setFlat(true); pr_ui_->displayedButton->setChecked(true); pr_ui_->allButton->setChecked(true); }
void TImageButton::setup() { setFlat(true); setAutoDefault(false); setIconSize(QSize(m_imageSize, m_imageSize)); setMaximumSize(m_imageSize, m_imageSize); setMinimumSize(m_imageSize, m_imageSize); m_animator = new Animation(m_imageSize); connect(m_animator->aTimer, SIGNAL(timeout()), this, SLOT(animate())); setFocusPolicy(Qt::NoFocus); }
GlyphButton::GlyphButton( QString thePix, QString theHoverPix, QString thePressed, QString thePressedHover ) : pix( thePix ), hoverPix( theHoverPix ), pPix( thePressed ), pHoverPix( thePressedHover ) { setStyleSheet( "QPushButton:flat { border: none; }" ); setCheckable( thePressed.size() && thePressedHover.size() ); setFlat( true ); setIcon( QIcon( ":/" + pix ) ); QPixmap p = QPixmap( ":/" + pix ); setIconSize( p.size() ); setGeometry( 0, 0, p.width(), p.height() ); connect( this, SIGNAL( toggled( bool ) ), this, SLOT( changedState( bool ) ) ); }
// ------------------------------------------------------------- TRasterMapsMembers::TDeleteCoordinatesButton::TDeleteCoordinatesButton( TRasterMapsDialog* Dialog_, TMapAnchor Anchor_, QHBoxLayout* Layout_, QWidget* Parent_) : QPushButton(Parent_), w_Layout(Layout_), w_Dialog(Dialog_), m_Anchor(Anchor_) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setMaximumSize(QSize(11, 11)); setFlat(true); m_Pixmap.loadFromData(qnetmap_deleteicon, sizeof(qnetmap_deleteicon)); setIcon(QIcon(m_Pixmap)); // QNM_DEBUG_CHECK(connect(this, SIGNAL(clicked()), SLOT(removeLayout()))); }
HomeButton::HomeButton( int w, int h, QWidget *parent) : QPushButton(parent) { changeIconOnConnectorType( Polyplexer::connectorType() ); setText(""); setSize( w, h); setFlat( true ); connect( Polyplexer::getInstance( this ), SIGNAL(newType(Polyplexer::ConnectorType)), this, SLOT(changeIconOnConnectorType(Polyplexer::ConnectorType))); }
myPushButton::myPushButton(QString picName,QString tipText,QWidget *parent) : QPushButton(parent) { setToolTip(tipText); setFlat(true); setWindowOpacity(0); pixmap.load(":/img/sysButton/"+picName); iconWidth=pixmap.width()/3; iconHeight=pixmap.height(); setIcon(QIcon(pixmap.copy(0,0,iconWidth,iconHeight))); setIconSize(QSize(iconWidth,iconHeight)); }
void KexiLinkButton::init() { setFlat(true); setText(QString()); setCursor(QCursor(Qt::PointingHandCursor)); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setForegroundRole(QPalette::Text); QStyleOptionButton option; option.initFrom(this); int m = style()->pixelMetric(QStyle::PM_ButtonMargin, &option, this); setFixedSize(iconSize() + QSize(m*2, m*2)); d->origIcon = KIcon(icon()); }
CSVSettings::Frame::Frame (bool isVisible, const QString &title, QWidget *parent) : mIsHorizontal (true), mLayout (new SettingLayout()), QGroupBox (title, parent) { setFlat (true); mVisibleBoxStyle = styleSheet(); if (!isVisible) setStyleSheet (sInvisibleBoxStyle); setLayout (mLayout); }