Qt5: 'bool QTreeWidget::isItemSelected(const QTreeWidgetItem*) const' is deprecated: Use QTreeWidgetItem::isSelected() instead [-Wdeprecated-declarations]
This commit is contained in:
@@ -696,7 +696,7 @@ bool CallTipsList::eventFilter(QObject * watched, QEvent * event)
|
||||
void CallTipsList::callTipItemActivated(QListWidgetItem *item)
|
||||
{
|
||||
hide();
|
||||
if (!isItemSelected(item)) return;
|
||||
if (!item->isSelected()) return;
|
||||
|
||||
QString text = item->text();
|
||||
QTextCursor cursor = textEdit->textCursor();
|
||||
|
||||
@@ -246,7 +246,7 @@ void DlgCustomCommandsImp::onModifyMacroAction(const QByteArray& macro)
|
||||
item->setSizeHint(0, QSize(32, 32));
|
||||
if (pCmd->getPixmap())
|
||||
item->setIcon(0, BitmapFactory().iconFromTheme(pCmd->getPixmap()));
|
||||
if (ui->commandTreeWidget->isItemSelected(item))
|
||||
if (item->isSelected())
|
||||
onDescription(item);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ void DlgCustomKeyboardImp::onModifyMacroAction(const QByteArray& macro)
|
||||
item->setSizeHint(0, QSize(32, 32));
|
||||
if (pCmd->getPixmap())
|
||||
item->setIcon(0, BitmapFactory().iconFromTheme(pCmd->getPixmap()));
|
||||
if (ui->commandTreeWidget->isItemSelected(item))
|
||||
if (item->isSelected())
|
||||
ui->textLabelDescription->setText(item->toolTip(1));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ ParameterGroup::~ParameterGroup()
|
||||
void ParameterGroup::contextMenuEvent ( QContextMenuEvent* event )
|
||||
{
|
||||
QTreeWidgetItem* item = currentItem();
|
||||
if (isItemSelected(item))
|
||||
if (item->isSelected())
|
||||
{
|
||||
expandAct->setEnabled(item->childCount() > 0);
|
||||
// do not allow to import parameters from a non-empty parameter group
|
||||
@@ -513,7 +513,7 @@ void ParameterGroup::keyPressEvent (QKeyEvent* event)
|
||||
void ParameterGroup::onDeleteSelectedItem()
|
||||
{
|
||||
QTreeWidgetItem* sel = currentItem();
|
||||
if (isItemSelected(sel) && sel->parent())
|
||||
if (sel->isSelected() && sel->parent())
|
||||
{
|
||||
if ( QMessageBox::question(this, tr("Remove group"), tr("Do you really want to remove this parameter group?"),
|
||||
QMessageBox::Yes, QMessageBox::No|QMessageBox::Default|QMessageBox::Escape) ==
|
||||
@@ -537,7 +537,7 @@ void ParameterGroup::onDeleteSelectedItem()
|
||||
void ParameterGroup::onToggleSelectedItem()
|
||||
{
|
||||
QTreeWidgetItem* sel = currentItem();
|
||||
if (isItemSelected(sel))
|
||||
if (sel->isSelected())
|
||||
{
|
||||
if (sel->isExpanded())
|
||||
sel->setExpanded(false);
|
||||
@@ -555,7 +555,7 @@ void ParameterGroup::onCreateSubgroup()
|
||||
if (ok && Gui::validateInput(this, name))
|
||||
{
|
||||
QTreeWidgetItem* item = currentItem();
|
||||
if (isItemSelected(item))
|
||||
if (item->isSelected())
|
||||
{
|
||||
ParameterGroupItem* para = static_cast<ParameterGroupItem*>(item);
|
||||
Base::Reference<ParameterGrp> hGrp = para->_hcGrp;
|
||||
@@ -581,7 +581,7 @@ void ParameterGroup::onExportToFile()
|
||||
if ( !file.isEmpty() )
|
||||
{
|
||||
QTreeWidgetItem* item = currentItem();
|
||||
if (isItemSelected(item))
|
||||
if (item->isSelected())
|
||||
{
|
||||
ParameterGroupItem* para = static_cast<ParameterGroupItem*>(item);
|
||||
Base::Reference<ParameterGrp> hGrp = para->_hcGrp;
|
||||
@@ -597,7 +597,7 @@ void ParameterGroup::onImportFromFile()
|
||||
if ( !file.isEmpty() )
|
||||
{
|
||||
QTreeWidgetItem* item = currentItem();
|
||||
if (isItemSelected(item))
|
||||
if (item->isSelected())
|
||||
{
|
||||
ParameterGroupItem* para = static_cast<ParameterGroupItem*>(item);
|
||||
Base::Reference<ParameterGrp> hGrp = para->_hcGrp;
|
||||
@@ -631,7 +631,7 @@ void ParameterGroup::onImportFromFile()
|
||||
void ParameterGroup::onRenameSelectedItem()
|
||||
{
|
||||
QTreeWidgetItem* sel = currentItem();
|
||||
if (isItemSelected(sel))
|
||||
if (sel->isSelected())
|
||||
{
|
||||
editItem(sel, 0);
|
||||
}
|
||||
@@ -701,7 +701,7 @@ bool ParameterValue::edit ( const QModelIndex & index, EditTrigger trigger, QEve
|
||||
void ParameterValue::contextMenuEvent ( QContextMenuEvent* event )
|
||||
{
|
||||
QTreeWidgetItem* item = currentItem();
|
||||
if (isItemSelected(item))
|
||||
if (item->isSelected())
|
||||
menuEdit->popup(event->globalPos());
|
||||
else
|
||||
menuNew->popup(event->globalPos());
|
||||
@@ -736,7 +736,7 @@ void ParameterValue::resizeEvent(QResizeEvent* event)
|
||||
|
||||
void ParameterValue::onChangeSelectedItem(QTreeWidgetItem* item, int col)
|
||||
{
|
||||
if (isItemSelected(item) && col > 0)
|
||||
if (item->isSelected() && col > 0)
|
||||
{
|
||||
static_cast<ParameterValueItem*>(item)->changeValue();
|
||||
}
|
||||
@@ -750,7 +750,7 @@ void ParameterValue::onChangeSelectedItem()
|
||||
void ParameterValue::onDeleteSelectedItem()
|
||||
{
|
||||
QTreeWidgetItem* sel = currentItem();
|
||||
if (isItemSelected(sel))
|
||||
if (sel->isSelected())
|
||||
{
|
||||
takeTopLevelItem(indexOfTopLevelItem(sel));
|
||||
static_cast<ParameterValueItem*>(sel)->removeFromGroup();
|
||||
@@ -761,7 +761,7 @@ void ParameterValue::onDeleteSelectedItem()
|
||||
void ParameterValue::onRenameSelectedItem()
|
||||
{
|
||||
QTreeWidgetItem* sel = currentItem();
|
||||
if (isItemSelected(sel))
|
||||
if (sel->isSelected())
|
||||
{
|
||||
editItem(sel, 0);
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ void DlgCustomToolbars::on_moveActionRightButton_clicked()
|
||||
void DlgCustomToolbars::on_moveActionLeftButton_clicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
if (item && item->parent() && ui->toolbarTreeWidget->isItemSelected(item)) {
|
||||
if (item && item->parent() && item->isSelected()) {
|
||||
QTreeWidgetItem* parent = item->parent();
|
||||
int index = parent->indexOfChild(item);
|
||||
parent->takeChild(index);
|
||||
@@ -412,7 +412,7 @@ void DlgCustomToolbars::on_moveActionLeftButton_clicked()
|
||||
void DlgCustomToolbars::on_moveActionUpButton_clicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
if (item && item->parent() && ui->toolbarTreeWidget->isItemSelected(item)) {
|
||||
if (item && item->parent() && item->isSelected()) {
|
||||
QTreeWidgetItem* parent = item->parent();
|
||||
int index = parent->indexOfChild(item);
|
||||
if (index > 0) {
|
||||
@@ -450,7 +450,7 @@ void DlgCustomToolbars::on_moveActionUpButton_clicked()
|
||||
void DlgCustomToolbars::on_moveActionDownButton_clicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
if (item && item->parent() && ui->toolbarTreeWidget->isItemSelected(item)) {
|
||||
if (item && item->parent() && item->isSelected()) {
|
||||
QTreeWidgetItem* parent = item->parent();
|
||||
int index = parent->indexOfChild(item);
|
||||
if (index < parent->childCount()-1) {
|
||||
@@ -515,7 +515,7 @@ void DlgCustomToolbars::on_newButton_clicked()
|
||||
void DlgCustomToolbars::on_deleteButton_clicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
if (item && !item->parent() && ui->toolbarTreeWidget->isItemSelected(item)) {
|
||||
if (item && !item->parent() && item->isSelected()) {
|
||||
int index = ui->toolbarTreeWidget->indexOfTopLevelItem(item);
|
||||
ui->toolbarTreeWidget->takeTopLevelItem(index);
|
||||
removeCustomToolbar(item->text(0));
|
||||
@@ -531,7 +531,7 @@ void DlgCustomToolbars::on_renameButton_clicked()
|
||||
{
|
||||
bool renamed = false;
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
if (item && !item->parent() && ui->toolbarTreeWidget->isItemSelected(item)) {
|
||||
if (item && !item->parent() && item->isSelected()) {
|
||||
bool ok;
|
||||
QString old_text = item->text(0);
|
||||
QString text = QInputDialog::getText(this, tr("Rename toolbar"), tr("Toolbar name:"),
|
||||
|
||||
@@ -1403,7 +1403,7 @@ void TreeWidget::dragMoveEvent(QDragMoveEvent *event)
|
||||
|
||||
auto modifier = QApplication::queryKeyboardModifiers();
|
||||
QTreeWidgetItem* targetItem = itemAt(event->pos());
|
||||
if (!targetItem || this->isItemSelected(targetItem)) {
|
||||
if (!targetItem || targetItem->isSelected()) {
|
||||
leaveEvent(0);
|
||||
event->ignore();
|
||||
}
|
||||
@@ -1545,7 +1545,7 @@ void TreeWidget::dropEvent(QDropEvent *event)
|
||||
if (!targetItem)
|
||||
return;
|
||||
// one of the source items is also the destination item, that's not allowed
|
||||
if (this->isItemSelected(targetItem))
|
||||
if (targetItem->isSelected())
|
||||
return;
|
||||
|
||||
App::Document *thisDoc;
|
||||
|
||||
@@ -339,7 +339,7 @@ void ActionSelector::on_removeButton_clicked()
|
||||
void ActionSelector::on_upButton_clicked()
|
||||
{
|
||||
QTreeWidgetItem* item = selectedWidget->currentItem();
|
||||
if (item && selectedWidget->isItemSelected(item)) {
|
||||
if (item && item->isSelected()) {
|
||||
int index = selectedWidget->indexOfTopLevelItem(item);
|
||||
if (index > 0) {
|
||||
selectedWidget->takeTopLevelItem(index);
|
||||
@@ -352,7 +352,7 @@ void ActionSelector::on_upButton_clicked()
|
||||
void ActionSelector::on_downButton_clicked()
|
||||
{
|
||||
QTreeWidgetItem* item = selectedWidget->currentItem();
|
||||
if (item && selectedWidget->isItemSelected(item)) {
|
||||
if (item && item->isSelected()) {
|
||||
int index = selectedWidget->indexOfTopLevelItem(item);
|
||||
if (index < selectedWidget->topLevelItemCount()-1) {
|
||||
selectedWidget->takeTopLevelItem(index);
|
||||
|
||||
Reference in New Issue
Block a user