KDEUI
ktabwidget.cpp
Go to the documentation of this file.
95 ( m_parent->tabPosition() == QTabWidget::South && point.y() > (m_parent->height() - size.height() ) ) ) {
202 QString title = m_automaticResizeTabs ? m_tabNames[ index ] : m_parent->QTabWidget::tabText( index );
207 // Remove '&'s, which are indicators for keyboard shortcuts in tab titles. "&&" is replaced by '&'.
208 for ( int i = toolTipText.indexOf( '&' ); i >= 0 && i < toolTipText.length(); i = toolTipText.indexOf( '&', i + 1 ) )
217 title = KStringHandler::rsqueeze( title, m_currentTabLength ).leftJustified( m_minLength, ' ' );
247 connect(tabBar(), SIGNAL(testCanDecode(const QDragMoveEvent*,bool&)), SIGNAL(testCanDecode(const QDragMoveEvent*,bool&)));
248 connect(tabBar(), SIGNAL(receivedDropEvent(int,QDropEvent*)), SLOT(receivedDropEvent(int,QDropEvent*)));
264 void KTabWidget::insertTab( QWidget *child, const QIcon& iconset, const QString &label, int index )
357 newTitle = KStringHandler::rsqueeze( newTitle, maxLength ).leftJustified( d->m_minLength, ' ' );
362 iw = tabBar()->tabIcon( i ).pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ), QIcon::Normal ).width() + 4;
411 kWarning(240) << "setTabText(" << index << ") called but d->m_tabNames has only" << d->m_tabNames.count() << "entries";
virtual void mouseReleaseEvent(QMouseEvent *)
Definition: ktabwidget.cpp:519
void mouseDoubleClick()
A double left mouse button click was performed over empty space besides tabbar.
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
virtual void dropEvent(QDropEvent *event)
int width() const
QString rsqueeze(const QString &str, int maxlen=40)
QString tabText(int index) const
QWidget * page(int index) const
void tabCloseRequested(int index)
void setTabText(int index, const QString &text)
bool hoverCloseButtonDelayed() const
Returns true if the close button is shown on tabs after a delay.
QStyle * style() const
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const =0
virtual void dragEnterEvent(QDragEnterEvent *event)
const QPoint & pos() const
QIcon tabIcon(int index) const
bool isVisible() const
QPoint mapToGlobal(const QPoint &pos) const
bool isAncestorOf(const QWidget *child) const
bool isTabReorderingEnabled() const
Returns true if tab ordering with the middle mouse button has been enabled.
Definition: ktabwidget.cpp:327
bool isTabBarHidden() const
Returns true if the tabbar was hidden by a call to setTabBarHidden( true ).
Definition: ktabwidget.cpp:304
QT_MOC_COMPAT void setTabCloseActivatePrevious(bool previous)
If previous is true, closing the current tab activates the previous active tab instead of the one to ...
Definition: ktabwidget.cpp:334
virtual void dragMoveEvent(QDragMoveEvent *event)
const QPoint & pos() const
QString & remove(int position, int n)
int indexOf(QWidget *w) const
void setTabsClosable(bool closeable)
void setTabEnabled(int index, bool enable)
virtual void mouseReleaseEvent(QMouseEvent *event)
int count() const
void mouseMiddleClick()
A middle mouse button click was performed over empty space besides tabbar.
KTabWidget(QWidget *parent=0, Qt::WindowFlags flags=0)
Creates a new tab widget.
Definition: ktabwidget.cpp:233
int x() const
int y() const
QSize globalStrut()
QPixmap pixmap(const QSize &size, Mode mode, State state) const
KSharedConfigPtr config()
void setTabText(int index, const QString &label)
width
int currentIndex() const
enabled
void setTabTextColor(int index, const QColor &color)
void contextMenu(const QPoint &)
The right mouse button was pressed over empty space besides tabbar.
QString & insert(int position, QChar ch)
virtual void mousePressEvent(QMouseEvent *event)
int x() const
bool hoverCloseButton() const
Returns true if the close button is shown on tabs when mouse is hovering over them.
void setUpdatesEnabled(bool enable)
virtual void dragEnterEvent(QDragEnterEvent *)
Definition: ktabwidget.cpp:428
void setFocus()
Qt::MouseButton button() const
void setObjectName(const QString &name)
QWidget * focusWidget()
QT_MOC_COMPAT void setTabReorderingEnabled(bool enable)
If enable is true, tab reordering with middle button will be enabled.
Definition: ktabwidget.cpp:320
bool sendEvent(QObject *receiver, QEvent *event)
void setTabTextColor(int index, const QColor &color)
Set the tab of the given widget to color.
Definition: ktabwidget.cpp:309
void setTabBarHidden(bool hide)
If hide is true, the tabbar is hidden along with any corner widgets.
Definition: ktabwidget.cpp:284
QIcon tabIcon(int index) const
void testCanDecode(const QDragMoveEvent *e, bool &accept)
Connect to this and set accept to true if you can and want to decode the event.
int insertTab(int index, QWidget *page, const QString &label)
void setTabToolTip(int index, const QString &tip)
void hide()
QWidget * widget(int index) const
void setAcceptDrops(bool on)
QT_MOC_COMPAT void setHoverCloseButton(bool enable)
If enable is true, a close button will be shown on mouse hover over tab icons which will emit signal ...
Definition: ktabwidget.cpp:626
bool tabCloseActivatePrevious() const
Returns true if closing the current tab activates the previous actice tab instead of the one to the r...
virtual void mouseDoubleClickEvent(QMouseEvent *)
Definition: ktabwidget.cpp:494
bool blockSignals(bool block)
void initiateDrag(QWidget *)
Request to start a drag operation on the given tab.
virtual void wheelEvent(QWheelEvent *event)
virtual void moveTab(int, int)
Move a widget's tab from first to second specified index and emit signal movedTab( int...
Definition: ktabwidget.cpp:556
int width(const QString &text, int len) const
bool isCloseButtonEnabled() const
Returns true if the close button is shown on tabs.
Definition: ktabwidget.cpp:665
virtual void mouseDoubleClickEvent(QMouseEvent *event)
void setWindowFlags(QFlags< Qt::WindowType > type)
QWidget * cornerWidget(Qt::Corner corner) const
QFontMetrics fontMetrics() const
QT_MOC_COMPAT void setHoverCloseButtonDelayed(bool delayed)
If delayed is true, a close button will be shown on mouse hover over tab icons after mouse double cli...
Definition: ktabwidget.cpp:642
QString escape(const QString &plain)
virtual void resizeEvent(QResizeEvent *e)
int length() const
bool mightBeRichText(const QString &text)
QString leftJustified(int width, QChar fill, bool truncate) const
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void setAutomaticResizeTabs(bool enable)
If enable is true, tabs will be resized to the width of the tab bar.
Definition: ktabwidget.cpp:671
QColor tabTextColor(int index) const
Returns the tab color for the given widget.
Definition: ktabwidget.cpp:314
virtual void removeTab(int index)
Removes the widget, reimplemented for internal reasons (keeping labels in sync).
Definition: ktabwidget.cpp:613
typedef WindowFlags
QT_MOC_COMPAT void setCloseButtonEnabled(bool)
If enabled, a close button is available for each tab.
Definition: ktabwidget.cpp:658
void receivedDropEvent(QDropEvent *)
Received an event in the empty space beside tabbar.
virtual QT_MOC_COMPAT void removePage(QWidget *w)
Removes the widget, reimplemented for internal reasons (keeping labels in sync).
Definition: ktabwidget.cpp:600
virtual void mousePressEvent(QMouseEvent *)
Definition: ktabwidget.cpp:507
void show()
const QPoint & pos() const
QTabBar * tabBar() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
void setTabText(int, const QString &)
Reimplemented for internal reasons.
Definition: ktabwidget.cpp:398
QColor tabTextColor(int index) const
bool automaticResizeTabs() const
Returns true if calling setTitle() will resize tabs to the width of the tab bar.
virtual QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const =0
QString tabToolTip(int index) const
bool isTabEnabled(int index) const
void setTabBar(QTabBar *tb)
void setTabIcon(int index, const QIcon &icon)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.