Пример #1
0
FormManualModify::FormManualModify( QVector<cl_Scene* > *scenes_,QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FormManualModify)
{
    ui->setupUi(this);
    scenes=scenes_;
    modelData=new ModelDataTable(scenes_,this);
    delegateTable=new DelegateTableManual(1,modelData);

    listWidget=new QListWidget;
    QHeaderView *qhv;
    qhv=ui->tableView->horizontalHeader();
    qhv->setSectionResizeMode(QHeaderView::ResizeToContents);

    ui->tableView->setModel(modelData);
    selection=new QItemSelectionModel(modelData);
    ui->tableView->setSelectionModel(selection);
    ui->tableView->setItemDelegate(delegateTable);
    ui->tableView->installEventFilter(new cl_MouseFilter(ui->tableView,this));
    ui->lineEditComment->setValidator(new  QRegExpValidator(QRegExp("[A-Za-z0-9 ]*"),this));

    connect(ui->tableView,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(slotMouseDoubleClicked(QModelIndex)));
    connect(ui->tableView,SIGNAL(clicked(QModelIndex)),this,SLOT(slotMouseClicked(QModelIndex)));

    connect(ui->pushButtonBack,     SIGNAL(clicked()),this,SLOT(slotPushButtonBack()));
    connect(ui->pushButtonAdd,      SIGNAL(clicked()),this,SLOT(slotPushButtonAdd()));
    connect(ui->pushButtonBegin,    SIGNAL(clicked()),this,SLOT(slotPushButtonBegin()));
    connect(ui->pushButtonDelete,   SIGNAL(clicked()),this,SLOT(slotPushButtonDelete()));
    connect(ui->pushButtonClone,    SIGNAL(clicked()),this,SLOT(slotPushButtonClone()));
    connect(ui->pushButtonAttach,   SIGNAL(clicked()),this,SIGNAL(signalAttach()));

    connect(listWidget,             SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(slotDoubleClickedListWidget(QListWidgetItem*)));

    //connect(listWidget,SIGNAL(clicked(QListWidgetItem*)),this,SLOT(clicked(QListWidgetItem*)));

}
Пример #2
0
Amor::Amor()
  : mAmor( 0 ),
    mBubble( 0 ),
    mForceHideAmorWidget( false )
{
    new AmorAdaptor( this );
    QDBusConnection::sessionBus().registerObject( QLatin1String( "/Amor" ), this );

    if( !readConfig() ) {
        qApp->quit();
    }

    mTargetWin   = 0;
    mNextTarget  = 0;
    mAmorDialog  = 0;
    mMenu        = 0;
    mCurrAnim    = mBaseAnim;
    mPosition    = mCurrAnim->hotspot().x();
    mState       = Normal;

    mWin = KWindowSystem::self();
    connect( mWin, SIGNAL(activeWindowChanged(WId)), this, SLOT(slotWindowActivate(WId)) );
    connect( mWin, SIGNAL(windowRemoved(WId)), this, SLOT(slotWindowRemove(WId)) );
    connect( mWin, SIGNAL(stackingOrderChanged()), this, SLOT(slotStackingChanged()) );
    connect( mWin, SIGNAL(windowChanged(WId,const ulong*)),
            this, SLOT(slotWindowChange(WId,const ulong*)) );
    connect( mWin, SIGNAL(currentDesktopChanged(int)), this, SLOT(slotDesktopChange(int)) );

    mAmor = new AmorWidget;
    connect( mAmor, SIGNAL(mouseClicked(QPoint)), SLOT(slotMouseClicked(QPoint)) );
    connect( mAmor, SIGNAL(dragged(QPoint,bool)), SLOT(slotWidgetDragged(QPoint,bool)) );
    mAmor->resize(mTheme.maximumSize());

    mTimer = new QTimer( this );
    connect( mTimer, SIGNAL(timeout()), SLOT(slotTimeout()) );

    mStackTimer = new QTimer( this );
    connect( mStackTimer, SIGNAL(timeout()), SLOT(restack()) );

    mBubbleTimer = new QTimer( this );
    connect( mBubbleTimer, SIGNAL(timeout()), SLOT(slotBubbleTimeout()) );

    std::time( &mActiveTime );
    mCursPos = QCursor::pos();
    mCursorTimer = new QTimer( this );
    connect( mCursorTimer, SIGNAL(timeout()), SLOT(slotCursorTimeout()) );
    mCursorTimer->start( 500 );

    if( mWin->activeWindow() ) {
        mNextTarget = mWin->activeWindow();
        selectAnimation( Focus );
        mTimer->setSingleShot( true );
        mTimer->start( 0 );
    }

    if( !QDBusConnection::sessionBus().connect( QString(), QString(), QLatin1String( "org.kde.amor" ),
            QLatin1String( "KDE_stop_screensaver" ), this, SLOT(screenSaverStopped()) ) )
    {
        kDebug(10000) << "Could not attach DBus signal: KDE_stop_screensaver()";
    }

    if( !QDBusConnection::sessionBus().connect( QString(), QString(), QLatin1String( "org.kde.amor" ),
            QLatin1String( "KDE_start_screensaver" ), this, SLOT(screenSaverStarted()) ) )
    {
        kDebug(10000) << "Could not attach DBus signal: KDE_start_screensaver()";
    }

    KStartupInfo::appStarted();
}