Exemplo n.º 1
0
/******************************************************************************
*  Specify a widget to receive focus when the checkbox is clicked on.
*/
void CheckBox::setFocusWidget(QWidget* w, bool enable)
{
	mFocusWidget = w;
	mFocusWidgetEnable = enable;
	if (w)
		connect(this, SIGNAL(clicked()), SLOT(slotClicked()));
	else
		disconnect(this, SIGNAL(clicked()), this, SLOT(slotClicked()));
}
Exemplo n.º 2
0
void ActivityPage::slotDelete()
{
    QString name = m_pActivityLW->currentItem()->text();
    m_pStateWidget->removeActivity(name);
    m_pActivityLW->takeItem(m_pActivityLW->currentRow());
    slotClicked(0);
}
Exemplo n.º 3
0
Diamond* KDiamond::Board::spawnDiamond(int color)
{
	Diamond* diamond = new Diamond((KDiamond::Color) color, m_renderer, this);
	connect(diamond, SIGNAL(clicked()), SLOT(slotClicked()));
	connect(diamond, SIGNAL(dragged(QPoint)), SLOT(slotDragged(QPoint)));
	return diamond;
}
Exemplo n.º 4
0
CTriStateButton::CTriStateButton(QWidget *parent) :
  QToolButton(parent)
