Tools: [skip ci] fix linking errors of designer plugin with MSVC
This commit is contained in:
@@ -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 *)
|
||||
|
||||
Reference in New Issue
Block a user