Example #1
0
QVariant KWidget::itemChange( GraphicsItemChange change, const QVariant & value )
{
    if(change == QGraphicsItem::ItemParentHasChanged
        || change == QGraphicsItem::ItemParentChange)
    {
        clearThemeCheckFlag();
    }
    else if(change == QGraphicsItem::ItemScenePositionHasChanged)
    {
        emit scenePosition(value.toPointF());
    }
    else if(change == QGraphicsItem::ItemVisibleHasChanged)
    {
        bool bvis = isVisible();
        visibleEvent(bvis);
        if(bvis)
        {
            showEvent();
        }
        else
        {
            hideEvent();
        }
    }
    return QGraphicsWidget::itemChange(change, value);
}
Example #2
0
bool KWMThemeClient::eventFilter( QObject* o, QEvent* e )
{
	if ( o != widget() )
		return false;

	switch ( e->type() )
	{
		case QEvent::Resize:
			resizeEvent( static_cast< QResizeEvent* >( e ) );
			return true;

		case QEvent::Paint:
			paintEvent( static_cast< QPaintEvent* >( e ) );
			return true;

		case QEvent::MouseButtonDblClick:
			mouseDoubleClickEvent( static_cast< QMouseEvent* >( e ) );
			return true;

		case QEvent::MouseButtonPress:
			processMousePressEvent( static_cast< QMouseEvent* >( e ) );
			return true;

		case QEvent::Show:
			showEvent( static_cast< QShowEvent* >( e ) );
			return true;

		default:
	    		return false;
	}
}
Example #3
0
int CentralSplitter::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QSplitter::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: buildInitialSizes(); break;
        case 1: { QList<int> _r = makeSizeList();
            if (_a[0]) *reinterpret_cast< QList<int>*>(_a[0]) = _r; }  break;
        case 2: refreshSizes((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 3: refreshSizes(); break;
        case 4: showEvent((*reinterpret_cast< QShowEvent*(*)>(_a[1]))); break;
        case 5: setSizesInt((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 6: { int _r = getTopicSize();
            if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; }  break;
        case 7: { int _r = getCentralSize();
            if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; }  break;
        case 8: { int _r = getInputSize();
            if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; }  break;
        default: ;
        }
        _id -= 9;
    }
    return _id;
}
Example #4
0
Dialog::Dialog(QWidget *parent) :
    QDialog(parent),

    ui(new Ui::Dialog)
{
    ui->setupUi(this);
    closeid=0;
    this->setWindowFlags(Qt::WindowFullscreenButtonHint);
    //this->setWindowFlags(Qt::WindowCloseButtonHint);
    _serv = new server(this,this);
    encrypt=false;
    ctx= new BLOWFISH_CTX;
    slotInitPass();
    connect(ui->btn_start,SIGNAL(clicked()),this,SLOT(runServer()));
    connect(ui->btn_send,SIGNAL(clicked()),this,SLOT(slotSendMessae()));
    connect(ui->tabWidget,SIGNAL(tabCloseRequested(int)),this,SLOT(closeTab(int)));
    connect(_serv,SIGNAL(newRoom(QString)),this,SLOT(addNewRoom(QString)));
    ui->ln_addr->setVisible(false);
    createMenuUserList();
#ifdef Q_OS_WIN32
    tray = new QSystemTrayIcon(QIcon(":/icon/resource/icon/icon.ico"),this);
    // tray->setProperty("_sni_qt_category", "ApplicationStatus");
    tray->show();
    QMenu *Menu = new QMenu(this);
    QAction *showw = new QAction("Show", this);
    connect(showw, SIGNAL(triggered()), this, SLOT(showEvent()));
    QAction *quitAction = new QAction("Quit", this);
    connect(quitAction, SIGNAL(triggered()), this, SLOT(closeEvent2()));
    Menu->addAction(showw);
    Menu->addAction(quitAction);
    tray->setContextMenu(Menu);

#endif

}
QWidget *EventsWindow::createTimeline()
{
    QWidget *container = new QWidget;
    QGridLayout *layout = new QGridLayout(container);

    m_timeline = new EventTimelineWidget;
    m_timeline->setContextMenuPolicy(Qt::CustomContextMenu);
    m_timeline->setModel(m_resultsView->eventsModel());

    m_timelineZoom = new QSlider(Qt::Horizontal);
    m_timelineZoom->setRange(0, 100);
    m_timelineZoom->setValue(0);

    connect(m_timeline, SIGNAL(customContextMenuRequested(QPoint)), SLOT(eventContextMenu(QPoint)));
    connect(m_timeline, SIGNAL(doubleClicked(QModelIndex)), SLOT(showEvent(QModelIndex)));

    connect(m_timelineZoom, SIGNAL(valueChanged(int)), SLOT(timelineSliderChanged(int)));

    layout->addWidget(m_timeline, 0, 0, 1, 2);

    QLabel *label = new QLabel(tr("Zoom:"));
    layout->addWidget(label, 1, 0, 1, 1, Qt::AlignLeft | Qt::AlignVCenter);

    layout->addWidget(m_timelineZoom, 1, 1);
    return container;
}
Example #6
0
bool NextClient::eventFilter(TQObject *o, TQEvent *e)
{
    if (TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(widget()))
	return false;
    switch (e->type()) {
    case TQEvent::Resize:
	resizeEvent(TQT_TQRESIZEEVENT( e ));
	return true;
    case TQEvent::Paint:
	paintEvent(TQT_TQPAINTEVENT( e ));
	return true;
    case TQEvent::MouseButtonDblClick:
	mouseDoubleClickEvent(TQT_TQMOUSEEVENT( e ));
	return true;
    case TQEvent::Wheel:
	wheelEvent( TQT_TQWHEELEVENT( e ));
	return true;
    case TQEvent::MouseButtonPress:
	processMousePressEvent(TQT_TQMOUSEEVENT( e ));
	return true;
    case TQEvent::Show:
	showEvent(TQT_TQSHOWEVENT( e ));
	return true;
    default:
	break;
    }
    return false;
}
Example #7
0
void
MainFrame::onWizardShow(wxCommandEvent& event)
{
	RuleWizard	*wizard = new RuleWizard(this);
	wxCommandEvent	showEvent(anEVT_WIZARD_SHOW);
	wxSize		displaySize;
	wxString	displayMsg;

	displaySize = wxGetDisplaySize();
	displayMsg = wxString::Format(_("Display size of %dx%d is too small "
	    "for the wizard.\nPresentation may be broken!"),
	    displaySize.GetWidth(), displaySize.GetHeight());
	an_menubar->Check(ID_MITOOLSWIZARD, event.GetInt());
	event.Skip();

	if (event.GetInt() != 0) {
		if (displaySize.GetWidth() < 1024) {
			anMessageBox(displayMsg, _("Wizard warning"),
			    wxOK|wxICON_EXCLAMATION, this);
		}
		wizard->RunWizard(wizard->getPage(RuleWizard::PAGE_PROGRAM));
		/* After finishing wizard, we uncheck menu and statusbar. */
		showEvent.SetInt(0);
		wxPostEvent(AnEvents::instance(), showEvent);
	}

	wizard->Destroy();
}
Example #8
0
void
ModSbMainPanelImpl::OnGridCellLeftDClick(wxGridEvent& event)
{
	wxCommandEvent		showEvent(anEVT_SHOW_RULE);
	SbOverviewTable	*table;
	SimpleOverviewRow	*tableRow;
	Policy			*policy;
	PolicyRuleSet		*ruleset;

	table = dynamic_cast<SbOverviewTable *> (lst_Rules->GetTable());
	if (table == NULL)
		return;

	tableRow = table->getRowAt(event.GetRow());

	policy = tableRow->getFilterPolicy();
	if (policy == NULL)
		policy = tableRow->getApplicationPolicy();
	if (policy == NULL)
		return;

	ruleset = policy->getParentRuleSet();
	if (ruleset == NULL)
		return;

	showEvent.SetInt(ruleset->isAdmin());
	showEvent.SetExtraLong(policy->getApnRuleId());
	wxPostEvent(AnEvents::instance(), showEvent);
}
Example #9
0
void wxTopLevelWindowGTK::GTKUpdateDecorSize(const DecorSize& decorSize)
{
    if (!IsMaximized() && !IsFullScreen())
        GetCachedDecorSize() = decorSize;
    if (m_updateDecorSize && memcmp(&m_decorSize, &decorSize, sizeof(DecorSize)))
    {
        m_useCachedClientSize = false;
        const wxSize diff(
            decorSize.left - m_decorSize.left + decorSize.right - m_decorSize.right,
            decorSize.top - m_decorSize.top + decorSize.bottom - m_decorSize.bottom);
        m_decorSize = decorSize;
        bool resized = false;
        if (m_minWidth > 0 || m_minHeight > 0 || m_maxWidth > 0 || m_maxHeight > 0)
        {
            // update size hints, they depend on m_decorSize
            DoSetSizeHints(m_minWidth, m_minHeight, m_maxWidth, m_maxHeight, m_incWidth, m_incHeight);
        }
        if (m_deferShow)
        {
            // keep overall size unchanged by shrinking m_widget
            int w, h;
            GTKDoGetSize(&w, &h);
            // but not if size would be less than minimum, it won't take effect
            if (w >= m_minWidth - (decorSize.left + decorSize.right) &&
                h >= m_minHeight - (decorSize.top + decorSize.bottom))
            {
                gtk_window_resize(GTK_WINDOW(m_widget), w, h);
                if (!gtk_window_get_resizable(GTK_WINDOW(m_widget)))
                    gtk_widget_set_size_request(GTK_WIDGET(m_widget), w, h);
                resized = true;
            }
        }
        if (!resized)
        {
            // adjust overall size to match change in frame extents
            m_width  += diff.x;
            m_height += diff.y;
            if (m_width  < 1) m_width  = 1;
            if (m_height < 1) m_height = 1;
            m_clientWidth = 0;
            gtk_widget_queue_resize(m_wxwindow);
        }
    }
    if (m_deferShow)
    {
        // gtk_widget_show() was deferred, do it now
        m_deferShow = false;
        DoGetClientSize(&m_clientWidth, &m_clientHeight);
        wxSizeEvent sizeEvent(GetSize(), GetId());
        sizeEvent.SetEventObject(this);
        HandleWindowEvent(sizeEvent);

        gtk_widget_show(m_widget);

        wxShowEvent showEvent(GetId(), true);
        showEvent.SetEventObject(this);
        HandleWindowEvent(showEvent);
    }
}
Example #10
0
void QStatusBar_QtDShell::__override_showEvent(QShowEvent*  arg__1, bool static_call)
{
    if (static_call) {
        QStatusBar::showEvent((QShowEvent* )arg__1);
    } else {
        showEvent((QShowEvent* )arg__1);
    }
}
Example #11
0
EditorFindDialog::EditorFindDialog(QWidget *parent) : QDialog(parent)
{
 setup_ui();
 setup_signals();
 assembly();

 showEvent(new QShowEvent());
}
Example #12
0
void QFontComboBox_QtDShell::__override_showEvent(QShowEvent*  e0, bool static_call)
{
    if (static_call) {
        QComboBox::showEvent((QShowEvent* )e0);
    } else {
        showEvent((QShowEvent* )e0);
    }
}
Example #13
0
void QTabWidget_QtDShell::__override_showEvent(QShowEvent*  arg__1, bool static_call)
{
    if (static_call) {
        QTabWidget::showEvent((QShowEvent* )arg__1);
    } else {
        showEvent((QShowEvent* )arg__1);
    }
}
void QAbstractPageSetupDialog_QtDShell::__override_showEvent(QShowEvent*  arg__1, bool static_call)
{
    if (static_call) {
        QDialog::showEvent((QShowEvent* )arg__1);
    } else {
        showEvent((QShowEvent* )arg__1);
    }
}
Example #15
0
void QDateEdit_QtDShell::__override_showEvent(QShowEvent*  event0, bool static_call)
{
    if (static_call) {
        QAbstractSpinBox::showEvent((QShowEvent* )event0);
    } else {
        showEvent((QShowEvent* )event0);
    }
}
Example #16
0
void
DlgLogViewer::onClose(wxCloseEvent &)
{
    wxCommandEvent	showEvent(anEVT_LOGVIEWER_SHOW);

    showEvent.SetInt(false);
    wxPostEvent(AnEvents::instance(), showEvent);
}
void EventsWindow::showEvent(const QModelIndex &index)
{
    EventData *data = index.data(EventsModel::EventDataPtr).value<EventData*>();
    showEvent(*data);

    m_modelEventsCursor->setCameraFilter(data->locationCamera());
    m_modelEventsCursor->setIndex(index.row());
}
Example #18
0
void QFontDialog_QtDShell::__override_showEvent(QShowEvent*  arg__1, bool static_call)
{
    if (static_call) {
        QDialog::showEvent((QShowEvent* )arg__1);
    } else {
        showEvent((QShowEvent* )arg__1);
    }
}
Example #19
0
void
MainFrame::OnMbToolsRuleEditorSelect(wxCommandEvent& event)
{
	wxCommandEvent  showEvent(anEVT_RULEEDITOR_SHOW);

	showEvent.SetInt(event.IsChecked());

	wxPostEvent(AnEvents::instance(), showEvent);
}
Example #20
0
void
MainFrame::OnMbToolsLogViewerSelect(wxCommandEvent& event)
{
	wxCommandEvent  showEvent(anEVT_LOGVIEWER_SHOW);

	showEvent.SetInt(event.IsChecked());

	wxPostEvent(AnEvents::instance(), showEvent);
}
Example #21
0
void
MainFrame::onMbToolsWizardSelect(wxCommandEvent& event)
{
	wxCommandEvent  showEvent(anEVT_WIZARD_SHOW);

	showEvent.SetInt(event.IsChecked());

	wxPostEvent(AnEvents::instance(), showEvent);
}
Example #22
0
void
MainFrame::OnMbEditPreferencesSelect(wxCommandEvent&)
{
	wxCommandEvent  showEvent(anEVT_ANOUBISOPTIONS_SHOW);

	showEvent.SetInt(true);

	wxPostEvent(AnEvents::instance(), showEvent);
}
Example #23
0
void CDlgUservCard::slotUpdateRoster(const QString& szId, QSharedPointer<CUser> userInfo)
{
    if(szId == m_szJid)
    {
        if(m_UserInfo.isNull())
        {
            m_UserInfo = userInfo->GetInfo();
        }
        showEvent(NULL);
    }
}
Example #24
0
void
DlgLogViewer::onShow(wxCommandEvent &event)
{
    wxCommandEvent	showEvent(anEVT_OPEN_ALERTS);
    showEvent.SetInt(0);
    showEvent.SetExtraLong(false);
    wxPostEvent(AnEvents::instance(), showEvent);

    this->Show(event.GetInt());
    event.Skip();
}
Example #25
0
void wxTopLevelWindowGTK::GTKUpdateDecorSize(const wxSize& decorSize)
{
    if (!IsMaximized() && !IsFullScreen())
        GetCachedDecorSize() = decorSize;
    if (m_updateDecorSize && m_decorSize != decorSize)
    {
        const wxSize diff = decorSize - m_decorSize;
        m_decorSize = decorSize;
        bool resized = false;
        if (m_deferShow)
        {
            // keep overall size unchanged by shrinking m_widget
            int w, h;
            GTKDoGetSize(&w, &h);
            // but not if size would be less than minimum, it won't take effect
            const wxSize minSize = GetMinSize();
            if (w >= minSize.x && h >= minSize.y)
            {
                gtk_window_resize(GTK_WINDOW(m_widget), w, h);
                resized = true;
            }
        }
        if (!resized)
        {
            // adjust overall size to match change in frame extents
            m_width  += diff.x;
            m_height += diff.y;
            if (m_width  < 0) m_width  = 0;
            if (m_height < 0) m_height = 0;
            m_oldClientWidth = 0;
            gtk_widget_queue_resize(m_wxwindow);
        }
    }
    if (m_deferShow)
    {
        // gtk_widget_show() was deferred, do it now
        m_deferShow = false;
        GetClientSize(&m_oldClientWidth, &m_oldClientHeight);
        wxSizeEvent sizeEvent(GetSize(), GetId());
        sizeEvent.SetEventObject(this);
        HandleWindowEvent(sizeEvent);

        gtk_widget_show(m_widget);

        wxShowEvent showEvent(GetId(), true);
        showEvent.SetEventObject(this);
        HandleWindowEvent(showEvent);
    }
}
QWidget *EventsWindow::createResultsView()
{
    m_resultsView = new EventsView;
    m_resultsView->setModel(new EventsModel(bcApp->serverRepository(), this));
    m_resultsView->setFrameStyle(QFrame::NoFrame);
    m_resultsView->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(m_resultsView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(eventContextMenu(QPoint)));
    connect(m_resultsView, SIGNAL(doubleClicked(QModelIndex)), SLOT(showEvent(QModelIndex)));

    QSettings settings;
    m_resultsView->header()->restoreState(settings.value(QLatin1String("ui/events/viewHeader")).toByteArray());
    m_resultsView->header()->setSortIndicatorShown(true);
    m_resultsView->header()->setSortIndicator(EventsModel::DateColumn, Qt::DescendingOrder);
    m_resultsView->setSortingEnabled(true);

    return m_resultsView;
}
Example #27
0
File: find.cpp Project: vprus/vis3
    void findNextEvent()
    {
        std::auto_ptr<Event_model> e = filtered->next_event();

        if (e.get())
        {
            unsigned event_time = e->time;

            if (event_time > model()->max_time())
            {
                int shown_time_range = model()->max_time()
                                       - model()->min_time();

                int one_tenth = shown_time_range/10;

                int desired_new_min_time = event_time - one_tenth;
                unsigned new_max_time = desired_new_min_time + shown_time_range;
                if (new_max_time > model()->root()->max_time())
                {
                    new_max_time = model()->root()->max_time();
                }
                int new_min_time = new_max_time - shown_time_range;

                canvas()->setModel(
                    model()->set_range(new_min_time, new_max_time));
            }


            QRect r = canvas()->boundingRect(e->component,
                                             e->time, e->time);

            r.adjust(-1, -1, 1, 1);
            highlight->setRect(r);

            emit showEvent(e.release());
            emit extraHelp("<b>Press F3 for next event</b>");
        }
        else
        {
            highlight->setRect(QRect());
            emit extraHelp(QString());
        }
    }
Example #28
0
bool FindQueryTab::findNext()
{
    Q_ASSERT(model_.get() != 0);

    if (!model_with_checker.get()) {
        model_with_checker = model_->install_checker(active_checker);
        model_with_checker->rewind();
    }

    Event_model* e = model_with_checker->next_event();

    if (e != nullptr)
    {
        model_ = model_->set_range(e->time, model_->max_time());
        emit showEvent(e);
        return true;
    }

    return false;
}
void FramestackWidget::currentSessionChanged(KDevelop::IDebugSession* session)
{
    kDebug() << "Adding session:" << isVisible();

    m_session = session;
    
    m_threads->setModel(session ? session->frameStackModel() : 0);
    m_frames->setModel(session ? session->frameStackModel() : 0);

    if (session) {
        connect(session->frameStackModel(), SIGNAL(currentThreadChanged(int)),
                SLOT(currentThreadChanged(int)));
        currentThreadChanged(session->frameStackModel()->currentThread());
        connect(session->frameStackModel(), SIGNAL(currentFrameChanged(int)),
                SLOT(currentFrameChanged(int)));
        currentFrameChanged(session->frameStackModel()->currentFrame());
    }

    if (isVisible()) {
        showEvent(0);
    }
}
Example #30
0
void
DlgLogViewer::onLogSelect(wxListEvent &event)
{
    wxCommandEvent			 showEvent(anEVT_SHOW_RULE);
    Notification			*notify;
    NotificationCtrl		*notifyCtrl;
    NotificationPerspective		*perspective;

    notifyCtrl = NotificationCtrl::instance();
    perspective = notifyCtrl->getPerspective(NotificationCtrl::LIST_ALL);
    notify = notifyCtrl->getNotification(perspective->getId(
            event.GetIndex()));

    if (!notify)
        return;

    if (notify->getRuleId() > 0) {
        showEvent.SetInt(notify->isAdmin());
        showEvent.SetExtraLong(notify->getRuleId());
        wxPostEvent(AnEvents::instance(), showEvent);
    }
}