コード例 #1
0
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();
}
コード例 #2
0
/*!
  Constructs a QtColorPicker widget. The popup will display a grid
  with \a cols columns, or if \a cols is -1, the number of columns
  will be calculated automatically.

  If \a enableColorDialog is true, the popup will also have a "More"
  button (signified by an ellipsis "...") that presents a
  QColorDialog when clicked.

  After constructing a QtColorPicker, call insertColor() to add
  individual colors to the popup grid, or call setStandardColors()
  to add all the standard colors in one go.

  The \a parent argument is passed to QFrame's constructor.

  \sa QFrame
*/
QtColorPicker::QtColorPicker(QWidget *parent,
                             int cols, bool enableColorDialog)
    :  QPushButton(parent), popup(0), withColorDialog(enableColorDialog), _labels(false)
{
    setFocusPolicy(Qt::StrongFocus);
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    setAutoDefault(false);
    setAutoFillBackground(true);
    setCheckable(true);

    // Set text
    setText(tr("Black"));
    firstInserted = false;

    // Create and set icon
    col = Qt::black;
    dirty = true;

    // Create color grid popup and connect to it.
    popup = new ColorPickerPopup(this, cols, withColorDialog, this);
    connect(popup, SIGNAL(selected(const QColor &)),
            SLOT(setCurrentColor(const QColor &)));
    connect(popup, SIGNAL(hid()), SLOT(popupClosed()));

    // Connect this push button's pressed() signal.
    connect(this, SIGNAL(toggled(bool)), SLOT(buttonPressed(bool)));
}
コード例 #3
0
ファイル: image_button.cpp プロジェクト: deycrypt/focuswriter
ImageButton::ImageButton(QWidget* parent)
    : QPushButton(parent)
{
    setAutoDefault(false);
    setIconSize(QSize(100, 100));
    unsetImage();
    connect(this, SIGNAL(clicked()), this, SLOT(onClicked()));
}
コード例 #4
0
ファイル: pickboardcfg.cpp プロジェクト: Artox/qtmoko
LetterButton::LetterButton(const QChar& letter, QWidget* parent) :
        QPushButton(QString(letter),parent)
{
    setCheckable(true);
    setAutoDefault(false);
    connect(this,SIGNAL(clicked()),this,SLOT(toggleCase()));
    skip=true;
}
コード例 #5
0
ファイル: tdmshutdown.cpp プロジェクト: Fat-Zer/tdebase
KSMPushButton::KSMPushButton( const KGuiItem &item,
					    TQWidget *parent,
					    const char *name)
  : KPushButton( item, parent, name),
    m_pressed(false)
{
	setDefault( false );
	setAutoDefault ( false );	
}
コード例 #6
0
ファイル: colorbutton.cpp プロジェクト: akosipc/ckb
ColorButton::ColorButton(QWidget* parent, bool allowAlpha) :
    QPushButton(parent), _alpha(allowAlpha)
{
    // Pick color on click (use queued connection so that any on_*_clicked() events can be processed first)
    connect(this, SIGNAL(clicked()), this, SLOT(pickColor()), Qt::QueuedConnection);
    setAutoDefault(false);
    setDefault(false);
    updateImage();
}
コード例 #7
0
ファイル: timagebutton.cpp プロジェクト: nanox/tupi
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);
}
コード例 #8
0
ファイル: UILineTextEdit.cpp プロジェクト: jeppeter/vbox
UILineTextEdit::UILineTextEdit(QWidget *pParent /* = NULL */)
  : QIWithRetranslateUI<QPushButton>(pParent)
{
    connect(this, SIGNAL(clicked()),
            this, SLOT(edit()));

    /* Don't interpret the Enter Key. */
    setAutoDefault(false);
    setDefault(false);

    setFocusPolicy(Qt::StrongFocus);
    retranslateUi();
}
コード例 #9
0
lcQColorPicker::lcQColorPicker(QWidget *parent)
	: QPushButton(parent)
{
	setFocusPolicy(Qt::StrongFocus);
	setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
	setAutoDefault(false);
	setCheckable(true);

	initialColorIndex = 0;
	currentColorIndex = 0;
	updateIcon();

	connect(this, SIGNAL(toggled(bool)), SLOT(buttonPressed(bool)));
}
コード例 #10
0
ファイル: flash.cpp プロジェクト: LibreGames/qjoypad
//Modified here (and in .h) to not have default arguments for 2 and 3.
//This caused an error with a development version of g++ on a Mandrake system
//in Sweden.
FlashButton::FlashButton(const QString &text, const QString &name, QWidget* parent )
        : QPushButton( text, parent )
{
    this->setObjectName(name);
    //record the base palette for posterity.
    flashPalette = normalPalette = palette();

    //define the palette the button will have when it flashes.
    flashPalette.setCurrentColorGroup(QPalette::Inactive);
    flashPalette.setColor(QPalette::Button, flashPalette.color(QPalette::Highlight));
    flashPalette.setColor(QPalette::ButtonText, flashPalette.color(QPalette::HighlightedText));
    flashing = false;

    setAutoDefault( false );
    setFocusPolicy(Qt::NoFocus);
    
}
コード例 #11
0
int QPushButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QAbstractButton::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 2)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 2;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = autoDefault(); break;
        case 1: *reinterpret_cast< bool*>(_v) = isDefault(); break;
        case 2: *reinterpret_cast< bool*>(_v) = isFlat(); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setAutoDefault(*reinterpret_cast< bool*>(_v)); break;
        case 1: setDefault(*reinterpret_cast< bool*>(_v)); break;
        case 2: setFlat(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 3;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
コード例 #12
0
/*!
  \param num Number of arrows
  \param arrowType see Qt::ArowType in the Qt docs.
  \param parent Parent widget
*/
QwtArrowButton::QwtArrowButton(int num,
                               Qt::ArrowType arrowType, QWidget *parent):
    QPushButton(parent)
{
    d_data = new PrivateData;
    d_data->num = qwtLim(num, 1, MaxNum);
    d_data->arrowType = arrowType;

    setAutoRepeat(true);
    setAutoDefault(false);

    switch(d_data->arrowType) {
    case Qt::LeftArrow:
    case Qt::RightArrow:
        setSizePolicy(QSizePolicy::Expanding,
                      QSizePolicy::Fixed);
        break;
    default:
        setSizePolicy(QSizePolicy::Fixed,
                      QSizePolicy::Expanding);
    }
}
コード例 #13
0
ファイル: color_button.cpp プロジェクト: barak/focuswriter
ColorButton::ColorButton(QWidget* parent)
	: QPushButton(parent)
{
	setAutoDefault(false);
	connect(this, SIGNAL(clicked()), this, SLOT(onClicked()));
}
コード例 #14
0
QFilePushButton::QFilePushButton(QLineEdit * pBuddy, const QString & strText, QWidget * parent, const char * name)
: QPushButton(strText, parent, name), m_pBuddy(pBuddy)
{
	connect(this, SIGNAL(clicked()), SLOT(slotChangeFile()));
	setAutoDefault(false);
}