Tools: [skip ci] fix linking errors of designer plugin with MSVC

This commit is contained in:
wmayer
2022-04-06 12:47:28 +02:00
parent 002ba58bad
commit 5c342f6e58
4 changed files with 41 additions and 5 deletions

View File

@@ -140,7 +140,7 @@ void LocationWidget::retranslateUi()
}
FileChooser::FileChooser( QWidget *parent )
: QWidget( parent ), md( File ), _filter( QString::null )
: QWidget( parent ), md( File ), _filter( QString() )
{
QHBoxLayout *layout = new QHBoxLayout( this );
layout->setMargin( 0 );
@@ -153,7 +153,11 @@ FileChooser::FileChooser( QWidget *parent )
this, SIGNAL(fileNameChanged(const QString &)));
button = new QPushButton( "...", this );
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
button->setFixedWidth(2 * button->fontMetrics().horizontalAdvance(" ... "));
#else
button->setFixedWidth(2*button->fontMetrics().width( " ... " ));
#endif
layout->addWidget( button );
connect(button, SIGNAL(clicked()), this, SLOT(chooseFile()));
@@ -216,8 +220,13 @@ void FileChooser::setFilter ( const QString& filter )
void FileChooser::setButtonText( const QString& txt )
{
button->setText( txt );
int w1 = 2*button->fontMetrics().width(txt);
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
int w1 = 2 * button->fontMetrics().horizontalAdvance(txt);
int w2 = 2 * button->fontMetrics().horizontalAdvance(" ... ");
#else
int w1 = 2 * button->fontMetrics().width(txt);
int w2 = 2*button->fontMetrics().width(" ... ");
#endif
button->setFixedWidth((w1 > w2 ? w1 : w2));
}
@@ -1391,7 +1400,7 @@ void CommandIconView::startDrag ( Qt::DropActions /*supportedActions*/ )
drag->setMimeData(mimeData);
drag->setHotSpot(QPoint(pixmap.width()/2, pixmap.height()/2));
drag->setPixmap(pixmap);
drag->start(Qt::MoveAction);
drag->exec(Qt::MoveAction);
}
void CommandIconView::onSelectionChanged(QListWidgetItem * item, QListWidgetItem *)