///////////////////////////////////////////////////
{
  m_state = 0;
  connect(this, SIGNAL(clicked()), this, SLOT(slotClicked()));
}
Exemplo n.º 5
0
void CBandScope::setupUi(QWidget *widget)
{
    QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    sizePolicy.setHorizontalStretch(200);
    sizePolicy.setVerticalStretch(200);
    //sizePolicy.setHeightForWidth(widget->sizePolicy().hasHeightForWidth());
    widget->setSizePolicy(sizePolicy);
    widget->setAutoFillBackground(false);
    hboxLayout = new QHBoxLayout(widget);
    xAxis = new FrequencyScaleDraw();
    qwtPlot = new QwtPlot(widget);
    qwtPlot->setSizePolicy(sizePolicy);
    qwtPlot->enableAxis(QwtPlot::yLeft,false);
    qwtPlot->setAxisAutoScale(QwtPlot::yLeft, false);
    qwtPlot->setAxisScale(QwtPlot::yLeft,0.0,50.0);
    qwtPlot->setCanvasBackground(QBrush(Qt::black));
    qwtPlot->setAxisScaleDraw(QwtPlot::xBottom, xAxis);
    qwtPlot->setAxisScale(QwtPlot::xBottom,0.0,256.0);
    qwtPlot->setAxisLabelRotation(QwtPlot::xBottom, 35.0);
    qwtPlot->setMouseTracking(true);
    qwtPlot->canvas()->setMouseTracking(true);
    picker = new MyBandPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::VLineRubberBand, QwtPicker::AlwaysOn, (QwtPlotCanvas*)qwtPlot->canvas() );
    hboxLayout->addWidget(qwtPlot);
    connect(picker, SIGNAL(selected(QPointF)), this, SLOT(slotClicked(QPointF)));
    bandscope = new QwtPlotHistogram("BandScope");
    bandscope->setStyle(QwtPlotHistogram::Columns);
    bandscope->setPen(QPen(Qt::blue));
    bandscope->setBrush(QBrush(Qt::blue,Qt::SolidPattern));
    bandscope->attach(qwtPlot);
    //qwtPlot->replot();
}
Exemplo n.º 6
0
void SplitterCollapser::slotRestore()
{
    if (!d->isVisible()) {
        slotClicked();
    }
    // else do nothing
}
Exemplo n.º 7
0
void SplitterCollapser::slotSetCollapsed(bool collapse)
{
    if (collapse == d->isVisible()) {
        slotClicked();
    }
    // else do nothing
}
Exemplo n.º 8
0
void URLNavigator::setURLEditable(bool editable)
{
    if (isURLEditable() != editable) {
        m_toggleButton->toggle();
        slotClicked();
    }
}
Exemplo n.º 9
0
bool KvsObject_checkBox::init(KviKvsRunTimeContext *,KviKvsVariantList *)
{
	QCheckBox  * cb = new QCheckBox(parentScriptWidget());
	cb->setObjectName(getName().toUtf8().data());
	setObject(cb, true);
	connect(cb,SIGNAL(toggled(bool)),this,SLOT(toggled(bool)));
	connect(widget(),SIGNAL(clicked()),this,SLOT(slotClicked()));
	return true;
}
Exemplo n.º 10
0
bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) {
    if ( e->type() == QEvent::KeyPress ) {
        QKeyEvent *k = (QKeyEvent *)e;
        if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) {
            slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0);
            return true;
        }
    }
    return false;
}
Exemplo n.º 11
0
SquareAdded::SquareAdded(const int &position, QWidget *parent) : QLabel(parent)
{ 
    this->setText(QString::number(position));
    this->setAlignment(Qt::AlignCenter);
    this->setFixedSize(100,100);
    this->setHidden(true);
    this->setAutoFillBackground(true);
    this->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);

    connect(this, SIGNAL(clicked()), this, SLOT( slotClicked()));
}
Exemplo n.º 12
0
KMultiTabBarButton::KMultiTabBarButton(const QPixmap& pic, const QString& text,
                                       int id, QWidget *parent)
	: QPushButton(QIcon(pic), text, parent), m_id(id)
{
	connect(this,SIGNAL(clicked()),this,SLOT(slotClicked()));

	// we can't see the focus, so don't take focus. #45557
	// If keyboard navigation is wanted, then only the bar should take focus,
	// and arrows could change the focused button; but generally, tabbars don't take focus anyway.
	setFocusPolicy(Qt::NoFocus);
}
Exemplo n.º 13
0
ChooseDlg::ChooseDlg(QWidget *parent) : QDialog(parent)
{
    QVBoxLayout* lay = new QVBoxLayout(this);
    lay->addWidget(_buttons[0] = new QPushButton("人机对战"));
    lay->addWidget(_buttons[1] = new QPushButton("人人对战"));
    lay->addWidget(_buttons[2] = new QPushButton("网络对战(服务端)"));
    lay->addWidget(_buttons[3] = new QPushButton("网络对战(客户端)"));

    for(int i=0; i<4; ++i)
    {
        connect(_buttons[i], SIGNAL(clicked()), this, SLOT(slotClicked()));
    }
}
Exemplo n.º 14
0
void ActivityPage::slotNewActivity()
{
    QString name = i18n("new activity");
    bool ok = Dialog_Utils::askName(i18n("New Activity"),
                                    i18n("Enter the name of the new activity:"),
                                    name);
    if (ok && name.length() > 0) {
        m_pActivityLW->addItem(name);
        m_pActivityLW->setCurrentRow(m_pActivityLW->count() - 1);
        m_pStateWidget->addActivity(name);
        slotClicked(m_pActivityLW->item(m_pActivityLW->count() - 1));
    }
}
Exemplo n.º 15
0
void EmoticonSelectorPage::setupFavouriteEmoticons()
{
	FavouriteEmoticonsDialog dlg;
	connect (&dlg, SIGNAL(doubleClicked(QString)), m_parentSelector, SLOT(slotClicked(QString)));
	if (dlg.exec() == QDialog::Accepted)
	{
		delete this->layout();
		delete emotions;

		setCurrentLayout();
		correctSize();
	}
}
KMultiTabBarButton::KMultiTabBarButton(const QString& text, QPopupMenu *popup,
		int id,QWidget *parent,KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style)
	:QPushButton(QIconSet(),text,parent),m_style(style)
{
	setText(text);
	m_position=pos;
  	if (popup) setPopup(popup);
	setFlat(true);
	setFixedHeight(24);
	setFixedWidth(24);
	m_id=id;
	QToolTip::add(this,text);
	connect(this,SIGNAL(clicked()),this,SLOT(slotClicked()));
}
Exemplo n.º 17
0
void ActivityPage::slotRename()
{
    QString name = m_pActivityLW->currentItem()->text();
    QString oldName = name;
    bool ok = Dialog_Utils::askName(i18n("Rename Activity"),
                                    i18n("Enter the new name of the activity:"),
                                    name);
    if (ok && name.length() > 0) {
        QListWidgetItem* item = m_pActivityLW->currentItem();
        item->setText(name);
        m_pStateWidget->renameActivity(oldName, name);
        slotClicked(item);
    }
}
Exemplo n.º 18
0
DialogHandoff::DialogHandoff(ATCFlight *flight, ATCSettings *settings, QWidget *parent) :
    flight(flight),
    settings(settings),
    QDialog(parent),
    ui(new Ui::DialogHandoff)
{
    ui->setupUi(this);

    setAttribute(Qt::WA_DeleteOnClose);
    setWindowFlags(Qt::FramelessWindowHint);

    dialogHandoffSetup();

    connect(ui->listView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotClicked(QModelIndex)));
}
Exemplo n.º 19
0
int LayerCheckBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QCheckBox::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: clicked((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: slotClicked(); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
Exemplo n.º 20
0
void ActivityPage::slotBottomClicked()
{
    int count = m_pActivityLW->count();
    int index = m_pActivityLW->currentRow();
    //shouldn't occur, but just in case
    if (count <= 1 || index >= count - 1)
        return;

    QListWidgetItem* item = m_pActivityLW->takeItem(index);
    m_pActivityLW->insertItem(m_pActivityLW->count(), item);
    //set the moved item selected
    m_pActivityLW->setCurrentRow(m_pActivityLW->count() - 1);

   slotClicked(m_pActivityLW->currentItem());
}
Exemplo n.º 21
0
QWidget* EmoticonSelectorPage::createEmoticonsWidget()
{
	QWidget* setWidget = new QWidget;
	QVBoxLayout* layout = new QVBoxLayout;
	layout->setSpacing(15);
	gridLayout = new QGridLayout;
	gridLayout->setHorizontalSpacing(10);

	int row = 0;
	int col = 0;
	int width = 0;

	Q_FOREACH (QString emoticonId, m_set)
	{
		const EmoticonInfo* info = theRM.emoticons().getEmoticonInfo(emoticonId);
		EmoticonWidget* w = new EmoticonWidget(info->id(), this);

		if (width + w->geometry().width() > 230)
		{
			col = 0;
			width = 0;
			row++;
		}

		w->setToolTip(info->tip());
		connect(w, SIGNAL(clicked(QString)), m_parentSelector, SLOT(slotClicked(QString)));
		gridLayout->addWidget(w, row, col);

		col++;
		width += w->geometry().width();
	}

	layout->addLayout(gridLayout);

	if (m_isFav)
	{
		QHBoxLayout* labelLayout = new QHBoxLayout;
		QLabel* settingsLabel = new QLabel("<a href=x>" + tr("Select") + "</a>");
		connect(settingsLabel, SIGNAL(linkActivated( const QString& )), this, SLOT(setupFavouriteEmoticons()));
		labelLayout->addStretch();
		labelLayout->addWidget(settingsLabel);
		layout->addLayout(labelLayout);
	}

	setWidget->setLayout(layout);

	return setWidget;
}
Exemplo n.º 22
0
CFrmGroupChatList::CFrmGroupChatList(QWidget *parent) :
    QFrame(parent),
    m_GroupList(this),
    ui(new Ui::CFrmGroupChatList)
{
    ui->setupUi(this);

    QDesktopWidget *pDesk = QApplication::desktop();
    move((pDesk->width() - width()) / 2,
         (pDesk->height() - height()) / 2);

    bool check = false;
    m_pAction = NULL;

    InitMenu();

    m_pModel = new QStandardItemModel(this);
    if(m_pModel)
    {
        //增加头,只有增加了这个后,下面才会显示内容  
        m_pModel->setHorizontalHeaderLabels(QStringList() << tr("Rooms")<< tr("Information"));
    }

    //禁止列表文本框编辑  
    m_GroupList.setEditTriggers(QAbstractItemView::NoEditTriggers);
    m_GroupList.setModel(m_pModel);
    m_GroupList.show();

    check = connect(&m_GroupList, SIGNAL(customContextMenuRequested(QPoint)),
                    SLOT(slotCustomContextMenuRequested(QPoint)));
    Q_ASSERT(check);
    
    check = connect(&CGlobal::Instance()->GetXmppClient()->m_MucManager, SIGNAL(invitationReceived(QString,QString,QString)),
                    SLOT(slotInvitationReceived(QString,QString,QString)));
    Q_ASSERT(check);

    /*check = connect(&CGlobal::Instance()->GetXmppClient()->m_MucManager, SIGNAL(roomAdded(QXmppMucRoom*)),
                    SLOT(slotRoomAdded(QXmppMucRoom*)));
    Q_ASSERT(check);*/

    check = connect(&m_GroupList, SIGNAL(clicked(QModelIndex)),
                    SLOT(slotClicked(QModelIndex)));
    Q_ASSERT(check);

    check = connect(&m_GroupList, SIGNAL(doubleClicked(QModelIndex)),
                    SLOT(slotDoubleClicked(QModelIndex)));
    Q_ASSERT(check);
}
Exemplo n.º 23
0
void ActivityPage::slotTopClicked()
{
    int count = m_pActivityLW->count();
    int index = m_pActivityLW->currentRow();
    //shouldn't occur, but just in case
    if (count <= 1 || index <= 0)
        return;

    //swap the text around in the ListBox
    QListWidgetItem* item = m_pActivityLW->takeItem(index);
    m_pActivityLW->insertItem(0, item);
    //set the moved item selected
    m_pActivityLW->setCurrentRow(0);

    slotClicked(m_pActivityLW->currentItem());
}
Exemplo n.º 24
0
void ActivityPage::slotDownClicked()
{
    int count = m_pActivityLW->count();
    int index = m_pActivityLW->currentRow();
    //shouldn't occur, but just in case
    if (count <= 1 || index >= count - 1) {
        return;
    }

    QListWidgetItem* item = m_pActivityLW->takeItem(index);
    m_pActivityLW->insertItem(index + 1, item);
    //set the moved atttribute selected
    m_pActivityLW->setCurrentRow(index + 1);

    slotClicked(m_pActivityLW->currentItem());
}
Exemplo n.º 25
0
EvaFontSelecter::EvaFontSelecter( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
	if ( !name )
		setName( "EvaFontSelecter" );
	EvaFontWindowLayout = new QGridLayout( this, 1, 1, 0, 0, "EvaFontWindowLayout");
	
	frame = new QFrame( this, "frame" );
	frame->setFrameShape( QFrame::StyledPanel );
	frame->setFrameShadow( QFrame::Raised );
	frame->setLineWidth( 1 );
	
	EvaFontSelecterLayout = new QGridLayout( frame, 1, 1, 11, 6, "EvaFontSelecterLayout"); 
	
	layout3 = new QHBoxLayout( 0, 3, 6, "layout3"); 
	
	lblColor = new QLabel( frame, "lblColor" );
	layout3->addWidget( lblColor );
	
	color = new KColorCombo( frame, "kColorButton" );
	color->setMaximumSize( QSize( 80, 32767 ) );
	layout3->addWidget( color );
	QObject::connect(color, SIGNAL(activated( const QColor & )), this, SLOT(slotClicked()));
	
	lblSize = new QLabel( frame, "lblSize" );
	layout3->addWidget( lblSize );
	
	kIntSpinBox = new KIntSpinBox( frame, "kIntSpinBox" );
	kIntSpinBox->setButtonSymbols( KIntSpinBox::UpDownArrows );
	kIntSpinBox->setMaxValue( 20 );
	kIntSpinBox->setMinValue( 8 );
	//kIntSpinBox->setValue( 9 );
	kIntSpinBox->setBase( 10 );
	layout3->addWidget( kIntSpinBox );
	
	pbOK = new QPushButton( frame, "pbOK" );
	pbOK->setMaximumSize( QSize( 32767, 50 ) );
	layout3->addWidget( pbOK );
	
	EvaFontSelecterLayout->addLayout( layout3, 0, 0 );
	EvaFontWindowLayout->addWidget( frame, 0, 0 );

	languageChange();
	resize( QSize(258, 52).expandedTo(minimumSizeHint()) );
	clearWState( WState_Polished );
	QObject::connect(pbOK, SIGNAL(clicked()), this, SLOT(slotClicked()));
}
Exemplo n.º 26
0
ListWidget::ListWidget()
	: selectedItem_(nullptr),
	  scrollValue_(0)
{
	setFillColor(DEFAULT_FILL_COLOR);
	setOutlineColor(DEFAULT_OUTLINE_COLOR);
	setOutlineThickness(DEFAULT_OUTLINE_THICKNESS);

	scrollBar_ = new ScrollBar();
	scrollBar_->signalValueChanged.connect([this] (float value) { slotScrollBarValueChanged(value); });
	scrollBar_->setSize({SCROLLBAR_WIDTH, this->getSize().y});
	scrollBar_->setParentAnchor({1, 0});
	scrollBar_->setAnchor({1, 0});
	addWidget(scrollBar_);

	signalClicked.connect([this] { slotClicked(); });
}
Exemplo n.º 27
0
ColorEditor::ColorEditor(QWidget *parent) :
    QWidget(parent), m_buttonPressed(false)
{
    m_colorIndicator = new ColorIndicator(this);
    m_colorIndicator->setColor(m_color);
    m_button = new QToolButton(this);
    m_button->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
    m_button->setText("...");
    m_button->installEventFilter(this);
    QHBoxLayout* layout = new QHBoxLayout(this);
    layout->addWidget(m_colorIndicator);
    layout->addWidget(m_button);
    layout->setSpacing(0);
    layout->setContentsMargins(1,1,1,1);
    setFocusProxy(m_button);
    setAutoFillBackground(true);
    setLayout(layout);
    connect(m_button,SIGNAL(clicked()),this,SLOT(slotClicked()));
}
Exemplo n.º 28
0
cMaterialSelector::cMaterialSelector(QWidget *parent) : QWidget(parent), CommonMyWidgetWrapper(this)
{
	layout = new QHBoxLayout(this);
	layout->setSpacing(2);
	layout->setMargin(2);

	materialWidget = new cMaterialWidget(this);
	label = new QLabel(parent);
	label->setText("test");
	layout->addWidget(materialWidget);
	layout->addWidget(label);

	defaultValue = 0;
	actualValue = 0;

	setMinimumHeight(cMaterialWidget::previewHeight);

	connect(
		materialWidget, SIGNAL(clicked(Qt::MouseButton)), this, SLOT(slotClicked(Qt::MouseButton)));
}
Exemplo n.º 29
0
int ClickableLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QLabel::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0:
            clicked();
            break;
        case 1:
            slotClicked();
            break;
        default:
            ;
        }
        _id -= 2;
    }
    return _id;
}
Exemplo n.º 30
0
URLNavigator::URLNavigator(const KURL& url,
                           DolphinView* dolphinView) :
    QHBox(dolphinView),
    m_historyIndex(0),
    m_dolphinView(dolphinView)
{
    m_history.prepend(HistoryElem(url));

    QFontMetrics fontMetrics(font());
    setMinimumHeight(fontMetrics.height() + 8);

    m_toggleButton = new QPushButton(SmallIcon("editurl"), 0, this);
    m_toggleButton->setFlat(true);
    m_toggleButton->setToggleButton(true);
    m_toggleButton->setFocusPolicy(QWidget::NoFocus);
    m_toggleButton->setMinimumHeight(minimumHeight());
    connect(m_toggleButton, SIGNAL(clicked()),
            this, SLOT(slotClicked()));
    if (DolphinSettings::instance().isURLEditable()) {
        m_toggleButton->toggle();
    }

    m_bookmarkSelector = new BookmarkSelector(this);
    connect(m_bookmarkSelector, SIGNAL(bookmarkActivated(int)),
            this, SLOT(slotBookmarkActivated(int)));

    m_pathBox = new KURLComboBox(KURLComboBox::Directories, true, this);

    KURLCompletion* kurlCompletion = new KURLCompletion(KURLCompletion::DirCompletion);
    m_pathBox->setCompletionObject(kurlCompletion);
    m_pathBox->setAutoDeleteCompletionObject(true);

    connect(m_pathBox, SIGNAL(returnPressed(const QString&)),
            this, SLOT(slotReturnPressed(const QString&)));
    connect(m_pathBox, SIGNAL(urlActivated(const KURL&)),
            this, SLOT(slotURLActivated(const KURL&)));

    connect(dolphinView, SIGNAL(contentsMoved(int, int)),
            this, SLOT(slotContentsMoved(int, int)));
    updateContent();
}