/** * Constructor, create LED's */ KBinaryClock::KBinaryClock(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name), ledWidth(6), _calendar(NULL), _disableCalendar(false), prefs( new Prefs(sharedConfig())), m_tooltip(this) { prefs->readConfig(); setBackgroundOrigin(AncestorOrigin); for(int i=0; i < 4; i++){ for(int j=0; j < ledWidth;j++){ KLed *led = new KLed( this ); led->setBackgroundOrigin(AncestorOrigin); ledMatrix[j][i] = led; } } // Why does kicker start out with a size of 800x409? // Kicker bug? resize(60,42); updateClock(); loadSettings(); QTimer *timer=new QTimer(this); connect (timer, SIGNAL (timeout()), this, SLOT (updateClock())); timer->start(500,false); }
Systemtray::Systemtray(TQWidget* parent) : TQWidget(parent,0,0) { setBackgroundOrigin(ParentOrigin); setBackgroundMode(FixedPixmap); m_Wins.setAutoDelete(true); }
void BaseContainer::configure(KPanelExtension::Orientation o, KPanelApplet::Direction d) { setBackgroundOrigin(AncestorOrigin); setOrientation(o); setPopupDirection(d); configure(); }
kweather::kweather(const TQString& configFile, Type t, int actions, TQWidget *parent, const char *name): KPanelApplet(configFile, t, actions, parent, name), weatherIface(), mFirstRun( false ), mReport( 0 ), mClient( 0 ), mContextMenu( 0 ), mWeatherService( 0 ), settingsDialog( 0 ), mTextColor(TQt::black) { kdDebug(12004) << "Constructor " << endl; setObjId("weatherIface"); setBackgroundOrigin( TQWidget::AncestorOrigin ); loadPrefs(); initContextMenu(); initDCOP(); dockWidget = new dockwidget(reportLocation, this, "dockwidget"); connect(dockWidget, TQT_SIGNAL(buttonClicked()), TQT_SLOT(doReport())); dockWidget->setViewMode(mViewMode); setLabelColor(); timeOut = new TQTimer(this, "timeOut" ); connect(timeOut, TQT_SIGNAL(timeout()), TQT_SLOT(timeout())); timeOut->start(10*60*1000); if(mFirstRun) preferences(); else timeout(); }
AppletHandle::AppletHandle(AppletContainer* parent) : QWidget(parent), m_applet(parent), m_menuButton(0), m_drawHandle(false), m_popupDirection(KPanelApplet::Up), m_handleHoverTimer(0) { setBackgroundOrigin(AncestorOrigin); setMinimumSize(widthForHeight(0), heightForWidth(0)); m_layout = new QBoxLayout(this, QBoxLayout::BottomToTop, 0, 0); m_dragBar = new AppletHandleDrag(this); m_dragBar->installEventFilter(this); m_layout->addWidget(m_dragBar); if (kapp->authorizeKAction("kicker_rmb")) { m_menuButton = new AppletHandleButton( this ); m_menuButton->setPixmap(xpmPixmap(up_xpm, "up")); m_menuButton->installEventFilter(this); m_layout->addWidget(m_menuButton); connect(m_menuButton, SIGNAL(pressed()), this, SLOT(menuButtonPressed())); QToolTip::add(m_menuButton, i18n("%1 menu").arg(parent->info().name())); } QToolTip::add(this, i18n("%1 applet handle").arg(parent->info().name())); resetLayout(); }
ViewApplet::ViewApplet(QWidget* parent, const char* name, Mixer* mixer, ViewBase::ViewFlags vflags, KPanelApplet::Position position ) : ViewBase(parent, name, QString::null, mixer, WStyle_Customize|WStyle_NoBorder, vflags) { setBackgroundOrigin(AncestorOrigin); // remove the menu bar action, that is put by the "ViewBase" constructor in _actions. //KToggleAction *m = static_cast<KToggleAction*>(KStdAction::showMenubar( this, SLOT(toggleMenuBarSlot()), _actions )); _actions->remove( KStdAction::showMenubar(this, SLOT(toggleMenuBarSlot()), _actions) ); if ( position == KPanelApplet::pLeft || position == KPanelApplet::pRight ) { //kdDebug(67100) << "ViewApplet() isVertical" << "\n"; _viewOrientation = Qt::Vertical; } else { //kdDebug(67100) << "ViewApplet() isHorizontal" << "\n"; _viewOrientation = Qt::Horizontal; } if ( _viewOrientation == Qt::Horizontal ) { _layoutMDW = new QHBoxLayout( this ); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); } else { _layoutMDW = new QVBoxLayout( this ); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); } //_layoutMDW->setResizeMode(QLayout::Fixed); init(); }
TaskBarContainer::TaskBarContainer(bool enableFrame, QWidget *parent, const char *name) : QFrame(parent, name), direction(KPanelApplet::Up), showWindowListButton(true), windowListButton(0), windowListMenu(0) { setBackgroundOrigin(AncestorOrigin); uint margin; if(enableFrame) { setFrameStyle(Sunken | StyledPanel); margin = frameWidth(); } else { setFrameStyle(NoFrame); margin = 0; } layout = new QBoxLayout(this, QApplication::reverseLayout() ? QBoxLayout::RightToLeft : QBoxLayout::LeftToRight); layout->setMargin(margin); // scrollable taskbar taskBar = new TaskBar(this); layout->addWidget(taskBar); connect(taskBar, SIGNAL(containerCountChanged()), SIGNAL(containerCountChanged())); setBackground(); // read settings and setup layout configure(); connectDCOPSignal("", "", "kdeTaskBarConfigChanged()", "configChanged()", false); }
QuickLauncher::QuickLauncher(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name) { DCOPObject::setObjId("QuickLauncherApplet"); DEBUGSTR << endl << endl << endl << "------------" << flush; DEBUGSTR << "QuickLauncher::QuickLauncher(" << configFile << ",...)" << endl << flush; m_settings = new Prefs(sharedConfig()); m_settings->readConfig(); m_needsSave = false; m_needsRefresh = false; m_refreshEnabled = false; m_configDialog = 0; m_popup = 0; m_appletPopup = 0; m_removeAppsMenu = 0; m_dragAccepted = false; m_buttons = new ButtonGroup; m_manager = new FlowGridManager; m_newButtons = 0; m_oldButtons = 0; m_dragButtons = 0; m_configAction = new TDEAction(i18n("Configure Quicklauncher..."), "configure", TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT(slotConfigure()), TQT_TQOBJECT(this)); m_saveTimer = new TQTimer(this, "m_saveTimer"); connect(m_saveTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(saveConfig())); m_popularity = new PopularityStatistics(); setBackgroundOrigin(AncestorOrigin); loadConfig(); buildPopupMenu(); m_minPanelDim = std::max(16, m_settings->iconDimChoices()[1]); refreshContents(); setRefreshEnabled(true); setAcceptDrops(true); //TQToolTip::add(this, i18n("Drop applications here")); DEBUGSTR << " QuickLauncher::QuickLauncher(" << configFile << ",...) END" << endl << flush; DCOPClient *dcopClient = TDEApplication::dcopClient(); dcopClient->connectDCOPSignal(0, "appLauncher", "serviceStartedByStorageId(TQString,TQString)", "QuickLauncherApplet", "serviceStartedByStorageId(TQString,TQString)", false); kdDebug() << "Quicklauncher registered DCOP signal" << endl; }
AppletHandleButton::AppletHandleButton(AppletHandle *parent) : QPushButton(parent), m_parent(parent) { setBackgroundOrigin( AncestorOrigin ); m_moveMouse = false; setFocusPolicy( NoFocus ); setToggleButton( true ); setToggleType(QButton::Toggle); }
QDesignerToolBarSeparator::QDesignerToolBarSeparator(Orientation o , QToolBar *parent, const char* name ) : QWidget( parent, name ) { connect( parent, SIGNAL(orientationChanged(Orientation)), this, SLOT(setOrientation(Orientation)) ); setOrientation( o ); setBackgroundMode( parent->backgroundMode() ); setBackgroundOrigin( ParentOrigin ); setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); }
void PanelButton::loadTiles() { if (m_tileColor.isValid()) { setBackgroundOrigin(WidgetOrigin); m_up = m_down = QPixmap(); } else if (m_tile.isNull()) { setBackgroundOrigin(AncestorOrigin); m_up = m_down = QPixmap(); } else { setBackgroundOrigin(WidgetOrigin); // If only the tiles were named a bit smarter we wouldn't have // to pass the up or down argument. m_up = QPixmap(loadTile(m_tile, size(), "up")); m_down = QPixmap(loadTile(m_tile, size(), "down")); } }
QSystemTray::QSystemTray(const QPixmap &icon) : QLabel(NULL, "", WMouseNoMask | WRepaintNoErase | WType_TopLevel | WStyle_Customize | WStyle_NoBorder | WStyle_StaysOnTop) { setMinimumSize(22, 22); setBackgroundMode(X11ParentRelative); setBackgroundOrigin(WindowOrigin); setPixmap(icon); setAlignment(AlignHCenter); setScaledContents(true); setTrayIcon(*this); }
HideButton::HideButton(QWidget *parent) : QAbstractButton(parent), m_highlight(false), m_arrow(Qt::LeftArrow) { setBackgroundOrigin(AncestorOrigin); connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), SLOT(slotSettingsChanged(int))); connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), SLOT(slotIconChanged(int))); slotSettingsChanged(KGlobalSettings::SETTINGS_MOUSE); }
HideButton::HideButton(QWidget *parent, const char *name) : QButton(parent, name), m_highlight(false), m_arrow(Qt::LeftArrow) { setBackgroundOrigin(AncestorOrigin); connect(kapp, SIGNAL(settingsChanged(int)), SLOT(slotSettingsChanged(int))); connect(kapp, SIGNAL(iconChanged(int)), SLOT(slotIconChanged(int))); kapp->addKipcEventMask(KIPC::SettingsChanged); kapp->addKipcEventMask(KIPC::IconChanged); slotSettingsChanged(KApplication::SETTINGS_MOUSE); }
UimToolbarDraggingHandler::UimToolbarDraggingHandler( QWidget *parent, const char* name ) : QFrame( parent, name ), isDragging( false ) { setFrameStyle( NoFrame ); setBackgroundMode( parent->backgroundMode() ); setBackgroundOrigin( ParentOrigin ); setFixedWidth( 10 ); }
QuickButton::QuickButton(const QString &u, KAction* configAction, QWidget *parent, const char *name) : QButton(parent, name), m_flashCounter(0), m_sticky(false) { installEventFilter(KickerTip::the()); if (parent && ! parent->parent()) { setBackgroundMode(X11ParentRelative); } setBackgroundOrigin( AncestorOrigin ); setMouseTracking(true); _highlight = false; _oldCursor = cursor(); _qurl=new QuickURL(u); QToolTip::add(this, _qurl->name()); resize(int(DEFAULT_ICON_DIM),int(DEFAULT_ICON_DIM)); QBrush bgbrush(colorGroup().brush(QColorGroup::Background)); QuickAddAppsMenu *addAppsMenu = new QuickAddAppsMenu( parent, this, _qurl->url()); _popup = new QPopupMenu(this); _popup->insertItem(i18n("Add Application"), addAppsMenu); configAction->plug(_popup); _popup->insertSeparator(); _popup->insertItem(SmallIcon("remove"), i18n("Remove"), this, SLOT(removeApp())); m_stickyAction = new KToggleAction(i18n("Never Remove Automatically"), KShortcut(), this); connect(m_stickyAction, SIGNAL(toggled(bool)), this, SLOT(slotStickyToggled(bool))); m_stickyAction->plug(_popup, 2); m_stickyId = _popup->idAt(2); settingsChanged(KApplication::SETTINGS_MOUSE); connect(kapp, SIGNAL(settingsChanged(int)), SLOT(settingsChanged(int))); connect(kapp, SIGNAL(iconChanged(int)), SLOT(iconChanged(int))); connect(this, SIGNAL(clicked()), SLOT(launch())); connect(this, SIGNAL(removeApp(QuickButton *)), parent, SLOT(removeAppManually(QuickButton *))); kapp->addKipcEventMask(KIPC::SettingsChanged); kapp->addKipcEventMask(KIPC::IconChanged); }
NaughtyApplet::NaughtyApplet ( const TQString & configFile, Type t, int actions, TQWidget * parent, const char * name ) : KPanelApplet(configFile, t, actions, parent, name) { TDEGlobal::iconLoader()->addAppDir("naughtyapplet"); setBackgroundOrigin( AncestorOrigin ); button_ = new SimpleButton(this); button_->setFixedSize(20, 20); TQVBoxLayout * layout = new TQVBoxLayout(this); layout->addWidget(button_); monitor_ = new NaughtyProcessMonitor(2, 20, TQT_TQOBJECT(this)); connect ( button_, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotPreferences()) ); connect ( monitor_, TQT_SIGNAL(runawayProcess(ulong, const TQString &)), this, TQT_SLOT(slotWarn(ulong, const TQString &)) ); connect ( monitor_, TQT_SIGNAL(load(uint)), this, TQT_SLOT(slotLoad(uint)) ); loadSettings(); monitor_->start(); }
/* * Constructs a CycleDialog as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ CycleDialog::CycleDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "Form1" ); setBackgroundOrigin( QDialog::WidgetOrigin ); Form1Layout = new QVBoxLayout( this, 9, 1, "Form1Layout"); ListView1 = new QListView( this, "ListView1" ); ListView1->addColumn( tr( "Type" ) ); ListView1->header()->setClickEnabled( FALSE, ListView1->header()->count() - 1 ); ListView1->addColumn( tr( "Value" ) ); ListView1->header()->setClickEnabled( FALSE, ListView1->header()->count() - 1 ); ListView1->setFrameShadow( QListView::Sunken ); ListView1->setMargin( 4 ); ListView1->setSelectionMode( QListView::NoSelection ); ListView1->setItemMargin( 6 ); ListView1->setRootIsDecorated( FALSE ); Form1Layout->addWidget( ListView1 ); Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout1->addItem( spacer ); PushButton1 = new QPushButton( this, "PushButton1" ); PushButton1->setAcceptDrops( TRUE ); PushButton1->setDefault( TRUE ); Layout1->addWidget( PushButton1 ); QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout1->addItem( spacer_2 ); Form1Layout->addLayout( Layout1 ); languageChange(); resize( QSize(406, 234).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( PushButton1, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( ListView1, SIGNAL( onViewport() ), this, SLOT( ListView1_onViewport() ) ); }
KSystemTray::KSystemTray(QWidget *parent, const char *name) : QLabel(parent, name, WType_TopLevel) { #ifdef Q_WS_X11 QXEmbed::initialize(); #endif d = new KSystemTrayPrivate; d->actionCollection = new KActionCollection(this); #ifdef Q_WS_X11 KWin::setSystemTrayWindowFor(winId(), parent ? parent->topLevelWidget()->winId() : qt_xrootwin()); #endif setBackgroundMode(X11ParentRelative); setBackgroundOrigin(WindowOrigin); hasQuit = 0; menu = new KPopupMenu(this); menu->insertTitle(kapp->miniIcon(), kapp->caption()); move(-1000, -1000); KStdAction::quit(this, SLOT(maybeQuit()), d->actionCollection); if(parentWidget()) { new KAction(i18n("Minimize"), KShortcut(), this, SLOT(minimizeRestoreAction()), d->actionCollection, "minimizeRestore"); #ifdef Q_WS_X11 KWin::WindowInfo info = KWin::windowInfo(parentWidget()->winId()); d->on_all_desktops = info.onAllDesktops(); #else d->on_all_desktops = false; #endif } else { d->on_all_desktops = false; } setCaption(KGlobal::instance()->aboutData()->programName()); setAlignment(alignment() | Qt::AlignVCenter | Qt::AlignHCenter); }
/* * Constructs a EvaUserInfoWidget as a child of 'parent', with the * name 'name' and widget flags set to 'f'. */ EvaUserInfoWidget::EvaUserInfoWidget( TQWidget* parent, const char* name, WFlags fl ) : TQWidget( parent, name, fl ) { if ( !name ) setName( "EvaUserInfoWidget" ); setEnabled( TRUE ); setMinimumSize( TQSize( 483, 610 ) ); setMaximumSize( TQSize( 483, 610 ) ); setBackgroundOrigin( TQWidget::WidgetOrigin ); EvaUserInfoWidgetLayout = new TQGridLayout( this, 1, 1, 11, 6, "EvaUserInfoWidgetLayout"); layout191 = new TQGridLayout( 0, 1, 1, 0, 6, "layout191"); spacer18 = new TQSpacerItem( 16, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout191->addItem( spacer18, 0, 1 ); layout189 = new TQVBoxLayout( 0, 0, 6, "layout189"); layout188 = new TQVBoxLayout( 0, 0, 15, "layout188"); lblBasicInfo = new TQLabel( this, "lblBasicInfo" ); layout188->addWidget( lblBasicInfo ); layout187 = new TQHBoxLayout( 0, 0, 6, "layout187"); layout186 = new TQHBoxLayout( 0, 0, 6, "layout186"); layout39 = new TQVBoxLayout( 0, 0, 6, "layout39"); lblRealName = new TQLabel( this, "lblRealName" ); layout39->addWidget( lblRealName ); lblNickName = new TQLabel( this, "lblNickName" ); layout39->addWidget( lblNickName ); lblAge = new TQLabel( this, "lblAge" ); layout39->addWidget( lblAge ); lblArea = new TQLabel( this, "lblArea" ); layout39->addWidget( lblArea ); layout186->addLayout( layout39 ); layout178 = new TQVBoxLayout( 0, 0, 6, "layout178"); leRealName = new TQLineEdit( this, "leRealName" ); leRealName->setEnabled( TRUE ); leRealName->setMinimumSize( TQSize( 100, 0 ) ); leRealName->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leRealName->setFrameShape( TQLineEdit::Box ); leRealName->setFrameShadow( TQLineEdit::Plain ); leRealName->setLineWidth( 1 ); leRealName->setReadOnly( TRUE ); layout178->addWidget( leRealName ); leNickName = new TQLineEdit( this, "leNickName" ); leNickName->setEnabled( TRUE ); leNickName->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leNickName->setFrameShape( TQLineEdit::Box ); leNickName->setFrameShadow( TQLineEdit::Plain ); leNickName->setLineWidth( 1 ); leNickName->setReadOnly( TRUE ); layout178->addWidget( leNickName ); leAge = new TQLineEdit( this, "leAge" ); leAge->setEnabled( TRUE ); leAge->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leAge->setFrameShape( TQLineEdit::Box ); leAge->setFrameShadow( TQLineEdit::Plain ); leAge->setLineWidth( 1 ); leAge->setReadOnly( TRUE ); layout178->addWidget( leAge ); leArea = new TQLineEdit( this, "leArea" ); leArea->setEnabled( TRUE ); leArea->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leArea->setFrameShape( TQLineEdit::Box ); leArea->setFrameShadow( TQLineEdit::Plain ); leArea->setLineWidth( 1 ); leArea->setReadOnly( TRUE ); layout178->addWidget( leArea ); layout186->addLayout( layout178 ); layout187->addLayout( layout186 ); layout163 = new TQHBoxLayout( 0, 0, 6, "layout163"); layout64 = new TQVBoxLayout( 0, 0, 6, "layout64"); lblNumber = new TQLabel( this, "lblNumber" ); layout64->addWidget( lblNumber ); lblLevel = new TQLabel( this, "lblLevel" ); layout64->addWidget( lblLevel ); lblSex = new TQLabel( this, "lblSex" ); layout64->addWidget( lblSex ); lblProvince = new TQLabel( this, "lblProvince" ); layout64->addWidget( lblProvince ); layout163->addLayout( layout64 ); layout162 = new TQVBoxLayout( 0, 0, 6, "layout162"); layout161 = new TQHBoxLayout( 0, 0, 6, "layout161"); layout86 = new TQVBoxLayout( 0, 0, 6, "layout86"); layout66 = new TQHBoxLayout( 0, 0, 6, "layout66"); leNumber = new TQLineEdit( this, "leNumber" ); leNumber->setEnabled( TRUE ); leNumber->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leNumber->setFrameShape( TQLineEdit::Box ); leNumber->setFrameShadow( TQLineEdit::Plain ); leNumber->setLineWidth( 1 ); leNumber->setReadOnly( TRUE ); layout66->addWidget( leNumber ); layout86->addLayout( layout66 ); lblLevelDisplay = new TQLabel( this, "lblLevelDisplay" ); lblLevelDisplay->setEnabled( TRUE ); layout86->addWidget( lblLevelDisplay ); layout65 = new TQHBoxLayout( 0, 0, 6, "layout65"); leSex = new TQLineEdit( this, "leSex" ); leSex->setEnabled( TRUE ); leSex->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leSex->setFrameShape( TQLineEdit::Box ); leSex->setFrameShadow( TQLineEdit::Plain ); leSex->setLineWidth( 1 ); leSex->setReadOnly( TRUE ); layout65->addWidget( leSex ); layout86->addLayout( layout65 ); layout161->addLayout( layout86 ); layout103 = new TQHBoxLayout( 0, 0, 6, "layout103"); spacer17 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout103->addItem( spacer17 ); lblFace = new TQLabel( this, "lblFace" ); lblFace->setMinimumSize( TQSize( 46, 46 ) ); lblFace->setMaximumSize( TQSize( 46, 46 ) ); lblFace->setFrameShape( TQLabel::Box ); lblFace->setAlignment( int( TQLabel::AlignCenter ) ); layout103->addWidget( lblFace ); spacer24 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout103->addItem( spacer24 ); layout161->addLayout( layout103 ); layout162->addLayout( layout161 ); layout151 = new TQHBoxLayout( 0, 0, 6, "layout151"); leProvince = new TQLineEdit( this, "leProvince" ); leProvince->setEnabled( TRUE ); leProvince->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leProvince->setFrameShape( TQLineEdit::Box ); leProvince->setFrameShadow( TQLineEdit::Plain ); leProvince->setLineWidth( 1 ); leProvince->setReadOnly( TRUE ); layout151->addWidget( leProvince ); lblCity = new TQLabel( this, "lblCity" ); layout151->addWidget( lblCity ); leCity = new TQLineEdit( this, "leCity" ); leCity->setEnabled( TRUE ); leCity->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leCity->setFrameShape( TQLineEdit::Box ); leCity->setFrameShadow( TQLineEdit::Plain ); leCity->setLineWidth( 1 ); leCity->setReadOnly( TRUE ); layout151->addWidget( leCity ); spacer26 = new TQSpacerItem( 50, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout151->addItem( spacer26 ); layout162->addLayout( layout151 ); layout163->addLayout( layout162 ); layout187->addLayout( layout163 ); layout188->addLayout( layout187 ); layout156 = new TQHBoxLayout( 0, 0, 6, "layout156"); layout99 = new TQGridLayout( 0, 1, 1, 0, 6, "layout99"); teSignature = new TQTextEdit( this, "teSignature" ); teSignature->setEnabled( TRUE ); teSignature->setMinimumSize( TQSize( 0, 50 ) ); teSignature->setMaximumSize( TQSize( 32767, 50 ) ); teSignature->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); teSignature->setPaletteBackgroundColor( TQColor( 255, 255, 255 ) ); teSignature->setFocusPolicy( TQTextEdit::NoFocus ); teSignature->setFrameShape( TQTextEdit::Box ); teSignature->setFrameShadow( TQTextEdit::Plain ); teSignature->setLineWidth( 1 ); teSignature->setHScrollBarMode( TQTextEdit::AlwaysOff ); teSignature->setWordWrap( TQTextEdit::WidgetWidth ); teSignature->setReadOnly( TRUE ); layout99->addMultiCellWidget( teSignature, 0, 1, 1, 1 ); lblSignature = new TQLabel( this, "lblSignature" ); layout99->addWidget( lblSignature, 0, 0 ); layout156->addLayout( layout99 ); spacer14_2 = new TQSpacerItem( 71, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum ); layout156->addItem( spacer14_2 ); layout188->addLayout( layout156 ); layout189->addLayout( layout188 ); layout144 = new TQGridLayout( 0, 1, 1, 0, 15, "layout144"); layout143 = new TQGridLayout( 0, 1, 1, 0, 6, "layout143"); layout142 = new TQGridLayout( 0, 1, 1, 0, 6, "layout142"); lePhone = new TQLineEdit( this, "lePhone" ); lePhone->setEnabled( TRUE ); lePhone->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); lePhone->setFrameShape( TQLineEdit::Box ); lePhone->setFrameShadow( TQLineEdit::Plain ); lePhone->setLineWidth( 1 ); lePhone->setReadOnly( TRUE ); layout142->addWidget( lePhone, 0, 0 ); leHomePage = new TQLineEdit( this, "leHomePage" ); leHomePage->setEnabled( TRUE ); leHomePage->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leHomePage->setFrameShape( TQLineEdit::Box ); leHomePage->setFrameShadow( TQLineEdit::Plain ); leHomePage->setLineWidth( 1 ); leHomePage->setReadOnly( TRUE ); layout142->addMultiCellWidget( leHomePage, 1, 1, 0, 2 ); lblMobile = new TQLabel( this, "lblMobile" ); layout142->addWidget( lblMobile, 0, 1 ); leMobile = new TQLineEdit( this, "leMobile" ); leMobile->setEnabled( TRUE ); leMobile->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leMobile->setFrameShape( TQLineEdit::Box ); leMobile->setFrameShadow( TQLineEdit::Plain ); leMobile->setLineWidth( 1 ); leMobile->setReadOnly( TRUE ); layout142->addWidget( leMobile, 0, 2 ); spacer28 = new TQSpacerItem( 41, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout142->addItem( spacer28, 0, 3 ); spacer29 = new TQSpacerItem( 31, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout142->addItem( spacer29, 1, 3 ); layout143->addMultiCellLayout( layout142, 2, 2, 0, 1 ); spacer13_2 = new TQSpacerItem( 180, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum ); layout143->addItem( spacer13_2, 1, 1 ); layout141 = new TQGridLayout( 0, 1, 1, 0, 6, "layout141"); layout139 = new TQHBoxLayout( 0, 0, 6, "layout139"); layout138 = new TQGridLayout( 0, 1, 1, 0, 6, "layout138"); leOccupation = new TQLineEdit( this, "leOccupation" ); leOccupation->setEnabled( TRUE ); leOccupation->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leOccupation->setFrameShape( TQLineEdit::Box ); leOccupation->setFrameShadow( TQLineEdit::Plain ); leOccupation->setLineWidth( 1 ); leOccupation->setReadOnly( TRUE ); layout138->addWidget( leOccupation, 0, 1 ); leBlood = new TQLineEdit( this, "leBlood" ); leBlood->setEnabled( TRUE ); leBlood->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leBlood->setFrameShape( TQLineEdit::Box ); leBlood->setFrameShadow( TQLineEdit::Plain ); leBlood->setLineWidth( 1 ); leBlood->setReadOnly( TRUE ); layout138->addWidget( leBlood, 1, 1 ); lblBlood = new TQLabel( this, "lblBlood" ); layout138->addWidget( lblBlood, 1, 0 ); lblOccupation = new TQLabel( this, "lblOccupation" ); layout138->addWidget( lblOccupation, 0, 0 ); layout139->addLayout( layout138 ); spacer27 = new TQSpacerItem( 30, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout139->addItem( spacer27 ); layout141->addMultiCellLayout( layout139, 0, 1, 1, 1 ); leZodiac = new TQLineEdit( this, "leZodiac" ); leZodiac->setEnabled( TRUE ); leZodiac->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leZodiac->setFrameShape( TQLineEdit::Panel ); leZodiac->setFrameShadow( TQLineEdit::Plain ); leZodiac->setLineWidth( 1 ); leZodiac->setReadOnly( TRUE ); layout141->addWidget( leZodiac, 0, 0 ); leHoroscape = new TQLineEdit( this, "leHoroscape" ); leHoroscape->setEnabled( TRUE ); leHoroscape->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leHoroscape->setFrameShape( TQLineEdit::Box ); leHoroscape->setFrameShadow( TQLineEdit::Plain ); leHoroscape->setLineWidth( 1 ); leHoroscape->setReadOnly( TRUE ); layout141->addWidget( leHoroscape, 1, 0 ); layout143->addMultiCellLayout( layout141, 0, 0, 0, 1 ); layout30 = new TQVBoxLayout( 0, 0, 6, "layout30"); leSchool = new TQLineEdit( this, "leSchool" ); leSchool->setEnabled( TRUE ); leSchool->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leSchool->setFrameShape( TQLineEdit::Box ); leSchool->setFrameShadow( TQLineEdit::Plain ); leSchool->setLineWidth( 1 ); leSchool->setReadOnly( TRUE ); layout30->addWidget( leSchool ); leEmail = new TQLineEdit( this, "leEmail" ); leEmail->setEnabled( TRUE ); leEmail->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leEmail->setFrameShape( TQLineEdit::Box ); leEmail->setFrameShadow( TQLineEdit::Plain ); leEmail->setLineWidth( 1 ); leEmail->setReadOnly( TRUE ); layout30->addWidget( leEmail ); leAddress = new TQLineEdit( this, "leAddress" ); leAddress->setEnabled( TRUE ); leAddress->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leAddress->setFrameShape( TQLineEdit::Box ); leAddress->setFrameShadow( TQLineEdit::Plain ); leAddress->setLineWidth( 1 ); leAddress->setReadOnly( TRUE ); layout30->addWidget( leAddress ); leZipCode = new TQLineEdit( this, "leZipCode" ); leZipCode->setEnabled( TRUE ); leZipCode->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); leZipCode->setFrameShape( TQLineEdit::Box ); leZipCode->setFrameShadow( TQLineEdit::Plain ); leZipCode->setLineWidth( 1 ); leZipCode->setReadOnly( TRUE ); layout30->addWidget( leZipCode ); layout143->addLayout( layout30, 1, 0 ); layout144->addLayout( layout143, 1, 1 ); layout51 = new TQVBoxLayout( 0, 0, 6, "layout51"); lblZodiac = new TQLabel( this, "lblZodiac" ); layout51->addWidget( lblZodiac ); lblHoroscape = new TQLabel( this, "lblHoroscape" ); layout51->addWidget( lblHoroscape ); lblSchool = new TQLabel( this, "lblSchool" ); layout51->addWidget( lblSchool ); lblEmail = new TQLabel( this, "lblEmail" ); layout51->addWidget( lblEmail ); lblAddress = new TQLabel( this, "lblAddress" ); layout51->addWidget( lblAddress ); lblZipCode = new TQLabel( this, "lblZipCode" ); layout51->addWidget( lblZipCode ); lblPhone = new TQLabel( this, "lblPhone" ); layout51->addWidget( lblPhone ); lblHomePage = new TQLabel( this, "lblHomePage" ); layout51->addWidget( lblHomePage ); layout144->addLayout( layout51, 1, 0 ); lblDetails = new TQLabel( this, "lblDetails" ); layout144->addMultiCellWidget( lblDetails, 0, 0, 0, 1 ); layout189->addLayout( layout144 ); layout95 = new TQVBoxLayout( 0, 0, 15, "layout95"); lblDescription = new TQLabel( this, "lblDescription" ); layout95->addWidget( lblDescription ); layout94 = new TQGridLayout( 0, 1, 1, 0, 6, "layout94"); spacer16 = new TQSpacerItem( 20, 77, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); layout94->addItem( spacer16, 1, 0 ); spacer14_2_2 = new TQSpacerItem( 71, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum ); layout94->addItem( spacer14_2_2, 1, 2 ); teAboutMe = new TQTextEdit( this, "teAboutMe" ); teAboutMe->setEnabled( TRUE ); teAboutMe->setMinimumSize( TQSize( 0, 0 ) ); teAboutMe->setMaximumSize( TQSize( 32767, 100 ) ); teAboutMe->setPaletteForegroundColor( TQColor( 0, 0, 0 ) ); teAboutMe->setPaletteBackgroundColor( TQColor( 255, 255, 255 ) ); teAboutMe->setFocusPolicy( TQTextEdit::NoFocus ); teAboutMe->setFrameShape( TQTextEdit::Box ); teAboutMe->setFrameShadow( TQTextEdit::Plain ); teAboutMe->setLineWidth( 1 ); teAboutMe->setHScrollBarMode( TQTextEdit::AlwaysOff ); teAboutMe->setWordWrap( TQTextEdit::WidgetWidth ); teAboutMe->setReadOnly( TRUE ); layout94->addMultiCellWidget( teAboutMe, 0, 1, 1, 1 ); lblAboutMe = new TQLabel( this, "lblAboutMe" ); layout94->addWidget( lblAboutMe, 0, 0 ); layout95->addLayout( layout94 ); layout189->addLayout( layout95 ); layout191->addLayout( layout189, 0, 0 ); spacer31 = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); layout191->addItem( spacer31, 1, 0 ); EvaUserInfoWidgetLayout->addLayout( layout191, 0, 0 ); languageChange(); resize( TQSize(483, 610).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // tab order setTabOrder( leRealName, leNickName ); setTabOrder( leNickName, leAge ); setTabOrder( leAge, leArea ); setTabOrder( leArea, leNumber ); setTabOrder( leNumber, leSex ); setTabOrder( leSex, leProvince ); setTabOrder( leProvince, leCity ); // buddies lblRealName->setBuddy( leRealName ); lblArea->setBuddy( leArea ); lblNumber->setBuddy( leNumber ); lblSex->setBuddy( leSex ); lblProvince->setBuddy( leProvince ); lblCity->setBuddy( leCity ); lblMobile->setBuddy( leRealName ); lblBlood->setBuddy( leRealName ); lblOccupation->setBuddy( leRealName ); lblZodiac->setBuddy( leRealName ); lblHoroscape->setBuddy( leRealName ); lblSchool->setBuddy( leRealName ); lblEmail->setBuddy( leRealName ); lblAddress->setBuddy( leRealName ); lblZipCode->setBuddy( leRealName ); lblPhone->setBuddy( leRealName ); lblHomePage->setBuddy( leRealName ); }
void MainWindow::changeSetting() { m_toggleDockingAction->setChecked(ScimKdeSettings::dockingToPanelApplet()); toggleDocking(true); //retrieve the m_mode first if(m_mode == StandAlone) { //re-initialize embed if next time toggle to that docking mode m_embedInitialized = false; setName("mainWindow"); reparent(0, Qt::WStyle_Customize | Qt::WX11BypassWM | Qt::WStyle_StaysOnTop, ScimKdeSettings::mainWindow_Position(),false); m_moveHandle->show(); setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); //if margin is 0, the frame can not be drawn correctly, frameWidth() is // sometimes too big (>1 and the main m_toolbar is not so decent), so // just fix it to 1 m_mainWindowLayout->setMargin(1); setBackgroundOrigin(QWidget::WindowOrigin); } else { //change name so that it won't be listed in the composite management page setName("mainWindow_embedded"); setWFlags(Qt::WStyle_Customize); m_moveHandle->hide(); setFrameStyle( QFrame::NoFrame ); m_mainWindowLayout->setMargin(0); setBackgroundOrigin(QWidget::AncestorOrigin); setBackgroundMode(QWidget::X11ParentRelative); } m_autoHideTimeout = ScimKdeSettings::hide_Timeout() * 1000; m_alwaysShow = ScimKdeSettings::always_Show(); m_autoSnap = ScimKdeSettings::auto_Snap(); requestReloadSelf(); if( m_alwaysShow && m_autoHideTimeout > 0 && m_mode == StandAlone) { if(!m_autoHideTimeoutTimer) { m_autoHideTimeoutTimer = new QTimer(this); connect( m_autoHideTimeoutTimer, SIGNAL( timeout() ), this, SLOT( hideToolbar() ) ); } } else { if(m_autoHideTimeoutTimer) m_autoHideTimeoutTimer->deleteLater(); m_autoHideTimeoutTimer = 0; m_toolbar->show(); if(m_mode == StandAlone) m_moveHandle->show(); } m_alwaysShowHandle = ScimKdeSettings::alwaysShowHandle(); m_alwaysShowExtensionHandle = ScimKdeSettings::alwaysShowExtensionHandle(); if(m_mode == PanelEmbedded) { //init m_alwaysShowHandle option support timer if(m_alwaysShowHandle) { if(m_showHandleTimer) m_showHandleTimer->deleteLater(); m_showHandleTimer = 0; } else { if(!m_showHandleTimer) { m_showHandleTimer = new QTimer(this); connect(m_showHandleTimer, SIGNAL(timeout()), this, SLOT(showHandleRequest())); } } //init m_alwaysShowExtensionHandle option support timer if(m_alwaysShowExtensionHandle) { if(m_showExtHandleTimer) m_showExtHandleTimer->deleteLater(); m_showExtHandleTimer = 0; if(m_embeddedAreaSize.isValid()) //only reset m_toolbar size if m_embeddedAreaSize is set before resetToolbarSize(m_embeddedAreaSize); } else { if(!m_showExtHandleTimer) { m_showExtHandleTimer = new QTimer(this); connect(m_showExtHandleTimer, SIGNAL(timeout()), this, SLOT(showExtHandleRequest())); } } initEmbedPanel(); } if(m_mode == StandAlone) { if(m_alwaysShow) { if(m_autoHideTimeoutTimer && !m_logo) { m_logo = new QLabel(this); m_logo->setPixmap(KGlobal::iconLoader()->loadIcon("skim", KIcon::Toolbar)); m_mainWindowLayout->addWidget(m_logo); m_logo->hide(); } QTimer::singleShot(0, this, SLOT(show()));//FIXME } else if(m_panelTurnedOn) QTimer::singleShot(0, this, SLOT(show()));//FIXME if((!m_alwaysShow || !m_autoHideTimeoutTimer) && m_logo) { m_logo->deleteLater(); m_logo = 0; } UPDATE_WINDOW_OPACITY(this); } if(m_mode == StandAlone || (!ScimKdeSettings::force_LeftToRight_In_Kicker() && m_mode == PanelEmbedded)) changeDirection((QBoxLayout::Direction)(ScimKdeSettings::mainWindow_Direction())); else changeDirection(QBoxLayout::LeftToRight); if(m_mode == StandAlone || (!m_alwaysShowExtensionHandle && m_mode == PanelEmbedded)) { resetToolbarSize(); } }
void KMenuBar::drawContents(QPainter *p) { // Closes the BR77113 // We need to overload this method to paint only the menu items // This way when the KMenuBar is embedded in the menu applet it // integrates correctly. // // Background mode and origin are set so late because of styles // using the polish() method to modify these settings. // // Of course this hack can safely be removed when real transparency // will be available if(!d->topLevel) { QMenuBar::drawContents(p); } else { bool up_enabled = isUpdatesEnabled(); BackgroundMode bg_mode = backgroundMode(); BackgroundOrigin bg_origin = backgroundOrigin(); setUpdatesEnabled(false); setBackgroundMode(X11ParentRelative); setBackgroundOrigin(WindowOrigin); p->eraseRect(rect()); erase(); QColorGroup g = colorGroup(); bool e; for(int i = 0; i < (int)count(); i++) { QMenuItem *mi = findItem(idAt(i)); if(!mi->text().isNull() || mi->pixmap()) { QRect r = itemRect(i); if(r.isEmpty() || !mi->isVisible()) continue; e = mi->isEnabledAndVisible(); if(e) g = isEnabled() ? (isActiveWindow() ? palette().active() : palette().inactive()) : palette().disabled(); else g = palette().disabled(); bool item_active = (actItem == i); p->setClipRect(r); if(item_active) { QStyle::SFlags flags = QStyle::Style_Default; if(isEnabled() && e) flags |= QStyle::Style_Enabled; if(item_active) flags |= QStyle::Style_Active; if(item_active && actItemDown) flags |= QStyle::Style_Down; flags |= QStyle::Style_HasFocus; style().drawControl(QStyle::CE_MenuBarItem, p, this, r, g, flags, QStyleOption(mi)); } else { style().drawItem(p, r, AlignCenter | AlignVCenter | ShowPrefix, g, e, mi->pixmap(), mi->text()); } } } setBackgroundOrigin(bg_origin); setBackgroundMode(bg_mode); setUpdatesEnabled(up_enabled); } }
bool QWidget::qt_property( int id, int f, QVariant* v) { switch ( id - staticMetaObject()->propertyOffset() ) { case 0: switch( f ) { case 1: *v = QVariant( this->isTopLevel(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 1: switch( f ) { case 1: *v = QVariant( this->isDialog(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 2: switch( f ) { case 1: *v = QVariant( this->isModal(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 3: switch( f ) { case 1: *v = QVariant( this->isPopup(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 4: switch( f ) { case 1: *v = QVariant( this->isDesktop(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 5: switch( f ) { case 0: setEnabled(v->asBool()); break; case 1: *v = QVariant( this->isEnabled(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 6: switch( f ) { case 0: setGeometry(v->asRect()); break; case 1: *v = QVariant( this->geometry() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 7: switch( f ) { case 1: *v = QVariant( this->frameGeometry() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 8: switch( f ) { case 1: *v = QVariant( this->x() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 9: switch( f ) { case 1: *v = QVariant( this->y() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 10: switch( f ) { case 0: move(v->asPoint()); break; case 1: *v = QVariant( this->pos() ); break; case 4: break; default: return FALSE; } break; case 11: switch( f ) { case 1: *v = QVariant( this->frameSize() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 12: switch( f ) { case 0: resize(v->asSize()); break; case 1: *v = QVariant( this->size() ); break; case 4: break; default: return FALSE; } break; case 13: switch( f ) { case 1: *v = QVariant( this->width() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 14: switch( f ) { case 1: *v = QVariant( this->height() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 15: switch( f ) { case 1: *v = QVariant( this->rect() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 16: switch( f ) { case 1: *v = QVariant( this->childrenRect() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 17: switch( f ) { case 1: *v = QVariant( this->childrenRegion() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 18: switch( f ) { case 0: setSizePolicy(v->asSizePolicy()); break; case 1: *v = QVariant( this->sizePolicy() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 19: switch( f ) { case 0: setMinimumSize(v->asSize()); break; case 1: *v = QVariant( this->minimumSize() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 20: switch( f ) { case 0: setMaximumSize(v->asSize()); break; case 1: *v = QVariant( this->maximumSize() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 21: switch( f ) { case 0: setMinimumWidth(v->asInt()); break; case 1: *v = QVariant( this->minimumWidth() ); break; case 4: break; default: return FALSE; } break; case 22: switch( f ) { case 0: setMinimumHeight(v->asInt()); break; case 1: *v = QVariant( this->minimumHeight() ); break; case 4: break; default: return FALSE; } break; case 23: switch( f ) { case 0: setMaximumWidth(v->asInt()); break; case 1: *v = QVariant( this->maximumWidth() ); break; case 4: break; default: return FALSE; } break; case 24: switch( f ) { case 0: setMaximumHeight(v->asInt()); break; case 1: *v = QVariant( this->maximumHeight() ); break; case 4: break; default: return FALSE; } break; case 25: switch( f ) { case 0: setSizeIncrement(v->asSize()); break; case 1: *v = QVariant( this->sizeIncrement() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 26: switch( f ) { case 0: setBaseSize(v->asSize()); break; case 1: *v = QVariant( this->baseSize() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 27: switch( f ) { case 0: setBackgroundMode((BackgroundMode&)v->asInt()); break; case 1: *v = QVariant( (int)this->backgroundMode() ); break; case 4: case 5: break; default: return FALSE; } break; case 28: switch( f ) { case 0: setPaletteForegroundColor(v->asColor()); break; case 1: *v = QVariant( this->paletteForegroundColor() ); break; case 2: this->unsetPalette(); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 29: switch( f ) { case 0: setPaletteBackgroundColor(v->asColor()); break; case 1: *v = QVariant( this->paletteBackgroundColor() ); break; case 2: this->unsetPalette(); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 30: switch( f ) { case 0: setPaletteBackgroundPixmap(v->asPixmap()); break; case 1: if ( this->paletteBackgroundPixmap() ) *v = QVariant( *paletteBackgroundPixmap() ); break; case 2: this->unsetPalette(); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 31: switch( f ) { case 1: *v = QVariant( this->backgroundBrush() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 32: switch( f ) { case 1: *v = QVariant( this->colorGroup() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 33: switch( f ) { case 0: setPalette(v->asPalette()); break; case 1: *v = QVariant( this->palette() ); break; case 2: this->unsetPalette(); break; case 5: return this->ownPalette(); case 3: case 4: break; default: return FALSE; } break; case 34: switch( f ) { case 0: setBackgroundOrigin((BackgroundOrigin&)v->asInt()); break; case 1: *v = QVariant( (int)this->backgroundOrigin() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 35: switch( f ) { case 1: *v = QVariant( this->ownPalette(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 36: switch( f ) { case 0: setFont(v->asFont()); break; case 1: *v = QVariant( this->font() ); break; case 2: this->unsetFont(); break; case 5: return this->ownFont(); case 3: case 4: break; default: return FALSE; } break; case 37: switch( f ) { case 1: *v = QVariant( this->ownFont(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 38: switch( f ) { case 0: setCursor(v->asCursor()); break; case 1: *v = QVariant( this->cursor() ); break; case 2: this->unsetCursor(); break; case 5: return this->ownCursor(); case 3: case 4: break; default: return FALSE; } break; case 39: switch( f ) { case 1: *v = QVariant( this->ownCursor(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 40: switch( f ) { case 0: setCaption(v->asString()); break; case 1: *v = QVariant( this->caption() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 41: switch( f ) { case 0: setIcon(v->asPixmap()); break; case 1: if ( this->icon() ) *v = QVariant( *icon() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 42: switch( f ) { case 0: setIconText(v->asString()); break; case 1: *v = QVariant( this->iconText() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 43: switch( f ) { case 0: setMouseTracking(v->asBool()); break; case 1: *v = QVariant( this->hasMouseTracking(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 44: switch( f ) { case 1: *v = QVariant( this->hasMouse(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 45: switch( f ) { case 1: *v = QVariant( this->isActiveWindow(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 46: switch( f ) { case 1: *v = QVariant( this->isFocusEnabled(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 47: switch( f ) { case 0: setFocusPolicy((FocusPolicy&)v->asInt()); break; case 1: *v = QVariant( (int)this->focusPolicy() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 48: switch( f ) { case 1: *v = QVariant( this->hasFocus(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 49: switch( f ) { case 0: setUpdatesEnabled(v->asBool()); break; case 1: *v = QVariant( this->isUpdatesEnabled(), 0 ); break; case 4: case 5: break; default: return FALSE; } break; case 50: switch( f ) { case 1: *v = QVariant( this->isVisible(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 51: switch( f ) { case 1: *v = QVariant( this->visibleRect() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 52: switch( f ) { case 0: setHidden(v->asBool()); break; case 1: *v = QVariant( this->isHidden(), 0 ); break; case 5: break; default: return FALSE; } break; case 53: switch( f ) { case 0: setShown(v->asBool()); break; case 1: *v = QVariant( this->isShown(), 0 ); break; case 5: break; default: return FALSE; } break; case 54: switch( f ) { case 1: *v = QVariant( this->isMinimized(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 55: switch( f ) { case 1: *v = QVariant( this->isMaximized(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 56: switch( f ) { case 1: *v = QVariant( this->isFullScreen(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 57: switch( f ) { case 1: *v = QVariant( this->sizeHint() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 58: switch( f ) { case 1: *v = QVariant( this->minimumSizeHint() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 59: switch( f ) { case 1: *v = QVariant( this->microFocusHint() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 60: switch( f ) { case 0: setAcceptDrops(v->asBool()); break; case 1: *v = QVariant( this->acceptDrops(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 61: switch( f ) { case 0: setAutoMask(v->asBool()); break; case 1: *v = QVariant( this->autoMask(), 0 ); break; case 5: break; default: return FALSE; } break; case 62: switch( f ) { case 1: *v = QVariant( this->customWhatsThis(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 63: switch( f ) { case 0: setInputMethodEnabled(v->asBool()); break; case 1: *v = QVariant( this->isInputMethodEnabled(), 0 ); break; case 5: break; default: return FALSE; } break; case 64: switch( f ) { case 0: setWindowOpacity(v->asDouble()); break; case 1: *v = QVariant( this->windowOpacity() ); break; case 4: case 5: break; default: return FALSE; } break; default: return QObject::qt_property( id, f, v ); } return TRUE; }
KMixApplet::KMixApplet( const QString& configFile, Type t, QWidget *parent, const char *name ) : KPanelApplet( configFile, t, KPanelApplet::Preferences | KPanelApplet::ReportBug | KPanelApplet::About, parent, name ), m_mixerWidget(0), m_errorLabel(0), m_pref(0), m_aboutData( "kmix", I18N_NOOP("KMix Panel Applet"), APP_VERSION, "Mini Sound Mixer Applet", KAboutData::License_GPL, I18N_NOOP( "(c) 1996-2000 Christian Esken\n(c) 2000-2003 Christian Esken, Stefan Schimanski") ) { setBackgroundOrigin(AncestorOrigin); kdDebug(67100) << "KMixApplet::KMixApplet instancing Applet. Old s_instCount="<< s_instCount << " configfile=" << configFile << endl; //kdDebug(67100) << "KMixApplet::KMixApplet()" << endl; _layout = new QHBoxLayout(this); // it will always only be one item in it, so we don't care whether it is HBox or VBox // init static vars if ( s_instCount == 0) { Mixer::mixers().setAutoDelete( TRUE ); QString dummyStringHwinfo; MixerToolBox::initMixer(Mixer::mixers(), false, dummyStringHwinfo); } s_instCount++; kdDebug(67100) << "KMixApplet::KMixApplet instancing Applet, s_instCount="<< s_instCount << endl; KGlobal::dirs()->addResourceType( "appicon", KStandardDirs::kde_default("data") + "kmix/pics" ); loadConfig(); /********** find out to use which mixer ****************************************/ _mixer = 0; for (_mixer= Mixer::mixers().first(); _mixer!=0; _mixer=Mixer::mixers().next()) { if ( _mixer->id() == _mixerId ) break; } if ( _mixer == 0 ) { /* Until KMix V3.4-0 the mixerNumber (int) was stored. This was too complicated to handle, so we use an * unique ID (_mixer->mixerId(). But in case when the user changes soundcards (or when upgrading from * KMix 3.4-0 to a 3.4-1 or newer), we scan also for the soundcard name */ for (_mixer= Mixer::mixers().first(); _mixer!=0; _mixer=Mixer::mixers().next()) { if ( _mixer->mixerName() == _mixerName ) break; } } // don't prompt for a mixer if there is just one available if ( !_mixer && Mixer::mixers().count() == 1 ) { _mixer = Mixer::mixers().first(); } if ( _mixer == 0 ) { // No mixer set by user (kmixappletrc_*) and more than one to choose // We do NOT know which mixer to use => ask the User m_errorLabel = new QPushButton( i18n("Select Mixer"), this ); m_errorLabel->setGeometry(0, 0, m_errorLabel->sizeHint().width(), m_errorLabel->sizeHint().height() ); resize( m_errorLabel->sizeHint() ); connect( m_errorLabel, SIGNAL(clicked()), this, SLOT(selectMixer()) ); } else { // We know which mixer to use: Call positionChange(), which does all the creating positionChange(position()); } m_aboutData.addCredit( I18N_NOOP( "For detailed credits, please refer to the About information of the KMix program" ) ); }
AppletHandleDrag::AppletHandleDrag(AppletHandle* parent) : QWidget(parent), m_parent(parent) { setBackgroundOrigin( AncestorOrigin ); }
TrayButton::TrayButton(QWidget* parent, const char* name) : QPushButton (parent, name) { setBackgroundMode(PaletteBackground); setBackgroundOrigin(AncestorOrigin); }